More renames
This commit is contained in:
parent
d320625392
commit
e8d798db59
11 changed files with 31 additions and 31 deletions
|
@ -3029,7 +3029,7 @@ namespace ts.server {
|
|||
let retainProjects: ConfiguredProject[] | ConfiguredProject | undefined;
|
||||
let projectForConfigFileDiag: ConfiguredProject | undefined;
|
||||
let defaultConfigProjectIsCreated = false;
|
||||
if (this.serverMode === LanguageServiceMode.ApproximateSemantic) {
|
||||
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.ApproximateSemantic && 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,7 +283,7 @@ namespace ts.server {
|
|||
case LanguageServiceMode.Semantic:
|
||||
this.languageServiceEnabled = true;
|
||||
break;
|
||||
case LanguageServiceMode.ApproximateSemantic:
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
this.languageServiceEnabled = true;
|
||||
this.compilerOptions.types = [];
|
||||
break;
|
||||
|
@ -471,7 +471,7 @@ namespace ts.server {
|
|||
switch (this.projectService.serverMode) {
|
||||
case LanguageServiceMode.Semantic:
|
||||
return true;
|
||||
case LanguageServiceMode.ApproximateSemantic:
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
return this.fileIsOpen(this.toPath(containingFile));
|
||||
case LanguageServiceMode.Syntactic:
|
||||
return false;
|
||||
|
|
|
@ -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,15 +751,15 @@ namespace ts.server {
|
|||
switch (this.projectService.serverMode) {
|
||||
case LanguageServiceMode.Semantic:
|
||||
break;
|
||||
case LanguageServiceMode.ApproximateSemantic:
|
||||
invalidApproximateSemanticOnlyCommands.forEach(commandName =>
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
invalidPartialSemanticModeCommands.forEach(commandName =>
|
||||
this.handlers.set(commandName, request => {
|
||||
throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.ApproximateSemantic`);
|
||||
throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.PartialSemantic`);
|
||||
})
|
||||
);
|
||||
break;
|
||||
case LanguageServiceMode.Syntactic:
|
||||
invalidSyntaxOnlyCommands.forEach(commandName =>
|
||||
invalidSyntacticModeCommands.forEach(commandName =>
|
||||
this.handlers.set(commandName, request => {
|
||||
throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.Syntactic`);
|
||||
})
|
||||
|
|
|
@ -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",
|
||||
|
@ -2545,15 +2545,15 @@ namespace ts {
|
|||
switch (languageServiceMode) {
|
||||
case LanguageServiceMode.Semantic:
|
||||
break;
|
||||
case LanguageServiceMode.ApproximateSemantic:
|
||||
invalidOperationsOnApproximateSemanticOnly.forEach(key =>
|
||||
case LanguageServiceMode.PartialSemantic:
|
||||
invalidOperationsInPartialSemanticMode.forEach(key =>
|
||||
ls[key] = () => {
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.ApproximateSemantic`);
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.PartialSemantic`);
|
||||
}
|
||||
);
|
||||
break;
|
||||
case LanguageServiceMode.Syntactic:
|
||||
invalidOperationsOnSyntaxOnly.forEach(key =>
|
||||
invalidOperationsInSyntacticMode.forEach(key =>
|
||||
ls[key] = () => {
|
||||
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.Syntactic`);
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ namespace ts {
|
|||
|
||||
export enum LanguageServiceMode {
|
||||
Semantic,
|
||||
ApproximateSemantic,
|
||||
PartialSemantic,
|
||||
Syntactic,
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -26,7 +26,7 @@ import { something } from "something";
|
|||
content: "{}"
|
||||
};
|
||||
const host = createServerHost([file1, file2, file3, something, libFile, configFile]);
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.ApproximateSemantic, 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 in LanguageServiceMode.ApproximateSemantic`);
|
||||
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 in LanguageServiceMode.ApproximateSemantic`);
|
||||
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.ApproximateSemantic, useSingleInferredProject: true });
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
|
||||
const service = session.getProjectService();
|
||||
openFilesForSession([file1], session);
|
||||
checkNumberOfProjects(service, { inferredProjects: 1 });
|
|
@ -959,9 +959,9 @@ namespace ts.server {
|
|||
switch (mode.toLowerCase()) {
|
||||
case "semantic":
|
||||
return LanguageServiceMode.Semantic;
|
||||
case "approximatesemanticonly":
|
||||
return LanguageServiceMode.ApproximateSemantic;
|
||||
case "syntaxonly":
|
||||
case "partialsemantic":
|
||||
return LanguageServiceMode.PartialSemantic;
|
||||
case "syntactic":
|
||||
return LanguageServiceMode.Syntactic;
|
||||
default:
|
||||
unknownServerMode = mode;
|
||||
|
|
|
@ -5316,7 +5316,7 @@ declare namespace ts {
|
|||
}
|
||||
enum LanguageServiceMode {
|
||||
Semantic = 0,
|
||||
ApproximateSemantic = 1,
|
||||
PartialSemantic = 1,
|
||||
Syntactic = 2
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
|
|
|
@ -5316,7 +5316,7 @@ declare namespace ts {
|
|||
}
|
||||
enum LanguageServiceMode {
|
||||
Semantic = 0,
|
||||
ApproximateSemantic = 1,
|
||||
PartialSemantic = 1,
|
||||
Syntactic = 2
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
|
|
Loading…
Reference in a new issue