Pārlūkot izejas kodu

Merge pull request #8076 from sailro/setup-itr-once

Only setup insertTextRules once, not every-time the completion provider is invoked.
David Catuhe 5 gadi atpakaļ
vecāks
revīzija
1bd7d452f7
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      Playground/js/monacoCreator.js

+ 1 - 1
Playground/js/monacoCreator.js

@@ -138,6 +138,7 @@ class MonacoCreator {
             for (const template of this.templates) {
                 template.kind = monaco.languages.CompletionItemKind.Snippet,
                 template.sortText = "!" + template.label; // make sure templates are on top of the completion window
+                template.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;
             }
 
             // As explained above, we need the 'dev' version of Monaco to access this adapter!
@@ -309,7 +310,6 @@ class MonacoCreator {
                         continue;
 
                     template.range = undefined;
-                    template.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;
                     suggestions.push(template);
                 }
             }