vscode-extensions

Extend icon theme with extension Visual Studio Code

喜夏-厌秋 提交于 2019-12-23 17:42:45
问题 Is it possible to extend an icon set with your extension? If so, how can I add this to my language extension? I have an extension for our custom language, and I'd like to include icons for the supported file types. 回答1: No, this is currently not supported. There's an open feature request here: #14662 - [file icons] Support for extending the file icon theme from an extension 来源: https://stackoverflow.com/questions/42209761/extend-icon-theme-with-extension-visual-studio-code

Extension API - Task Provider - Build Task example

喜夏-厌秋 提交于 2019-12-23 15:20:58
问题 I've built an extension for a programming language that I use and I've created hotkey shortcuts for calling the compiler executable with the currently open document's URI. I want to convert that to a build task in my extension. I have made a tasks.json file with a build task that works and catches errors and such, but it only works if I put it in the current workspace. There are absolutely no examples of adding a build task anywhere and the API documentation for task providers is specifically

VSCode Private Extension Repository for teams

痞子三分冷 提交于 2019-12-23 13:58:31
问题 I'm writing highly specific private VSCode extensions for our dev team. I will be making constant changes to these extensions. From what I've read, the only way is to compile the extension as a .vsix file and send this file to each of the team. This workflow is tedious and feels unnecessary. I am looking for a more automatic and transparent solution, which more or less updates the private extension automatically. Has this scenario been solved? 回答1: Not as of VSCode 1.14 but we are tracking

React with a event based communication

匆匆过客 提交于 2019-12-23 03:34:10
问题 I'm trying to use React inside a vscode webview panel. I'd consider myself decently component in react, but I'm used to communicating with the backend via http. In this project, the vscode extension is essentially the server and all communication must be done by sending events between the two. //vscode extension (server) //send message to react app panel.webview.postMessage({ command: 'refactor' }); //receive messages from react app panel.webview.onDidReceiveMessage(message => console.log

Updating VS Code user settings via an extension

馋奶兔 提交于 2019-12-22 14:16:29
问题 I'm trying to create a simple extension for toggling the visibility of test files in VS Code. Here's my current approach: const testGlobs = [ '**/__tests__', '**/__mocks__', '**/*.spec.js', ] function hideTests() { const exclude = workspace.getConfiguration('files.exclude', vscode.ConfigurationTarget.Global) testGlobs.forEach(glob => exclude.update(glob, true, vscode.ConfigurationTarget.Global)); console.log(exclude) // does not reflect the updated values } This appears to have no impact. The

How to create VS Code extension that provides custom problemMatcher?

隐身守侯 提交于 2019-12-22 08:57:10
问题 I have project that uses custom problemMatcher . But I would like to extract it into an extension making it configurable. So eventually it could be used in tasks.json like { "problemMatcher": "$myCustomProblemMatcher" } How to do that? 回答1: As of VSCode 1.11.0 (March 2017), extensions can contribute problem matchers via package.json: { "contributes": { "problemMatchers": [ { "name": "gcc", "owner": "cpp", "fileLocation": [ "relative", "${workspaceRoot}" ], "pattern": { "regexp": "^(.*):(\\d+)

VS Code extension: Hide commands from command palette

不想你离开。 提交于 2019-12-22 07:04:48
问题 Background: I'm currently working on a simple VS Code extension that will provide dynamically set command variables to my build & debug tasks. The plan is to have a series of attributes that will be accessible in launch.json, etc. through the "${command:extension.myCommand}" syntax. Registering commands like this is as simple as adding an entry to the package.json file, e.g.: "contributes": { "commands": [ { "command": "extension.myCommand", "title": "" } ] } and implementing the

Stylelint VScode doesn't work

烂漫一生 提交于 2019-12-22 06:46:59
问题 I want to use the css linter "stylelint" on my VScode text editor. I downloaded the plugin and install it, then I make the "css.validate": false. But i don't have any box that show me error on my CSS files. What can I do ? 回答1: If you're getting started with stylelint for the first time , there are two key steps to enable it in Visual Studio Code: turn off Visual Studio Code's built-in CSS linter and turn on the stylelint extension create a stylelint configuration object and turn on some

How to customize comment block characters in visual studio code?

别来无恙 提交于 2019-12-22 04:37:51
问题 I created a language extension for visual studio code and I would like to change the comment block characters but I couldn't find a way to do so.. Has anyone already done or know how to do it? 回答1: OK, I finally figured out what was the problem. There are two ways you can change the comment blocks: 1 - CONFIG FILE I dont know why it's not in the docs (or at least I couldn't find it) but there is a optional property you pass to the object inside the contributes.languages array in the package

Change Integrated Terminal title in vscode

拜拜、爱过 提交于 2019-12-22 04:11:55
问题 We can open command prompt in vscode by using the Integrated Terminal feature in View menu. We can even open multiple terminals as shown below: Is there any way I can change the title of the terminal ? 1: cmd.exe will be build terminal 2: cmd.exe will be watch terminal I have gone through the integrated terminal documentation but I didn't find a way to do that. 回答1: Press in windows Ctrl + Shift + P and after type: Terminal: Rename, there you can change the terminal name/title 回答2: In v1.41