Kaynağa Gözat

auto trigger vaue completions. For https://github.com/microsoft/monaco-editor/issues/2564

Martin Aeschlimann 4 yıl önce
ebeveyn
işleme
04c34d444a
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      src/languageFeatures.ts

+ 5 - 0
src/languageFeatures.ts

@@ -157,6 +157,10 @@ function toTextEdit(textEdit: htmlService.TextEdit): editor.ISingleEditOperation
 	};
 }
 
+function toCommand(c: htmlService.Command | undefined): languages.Command {
+	return c ? { id: c.command, title: c.title, arguments: c.arguments } : undefined
+}
+
 export class CompletionAdapter implements languages.CompletionItemProvider {
 	constructor(private _worker: WorkerAccessor) { }
 
@@ -195,6 +199,7 @@ export class CompletionAdapter implements languages.CompletionItemProvider {
 						sortText: entry.sortText,
 						filterText: entry.filterText,
 						documentation: entry.documentation,
+						command: toCommand(entry.command),
 						detail: entry.detail,
 						range: wordRange,
 						kind: toCompletionItemKind(entry.kind)