vscode-extensions

VSCode extension: How to render colored output in output channel?

霸气de小男生 提交于 2021-02-09 11:09:57
问题 I have custom output from API and I want to format it to string with some colored values. 回答1: The output channel can be colorized with a TmLanguage grammar. The Output Colorizer extension extension does exactly that: You can do this by targeting the text/x-code-output mimetype: "contributes": { "languages": [{ "id": "code-output", "mimetypes": [ "text/x-code-output" ] }], "grammars": [{ "language": "code-output", "scopeName": "code.output", "path": "./syntaxes/code-output.tmLanguage" }] }

VSCode extension: How to render colored output in output channel?

萝らか妹 提交于 2021-02-09 11:09:33
问题 I have custom output from API and I want to format it to string with some colored values. 回答1: The output channel can be colorized with a TmLanguage grammar. The Output Colorizer extension extension does exactly that: You can do this by targeting the text/x-code-output mimetype: "contributes": { "languages": [{ "id": "code-output", "mimetypes": [ "text/x-code-output" ] }], "grammars": [{ "language": "code-output", "scopeName": "code.output", "path": "./syntaxes/code-output.tmLanguage" }] }

Unable to open Extension Development Host for TypeScript project

筅森魡賤 提交于 2021-02-09 04:19:52
问题 I am trying to go through the first vs code extension tutorial, but I am unable to open the extension development host. Hitting F5 does nothing, and clicking on the start button in the debug sidebar doesn't seem to do anything either. I have generated my project using yo code and picked the TypeScript option. I have experimented with picking the JavaScript option and that seems to work fine. launch.json looks like: // A launch configuration that compiles the extension and then opens it inside

Unable to open Extension Development Host for TypeScript project

筅森魡賤 提交于 2021-02-09 04:19:09
问题 I am trying to go through the first vs code extension tutorial, but I am unable to open the extension development host. Hitting F5 does nothing, and clicking on the start button in the debug sidebar doesn't seem to do anything either. I have generated my project using yo code and picked the TypeScript option. I have experimented with picking the JavaScript option and that seems to work fine. launch.json looks like: // A launch configuration that compiles the extension and then opens it inside

VS Code extension API for registering pointer down and up and translating coordinates to line/character position

微笑、不失礼 提交于 2021-02-08 10:33:14
问题 I have developed a VS Code Box Drawing extension which works by using selection's start and end positions to work out a level rectangle between the two positions in the text and replaces the edge characters of the rectangle with Unicode box drawing characters. This works great with a selection start and end positions provided, but it also requires at least white space to already extend all the way to the right edge of where the box is supposed to end, otherwise the selection cannot be made

Using Built in Icons for Extension menus

橙三吉。 提交于 2021-02-08 05:36:15
问题 I'd like to reuse the "play" button icon used in the debugger toolbar for a new menu item I'm adding from an extension. Is there a way to set up the icon information in "package.json" to use that existing svg already in VSCode or do I have to supply my own for extensions? 回答1: Yes you can use built-in icons, they are called Codicons. Here is a list of them: https://code.visualstudio.com/api/references/icons-in-labels To use them in your package.json, you will put "icon": "$(iconIdentifier)" .

How to call other extensions in a extension on vscode

这一生的挚爱 提交于 2021-02-08 04:48:51
问题 Here is my demand, I want to startup a debug session with some dynamic arguments. So I need to develop a extension that collect the arguments at first and register a debugger wrapper to vscode, after that I have to find a way to call the target extension's debugger with my arguments. vscode.extensions.getExtension can get extension's informations and be able to active it only. I found a command named "debug.startFromConfig" in vscode's sources, so I can use vscode.commands.executeCommand to

How to call other extensions in a extension on vscode

天大地大妈咪最大 提交于 2021-02-08 04:47:07
问题 Here is my demand, I want to startup a debug session with some dynamic arguments. So I need to develop a extension that collect the arguments at first and register a debugger wrapper to vscode, after that I have to find a way to call the target extension's debugger with my arguments. vscode.extensions.getExtension can get extension's informations and be able to active it only. I found a command named "debug.startFromConfig" in vscode's sources, so I can use vscode.commands.executeCommand to

VSCode: Restart an extension automatically when its source has changed

99封情书 提交于 2021-02-07 18:42:25
问题 I'm developing a VSCode extension. Is it possible to automatically have the extension reloaded when I change its source. Currently, I need to press Ctrl + SHift + F5 . 回答1: I guess your extension is written in TS/javascript, so you can use fs.watch to watch your sources, and find a way to run the vscode command workbench.action.reloadWindow , which is from sources of vscode, the function ReloadWindowAction.Run() or directly windowService.reloadWindow() . export class ReloadWindowAction

VSCode: Restart an extension automatically when its source has changed

我只是一个虾纸丫 提交于 2021-02-07 18:41:41
问题 I'm developing a VSCode extension. Is it possible to automatically have the extension reloaded when I change its source. Currently, I need to press Ctrl + SHift + F5 . 回答1: I guess your extension is written in TS/javascript, so you can use fs.watch to watch your sources, and find a way to run the vscode command workbench.action.reloadWindow , which is from sources of vscode, the function ReloadWindowAction.Run() or directly windowService.reloadWindow() . export class ReloadWindowAction