mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 20:37:46 -05:00
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
This commit is contained in:
@@ -194,7 +194,7 @@ namespace ts.server {
|
||||
formatCodeOptions: FormatCodeSettings;
|
||||
preferences: UserPreferences;
|
||||
hostInfo: string;
|
||||
extraFileExtensions?: JsFileExtensionInfo[];
|
||||
extraFileExtensions?: FileExtensionInfo[];
|
||||
}
|
||||
|
||||
export interface OpenConfiguredProjectResult {
|
||||
@@ -204,8 +204,8 @@ namespace ts.server {
|
||||
|
||||
interface FilePropertyReader<T> {
|
||||
getFileName(f: T): string;
|
||||
getScriptKind(f: T, extraFileExtensions?: JsFileExtensionInfo[]): ScriptKind;
|
||||
hasMixedContent(f: T, extraFileExtensions: JsFileExtensionInfo[]): boolean;
|
||||
getScriptKind(f: T, extraFileExtensions?: FileExtensionInfo[]): ScriptKind;
|
||||
hasMixedContent(f: T, extraFileExtensions: FileExtensionInfo[]): boolean;
|
||||
}
|
||||
|
||||
const fileNamePropertyReader: FilePropertyReader<string> = {
|
||||
@@ -2426,5 +2426,15 @@ namespace ts.server {
|
||||
this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles);
|
||||
}
|
||||
}
|
||||
|
||||
hasDeferredExtension() {
|
||||
for (const extension of this.hostConfiguration.extraFileExtensions) {
|
||||
if (extension.scriptKind === ScriptKind.Deferred) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace ts.server {
|
||||
this.compilerOptions.allowNonTsExtensions = true;
|
||||
this.compilerOptions.allowJs = true;
|
||||
}
|
||||
else if (hasExplicitListOfFiles || this.compilerOptions.allowJs) {
|
||||
else if (hasExplicitListOfFiles || this.compilerOptions.allowJs || this.projectService.hasDeferredExtension()) {
|
||||
// If files are listed explicitly or allowJs is specified, allow all extensions
|
||||
this.compilerOptions.allowNonTsExtensions = true;
|
||||
}
|
||||
|
||||
@@ -1293,7 +1293,7 @@ namespace ts.server.protocol {
|
||||
/**
|
||||
* The host's additional supported .js file extensions
|
||||
*/
|
||||
extraFileExtensions?: JsFileExtensionInfo[];
|
||||
extraFileExtensions?: FileExtensionInfo[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user