diff --git a/.gitignore b/.gitignore index fb9bc1f..6893353 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ temp *.vsix *.log *.tsbuildinfo + +*.swp diff --git a/server/snippets.json b/server/snippets.json index f7ea08b..aa3bdab 100644 --- a/server/snippets.json +++ b/server/snippets.json @@ -42,7 +42,7 @@ "!${1:expression}" ] }, - "compare to": { + "compare-to": { "description": "comparison operator", "prefix": "compare-to", "body": [ @@ -71,7 +71,7 @@ "\t$0" ] }, - "if else": { + "if-else": { "description": "if else operator", "prefix": "if-else", "body": [ @@ -90,7 +90,7 @@ "\t$0" ] }, - "do while": { + "do-while": { "description": "do while operator", "prefix": "do-while", "body": [ 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 @@ -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, })), ) }