当前位置: 首页>>代码示例>>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;未经允许,请勿转载。