vscode-extension | Zeplin for Visual Studio Code
kandi X-RAY | vscode-extension Summary
kandi X-RAY | vscode-extension Summary
Zeplin for Visual Studio Code lets you quickly access the designs you’re working on, follow design changes, open the Jira issues they’re attached to —all from within VS Code. .
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-extension
vscode-extension Key Features
vscode-extension Examples and Code Snippets
Community Discussions
Trending Discussions on vscode-extension
QUESTION
I'm trying to use node's tree-sitter package in my vscode extension, but I get the following error:
Activating extension 'extension name' failed: The module '.../node_modules/tree-sitter/build/Release/tree_sitter_runtime_binding.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 93. This version of Node.js requires NODE_MODULE_VERSION 89. Please try re-compiling or re-installing the module (for instance, using
npm rebuild
ornpm install
)..
From what I understand, the NODE_MODULE_VERSION is the version of node's ABI. However, I couldn't even find a release of node that has NODE_MODULE_VERSION 89 in the official website.
What I've tried:- Deleting the node_modules folder and reinstalling the packages.
- Running
npm rebuild tree-sitter --update-binary
from the top directory. - Rebuilding the tree-sitter package with
node-gyp rebuild
andnode-gyp rebuild --target=(my node version)
from thenode_modules/tree-sitter
directory. - Switching node versions using nvm.
None of that helped. I understand from here that changing node versions won't help, as I confirmed when I tried
console.log(process.version); // v14.16.0
console.log(process.versions.modules); // 89
This gave the same output no matter which node version I used. I also tried rebuilding the tree-sitter package using that node version node-gyp rebuild --target=14.16.0
, but I get the same error, however this time it says the module was compiled using NODE_MODULE_VERSION 83, which is consistent with what node's site says.
How do I resolve this error? Any help is appreciated.
...ANSWER
Answered 2022-Mar-23 at 22:45As I suspected, the version of node ABI used by vscode extensions is the ABI version used by vscode's internal electron. According to this source
Native Node.js modules are supported by Electron, but since Electron has a different application binary interface (ABI) from a given Node.js binary (due to differences such as using Chromium's BoringSSL instead of OpenSSL), the native modules you use will need to be recompiled for Electron...
This explains why I couldn't find NODE_MODULE_VERSION 89 in node's site.
Next, I checked what version of electron my build of vscode uses. To do this, I simply checked the package.json that came with vscode (/usr/lib/code/package.json
on linux, I guess that it is inside the folder vscode is installed on on windows).
Next, following the instructions from electron's site, rebuild the module using the package electron-rebuild
. To specify a target version, simply run
./node_modules/.bin/electron-rebuild -v [version]
However, I have no source for this but it seems that tree-sitter does not currently support newer versions of electron, so the build fails. This seems to be because of a change in V8's API (according to this).
The author linked his solution here. I copied his changes and the build succeeded.
Note that I had to replace the existing node addon with the newly built one.
QUESTION
I want to add a language server to handle completion / highlighting / etc. for a file. As a basis for testing stuff I am using an example from Microsoft (https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-sample) and changed it to be active for any File. This language server highlights any word in all capital letters.
When opening a C++ File, I get the highlighting / completion of my language server and the default one for C++ (See image).
I would like to detect if some other extension / build in highlighter is active for a file and deactivate it for this workspace or the current file if it is impossible for the current workspace)
- Is there a way to do this in a generic way where I do not have to know which extensions are highlighting code?
- If no, is there a way to do this, if I know a set of extensions I want to deactivate?
ANSWER
Answered 2022-Mar-22 at 09:29I finally had enough time to try around a bit more and found that providing your own language for the same extension is enough.
In package.json
I added an element in contributes.languages
with extensions
containing .cpp
(since I am using cpp files for testing).
I also copied over some implementation code from an example.
This suppressed the default highlighter and code completion for cpp files. Since i am only implementing a semantic token provider, I can see the default highlighting before my provider takes over. (I think this could be solved by adding a syntax highlighter, but this is already sufficient fo my preliminary testing)
I am not sure, how stable all of this would be as a plugin (I only tested in Extension Development Host mode)
QUESTION
I'm trying to use registerInlineCompletionItemProvider proposed API. I'm following the instructions in https://code.visualstudio.com/updates/v1_58 and here https://github.com/microsoft/vscode-extension-samples/tree/main/inline-completions. Both of them ask to copy https://raw.githubusercontent.com/microsoft/vscode/master/src/vs/vscode.proposed.d.ts to your local directory, but that file doesn't exist. Also when I follow the instructions to install the extension I always get an error because it doesn't exist:
...ANSWER
Answered 2021-Nov-24 at 22:21You need https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.inlineCompletions.d.ts.
The file was split up 13 days ago in a4d426a, tracked in #131165.
Apparently not all docs have been updated.
QUESTION
I created a VS Code extension which uses a Webview. In the Webview I have a link to a file in the node_modules
folder which I added to the html as recommended by various sources (e.g. vscode-codicons-sample):
ANSWER
Answered 2021-Nov-22 at 16:49I decided to go with @MikeLischke's suggestion and copy the required files into the dist
folder, which is packaged. But I didn't want to do it manually, so I did the following.
Firstly, I created a class which does the mapping between the files in the node_modules
folder and the destination in the packaged dist
folder.
QUESTION
This is a dump non-vim, non-emacs user question to the users of those editors.
VScode supports such things as decorations of the code:
- color highlight the text ranges
- or insert some helper text content that actually does not belong to the source content but is visible for the user.
https://github.com/microsoft/vscode-extension-samples/blob/main/decorator-sample/README.md
Do 1) vim, 2) neovim, 3) emacs support this kind of editor extension?
...ANSWER
Answered 2021-Aug-03 at 15:55Yes, all three support something to that effect.
For vim, a way to do something similar to the example is to use the :syntax
command.
To approximate the example (small numbers one color, big numbers another), you could say:
QUESTION
Someone in my team uses vim, but the rest of us use VSCode's default formatter (i.e. vscode.typescript-language-features
). I'd like to add a git precommit hook or something that invokes the formatter without opening up the app.
See also:
...ANSWER
Answered 2021-Jun-23 at 20:33There is a great git hooks tool called Husky and its documentation can be found here.
Here is an example of it inside of a package.json
file that uses pretty-quick to execute prettier whenever a git pre-commit
is executed.
QUESTION
i recently asked a question "how do i add custom parameters to a custom command in a custom vs code extension" and realized through some of the comments that you cant enter parameters in the command palette. so i looked for alternate options. one i came across was quickInput which allows the user to enter text into a window. however, being new to typescript, along with having documentation for more knowledgeable users on my hands, i couldn't figure out how to use it. please help!
update: since "quickInput" couldn't be found, i decided to opt for "showInputBox" but wasn't sure how to use the "title" parameter. but just for testing porpuses i decided to test the following:
...ANSWER
Answered 2021-Jun-22 at 23:19Some sample code I have used before (modified):
QUESTION
I have troubles adding icons to a TreeItem
in my VSCode extension. When I load the extension, the item has a blank space where the icon ought to be.
I have tried to mimic the nodeDependency
example. I have the following in extension.ts
:
ANSWER
Answered 2021-Jun-03 at 11:18Webpack changes __filename
, so your attempt to go to the resource directory fails.
Add the following to webpack.config.js
to leave __filename
unchanged:
QUESTION
I am new to VSC extension development.
I started with the extension hello world and I want to add an icon to the activity bar and get a notification when it is clicked.
I add these lines to package.json
...ANSWER
Answered 2021-May-09 at 20:45You must also specify a "views"
item that matches the id
of your viewContainer
Try adding the following right after the "viewsContainers"
object in the "contributes"
section of package.json
QUESTION
I am trying to develop a VSCode extension which requires the current open file and same file from previous git revision/commit. Which is same as clicking the open changes button in vs code.
I Tried using SCM and QuickDiffProvider as shown in this sample-extension, but its giving "unable to resolve resource" when trying to open the old file in vscode.
snippet from extension.ts
...ANSWER
Answered 2021-Apr-28 at 11:52After struggling so much to find alternative solution to get the diff of file, I found that we can use vscode.editors
, to access all the open editors.
Example: In git diff we will have 2 editors (left: old and right: new), so we can use the following code to access old and new content.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vscode-extension
Open the new Zeplin sidebar.
Login to Zeplin.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page