-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed extension not working if the VSCode folder was called "Code - OSS" #179
Conversation
Hi @Kurolox , Thanks for you PR. I will merge and update the extension later today. |
src/extension.ts
Outdated
@@ -594,6 +594,8 @@ export function activate(context: vscode.ExtensionContext) { | |||
function getChannelPath(): string { | |||
if (vscode.env.appName.indexOf("Insiders") > 0) { | |||
return "Code - Insiders"; | |||
} else if (vscode.env.appName.indexOf("OSS") > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make a small change. Instead of another if
statement, it would be better to use:
function getChannelPath(): string {
return vscode.env.appName.replace("Visual Studio ", "");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry if you can't update the PR right now. I can do it myself before merging. I was just playing with code-review 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing, I'll update it right now. I've never touched TypeScript, so I didn't want to take any chances and went with something simple that I knew it would work. This is better, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great. Btw, my first TypeScript experience was also with VS Code extensions 😄
Basically added an extra if statement when checking the value of vscode.env.appName, so if it has "OSS" on it, the path will be changed to
Code - OSS
instead ofCode
, which was conflicting before making the extension unable to work.