Skip to content

Pr snip not work #46

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ temp
*.vsix
*.log
*.tsbuildinfo

*.swp
6 changes: 3 additions & 3 deletions server/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"!${1:expression}"
]
},
"compare to": {
"compare-to": {
"description": "comparison operator",
"prefix": "compare-to",
"body": [
Expand Down Expand Up @@ -71,7 +71,7 @@
"\t$0"
]
},
"if else": {
"if-else": {
"description": "if else operator",
"prefix": "if-else",
"body": [
Expand All @@ -90,7 +90,7 @@
"\t$0"
]
},
"do while": {
"do-while": {
"description": "do while operator",
"prefix": "do-while",
"body": [
Expand Down
6 changes: 5 additions & 1 deletion server/src/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ export function initCompletionList(docs: Documentation, snippets: Snippets): voi

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,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 lines are unnecessary and added on CompletionResolve event with enrichWithSnippetDetails function.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually have to, otherwise those are not snip items.
those are working for auto completion, vs compared to completionResolve looks those for manual omni completion.

})),
)
}
Expand Down