vscode-extensions

How to open a browser within VSCode just like another editor tab

江枫思渺然 提交于 2019-11-28 03:52:06
问题 For a VSCode extension i want open browser within VSCode not externally, wherein i can load some URL (https://developers.redhat.com/) I tried looking into various options to achieve it in VScode extension, what i came across is with help of webview i.e 'vscode.previewHtml' we can pass html content which would be rendered with in VSCode editor tab, but what i have is url to load. Can pass it to iframe but i can't open it in iframe Another option is to open it in browser but it opens external

Where can I find a list of all possible keys for tm-themes for syntax highlighting?

限于喜欢 提交于 2019-11-28 01:22:25
In the tmTheme file for my current text editor theme there are a number of options, including the ones in the code below. Is there a list somewhere that defines all possible tags that could be included in this list (eg. background , inactiveSelection , findHighlight , etc)? <dict> <key>background</key> <string>#1a1a1a</string> <key>caret</key> <string>#B6ECF9AF</string> <key>foreground</key> <string>#ecf0f1</string> <key>invisibles</key> <string>#F3FFB51A</string> <key>lineHighlight</key> <string>#2a2a2a</string> <key>selection</key> <string>#e74c3c55</string> <key>selectionForeground</key>

Customizing syntax highlighting in Visual Studio Code

妖精的绣舞 提交于 2019-11-27 22:06:30
I'm currently trying to write an extension for a new file type (ANTLR) and wonder how to change the colors used for syntax highlighting in Visual Studio Code. To me it looks as if that is not defined in the extension, but somewhere else. There is no preferences entry for colors nor did I find a CSS file which defines that (which I'd expect since vscode is using Electron). I also looked through the settings file vscode generated and files that came with it, but no clue either. Neither did a web search help. So, I'm kinda lost now. Can someone give me some hints or point me to the relevant docs?

Create Custom Language in Visual Studio Code

五迷三道 提交于 2019-11-27 11:56:08
Is there a way to extend the supported languages/grammars in Visual Studio Code? I'd like to add a custom language syntax, but I've not been able to find any information on how language services are provided. Can anybody point to any references or even examples of existing language implementations? Wosi It's possible with the new version 0.9.0. There's an official documentation on how to add a custom language: https://github.com/Microsoft/vscode-docs/blob/0.9.0/release-notes/latest.md You need a .tmLanguage file for the language you want to add. You can find existing files e.g. on GitHub or

VSCode extensions location variable

筅森魡賤 提交于 2019-11-27 09:51:40
In an extension I am writing, I want to redefine an existing setting in the workspace to point at a script I am packaging with the extension. On a mac this script lives in ~/.vscode/extensions/publisher.name.version/script for example. If I assume that this is where the extension lives then in my activate function I can update this value using export async function activate(context: vscode.ExtensionContext) { const home = process.env.HOME; const execLocation = home + "/.vscode/extensions/publisher.name.version/script"; ... and then updating the workspace setting. However - I would like to

VSCode Extension API - Identify file or folder click in explorer context menu

若如初见. 提交于 2019-11-27 07:49:16
问题 VSCode 1.3 has added support for adding commands to context menus. Is there a way to identify whether a file or folder is clicked to open the explorer context menu? "menus": { "explorer/context": [ { "when": "????", "command": "extension.myCommand", "group": "myGroup" } ] } Also, is there a comprehensive(ish) list of expressions that might be checked in the when clause here? 回答1: Regarding obtaining a comprehensive list of context keys: in recent VSCode versions, there's a Developer: Inspect

Custom view decorations in VSCode extension

♀尐吖头ヾ 提交于 2019-11-27 07:11:22
问题 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. 回答1: 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

How to tokenize grammars, like in monaco.editor.tokenize for use in extension

跟風遠走 提交于 2019-11-27 06:26:46
问题 I have used the tokenizer in monaco but I do not see that it is accessible in vscode. This would be helpful for completion/signature help providers, how can I tokenize a grammar? 回答1: It doesn't seem like there's an official way of doing this right now. There is an open feature request for adding the ability to retrieve tmLanguage scopes at a position here: #580 There is one potential workaround, which requires adding a dependency to the scope-info extension. This extension exposes an API of

How do you determine which formatter is being used for VS Code?

余生长醉 提交于 2019-11-27 02:39:29
问题 If you have multiple extensions installed how do you determine which formatter is running on your document? For instance I have a couple of HTML extensions that may format HTML but I'm not sure which one is actually formatting, or if multiple are. I'm not even sure which extensions may be contributing to the formatting honestly. Recently auto formatting in HTML and CSS have changed how they're formatting in ways that I do not care for, and I would like to know which extension is doing this so

Customizing syntax highlighting in Visual Studio Code

巧了我就是萌 提交于 2019-11-26 20:24:09
问题 I'm currently trying to write an extension for a new file type (ANTLR) and wonder how to change the colors used for syntax highlighting in Visual Studio Code. To me it looks as if that is not defined in the extension, but somewhere else. There is no preferences entry for colors nor did I find a CSS file which defines that (which I'd expect since vscode is using Electron). I also looked through the settings file vscode generated and files that came with it, but no clue either. Neither did a