Use 'approximation' instead of 'approximate'.
This commit is contained in:
parent
54f988cd9f
commit
05f1301301
|
@ -1587,7 +1587,7 @@ namespace ts {
|
||||||
kind: ScriptElementKind.unknown,
|
kind: ScriptElementKind.unknown,
|
||||||
kindModifiers: ScriptElementKindModifier.none,
|
kindModifiers: ScriptElementKindModifier.none,
|
||||||
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
|
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
|
||||||
displayParts: prefixWithApproximate(
|
displayParts: prefixWithApproximation(
|
||||||
typeChecker.runWithCancellationToken(cancellationToken, typeChecker => typeToDisplayParts(typeChecker, type, getContainerNode(nodeForQuickInfo)))
|
typeChecker.runWithCancellationToken(cancellationToken, typeChecker => typeToDisplayParts(typeChecker, type, getContainerNode(nodeForQuickInfo)))
|
||||||
),
|
),
|
||||||
documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined,
|
documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined,
|
||||||
|
@ -1602,7 +1602,7 @@ namespace ts {
|
||||||
kind: symbolKind,
|
kind: symbolKind,
|
||||||
kindModifiers: SymbolDisplay.getSymbolModifiers(symbol),
|
kindModifiers: SymbolDisplay.getSymbolModifiers(symbol),
|
||||||
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
|
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
|
||||||
displayParts: prefixWithApproximate(displayParts),
|
displayParts: prefixWithApproximation(displayParts),
|
||||||
documentation,
|
documentation,
|
||||||
tags,
|
tags,
|
||||||
};
|
};
|
||||||
|
@ -1632,11 +1632,11 @@ namespace ts {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function prefixWithApproximate(displayParts: SymbolDisplayPart[]): SymbolDisplayPart[] {
|
function prefixWithApproximation(displayParts: SymbolDisplayPart[]): SymbolDisplayPart[] {
|
||||||
if (languageServiceMode === LanguageServiceMode.Semantic) {
|
if (languageServiceMode === LanguageServiceMode.Semantic) {
|
||||||
return displayParts;
|
return displayParts;
|
||||||
}
|
}
|
||||||
return [textPart("(approximate)"), lineBreakPart(), ...displayParts];
|
return [textPart("(approximation)"), spacePart(), ...displayParts];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Goto definition
|
/// Goto definition
|
||||||
|
|
|
@ -30,7 +30,7 @@ import { something } from "something";
|
||||||
return { host, session, file1, file2, file3, something, configFile };
|
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 = {
|
const file: File = {
|
||||||
path: `${tscWatch.projectRoot}/foo.ts`,
|
path: `${tscWatch.projectRoot}/foo.ts`,
|
||||||
content: "export const foo = 100;"
|
content: "export const foo = 100;"
|
||||||
|
@ -39,11 +39,11 @@ import { something } from "something";
|
||||||
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
|
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
|
||||||
openFilesForSession([file], session);
|
openFilesForSession([file], session);
|
||||||
const response = session.executeCommandSeq<protocol.QuickInfoRequest>({
|
const response = session.executeCommandSeq<protocol.QuickInfoRequest>({
|
||||||
command: ts.server.protocol.CommandTypes.Quickinfo,
|
command: protocol.CommandTypes.Quickinfo,
|
||||||
arguments: protocolFileLocationFromSubstring(file, "foo"),
|
arguments: protocolFileLocationFromSubstring(file, "foo"),
|
||||||
}).response as protocol.QuickInfoResponseBody;
|
}).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", () => {
|
it("open files are added to inferred project even if config file is present and semantic operations succeed", () => {
|
||||||
|
|
Loading…
Reference in a new issue