當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript TextEditor.setDecorations方法代碼示例

本文整理匯總了TypeScript中vscode.TextEditor.setDecorations方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TextEditor.setDecorations方法的具體用法?TypeScript TextEditor.setDecorations怎麽用?TypeScript TextEditor.setDecorations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vscode.TextEditor的用法示例。


在下文中一共展示了TextEditor.setDecorations方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: clear

    clear() {
        this.status = undefined;
        if (this.editor === undefined) return;

        if (this.decoration !== undefined) {
            try {
                this.editor.setDecorations(this.decoration, []);
            }
            catch {}
        }

        if (this.additionalDecorations !== undefined && this.additionalDecorations.length > 0) {
            for (const d of this.additionalDecorations) {
                try {
                    this.editor.setDecorations(d.decoration, []);
                }
                catch {}
            }

            this.additionalDecorations = undefined;
        }

        if (this.highlightDecoration !== undefined) {
            try {
                this.editor.setDecorations(this.highlightDecoration, []);
            }
            catch {}
        }
    }
開發者ID:chrisleaman,項目名稱:vscode-gitlens,代碼行數:29,代碼來源:annotationProvider.ts

示例2: restore

    async restore(editor: TextEditor) {
        // If the editor isn't disposed then we don't need to do anything
        // Explicitly check for `false`
        if ((this.editor as any)._disposed === false) return;

        this.status = AnnotationStatus.Computing;
        if (editor === window.activeTextEditor) {
            await setCommandContext(CommandContext.AnnotationStatus, this.status);
        }

        this.editor = editor;
        this.correlationKey = AnnotationProviderBase.getCorrelationKey(editor);
        this.document = editor.document;

        if (this.decorations !== undefined && this.decorations.length) {
            this.editor.setDecorations(this.decoration, this.decorations);

            if (this.additionalDecorations !== undefined && this.additionalDecorations.length) {
                for (const d of this.additionalDecorations) {
                    this.editor.setDecorations(d.decoration, d.ranges);
                }
            }
        }

        this.status = AnnotationStatus.Computed;
        if (editor === window.activeTextEditor) {
            await setCommandContext(CommandContext.AnnotationStatus, this.status);
        }
    }
開發者ID:chrisleaman,項目名稱:vscode-gitlens,代碼行數:29,代碼來源:annotationProvider.ts

示例3: update_editor

export function update_editor(editor: TextEditor)
{
  if (editor) {
    const decorations = document_decorations.get(editor.document.uri.toString())
    if (decorations) {
      for (const [typ, content] of decorations) {
        editor.setDecorations(types.get(typ), content)
      }
    }
  }
}
開發者ID:seL4,項目名稱:isabelle,代碼行數:11,代碼來源:decorations.ts

示例4:

this.sets.forEach(set => textEditor.setDecorations(set.decorationType, set.ranges));
開發者ID:Janne252,項目名稱:vscode-scar,代碼行數:1,代碼來源:decorationSetCollection.ts

示例5: unsetDecorations

 unsetDecorations(decorationType: TextEditorDecorationType) {
     this.editor.setDecorations(decorationType, []);
 }
開發者ID:ryu1kn,項目名稱:vscode-text-marker,代碼行數:3,代碼來源:text-editor.ts

示例6: setDecorations

 setDecorations(decorationType: TextEditorDecorationType, ranges: FlatRange[]) {
     const vsRanges = ranges.map(range => this.getRange(range));
     this.editor.setDecorations(decorationType, vsRanges);
 }
開發者ID:ryu1kn,項目名稱:vscode-text-marker,代碼行數:4,代碼來源:text-editor.ts


注:本文中的vscode.TextEditor.setDecorations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。