Skip to content

Commit

Permalink
Fix to check snippet items
Browse files Browse the repository at this point in the history
  • Loading branch information
uga-rosa committed Jul 16, 2023
1 parent f6a2871 commit 7008699
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion denops/@ddc-sources/nvim-lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Source extends BaseSource<Params> {
const isSnippetEngineRegistered = args.sourceParams.snippetEngine !== "";
const isValid = (lspItem: LSP.CompletionItem) =>
isSnippetEngineRegistered ||
lspItem.kind !== LSP.CompletionItemKind.Snippet;
lspItem.insertTextFormat !== LSP.InsertTextFormat.Snippet;
let isIncomplete = false;

const clients = await denops.call(
Expand Down
3 changes: 2 additions & 1 deletion denops/ddc-source-nvim-lsp/completion_item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ export class CompletionItem {
}

// Expand main part
// If snippetEngine is unregistered, snippet candidates are excluded at the time of gather.
const isSnippet = lspItem.insertTextFormat === LSP.InsertTextFormat.Snippet;
if (!isSnippet || params.snippetEngine === "") {
if (!isSnippet) {
await linePatch(denops, before, after, insertText);
} else {
await linePatch(denops, before, after, "");
Expand Down

0 comments on commit 7008699

Please sign in to comment.