Use 'approximation' instead of 'approximate'.

This commit is contained in:
Daniel Rosenwasser 2020-08-15 00:33:34 +00:00
parent 54f988cd9f
commit 05f1301301
2 changed files with 7 additions and 7 deletions

View file

@ -1587,7 +1587,7 @@ namespace ts {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
displayParts: prefixWithApproximate(
displayParts: prefixWithApproximation(
typeChecker.runWithCancellationToken(cancellationToken, typeChecker => typeToDisplayParts(typeChecker, type, getContainerNode(nodeForQuickInfo)))
),
documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined,
@ -1602,7 +1602,7 @@ namespace ts {
kind: symbolKind,
kindModifiers: SymbolDisplay.getSymbolModifiers(symbol),
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
displayParts: prefixWithApproximate(displayParts),
displayParts: prefixWithApproximation(displayParts),
documentation,
tags,
};
@ -1632,11 +1632,11 @@ namespace ts {
}
}
function prefixWithApproximate(displayParts: SymbolDisplayPart[]): SymbolDisplayPart[] {
function prefixWithApproximation(displayParts: SymbolDisplayPart[]): SymbolDisplayPart[] {
if (languageServiceMode === LanguageServiceMode.Semantic) {
return displayParts;
}
return [textPart("(approximate)"), lineBreakPart(), ...displayParts];
return [textPart("(approximation)"), spacePart(), ...displayParts];
}
/// Goto definition

View file

@ -30,7 +30,7 @@ import { something } from "something";
return { host, session, file1, file2, file3, something, configFile };
}
it("adds '(approximate)' to the description of quick info", () => {
it("adds '(approximation)' to the description of quick info", () => {
const file: File = {
path: `${tscWatch.projectRoot}/foo.ts`,
content: "export const foo = 100;"
@ -39,11 +39,11 @@ import { something } from "something";
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
openFilesForSession([file], session);
const response = session.executeCommandSeq<protocol.QuickInfoRequest>({
command: ts.server.protocol.CommandTypes.Quickinfo,
command: protocol.CommandTypes.Quickinfo,
arguments: protocolFileLocationFromSubstring(file, "foo"),
}).response as protocol.QuickInfoResponseBody;
assert(stringContainsAt(response.displayString, "(approximate)", 0));
assert(stringContainsAt(response.displayString, "(approximation)", 0));
});
it("open files are added to inferred project even if config file is present and semantic operations succeed", () => {