I am writing C++ code in .cpp files. Until very recently (updating to Microsoft Visual Studio Community 2019 Version 16.8.3), it used to be that typing /// would do exactly that. Now there is an autocompletion where the /// is replaced by something of the form:
/// <summary>
///
/// </summary>
/// <param name="model"></param>
I understand that this is trying to help in documenting functions, but I am not using automatic document generation. How do I disable my text being replaced?
I don't want to disable intellisense entirely, but I would like to disable any automatic replacement or augmentation of what I type that doesn't get my explicit approval by e.g. pressing tab. I have already disabled automatic brace completion and the C# XML documentation completion for ///.
This is the right behavior for xml document. See this official document.
To disable it, please enter Tools-->Options-->Text Editor-->C#-->Advanced
uncheck the option Generate XML documentation comment for ///
Actually, this option is a good feature, it will automatically generate a description structure based on the following method names and parameter types.
Update 1
For C++ projects, please enter Tools-->Options-->Text Editor-->C/C++-->Code Style-->General
select Generated documentation comments style to None.
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?
For my debugger extension I'd like to implement a functionality from the following image where a step can ask a debugger client to show an inlined text with the result of the step.
I've read the DAP documentation thoroughly but still don't have a clue how this can be implemented or if it's even possible to implement. What request or event do I have to implement?
By the way, how is this function of debbuger client called?
With vscode v1.54, see Inline value provider
Today the Show Inline Values feature of VS Code's debugger is based on
a generic implementation in VS Code core, and doesn't provide
customizability through settings or extensibility via extensions. As a
consequence, it is not a perfect fit for all languages and sometimes
shows incorrect values because it doesn't understand the underlying
source language. For this reason, we are working on an extension API
that allows to replace the built-in implementation completely or to
replace parts of the implementation with custom code.
In this milestone we've made a first implementation of the proposed
API available.
And much more at the first link including sample code. So vscode is adding a true API for inline values rather than depending on Decorations anymore.
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.
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.