diff --git a/package-lock.json b/package-lock.json index 6b6d1e1b..dd9e4bed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "snippet", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "snippet", - "version": "1.1.2", + "version": "1.1.3", "license": "MIT", "dependencies": { "@vscode/vsce": "^2.22.0", diff --git a/package.json b/package.json index b321f840..94d14286 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "snippet", "displayName": "Snippet", "description": "Insert a snippet from cht.sh for Python, JavaScript, Ruby, C#, Go, Rust (and any other language)", - "version": "1.1.2", + "version": "1.1.3", "publisher": "vscode-snippet", "engines": { "vscode": "^1.74.0" diff --git a/src/endpoints.ts b/src/endpoints.ts index 5010286a..aa304da0 100644 --- a/src/endpoints.ts +++ b/src/endpoints.ts @@ -62,8 +62,9 @@ export async function findWithProvider( }); } else { const text = savedSnippetContent ? savedSnippetContent : doc.getText(); - const snippet = new vscode.SnippetString(text); - const success = await editor.insertSnippet(snippet); + const success = await editor.edit((builder) => { + builder.insert(editor.selection.start, text); + }); if (!success) { vscode.window.showInformationMessage("Error while opening snippet."); }