Skip to content

Commit

Permalink
comment and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
machty committed Sep 21, 2024
1 parent 01b8deb commit b29a807
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/core/src/volar/ember-language-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function createEmberLanguagePlugin<T extends URI | string>(

// See: https://github.com/JetBrains/intellij-plugins/blob/11a9149e20f4d4ba2c1600da9f2b81ff88bd7c97/Angular/src/angular-service/src/index.ts#L31
if (
glintConfig.enableTsPlugin &&
glintConfig.enableTsPlugin && // Loose mode not supported for classic "takeover" mode, only TS Plugin
languageId === 'typescript' &&
!scriptIdStr.endsWith('.d.ts') &&
scriptIdStr.indexOf('/node_modules/') < 0
Expand All @@ -64,12 +64,15 @@ export function createEmberLanguagePlugin<T extends URI | string>(
}
},

//
// This hook is only called in TS Plugin mode (not classic "takeover" mode), because Volar's
// support for two-file components only exists for TS Plugin.
//
// Because we declare handlebars files to be associated with "root" .ts files, we
// need to mark them here as "associated file only" so that TS doesn't attempt
// to type-check them directly, but rather indirectly via the .ts file.
//
isAssociatedFileOnly(_scriptId: string | URI, languageId: string): boolean {
// `ember-loose` only
//
// Because we declare handlebars files to be associated with "root" .ts files, we
// need to mark them here as "associated file only" so that TS doesn't attempt
// to type-check them directly, but rather indirectly via the .ts file.
return languageId === 'handlebars';
},

Expand Down

0 comments on commit b29a807

Please sign in to comment.