Merge pull request #378 from kiteco/fix-windows-line-decoration-icon

Fix related code line decoration icon for windows
This commit is contained in:
Ryan Berg 2021-02-16 13:01:15 -08:00 committed by GitHub
commit bdfd4c614a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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