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


TypeScript editorCommonExtensions.ServicesAccessor類代碼示例

本文整理匯總了TypeScript中vs/editor/common/editorCommonExtensions.ServicesAccessor的典型用法代碼示例。如果您正苦於以下問題:TypeScript ServicesAccessor類的具體用法?TypeScript ServicesAccessor怎麽用?TypeScript ServicesAccessor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<void> {
        const debugService = accessor.get(IDebugService);
        const viewletService = accessor.get(IViewletService);

        const text = editor.getModel().getValueInRange(editor.getSelection());
        return viewletService.openViewlet(VIEWLET_ID).then(() => debugService.addWatchExpression(text));
    }
開發者ID:diarmaidm,項目名稱:vscode,代碼行數:7,代碼來源:debugEditorActions.ts

示例2: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const keybindingService = accessor.get(IKeybindingService);
        const editorService = accessor.get(IWorkbenchEditorService);

        if (keybindingService instanceof WorkbenchKeybindingService) {
            editorService.openEditor({ contents: keybindingService.dumpDebugInfo(), options: { pinned: true } } as IUntitledResourceInput);
        }
    }
開發者ID:FabianLauer,項目名稱:vscode,代碼行數:8,代碼來源:inspectKeybindings.ts

示例3: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const keybindingService = accessor.get(IKeybindingService);
        const editorService = accessor.get(IWorkbenchEditorService);
        const untitledEditorService = accessor.get(IUntitledEditorService);

        if (keybindingService instanceof WorkbenchKeybindingService) {
            const input = untitledEditorService.createOrGet(undefined, null, keybindingService.dumpDebugInfo());
            editorService.openEditor(input, { pinned: true });
        }
    }
開發者ID:thinhpham,項目名稱:vscode,代碼行數:10,代碼來源:inspectKeybindings.ts

示例4: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const configurationEditingService = accessor.get(IConfigurationEditingService);
        const messageService = accessor.get(IMessageService);

        let newRenderControlCharacters = !editor.getConfiguration().viewInfo.renderControlCharacters;

        configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.renderControlCharacters', value: newRenderControlCharacters }).then(null, error => {
            messageService.show(Severity.Error, error);
        });
    }
開發者ID:diarmaidm,項目名稱:vscode,代碼行數:10,代碼來源:toggleRenderControlCharacter.ts

示例5: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const configurationEditingService = accessor.get(IConfigurationEditingService);
        const messageService = accessor.get(IMessageService);

        let renderWhitespace = editor.getConfiguration().viewInfo.renderWhitespace;
        let newRenderWhitespace: string;
        if (renderWhitespace === 'none') {
            newRenderWhitespace = 'all';
        } else {
            newRenderWhitespace = 'none';
        }

        configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.renderWhitespace', value: newRenderWhitespace }).then(null, error => {
            messageService.show(Severity.Error, error);
        });
    }
開發者ID:diarmaidm,項目名稱:vscode,代碼行數:16,代碼來源:toggleRenderWhitespace.ts

示例6: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const configurationService = accessor.get(IConfigurationService);

        let newRenderControlCharacters = !editor.getConfiguration().viewInfo.renderControlCharacters;

        configurationService.updateValue('editor.renderControlCharacters', newRenderControlCharacters, ConfigurationTarget.USER);
    }
開發者ID:gokulakrishna9,項目名稱:vscode,代碼行數:7,代碼來源:toggleRenderControlCharacter.ts

示例7: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<void> {
        const quickOpenService = accessor.get(IQuickOpenService);

        if (!editor.getModel()) {
            return;
        }

        const {lineNumber, column} = editor.getPosition();
        const modeId = editor.getModel().getModeIdAtPosition(lineNumber, column);

        const picks: ISnippetPick[] = [];
        Registry.as<ISnippetsRegistry>(Extensions.Snippets).visitSnippets(modeId, snippet => {
            picks.push({
                label: snippet.prefix,
                detail: snippet.description,
                snippet
            });
            return true;
        });

        return quickOpenService.pick(picks).then(pick => {
            if (pick) {
                SnippetController.get(editor).insertSnippet(pick.snippet.codeSnippet, 0, 0);
            }
        });
    }
開發者ID:sandy081,項目名稱:vscode,代碼行數:26,代碼來源:snippetCompletion.ts

示例8: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const configurationEditingService = accessor.get(IConfigurationEditingService);

        const newValue = !editor.getConfiguration().viewInfo.minimap.enabled;

        configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.minimap.enabled', value: newValue });
    }
開發者ID:armanio123,項目名稱:vscode,代碼行數:7,代碼來源:toggleMinimap.ts

示例9: run

    public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
        const configurationEditingService = accessor.get(IConfigurationEditingService);
        const messageService = accessor.get(IMessageService);

        let wrappingInfo = editor.getConfiguration().wrappingInfo;
        let newWordWrap: boolean;
        if (!wrappingInfo.isViewportWrapping) {
            newWordWrap = true;
        } else {
            newWordWrap = false;
        }

        configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.wordWrap', value: newWordWrap }).then(null, error => {
            messageService.show(Severity.Error, error);
        });
    }
開發者ID:diarmaidm,項目名稱:vscode,代碼行數:16,代碼來源:toggleWordWrap.ts


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