Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode" #40072

Merged
merged 1 commit into from Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/services/services.ts
Expand Up @@ -1587,9 +1587,7 @@ namespace ts {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
displayParts: prefixWithApproximation(
typeChecker.runWithCancellationToken(cancellationToken, typeChecker => typeToDisplayParts(typeChecker, type, getContainerNode(nodeForQuickInfo)))
),
displayParts: typeChecker.runWithCancellationToken(cancellationToken, typeChecker => typeToDisplayParts(typeChecker, type, getContainerNode(nodeForQuickInfo))),
documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined,
tags: type.symbol ? type.symbol.getJsDocTags() : undefined
};
Expand All @@ -1602,7 +1600,7 @@ namespace ts {
kind: symbolKind,
kindModifiers: SymbolDisplay.getSymbolModifiers(symbol),
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
displayParts: prefixWithApproximation(displayParts),
displayParts,
documentation,
tags,
};
Expand Down Expand Up @@ -1632,13 +1630,6 @@ namespace ts {
}
}

function prefixWithApproximation(displayParts: SymbolDisplayPart[]): SymbolDisplayPart[] {
if (languageServiceMode === LanguageServiceMode.Semantic) {
return displayParts;
}
return [textPart("(approximation)"), spacePart(), ...displayParts];
}

/// Goto definition
function getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined {
synchronizeHostData();
Expand Down
16 changes: 0 additions & 16 deletions src/testRunner/unittests/tsserver/partialSemanticServer.ts
Expand Up @@ -30,22 +30,6 @@ import { something } from "something";
return { host, session, file1, file2, file3, something, configFile };
}

it("adds '(approximation)' to the description of quick info", () => {
const file: File = {
path: `${tscWatch.projectRoot}/foo.ts`,
content: "export const foo = 100;"
};
const host = createServerHost([file]);
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
openFilesForSession([file], session);
const response = session.executeCommandSeq<protocol.QuickInfoRequest>({
command: protocol.CommandTypes.Quickinfo,
arguments: protocolFileLocationFromSubstring(file, "foo"),
}).response as protocol.QuickInfoResponseBody;

assert(stringContainsAt(response.displayString, "(approximation)", 0));
});

it("open files are added to inferred project even if config file is present and semantic operations succeed", () => {
const { host, session, file1, file2 } = setup();
const service = session.getProjectService();
Expand Down