Skip to content

Commit a842599

Browse files
author
Keen Yee Liau
committed
fix: Always open HTML files as External Script
When ScriptInfo is created for non-JS/TS files other than through `openClientFile()`, explicitly set HTML files as ts.ScriptKind.External. This is used, for example, for files returned by `getExternalFiles()`.
1 parent 1439441 commit a842599

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server/src/project_service.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ export class ProjectService {
6161
allowLocalPluginLoads: false, // do not load plugins from tsconfig.json
6262
});
6363

64+
this.tsProjSvc.setHostConfiguration({
65+
formatOptions: this.tsProjSvc.getHostFormatCodeOptions(),
66+
extraFileExtensions: [
67+
{
68+
extension: '.html',
69+
isMixedContent: false,
70+
scriptKind: ts.ScriptKind.External,
71+
},
72+
],
73+
});
74+
6475
this.tsProjSvc.configurePlugin({
6576
pluginName: '@angular/language-service',
6677
configuration: {

0 commit comments

Comments
 (0)