Skip to content

Commit

Permalink
chore: basic glimmer-ts, glimmer-js syntax support
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed May 30, 2023
1 parent 044e368 commit 1b8797a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
4 changes: 3 additions & 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 <[email protected]>",
"license": "MIT",
"version": "3.0.49",
"version": "3.0.50",
"publisher": "lifeart",
"icon": "assets/icon.png",
"keywords": [
Expand Down Expand Up @@ -32,6 +32,8 @@
"onLanguage:handlebars",
"onLanguage:javascript",
"onLanguage:typescript",
"onLanguage:glimmer-js",
"onLanguage:glimmer-ts",
"workspaceContains:ember-cli-build.js",
"onCommand:els.runInEmberCLI"
],
Expand Down
8 changes: 7 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ export async function activate(context: ExtensionContext) {
// Options to control the language client
const clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
documentSelector: ['handlebars', 'javascript', 'typescript'],
documentSelector: [
'handlebars',
'glimmer-ts',
'glimmer-js',
'javascript',
'typescript',
],
outputChannelName: 'Unstable Ember Language Server',
revealOutputChannelOn: RevealOutputChannelOn.Never,
initializationOptions: { editor: 'vscode' },
Expand Down
10 changes: 7 additions & 3 deletions src/usages-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export class UsagesProvider implements vscode.TreeDataProvider<Dependency> {
private onActiveEditorChanged(): void {
if (vscode.window.activeTextEditor) {
if (vscode.window.activeTextEditor.document.uri.scheme === 'file') {
const enabled = ['handlebars', 'javascript', 'typescript'].includes(
vscode.window.activeTextEditor.document.languageId
);
const enabled = [
'handlebars',
'javascript',
'typescript',
'glimmer-js',
'glimmer-ts',
].includes(vscode.window.activeTextEditor.document.languageId);

vscode.commands.executeCommand(
'setContext',
Expand Down
8 changes: 7 additions & 1 deletion src/worker-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ export async function activate(context: ExtensionContext) {
// Options to control the language client
const clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
documentSelector: ['handlebars', 'javascript', 'typescript'].map((el) => {
documentSelector: [
'handlebars',
'glimmer-ts',
'glimmer-js',
'javascript',
'typescript',
].map((el) => {
return {
language: el,
scheme: 'file',
Expand Down

0 comments on commit 1b8797a

Please sign in to comment.