I want to give the code snippet extension support for my custom blazor controls to add my codes in the Visual Studio Code editor (.razor files) for my customers. So, I have used the below link to implement this.
https://code.visualstudio.com/api/language-extensions/snippet-guide
Now, my custom code snippets have been added as I expected when to click the ENTER key after typing my prefix value. But, I want to add the namespace also for my controls which are added from the code snippet at the same time of code snippet added. In the above link that gives the options prefix, body and description only. There is no namespace option available. Could you please suggest to me how can I add the Namespace in the razor at the time of add the code snippets?
Also, I want to add the required assemblies at the same time to run my controls to reduce the manual work. Could you please suggest to me this also?
Thanks,
Ganesan R.
Related
I've created a custom language extension for my own script language. I've written a tmlanguage file to tokenize my script and do custom highlighting. I created a hover-provider that currently only shows the word that is hovered for testing the provider itself. I want to react on the textmate scopes of the current position in this hover, like the vs code Developer tool "Inspect Editor Token and Scopes" does.
At the end I want to react to one particular scope whose value I want to read and show a corresponding image of this value in the hover.
Fore example a line in my script could look like:
setImage(dic_1/dic_2/testImg)
Now I want to show the image that correlates with the path in the brackets if I hover over it.
I tried to find something in the documentation (https://code.visualstudio.com/api/references/vscode-api#languages) if there is something that would help me but couldn't see anything related.
I tried to ask ChatGPT for help after he suggested "possible internal and not public available methods" it suggested to create a custom hover provider with the help of the library "oniguruma" and tokenize the document again.
However, this feels a bit like an overkill. If vscode has a internal tool that does return the textmate scopes I would guess there is a easy way to access those tokens.
I found this thread (Is there a way to find the textmate scope from within my VSCode extension language functions?) but I don't rally understand why I need to write another parser.
Is there any way to access this textmate scopes in a hover-provider?
I would like to set up a dev environment using Visual Studio Code. I'm able to do that with the help of Salesforce Extension Pack. I want to fetch all custom objects in the VS Code. How Can I achieve this?
To achieve this goal in the VS Code you can use this ways. Please find below
Org browser Extention => You can import selected components like custom objects.
I'm in the process of creating a VSCode extension to do code completion for an existing Lua API.
I'm having a bit of trouble achieving the following (examples are JavaScript):
I've been looking for examples and tutorials but haven't come up with much. I assume I may need to do a fair amount of string processing, around the current cursor position, to get enough data to lookup the appropriate documentation (which I stored in an array of json objects). But presently I don't know how to get the meta-data dialog to show when entering parameters.
P.S. I have reviewed the official extension samples.
Your screenshots show two VS Code features:
The first screenshot shows a hover / quick info. It is used to display information about the current word the user is hovering over. To add a hover, your extension should implement and register a HoverProvider
The second screenshot shows parameter hints / signature help. It displays information to the user as they complete a function call. To add signature help, your extension should implement and register a SignatureHelpProvider
In both cases, how you implement the functionality is entirely up to your extension. Most language extensions maintain a structural representation of the file (such as an AST) and use this to provide hover and signature help info.
You can also either implement your extension as a direct VS Code extension or using the language server protocol (which works across editors). See VS Code's Language Extensions Overview for more information about developing a language extension and why you may want to consider the Language Server Protocol
Is it possible to create an extension with user interface for visual studio code.
I like to have an editor for a json file and I like to have some UI for it.
Like google chrome extensions with HTML/CSS/JAVASCRIPT.
Does VS Code supports these kind of extensions?
No, VSCode does not provide this level of extension integration. However, if you still plan to edit the JSON using the text editor, but want to "render" it in some way, that is possible. You can use a TextDocumentContentProvider to provide a read-only view of your JSON file. For a similar example, look at the CSS Properties Preview example extension.
I wish to simply add more words that autocomplete will recognize. We use some custom fields in our HTML (1000's of them) and I want autocomplete to pop up when we start typing one, with a drop down list of all that are available, narrowing them down and you type, just like the normal behavior.
The fact that we have so many might be an issue, but is there any way I can just add my own words that autocomplete will recognize?
I think this page on MSDN should help.
You'll need to create a snippet file using this guide