vscode-extensions

Is it possible to call command between extensions in VSCode?

旧时模样 提交于 2019-12-21 07:34:07
问题 for example there are two VSCode extension. - extension1 is regist command 'exCommand1'. - extension2 is regist command 'exCommand2'. VSCode extension can call command. (ref: https://code.visualstudio.com/docs/extensionAPI/vscode-api) executeCommand<T>(command: string, ...rest: any[]): Thenable<T | undefined> If API Doc is correct then.. extension1 can call extension2's 'exCommand2'. and extension2 can call extension1's 'exCommand1'. is it possible? VSCode's extension is Lazy Loading... If

Is it possible to call command between extensions in VSCode?

梦想与她 提交于 2019-12-21 07:33:56
问题 for example there are two VSCode extension. - extension1 is regist command 'exCommand1'. - extension2 is regist command 'exCommand2'. VSCode extension can call command. (ref: https://code.visualstudio.com/docs/extensionAPI/vscode-api) executeCommand<T>(command: string, ...rest: any[]): Thenable<T | undefined> If API Doc is correct then.. extension1 can call extension2's 'exCommand2'. and extension2 can call extension1's 'exCommand1'. is it possible? VSCode's extension is Lazy Loading... If

Is it possible to call command between extensions in VSCode?

醉酒当歌 提交于 2019-12-21 07:33:07
问题 for example there are two VSCode extension. - extension1 is regist command 'exCommand1'. - extension2 is regist command 'exCommand2'. VSCode extension can call command. (ref: https://code.visualstudio.com/docs/extensionAPI/vscode-api) executeCommand<T>(command: string, ...rest: any[]): Thenable<T | undefined> If API Doc is correct then.. extension1 can call extension2's 'exCommand2'. and extension2 can call extension1's 'exCommand1'. is it possible? VSCode's extension is Lazy Loading... If

Execute “go to Symbol in File” programmatically in vscode?

微笑、不失礼 提交于 2019-12-20 05:39:09
问题 Is it possible to jump to an existing symbol in file from Extension? Something of the sort: goToSymbol(symbol: string) P.S. I don't want to provide a DocumentSymbolProvider . How to use existing ones? 回答1: async function getSymbols(document: TextDocument): Promise<DocumentSymbol[]> { return await commands.executeCommand<DocumentSymbol[]>('vscode.executeDocumentSymbolProvider', document.uri) || []; } async function goToSymbol(document: TextDocument, symbolName: string) { const symbols = await

Listen for editor commands in VS Code

点点圈 提交于 2019-12-20 04:16:24
问题 I am building an extension for VS Code. My extension will show the key bindings associated to a recently action (I am a fan of this for helping me learn key bindings). Looking through the documentation there seems to be a way to access the commands in the editor, but no way that I can find to listen for actions / commands as they are invoked. Is this possible with the current API? Or should I create a feature request in Github? 回答1: This isn't possible with the current release 0.10.3. I

Disable wordBasedSuggestions from an Extension

。_饼干妹妹 提交于 2019-12-20 02:06:34
问题 I'm developing an extension for VSCode which is supplying completion items but there are word suggestions among them. I know you can in your User/Workspace settings disable editor.wordBasedSuggestions but are there a way to this from an extension? 回答1: Yes, extensions can change the default value of settings by contributing configurationDefaults in package.json : "contributes": { "configurationDefaults": { "[lang]": { "editor.wordBasedSuggestions": false } } } Where lang is the ID of the

Adding conditions to “when” from VS-code extension?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 01:06:59
问题 The code editor I've been using for the past 20 years (codewright) allows you to set a "select mode". When that is set, all keyboard cursor movements extend the selection. In VS Code, you can extend the selection by holding down the shift key (for example, Shift down-arrow), but I am looking for a way to do that without the shift key. I have written an extension that mostly does it, but I would have had to do far less work if I could have created a new condition for the "when" clause in

vscode extension how to display a form

与世无争的帅哥 提交于 2019-12-19 07:32:36
问题 I wish to create a VSCode extension with an entry form on it - some way of input. So far I have only seen document processing or output for an extension. How can you display a form of input fields in a vscode extension? 回答1: How much data do they need to enter? If it's not much, you should be able to handle it with a series of InputBoxes From https://code.visualstudio.com/docs/extensionAPI/vscode-api showInputBox(options?: InputBoxOptions): Thenable<string> Opens an input box to ask the user

How to add context menu with VSCode extension?

核能气质少年 提交于 2019-12-19 05:48:13
问题 How do you add a context menu? (in the explorer and/or the editor) I tried the following which doesn't work: { "command": "extension.sayHello", "title": "Say Hello", "context": { "where": "explorer/context", "when": "json" } } That's based on: https://github.com/Microsoft/vscode/issues/3192 https://github.com/Microsoft/vscode/pull/7704 回答1: The extensionAPI documentation has a working example: https://code.visualstudio.com/docs/extensionAPI/extension-points "contributes": { "commands": [ {

How to trigger documentation popup in vscode

荒凉一梦 提交于 2019-12-18 14:48:22
问题 How to trigger a popup with documentation for identifier under the cursor? Normally it appears when hovering the identifier using the mouse pointer: I would like to achieve this effect using a command or keyboard shortcut. The only related commands I found are: trigger completion (which doesn't show the function doc) and trigger parameters hint (which only works when the cursor is inside function call - parameters list). 回答1: This is the editor.action.showHover command. It is bound to cmd k