mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
lamguage servers: Require snippetSupport for completionProvider capability
This commit is contained in:
parent
1a35a77864
commit
c0b1937b47
|
@ -46,11 +46,12 @@ connection.onShutdown(() => {
|
|||
// After the server has started the client sends an initilize request. The server receives
|
||||
// in the passed params the rootPath of the workspace plus the client capabilities.
|
||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
let snippetSupport = params.capabilities && params.capabilities.textDocument && params.capabilities.textDocument.completion && params.capabilities.textDocument.completion.completionItem && params.capabilities.textDocument.completion.completionItem.snippetSupport;
|
||||
return {
|
||||
capabilities: {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
textDocumentSync: documents.syncKind,
|
||||
completionProvider: { resolveProvider: false },
|
||||
completionProvider: snippetSupport ? { resolveProvider: false } : null,
|
||||
hoverProvider: true,
|
||||
documentSymbolProvider: true,
|
||||
referencesProvider: true,
|
||||
|
|
|
@ -53,12 +53,12 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
|||
connection.onShutdown(() => {
|
||||
languageModes.dispose();
|
||||
});
|
||||
|
||||
let snippetSupport = params.capabilities && params.capabilities.textDocument && params.capabilities.textDocument.completion && params.capabilities.textDocument.completion.completionItem && params.capabilities.textDocument.completion.completionItem.snippetSupport;
|
||||
return {
|
||||
capabilities: {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
textDocumentSync: documents.syncKind,
|
||||
completionProvider: { resolveProvider: true, triggerCharacters: ['.', ':', '<', '"', '=', '/'] },
|
||||
completionProvider: snippetSupport ? { resolveProvider: true, triggerCharacters: ['.', ':', '<', '"', '=', '/'] } : null,
|
||||
hoverProvider: true,
|
||||
documentHighlightProvider: true,
|
||||
documentRangeFormattingProvider: initializationOptions && initializationOptions['format.enable'],
|
||||
|
|
|
@ -59,11 +59,12 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
|||
if (params.initializationOptions) {
|
||||
filesAssociationContribution.setLanguageIds(params.initializationOptions.languageIds);
|
||||
}
|
||||
let snippetSupport = params.capabilities && params.capabilities.textDocument && params.capabilities.textDocument.completion && params.capabilities.textDocument.completion.completionItem && params.capabilities.textDocument.completion.completionItem.snippetSupport;
|
||||
return {
|
||||
capabilities: {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
textDocumentSync: documents.syncKind,
|
||||
completionProvider: { resolveProvider: true, triggerCharacters: ['"', ':'] },
|
||||
completionProvider: snippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : null,
|
||||
hoverProvider: true,
|
||||
documentSymbolProvider: true,
|
||||
documentRangeFormattingProvider: !params.initializationOptions || params.initializationOptions['format.enable']
|
||||
|
|
Loading…
Reference in a new issue