Skip to content

Commit

Permalink
Merge pull request #151 from mkslanc/fix-completion-documentation-ts
Browse files Browse the repository at this point in the history
Fix: not working documentation tooltip for Typescript Service
  • Loading branch information
mkslanc authored Jan 24, 2025
2 parents bdf8bdf + 37ac5c7 commit 6a5a445
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,14 @@ export function toCompletions(completionInfo: CompletionInfo, doc: TextDocument,
}

export function toResolvedCompletion(entry: CompletionEntryDetails): lsp.CompletionItem {
let documentation = entry.displayParts.map((displayPart) => displayPart.text).join('');
if (entry.documentation) {
documentation += "\n\n" + entry.documentation.map((displayPart) => displayPart.text).join('');
}
return {
label: entry.name,
kind: convertKind(entry.kind),
documentation: entry.displayParts.map((displayPart) => displayPart.text).join('')
documentation: documentation
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export class TypescriptService extends BaseService<TsServiceOptions> implements

serviceCapabilities = {
completionProvider: {
triggerCharacters: ['.', '"', '\'', '`', '/', '@', '<', '#']
triggerCharacters: ['.', '"', '\'', '`', '/', '@', '<', '#'],
resolveProvider: true
},
diagnosticProvider: {
interFileDependencies: true,
Expand Down Expand Up @@ -273,7 +274,7 @@ export class TypescriptService extends BaseService<TsServiceOptions> implements

async doResolve(item: lsp.CompletionItem): Promise<lsp.CompletionItem | null> {
let resolvedCompletion = this.$service.getCompletionEntryDetails(
item["fileName"],
item["fileName"].documentUri,
item["position"],
item.label,
undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export declare class TypescriptService extends BaseService<TsServiceOptions> imp
serviceCapabilities: {
completionProvider: {
triggerCharacters: string[];
resolveProvider: boolean;
};
diagnosticProvider: {
interFileDependencies: boolean;
Expand Down

0 comments on commit 6a5a445

Please sign in to comment.