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

Add 'data' to the list of item defaults for completion items. #1237

Merged
merged 1 commit into from
Apr 21, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/common/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class CompletionItemFeature extends TextDocumentLanguageFeature<Completio
completion.completionItemKind = { valueSet: SupportedCompletionItemKinds };
completion.completionList = {
itemDefaults: [
'commitCharacters', 'editRange', 'insertTextFormat', 'insertTextMode'
'commitCharacters', 'editRange', 'insertTextFormat', 'insertTextMode', 'data'
]
};
}
Expand Down
10 changes: 6 additions & 4 deletions testbed/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
TextEdit, ProposedFeatures, DiagnosticTag, InsertTextFormat, SelectionRangeRequest, SelectionRange, InsertReplaceEdit,
SemanticTokensClientCapabilities, SemanticTokensLegend, SemanticTokensBuilder, SemanticTokensRegistrationType,
SemanticTokensRegistrationOptions, ProtocolNotificationType, ChangeAnnotation, WorkspaceChange, CompletionItemKind, DiagnosticSeverity,
DocumentDiagnosticReportKind, WorkspaceDiagnosticReport, NotebookDocuments
DocumentDiagnosticReportKind, WorkspaceDiagnosticReport, NotebookDocuments, CompletionList, DocumentLinkResolveRequest
} from 'vscode-languageserver/node';

import {
Expand Down Expand Up @@ -126,7 +126,7 @@ connection.onInitialize((params, cancel, progress): Thenable<InitializeResult> |
completionProvider: {
triggerCharacters: ['.'],
allCommitCharacters: [';'],
resolveProvider: false,
resolveProvider: true,
},
signatureHelpProvider: {
},
Expand Down Expand Up @@ -372,7 +372,7 @@ connection.languages.diagnostics.onWorkspace(async (params, token, _, resultProg
return { items: [] };
});

connection.onCompletion((params, token): CompletionItem[] => {
connection.onCompletion((params, token): CompletionList => {
const result: CompletionItem[] = [];
let item = CompletionItem.create('foo');
result.push(item);
Expand Down Expand Up @@ -407,7 +407,9 @@ connection.onCompletion((params, token): CompletionItem[] => {
item.kind = CompletionItemKind.Field;
result.push(item);

return result;
const list = CompletionList.create(result, true);
list.itemDefaults = { data: 'abc' };
return list;
});

connection.onCompletionResolve((item): CompletionItem => {
Expand Down