Fix related code line decoration icon for windows

This commit is contained in:
Ryan Berg 2021-02-16 12:45:13 -08:00
parent 6b00cf2eb6
commit e39f20d141

View File

@ -116,7 +116,10 @@ export default class KiteRelatedCodeDecorationsProvider {
private hoverMessage(hover: string): MarkdownString {
let logo = path.join(extensions.getExtension("kiteco.kite").extensionPath, "dist", "assets", "images", "logo-light-blue.svg");
if (process.platform === 'win32') {
logo = `file:\\\\\\${logo}`;
logo = `file:\\\\${logo}`;
// Replace all \ in Windows path with \\
// otherwise c:\Users\Foo\.vscode turns into c:\Users\Foo.vscode
logo = logo.replace(/\\/g,'\\\\');
}
const md = new MarkdownString(`![KiteIcon](${logo}|height=12)  [${hover}](command:kite.related-code-from-line)`);
// Must mark as trusted to run commands in MarkdownStrings