vscode-extensions

How to persist information for a vscode extension?

╄→尐↘猪︶ㄣ 提交于 2019-12-02 01:06:00
I'm planning to write a Visual Studio Code extension and it need to save some information for example a counter. The user can press a shortcut to increase or decrease the counter and the value of the counter will be saved some where. Next time when the user starts Visual Studio Code, the extension can load the counter's last value. My question is, where is the proper place to store this info? You're probably looking for the Memento API . The ExtensionContext has two different memento instances you can access: workspaceState A memento object that stores state in the context of the currently

How to persist information for a vscode extension?

久未见 提交于 2019-12-02 00:57:12
问题 I'm planning to write a Visual Studio Code extension and it need to save some information for example a counter. The user can press a shortcut to increase or decrease the counter and the value of the counter will be saved some where. Next time when the user starts Visual Studio Code, the extension can load the counter's last value. My question is, where is the proper place to store this info? 回答1: You're probably looking for the Memento API. The ExtensionContext has two different memento

Visual Studio Code: Is it possible to make a decorations hoverMessage clickable

时光怂恿深爱的人放手 提交于 2019-12-01 19:41:30
Hi I am developing an extension for VSCode. I am decorating the text editor and hovering some items. Is it possible to make clickable items at hoverMessage and modify the range according to it. The extension is at: https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates You can see the hoverMessage from the GIF Matt Bierner Yes, using markdown you can then create a command link that will execute a command when a user clicks on it: import * as vscode from 'vscode'; const myContent = new vscode.MarkdownString('[link](command:myCommand?arg1)'); // Command Uris are disabled by

Vscode Language Client extension - how to send a message from the server to the client?

眉间皱痕 提交于 2019-12-01 06:14:11
I have been developing a vscode extension that consits of client and server using the language server protocol. At the moment, I am trying to do the following thing: when the server detects a certain condition, he requests the client to load a certain number of files into the workspace. I am having serious problems doing this. Since the language server protocol does not have a specific request to do this I thought about sending a message from the server to the client and once the client detects this message he would proceed to execute this command. The problem is, I also do not know how to do

vscode extension how to display a form

爱⌒轻易说出口 提交于 2019-12-01 05:37:16
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? 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 for input. The returned value will be undefined if the input box was canceled (e.g. pressing ESC). Otherwise

Vscode Language Client extension - how to send a message from the server to the client?

泪湿孤枕 提交于 2019-12-01 05:18:44
问题 I have been developing a vscode extension that consits of client and server using the language server protocol. At the moment, I am trying to do the following thing: when the server detects a certain condition, he requests the client to load a certain number of files into the workspace. I am having serious problems doing this. Since the language server protocol does not have a specific request to do this I thought about sending a message from the server to the client and once the client

“No extensions found” when running Visual Studio Code from source

倾然丶 夕夏残阳落幕 提交于 2019-11-29 13:42:08
When I try to install any extension in Visual Studio Code (i.e., by pressing Ctrl+P and then running ext install RustyCode ), I get a message that No extensions found . However, this only happens when I run VS Code directly from source repository. I.e., after: git clone https://github.com/Microsoft/vscode.git cd vscode git checkout 1.0.0 scripts/code.sh But, if I run VS Code from official builds , then I'm able to install extensions. So, how can I enable downloading and installing extensions from Visual Studio Marketplace when I run VS Code directly from source repository? (Is Visual Studio

How to customize the color of custom syntax tokens in VSCode extension

徘徊边缘 提交于 2019-11-29 01:30:36
问题 TLDR; How can I have an extension colorize the syntax the extension is defining without it actually being a color theme the user has to enable? I'm attempting to port this Sublime Text plugin (ToDone) to VSCode. It creates a grammar for todo lists and then uses syntax highlighting to emphasize important tasks, mute completed tasks, etc. I found "editor.tokenColorCustomizations" , via Customize a Color Theme. It works with the new syntax when I use it in my user settings, but fails when I use

Custom view decorations in VSCode extension

蓝咒 提交于 2019-11-28 12:47:05
I'm building a VS Code extension and it uses a TreeDataProvider to create a list of items. The list has nested children and I would like to show a count for these in the parent. I've looked for examples and tried to understand how the git extension does it but no luck. Perhaps someone can provide an example of how to do this. Support for custom decorations in views appears to be a work-in-progress. There has been an API for it in the "proposed state" for a while, see: Make decoration provider API public (#54938) relevant section in vscode.proposed.d.ts Source Control and Problem decorations

“No extensions found” when running Visual Studio Code from source

蹲街弑〆低调 提交于 2019-11-28 07:36:22
问题 When I try to install any extension in Visual Studio Code (i.e., by pressing Ctrl+P and then running ext install RustyCode ), I get a message that No extensions found . However, this only happens when I run VS Code directly from source repository. I.e., after: git clone https://github.com/Microsoft/vscode.git cd vscode git checkout 1.0.0 scripts/code.sh But, if I run VS Code from official builds, then I'm able to install extensions. So, how can I enable downloading and installing extensions