mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into triple-slash-jsdoc
This commit is contained in:
@@ -2166,6 +2166,9 @@
|
||||
<Item ItemId=";Arguments_for_the_rest_parameter_0_were_not_provided_6236" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Arguments for the rest parameter '{0}' were not provided.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Es wurden keine Argumente für den rest-Parameter "{0}" angegeben.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2619,6 +2622,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Das Modul "{0}" wurde nicht gefunden. Möchten Sie die Option "moduleResolution" auf "node" festlegen oder Aliase zur Option "paths" hinzufügen?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2181,6 +2181,9 @@
|
||||
<Item ItemId=";Arguments_for_the_rest_parameter_0_were_not_provided_6236" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Arguments for the rest parameter '{0}' were not provided.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Les arguments du paramètre de reste '{0}' n'ont pas été fournis.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2634,6 +2637,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le module '{0}' est introuvable. Vouliez-vous affecter à l'option 'moduleResolution' la valeur 'node' ou ajouter des alias à l'option 'paths' ?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2169,6 +2169,9 @@
|
||||
<Item ItemId=";Arguments_for_the_rest_parameter_0_were_not_provided_6236" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Arguments for the rest parameter '{0}' were not provided.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Gli argomenti per il parametro REST '{0}' non sono stati specificati.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2622,6 +2625,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il modulo '{0}'. Si intendeva impostare l'opzione 'moduleResolution' su 'node' o aggiungere alias all'opzione 'paths'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2169,6 +2169,9 @@
|
||||
<Item ItemId=";Arguments_for_the_rest_parameter_0_were_not_provided_6236" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Arguments for the rest parameter '{0}' were not provided.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[rest パラメーター '{0}' の引数が指定されませんでした。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2622,6 +2625,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[モジュール '{0}' が見つかりません。'moduleResolution' オプションを 'node' に設定することか、'paths' オプションにエイリアスを追加することを意図していましたか?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2618,6 +2618,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o módulo '{0}'. Você quis definir a opção 'moduleResolution' como 'node' ou adicionar aliases à opção 'paths'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2168,6 +2168,9 @@
|
||||
<Item ItemId=";Arguments_for_the_rest_parameter_0_were_not_provided_6236" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Arguments for the rest parameter '{0}' were not provided.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не указаны аргументы для параметра REST "{0}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2621,6 +2624,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не найден модуль "{0}". Хотели ли вы задать значение "node" для параметра "moduleResolution" или добавить псевдонимы в параметр "paths"?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2162,6 +2162,9 @@
|
||||
<Item ItemId=";Arguments_for_the_rest_parameter_0_were_not_provided_6236" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Arguments for the rest parameter '{0}' were not provided.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' rest parametresinin bağımsız değişkenleri sağlanmadı.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2615,6 +2618,9 @@
|
||||
<Item ItemId=";Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' modülü bulunamıyor. 'moduleResolution' seçeneğini 'node' olarak ayarlamak veya 'paths' seçeneğine diğer adlar eklemek mi istediniz?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -719,10 +719,10 @@ namespace ts.server {
|
||||
this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
|
||||
if (opts.serverMode !== undefined) {
|
||||
this.serverMode = opts.serverMode;
|
||||
this.syntaxOnly = this.serverMode === LanguageServiceMode.SyntaxOnly;
|
||||
this.syntaxOnly = this.serverMode === LanguageServiceMode.Syntactic;
|
||||
}
|
||||
else if (opts.syntaxOnly) {
|
||||
this.serverMode = LanguageServiceMode.SyntaxOnly;
|
||||
this.serverMode = LanguageServiceMode.Syntactic;
|
||||
this.syntaxOnly = true;
|
||||
}
|
||||
else {
|
||||
@@ -3029,7 +3029,7 @@ namespace ts.server {
|
||||
let retainProjects: ConfiguredProject[] | ConfiguredProject | undefined;
|
||||
let projectForConfigFileDiag: ConfiguredProject | undefined;
|
||||
let defaultConfigProjectIsCreated = false;
|
||||
if (this.serverMode === LanguageServiceMode.ApproximateSemanticOnly) {
|
||||
if (this.serverMode === LanguageServiceMode.PartialSemantic) {
|
||||
// Invalidate resolutions in the file since this file is now open
|
||||
info.containingProjects.forEach(project => {
|
||||
if (project.resolutionCache.removeRelativeNoResolveResolutionsOfFile(info.path)) {
|
||||
@@ -3124,7 +3124,7 @@ namespace ts.server {
|
||||
Debug.assert(this.openFiles.has(info.path));
|
||||
this.assignOrphanScriptInfoToInferredProject(info, this.openFiles.get(info.path));
|
||||
}
|
||||
else if (this.serverMode === LanguageServiceMode.ApproximateSemanticOnly && info.cacheSourceFile?.sourceFile.referencedFiles.length) {
|
||||
else if (this.serverMode === LanguageServiceMode.PartialSemantic && info.cacheSourceFile?.sourceFile.referencedFiles.length) {
|
||||
// This file was just opened and references in this file will previously not been resolved so schedule update
|
||||
info.containingProjects.forEach(project => project.markAsDirty());
|
||||
}
|
||||
|
||||
@@ -283,11 +283,11 @@ namespace ts.server {
|
||||
case LanguageServiceMode.Semantic:
|
||||
this.languageServiceEnabled = true;
|
||||
break;
|
||||
case LanguageServiceMode.ApproximateSemanticOnly:
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
this.languageServiceEnabled = true;
|
||||
this.compilerOptions.types = [];
|
||||
break;
|
||||
case LanguageServiceMode.SyntaxOnly:
|
||||
case LanguageServiceMode.Syntactic:
|
||||
this.languageServiceEnabled = false;
|
||||
this.compilerOptions.noResolve = true;
|
||||
this.compilerOptions.types = [];
|
||||
@@ -471,9 +471,9 @@ namespace ts.server {
|
||||
switch (this.projectService.serverMode) {
|
||||
case LanguageServiceMode.Semantic:
|
||||
return true;
|
||||
case LanguageServiceMode.ApproximateSemanticOnly:
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
return this.fileIsOpen(this.toPath(containingFile));
|
||||
case LanguageServiceMode.SyntaxOnly:
|
||||
case LanguageServiceMode.Syntactic:
|
||||
return false;
|
||||
default:
|
||||
Debug.assertNever(this.projectService.serverMode);
|
||||
@@ -677,7 +677,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
enableLanguageService() {
|
||||
if (this.languageServiceEnabled || this.projectService.serverMode === LanguageServiceMode.SyntaxOnly) {
|
||||
if (this.languageServiceEnabled || this.projectService.serverMode === LanguageServiceMode.Syntactic) {
|
||||
return;
|
||||
}
|
||||
this.languageServiceEnabled = true;
|
||||
@@ -689,7 +689,7 @@ namespace ts.server {
|
||||
if (!this.languageServiceEnabled) {
|
||||
return;
|
||||
}
|
||||
Debug.assert(this.projectService.serverMode !== LanguageServiceMode.SyntaxOnly);
|
||||
Debug.assert(this.projectService.serverMode !== LanguageServiceMode.Syntactic);
|
||||
this.languageService.cleanupSemanticCache();
|
||||
this.languageServiceEnabled = false;
|
||||
this.lastFileExceededProgramSize = lastFileExceededProgramSize;
|
||||
|
||||
@@ -585,7 +585,7 @@ namespace ts.server {
|
||||
undefined;
|
||||
}
|
||||
|
||||
const invalidApproximateSemanticOnlyCommands: readonly CommandNames[] = [
|
||||
const invalidPartialSemanticModeCommands: readonly CommandNames[] = [
|
||||
CommandNames.OpenExternalProject,
|
||||
CommandNames.OpenExternalProjects,
|
||||
CommandNames.CloseExternalProject,
|
||||
@@ -621,8 +621,8 @@ namespace ts.server {
|
||||
CommandNames.ProvideCallHierarchyOutgoingCalls,
|
||||
];
|
||||
|
||||
const invalidSyntaxOnlyCommands: readonly CommandNames[] = [
|
||||
...invalidApproximateSemanticOnlyCommands,
|
||||
const invalidSyntacticModeCommands: readonly CommandNames[] = [
|
||||
...invalidPartialSemanticModeCommands,
|
||||
CommandNames.Definition,
|
||||
CommandNames.DefinitionFull,
|
||||
CommandNames.DefinitionAndBoundSpan,
|
||||
@@ -751,17 +751,17 @@ namespace ts.server {
|
||||
switch (this.projectService.serverMode) {
|
||||
case LanguageServiceMode.Semantic:
|
||||
break;
|
||||
case LanguageServiceMode.ApproximateSemanticOnly:
|
||||
invalidApproximateSemanticOnlyCommands.forEach(commandName =>
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
invalidPartialSemanticModeCommands.forEach(commandName =>
|
||||
this.handlers.set(commandName, request => {
|
||||
throw new Error(`Request: ${request.command} not allowed on approximate semantic only server`);
|
||||
throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.PartialSemantic`);
|
||||
})
|
||||
);
|
||||
break;
|
||||
case LanguageServiceMode.SyntaxOnly:
|
||||
invalidSyntaxOnlyCommands.forEach(commandName =>
|
||||
case LanguageServiceMode.Syntactic:
|
||||
invalidSyntacticModeCommands.forEach(commandName =>
|
||||
this.handlers.set(commandName, request => {
|
||||
throw new Error(`Request: ${request.command} not allowed on syntax only server`);
|
||||
throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.Syntactic`);
|
||||
})
|
||||
);
|
||||
break;
|
||||
|
||||
+12
-12
@@ -1171,7 +1171,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const invalidOperationsOnApproximateSemanticOnly: readonly (keyof LanguageService)[] = [
|
||||
const invalidOperationsInPartialSemanticMode: readonly (keyof LanguageService)[] = [
|
||||
"getSyntacticDiagnostics",
|
||||
"getSemanticDiagnostics",
|
||||
"getSuggestionDiagnostics",
|
||||
@@ -1191,8 +1191,8 @@ namespace ts {
|
||||
"provideCallHierarchyOutgoingCalls",
|
||||
];
|
||||
|
||||
const invalidOperationsOnSyntaxOnly: readonly (keyof LanguageService)[] = [
|
||||
...invalidOperationsOnApproximateSemanticOnly,
|
||||
const invalidOperationsInSyntacticMode: readonly (keyof LanguageService)[] = [
|
||||
...invalidOperationsInPartialSemanticMode,
|
||||
"getCompletionsAtPosition",
|
||||
"getCompletionEntryDetails",
|
||||
"getCompletionEntrySymbol",
|
||||
@@ -1222,7 +1222,7 @@ namespace ts {
|
||||
}
|
||||
else if (typeof syntaxOnlyOrLanguageServiceMode === "boolean") {
|
||||
// languageServiceMode = SyntaxOnly
|
||||
languageServiceMode = syntaxOnlyOrLanguageServiceMode ? LanguageServiceMode.SyntaxOnly : LanguageServiceMode.Semantic;
|
||||
languageServiceMode = syntaxOnlyOrLanguageServiceMode ? LanguageServiceMode.Syntactic : LanguageServiceMode.Semantic;
|
||||
}
|
||||
else {
|
||||
languageServiceMode = syntaxOnlyOrLanguageServiceMode;
|
||||
@@ -1276,7 +1276,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function synchronizeHostData(): void {
|
||||
Debug.assert(languageServiceMode !== LanguageServiceMode.SyntaxOnly);
|
||||
Debug.assert(languageServiceMode !== LanguageServiceMode.Syntactic);
|
||||
// perform fast check if host supports it
|
||||
if (host.getProjectVersion) {
|
||||
const hostProjectVersion = host.getProjectVersion();
|
||||
@@ -1462,7 +1462,7 @@ namespace ts {
|
||||
|
||||
// TODO: GH#18217 frequently asserted as defined
|
||||
function getProgram(): Program | undefined {
|
||||
if (languageServiceMode === LanguageServiceMode.SyntaxOnly) {
|
||||
if (languageServiceMode === LanguageServiceMode.Syntactic) {
|
||||
Debug.assert(program === undefined);
|
||||
return undefined;
|
||||
}
|
||||
@@ -2545,17 +2545,17 @@ namespace ts {
|
||||
switch (languageServiceMode) {
|
||||
case LanguageServiceMode.Semantic:
|
||||
break;
|
||||
case LanguageServiceMode.ApproximateSemanticOnly:
|
||||
invalidOperationsOnApproximateSemanticOnly.forEach(key =>
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
invalidOperationsInPartialSemanticMode.forEach(key =>
|
||||
ls[key] = () => {
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed on approximate semantic only server`);
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.PartialSemantic`);
|
||||
}
|
||||
);
|
||||
break;
|
||||
case LanguageServiceMode.SyntaxOnly:
|
||||
invalidOperationsOnSyntaxOnly.forEach(key =>
|
||||
case LanguageServiceMode.Syntactic:
|
||||
invalidOperationsInSyntacticMode.forEach(key =>
|
||||
ls[key] = () => {
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed on syntax only server`);
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.Syntactic`);
|
||||
}
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -223,8 +223,8 @@ namespace ts {
|
||||
|
||||
export enum LanguageServiceMode {
|
||||
Semantic,
|
||||
ApproximateSemanticOnly,
|
||||
SyntaxOnly,
|
||||
PartialSemantic,
|
||||
Syntactic,
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -1217,6 +1217,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
const children = n.getChildren(sourceFile);
|
||||
if (children.length === 0) {
|
||||
return n;
|
||||
}
|
||||
|
||||
const candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile);
|
||||
return candidate && findRightmostToken(candidate, sourceFile);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,6 @@
|
||||
"unittests/tscWatch/watchApi.ts",
|
||||
"unittests/tscWatch/watchEnvironment.ts",
|
||||
"unittests/tsserver/applyChangesToOpenFiles.ts",
|
||||
"unittests/tsserver/approximateSemanticOnlyServer.ts",
|
||||
"unittests/tsserver/autoImportProvider.ts",
|
||||
"unittests/tsserver/cachingFileSystemInformation.ts",
|
||||
"unittests/tsserver/cancellationToken.ts",
|
||||
@@ -177,6 +176,7 @@
|
||||
"unittests/tsserver/occurences.ts",
|
||||
"unittests/tsserver/openFile.ts",
|
||||
"unittests/tsserver/packageJsonInfo.ts",
|
||||
"unittests/tsserver/partialSemanticServer.ts",
|
||||
"unittests/tsserver/projectErrors.ts",
|
||||
"unittests/tsserver/projectReferenceCompileOnSave.ts",
|
||||
"unittests/tsserver/projectReferenceErrors.ts",
|
||||
@@ -186,11 +186,11 @@
|
||||
"unittests/tsserver/reload.ts",
|
||||
"unittests/tsserver/rename.ts",
|
||||
"unittests/tsserver/resolutionCache.ts",
|
||||
"unittests/tsserver/semanticOperationsOnSyntaxServer.ts",
|
||||
"unittests/tsserver/smartSelection.ts",
|
||||
"unittests/tsserver/session.ts",
|
||||
"unittests/tsserver/skipLibCheck.ts",
|
||||
"unittests/tsserver/smartSelection.ts",
|
||||
"unittests/tsserver/symLinks.ts",
|
||||
"unittests/tsserver/syntacticServer.ts",
|
||||
"unittests/tsserver/syntaxOperations.ts",
|
||||
"unittests/tsserver/textStorage.ts",
|
||||
"unittests/tsserver/telemetry.ts",
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@ import { something } from "something";
|
||||
content: "{}"
|
||||
};
|
||||
const host = createServerHost([file1, file2, file3, something, libFile, configFile]);
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.ApproximateSemanticOnly, useSingleInferredProject: true });
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
|
||||
return { host, session, file1, file2, file3, something, configFile };
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ import { something } from "something";
|
||||
session.executeCommand(request);
|
||||
}
|
||||
catch (e) {
|
||||
assert.equal(e.message, `Request: semanticDiagnosticsSync not allowed on approximate semantic only server`);
|
||||
assert.equal(e.message, `Request: semanticDiagnosticsSync not allowed in LanguageServiceMode.PartialSemantic`);
|
||||
hasException = true;
|
||||
}
|
||||
assert.isTrue(hasException);
|
||||
@@ -149,7 +149,7 @@ import { something } from "something";
|
||||
project.getLanguageService().getSemanticDiagnostics(file1.path);
|
||||
}
|
||||
catch (e) {
|
||||
assert.equal(e.message, `LanguageService Operation: getSemanticDiagnostics not allowed on approximate semantic only server`);
|
||||
assert.equal(e.message, `LanguageService Operation: getSemanticDiagnostics not allowed in LanguageServiceMode.PartialSemantic`);
|
||||
hasException = true;
|
||||
}
|
||||
assert.isTrue(hasException);
|
||||
@@ -195,7 +195,7 @@ function fooB() { }`
|
||||
content: "{}"
|
||||
};
|
||||
const host = createServerHost([file1, file2, file3, something, libFile, configFile]);
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.ApproximateSemanticOnly, useSingleInferredProject: true });
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
|
||||
const service = session.getProjectService();
|
||||
openFilesForSession([file1], session);
|
||||
checkNumberOfProjects(service, { inferredProjects: 1 });
|
||||
+2
-2
@@ -36,7 +36,7 @@ import { something } from "something";
|
||||
session.executeCommandSeq(request);
|
||||
}
|
||||
catch (e) {
|
||||
assert.equal(e.message, `Request: ${request.command} not allowed on syntax only server`);
|
||||
assert.equal(e.message, `Request: ${request.command} not allowed in LanguageServiceMode.Syntactic`);
|
||||
hasException = true;
|
||||
}
|
||||
assert.isTrue(hasException);
|
||||
@@ -119,7 +119,7 @@ import { something } from "something";
|
||||
project.getLanguageService().getSemanticDiagnostics(file1.path);
|
||||
}
|
||||
catch (e) {
|
||||
assert.equal(e.message, `LanguageService Operation: getSemanticDiagnostics not allowed on syntax only server`);
|
||||
assert.equal(e.message, `LanguageService Operation: getSemanticDiagnostics not allowed in LanguageServiceMode.Syntactic`);
|
||||
hasException = true;
|
||||
}
|
||||
assert.isTrue(hasException);
|
||||
@@ -959,10 +959,10 @@ namespace ts.server {
|
||||
switch (mode.toLowerCase()) {
|
||||
case "semantic":
|
||||
return LanguageServiceMode.Semantic;
|
||||
case "approximatesemanticonly":
|
||||
return LanguageServiceMode.ApproximateSemanticOnly;
|
||||
case "syntaxonly":
|
||||
return LanguageServiceMode.SyntaxOnly;
|
||||
case "partialsemantic":
|
||||
return LanguageServiceMode.PartialSemantic;
|
||||
case "syntactic":
|
||||
return LanguageServiceMode.Syntactic;
|
||||
default:
|
||||
unknownServerMode = mode;
|
||||
return undefined;
|
||||
|
||||
+2
-2
@@ -5316,8 +5316,8 @@ declare namespace ts {
|
||||
}
|
||||
enum LanguageServiceMode {
|
||||
Semantic = 0,
|
||||
ApproximateSemanticOnly = 1,
|
||||
SyntaxOnly = 2
|
||||
PartialSemantic = 1,
|
||||
Syntactic = 2
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
getCompilationSettings(): CompilerOptions;
|
||||
|
||||
+2
-2
@@ -5316,8 +5316,8 @@ declare namespace ts {
|
||||
}
|
||||
enum LanguageServiceMode {
|
||||
Semantic = 0,
|
||||
ApproximateSemanticOnly = 1,
|
||||
SyntaxOnly = 2
|
||||
PartialSemantic = 1,
|
||||
Syntactic = 2
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
getCompilationSettings(): CompilerOptions;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////export interface Foo {
|
||||
//// /** JSDoc */
|
||||
//// /**/foo(): void;
|
||||
////}
|
||||
|
||||
// Should not crash, #35632
|
||||
verify.completions({
|
||||
marker: "",
|
||||
isNewIdentifierLocation: true,
|
||||
exact: [{
|
||||
name: "readonly",
|
||||
kind: "keyword",
|
||||
sortText: completion.SortText.GlobalsOrKeywords
|
||||
}]
|
||||
});
|
||||
Reference in New Issue
Block a user