typescript-language-server
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -51,4 +51,3 @@ import * as lsp from 'vscode-languageserver'; | ||
completion(params: lsp.CompletionParams): Promise<TSCompletionItem[] | null>; | ||
completionDetails(items: tsp.CompletionEntry[], file: string, line: number, offset: number): Promise<TSCompletionItem[]>; | ||
completionResolve(item: TSCompletionItem): Promise<TSCompletionItem>; | ||
completionResolve(item: TSCompletionItem): Promise<lsp.CompletionItem>; | ||
hover(params: lsp.TextDocumentPositionParams): Promise<lsp.Hover>; | ||
@@ -55,0 +54,0 @@ protected getQuickInfo(file: string, position: lsp.Position): Promise<tsp.QuickInfoResponse | undefined>; |
@@ -408,3 +408,6 @@ "use strict"; | ||
})); | ||
return this.completionDetails(result.body || [], file, params.position.line + 1, params.position.character + 1); | ||
const body = result.body || []; | ||
return body | ||
.filter(entry => entry.kind !== 'warning') | ||
.map(entry => completion_1.asCompletionItem(entry, file, params.position, document)); | ||
} | ||
@@ -422,30 +425,2 @@ catch (error) { | ||
} | ||
completionDetails(items, file, line, offset) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { body } = yield this.interuptDiagnostics(() => this.tspClient.request("completionEntryDetails" /* CompletionDetails */, { | ||
file, | ||
line, | ||
offset, | ||
entryNames: items.map(item => item.name) | ||
})); | ||
return (body || []).map(entry => { | ||
const item = { | ||
label: entry.name, | ||
kind: completion_1.asCompletionItemKind(entry.kind), | ||
commitCharacters: completion_1.asCommitCharacters(entry.kind), | ||
detail: completion_1.asDetail(entry), | ||
documentation: protocol_translation_1.asDocumentation(entry), | ||
data: { | ||
file, | ||
line, | ||
offset, | ||
entryNames: [ | ||
entry.source ? { name: entry.name, source: entry.source.join(' ') } : entry.name | ||
] | ||
} | ||
}; | ||
return Object.assign(Object.assign({}, item), completion_1.asCodeActions(entry, file)); | ||
}); | ||
}); | ||
} | ||
completionResolve(item) { | ||
@@ -452,0 +427,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "typescript-language-server", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Language Server Protocol (LSP) implementation for TypeScript using tsserver", | ||
@@ -37,3 +37,3 @@ "author": "TypeFox and others", | ||
}, | ||
"gitHead": "0e0cfb1da55ac06b0da0b9b8da2556891156fab0" | ||
"gitHead": "3a8ea0f04bde047e2f60b9f68ef7816e3a41aa10" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
315167
4175