Skip to content

Commit

Permalink
chore: try to activate official extension first
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Mar 29, 2024
1 parent 348c7f1 commit afb12d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "(aka uELS, Unstable Ember Language Server), Provides features like auto complete, goto definition and diagnostics for Ember.js projects",
"author": "Aleksandr Kanunnikov <lifeart92@gmail.com>",
"license": "MIT",
"version": "3.0.54",
"version": "3.0.55",
"publisher": "lifeart",
"icon": "assets/icon.png",
"keywords": [
Expand Down
14 changes: 12 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ let ExtServerDebugBarItem: StatusBarItem;
const OFFICIAL_EMBER_LANGUAGE_SERVER = 'EmberTooling.vscode-ember';
export async function activate(context: ExtensionContext) {
const extension = extensions.getExtension(OFFICIAL_EMBER_LANGUAGE_SERVER);
if (extension && extension.isActive) {
return;
if (extension) {
if (extension.isActive) {
return;
}
try {
await extension.activate();
} catch (e) {
// noop
}
if (extension.isActive) {
return;
}
}
// The server is implemented in node
const serverModule = path.join(context.extensionPath, './start-server.js');
Expand Down

0 comments on commit afb12d1

Please sign in to comment.