Skip to content

Commit 84fc046

Browse files
committed
Support snippets in LSP CodeActions that don't have 0'th tabstops
The fixes to support #3869 require this is handled properly.
1 parent 3d10848 commit 84fc046

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎.eslintrc.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Try to keep synced with Flutter extension!
12
module.exports = {
23
"env": {
34
"es6": true,

‎.vscodeignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ out/tool/**
2727
package-lock.json
2828
src/**
2929
tool/**
30-
tool/**
3130
tsconfig.*.json
3231
tsconfig.json
3332
typings/**

‎src/extension/analysis/analyzer_lsp_snippet_text_edits.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class SnippetTextEditFeature implements IAmDisposable {
4242
const textEdit = entries[0][1][0];
4343
// HACK: This should be checking InsertTextFormat:
4444
// https://github.com/microsoft/language-server-protocol/issues/724#issuecomment-800334721
45-
const hasSnippet = /\$(0|\{0:([^}]*)\})/.test(textEdit.newText);
45+
const hasSnippet = /\$(\d+|\{\d+:([^}]*)\})/.test(textEdit.newText);
4646
// if ((textEdit as any).insertTextFormat === InsertTextFormat.Snippet) {
4747
if (hasSnippet) {
4848
action.edit = undefined;

0 commit comments

Comments
 (0)