mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
[html] resolve JS completion proposals
This commit is contained in:
@@ -54,7 +54,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
capabilities: {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
textDocumentSync: documents.syncKind,
|
||||
completionProvider: { resolveProvider: false, triggerCharacters: ['.', ':', '<', '"', '=', '/'] },
|
||||
completionProvider: { resolveProvider: true, triggerCharacters: ['.', ':', '<', '"', '=', '/'] },
|
||||
hoverProvider: true,
|
||||
documentHighlightProvider: true,
|
||||
documentRangeFormattingProvider: initializationOptions && initializationOptions['format.enable'],
|
||||
@@ -127,6 +127,18 @@ connection.onCompletion(textDocumentPosition => {
|
||||
return { isIncomplete: true, items: [] };
|
||||
});
|
||||
|
||||
connection.onCompletionResolve(item => {
|
||||
let data = item.data;
|
||||
if (data && data.languageId && data.uri) {
|
||||
let mode = languageModes.getMode(data.languageId);
|
||||
let document = documents.get(data.uri);
|
||||
if (mode && mode.doResolve && document) {
|
||||
return mode.doResolve(document, item);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
connection.onHover(textDocumentPosition => {
|
||||
let document = documents.get(textDocumentPosition.textDocument.uri);
|
||||
let mode = languageModes.getModeAtPosition(document, textDocumentPosition.position);
|
||||
|
||||
Reference in New Issue
Block a user