-
Notifications
You must be signed in to change notification settings - Fork 5
snip not work #44
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
Comments
Merged
Are you sure your editor supports snippets as part of LSP? |
yes. bashls had done the same.
…--
shane.xb.qian
|
What editor version do u use? Maybe I can try to reproduce the bug (or maybe it's a feature 😄). Maybe there is already such issue filled for this editor? 🤔 |
yea, i tried to debug with following, diff --git a/server/src/completion.ts b/server/src/completion.ts
index 1c53179..eabfd22 100644
--- a/server/src/completion.ts
+++ b/server/src/completion.ts
@@ -73,15 +73,19 @@ export function initCompletionList(docs: Documentation, snippets: Snippets): voi
data: { type: DataEntryType.Documentation, jsonPath: `patterns.${key}` },
})),
)
predefinedCompletionListLight.push(
...Object.entries(snippets).map(([title, info]) => ({
- label: title,
+ label: info.prefix,
kind: CompletionItemKind.Snippet,
data: { type: DataEntryType.Snippet },
+
+ detail: info.description,
+ insertText: info.body.join('\n'),
+ insertTextFormat: InsertTextFormat.Snippet,
})),
)
}
export function getPredefinedCompletionItems(): AWKCompletionItem[] {
return predefinedCompletionListLight |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1, seems somewhere did not set for snip compl item:
e.g: no
insertTextFormat
is 2 found.The text was updated successfully, but these errors were encountered: