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 retainProjects: ConfiguredProject[] | ConfiguredProject | undefined;
|
||||||
let projectForConfigFileDiag: ConfiguredProject | undefined;
|
let projectForConfigFileDiag: ConfiguredProject | undefined;
|
||||||
let defaultConfigProjectIsCreated = false;
|
let defaultConfigProjectIsCreated = false;
|
||||||
if (this.serverMode === LanguageServiceMode.ApproximateSemantic) {
|
if (this.serverMode === LanguageServiceMode.PartialSemantic) {
|
||||||
// Invalidate resolutions in the file since this file is now open
|
// Invalidate resolutions in the file since this file is now open
|
||||||
info.containingProjects.forEach(project => {
|
info.containingProjects.forEach(project => {
|
||||||
if (project.resolutionCache.removeRelativeNoResolveResolutionsOfFile(info.path)) {
|
if (project.resolutionCache.removeRelativeNoResolveResolutionsOfFile(info.path)) {
|
||||||
|
@ -3124,7 +3124,7 @@ namespace ts.server {
|
||||||
Debug.assert(this.openFiles.has(info.path));
|
Debug.assert(this.openFiles.has(info.path));
|
||||||
this.assignOrphanScriptInfoToInferredProject(info, this.openFiles.get(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
|
// This file was just opened and references in this file will previously not been resolved so schedule update
|
||||||
info.containingProjects.forEach(project => project.markAsDirty());
|
info.containingProjects.forEach(project => project.markAsDirty());
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,7 @@ namespace ts.server {
|
||||||
case LanguageServiceMode.Semantic:
|
case LanguageServiceMode.Semantic:
|
||||||
this.languageServiceEnabled = true;
|
this.languageServiceEnabled = true;
|
||||||
break;
|
break;
|
||||||
case LanguageServiceMode.ApproximateSemantic:
|
case LanguageServiceMode.PartialSemantic:
|
||||||
this.languageServiceEnabled = true;
|
this.languageServiceEnabled = true;
|
||||||
this.compilerOptions.types = [];
|
this.compilerOptions.types = [];
|
||||||
break;
|
break;
|
||||||
|
@ -471,7 +471,7 @@ namespace ts.server {
|
||||||
switch (this.projectService.serverMode) {
|
switch (this.projectService.serverMode) {
|
||||||
case LanguageServiceMode.Semantic:
|
case LanguageServiceMode.Semantic:
|
||||||
return true;
|
return true;
|
||||||
case LanguageServiceMode.ApproximateSemantic:
|
case LanguageServiceMode.PartialSemantic:
|
||||||
return this.fileIsOpen(this.toPath(containingFile));
|
return this.fileIsOpen(this.toPath(containingFile));
|
||||||
case LanguageServiceMode.Syntactic:
|
case LanguageServiceMode.Syntactic:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -585,7 +585,7 @@ namespace ts.server {
|
||||||
undefined;
|
undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const invalidApproximateSemanticOnlyCommands: readonly CommandNames[] = [
|
const invalidPartialSemanticModeCommands: readonly CommandNames[] = [
|
||||||
CommandNames.OpenExternalProject,
|
CommandNames.OpenExternalProject,
|
||||||
CommandNames.OpenExternalProjects,
|
CommandNames.OpenExternalProjects,
|
||||||
CommandNames.CloseExternalProject,
|
CommandNames.CloseExternalProject,
|
||||||
|
@ -621,8 +621,8 @@ namespace ts.server {
|
||||||
CommandNames.ProvideCallHierarchyOutgoingCalls,
|
CommandNames.ProvideCallHierarchyOutgoingCalls,
|
||||||
];
|
];
|
||||||
|
|
||||||
const invalidSyntaxOnlyCommands: readonly CommandNames[] = [
|
const invalidSyntacticModeCommands: readonly CommandNames[] = [
|
||||||
...invalidApproximateSemanticOnlyCommands,
|
...invalidPartialSemanticModeCommands,
|
||||||
CommandNames.Definition,
|
CommandNames.Definition,
|
||||||
CommandNames.DefinitionFull,
|
CommandNames.DefinitionFull,
|
||||||
CommandNames.DefinitionAndBoundSpan,
|
CommandNames.DefinitionAndBoundSpan,
|
||||||
|
@ -751,15 +751,15 @@ namespace ts.server {
|
||||||
switch (this.projectService.serverMode) {
|
switch (this.projectService.serverMode) {
|
||||||
case LanguageServiceMode.Semantic:
|
case LanguageServiceMode.Semantic:
|
||||||
break;
|
break;
|
||||||
case LanguageServiceMode.ApproximateSemantic:
|
case LanguageServiceMode.PartialSemantic:
|
||||||
invalidApproximateSemanticOnlyCommands.forEach(commandName =>
|
invalidPartialSemanticModeCommands.forEach(commandName =>
|
||||||
this.handlers.set(commandName, request => {
|
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;
|
break;
|
||||||
case LanguageServiceMode.Syntactic:
|
case LanguageServiceMode.Syntactic:
|
||||||
invalidSyntaxOnlyCommands.forEach(commandName =>
|
invalidSyntacticModeCommands.forEach(commandName =>
|
||||||
this.handlers.set(commandName, request => {
|
this.handlers.set(commandName, request => {
|
||||||
throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.Syntactic`);
|
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",
|
"getSyntacticDiagnostics",
|
||||||
"getSemanticDiagnostics",
|
"getSemanticDiagnostics",
|
||||||
"getSuggestionDiagnostics",
|
"getSuggestionDiagnostics",
|
||||||
|
@ -1191,8 +1191,8 @@ namespace ts {
|
||||||
"provideCallHierarchyOutgoingCalls",
|
"provideCallHierarchyOutgoingCalls",
|
||||||
];
|
];
|
||||||
|
|
||||||
const invalidOperationsOnSyntaxOnly: readonly (keyof LanguageService)[] = [
|
const invalidOperationsInSyntacticMode: readonly (keyof LanguageService)[] = [
|
||||||
...invalidOperationsOnApproximateSemanticOnly,
|
...invalidOperationsInPartialSemanticMode,
|
||||||
"getCompletionsAtPosition",
|
"getCompletionsAtPosition",
|
||||||
"getCompletionEntryDetails",
|
"getCompletionEntryDetails",
|
||||||
"getCompletionEntrySymbol",
|
"getCompletionEntrySymbol",
|
||||||
|
@ -2545,15 +2545,15 @@ namespace ts {
|
||||||
switch (languageServiceMode) {
|
switch (languageServiceMode) {
|
||||||
case LanguageServiceMode.Semantic:
|
case LanguageServiceMode.Semantic:
|
||||||
break;
|
break;
|
||||||
case LanguageServiceMode.ApproximateSemantic:
|
case LanguageServiceMode.PartialSemantic:
|
||||||
invalidOperationsOnApproximateSemanticOnly.forEach(key =>
|
invalidOperationsInPartialSemanticMode.forEach(key =>
|
||||||
ls[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;
|
break;
|
||||||
case LanguageServiceMode.Syntactic:
|
case LanguageServiceMode.Syntactic:
|
||||||
invalidOperationsOnSyntaxOnly.forEach(key =>
|
invalidOperationsInSyntacticMode.forEach(key =>
|
||||||
ls[key] = () => {
|
ls[key] = () => {
|
||||||
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.Syntactic`);
|
throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.Syntactic`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,7 @@ namespace ts {
|
||||||
|
|
||||||
export enum LanguageServiceMode {
|
export enum LanguageServiceMode {
|
||||||
Semantic,
|
Semantic,
|
||||||
ApproximateSemantic,
|
PartialSemantic,
|
||||||
Syntactic,
|
Syntactic,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,6 @@
|
||||||
"unittests/tscWatch/watchApi.ts",
|
"unittests/tscWatch/watchApi.ts",
|
||||||
"unittests/tscWatch/watchEnvironment.ts",
|
"unittests/tscWatch/watchEnvironment.ts",
|
||||||
"unittests/tsserver/applyChangesToOpenFiles.ts",
|
"unittests/tsserver/applyChangesToOpenFiles.ts",
|
||||||
"unittests/tsserver/approximateSemanticOnlyServer.ts",
|
|
||||||
"unittests/tsserver/autoImportProvider.ts",
|
"unittests/tsserver/autoImportProvider.ts",
|
||||||
"unittests/tsserver/cachingFileSystemInformation.ts",
|
"unittests/tsserver/cachingFileSystemInformation.ts",
|
||||||
"unittests/tsserver/cancellationToken.ts",
|
"unittests/tsserver/cancellationToken.ts",
|
||||||
|
@ -177,6 +176,7 @@
|
||||||
"unittests/tsserver/occurences.ts",
|
"unittests/tsserver/occurences.ts",
|
||||||
"unittests/tsserver/openFile.ts",
|
"unittests/tsserver/openFile.ts",
|
||||||
"unittests/tsserver/packageJsonInfo.ts",
|
"unittests/tsserver/packageJsonInfo.ts",
|
||||||
|
"unittests/tsserver/partialSemanticServer.ts",
|
||||||
"unittests/tsserver/projectErrors.ts",
|
"unittests/tsserver/projectErrors.ts",
|
||||||
"unittests/tsserver/projectReferenceCompileOnSave.ts",
|
"unittests/tsserver/projectReferenceCompileOnSave.ts",
|
||||||
"unittests/tsserver/projectReferenceErrors.ts",
|
"unittests/tsserver/projectReferenceErrors.ts",
|
||||||
|
@ -186,11 +186,11 @@
|
||||||
"unittests/tsserver/reload.ts",
|
"unittests/tsserver/reload.ts",
|
||||||
"unittests/tsserver/rename.ts",
|
"unittests/tsserver/rename.ts",
|
||||||
"unittests/tsserver/resolutionCache.ts",
|
"unittests/tsserver/resolutionCache.ts",
|
||||||
"unittests/tsserver/semanticOperationsOnSyntaxServer.ts",
|
|
||||||
"unittests/tsserver/smartSelection.ts",
|
|
||||||
"unittests/tsserver/session.ts",
|
"unittests/tsserver/session.ts",
|
||||||
"unittests/tsserver/skipLibCheck.ts",
|
"unittests/tsserver/skipLibCheck.ts",
|
||||||
|
"unittests/tsserver/smartSelection.ts",
|
||||||
"unittests/tsserver/symLinks.ts",
|
"unittests/tsserver/symLinks.ts",
|
||||||
|
"unittests/tsserver/syntacticServer.ts",
|
||||||
"unittests/tsserver/syntaxOperations.ts",
|
"unittests/tsserver/syntaxOperations.ts",
|
||||||
"unittests/tsserver/textStorage.ts",
|
"unittests/tsserver/textStorage.ts",
|
||||||
"unittests/tsserver/telemetry.ts",
|
"unittests/tsserver/telemetry.ts",
|
||||||
|
|
|
@ -26,7 +26,7 @@ import { something } from "something";
|
||||||
content: "{}"
|
content: "{}"
|
||||||
};
|
};
|
||||||
const host = createServerHost([file1, file2, file3, something, libFile, configFile]);
|
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 };
|
return { host, session, file1, file2, file3, something, configFile };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ import { something } from "something";
|
||||||
session.executeCommand(request);
|
session.executeCommand(request);
|
||||||
}
|
}
|
||||||
catch (e) {
|
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;
|
hasException = true;
|
||||||
}
|
}
|
||||||
assert.isTrue(hasException);
|
assert.isTrue(hasException);
|
||||||
|
@ -149,7 +149,7 @@ import { something } from "something";
|
||||||
project.getLanguageService().getSemanticDiagnostics(file1.path);
|
project.getLanguageService().getSemanticDiagnostics(file1.path);
|
||||||
}
|
}
|
||||||
catch (e) {
|
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;
|
hasException = true;
|
||||||
}
|
}
|
||||||
assert.isTrue(hasException);
|
assert.isTrue(hasException);
|
||||||
|
@ -195,7 +195,7 @@ function fooB() { }`
|
||||||
content: "{}"
|
content: "{}"
|
||||||
};
|
};
|
||||||
const host = createServerHost([file1, file2, file3, something, libFile, configFile]);
|
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();
|
const service = session.getProjectService();
|
||||||
openFilesForSession([file1], session);
|
openFilesForSession([file1], session);
|
||||||
checkNumberOfProjects(service, { inferredProjects: 1 });
|
checkNumberOfProjects(service, { inferredProjects: 1 });
|
|
@ -959,9 +959,9 @@ namespace ts.server {
|
||||||
switch (mode.toLowerCase()) {
|
switch (mode.toLowerCase()) {
|
||||||
case "semantic":
|
case "semantic":
|
||||||
return LanguageServiceMode.Semantic;
|
return LanguageServiceMode.Semantic;
|
||||||
case "approximatesemanticonly":
|
case "partialsemantic":
|
||||||
return LanguageServiceMode.ApproximateSemantic;
|
return LanguageServiceMode.PartialSemantic;
|
||||||
case "syntaxonly":
|
case "syntactic":
|
||||||
return LanguageServiceMode.Syntactic;
|
return LanguageServiceMode.Syntactic;
|
||||||
default:
|
default:
|
||||||
unknownServerMode = mode;
|
unknownServerMode = mode;
|
||||||
|
|
|
@ -5316,7 +5316,7 @@ declare namespace ts {
|
||||||
}
|
}
|
||||||
enum LanguageServiceMode {
|
enum LanguageServiceMode {
|
||||||
Semantic = 0,
|
Semantic = 0,
|
||||||
ApproximateSemantic = 1,
|
PartialSemantic = 1,
|
||||||
Syntactic = 2
|
Syntactic = 2
|
||||||
}
|
}
|
||||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||||
|
|
|
@ -5316,7 +5316,7 @@ declare namespace ts {
|
||||||
}
|
}
|
||||||
enum LanguageServiceMode {
|
enum LanguageServiceMode {
|
||||||
Semantic = 0,
|
Semantic = 0,
|
||||||
ApproximateSemantic = 1,
|
PartialSemantic = 1,
|
||||||
Syntactic = 2
|
Syntactic = 2
|
||||||
}
|
}
|
||||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||||
|
|
Loading…
Reference in a new issue