I upgraded to Visual Studio 2022 (17.4.4) and see that the formatting options have changed significantly.
I have tried experimenting and searching but cannot figure out how to force the required use of the this keyword when referring to instance fields, properties, methods, etc.
Setting VS options as well as editing the *.editconfig file has had no effect. The this keyword keeps getting removed during file saving, formatting, and compilation.
Related
When I'm editing a class in Visual Studio, frequently these weird 'using' statements get automatically added to my classes. I don't add them and I have to constantly remove them. I have no idea where they are coming from or why they are getting added when I have no references to these objects. This didn't happen in previous (e.g. 2019) versions of VS.
Is there a setting or something I can change that's causing this?
I've been working on a long and convoluted C++ project in Visual Studio 2022, so I've been making sure to comment as much as possible and have been using the XML documentation summaries for most every function.
These summaries are supposed to show up in IntelliSense when writing the function, and then the parameter summaries should show up when in the spot for that parameter.
Up until today everything had been working pretty much fine, it was always finnicky, but mostly it worked. Today however it all stopped showing up, so I tried following some recommendations from past posts, turning on or off the generation of an XML file, parameter information for C++, and restarting Visual Studio. Nothing has fixed it.
I have managed to find a random portion of my code in which summaries show up for some reason, but even there they're the wrong ones.
Does anyone know of any way to fix this issue? I really need these summaries.
EDIT:
Here's a screenshot of my C++ Intellisense settings
You can check settings in Tools > Options >Text Editor >C/C++ > Advanced > Intellisense:
If it doesn’t work you can try to Reset all settings under Tools > Import and Export Settings
I've been running into an issue with Visual Studio 2017 where a T4 template that is generating a bunch of C# classes from metadata is auto formatting the files based on the settings in Visual Studio's C# formatting options. I have changed these options and verified that the changes are reflected in the generated code. Basically what is happening is the T4 code generation completes and then Visual Studio begins to open every single file that was just generated and format it.
I've turned off formatting for the C# language in Tools and Options and disabled .editorconfig files just in case it was picking up one of those, but the template generation seems to ignore this. The problem is that these T4 templates generate ~2000 files which are then formatted which causes TFS to check out the file and eventually crashes visual studio about halfway through the formatting. Is there an option somewhere I'm missing to turn off formatting for generated code? This was not an issue prior to our recent upgrade to VS2017.
The default setting for Visual Studio 2017 is that it doesn't do anything to template files on the onset, so in order for this to happen it should be something you've added to your VS environment. Few things to check...
Any Visual Studio extensions or features. T4 is not well supported so a lot of the extensions and features out there have bugs in them. It maybe that the software provider hasn't thought of your problem yet and you should raise a bug with them. If your using an extension or feature to assist in your software development of T4 then try a different one. Additionally extensions or features not related to T4 also format files. An examples are Productivity Power Tools or Resharper
Under the properties of your template files check the Custom Tool value. It may not seem like the obvious choice, but occasionally if this is not set to TextTemplatingFileGenerator or TextTemplatingFilePreprocessor, you need know why it's not set that way. There might be a perfectly good reason for why its set differently, just so long as you know what that reason is
Normally templates use the *.tt extension, however there are many different acceptable extensions that suit different occasions. Make sure the extension isn't named the same as an existing extension, that formats files in its own way
If the features for C# are off, you might want to consider turning off all formatting features one by one incase the templates files are being considered as part of a different language or under a different option. Start with Tools > Options > Text Editor > Basic > Advanced > Pretty listing as an example. That may give you a clue as to where the setting is being affected.
HTH
ReSharper TypeScript seems to be not working at all in my VS 2015 installation. Despite of the correctly placed TypeScript definitions ReSharper does not recognize the defined types, gives zillion red underlines, and of course intellisense does not work on the variables.
The error message is for example: Could not find symbol 'JQuery'
Some more diagnostics:
Compiling the project in VS 2015 compiles with no error. Making an intentional error in the source then build generates one correct error message
Intentionally making a spell in the type definition file paths, it underlined with red correctly. When correcting the path, underline diasppears
Opening the very same project in VS 2013 all works like a charm, ReSharper is working correctly
Originally used ReSharper 9.1.2 this issue was there. Now upgraded to the latest 9.1.3 and the issue remained.
Any ideas?
If you see this kind of behaviour - lots of red, but clean compile, especially after an upgrade - you should try to clean the caches. Go to ReSharper → Options → General → Clean caches, then restart Visual Studio.
Since the problem occurs in more than one version including latest as of writing, you also have the option to switch off TypeScript support in ReSharper. After all, if a feature is broken, why use it?
How to switch it off according to their web site:
If necessary, you can disable/enable ReSharper features in TypeScript
files by clearing the corresponding check box on the Environment |
Products & Feature page of ReSharper options.
Source: JetBrains help page for ReSharper (retrieved 29 March 2018)
After this change you may have to restart Visual Studio for the new settings to take effect.
I have found that sometimes, the Visual Studio Project file is corrupted, containing multiple references to .ts files. This can cause a different, but related error, where ReSharper thinks there are multiple declarations of a symbol.
To resolve, if you are using version control, it is simple.
Make a commit
Delete the folder containing the duplicated files
Revert changes to the repository
Add the folder back to Visual Studio
Save the project file
As I mentioned, this doesn't solve the original problem, but can help in situations where ReSharper reports duplicate symbols.
I am experimenting with Less Css, and I am using Visual Studio 2010.
It would be nice if the editor provided support for syntax highlighting and Intellisense for Less, for instance coloring and suggesting variables. What are my options to get that to work ? Do I need to write a plugin for it, or how would one go about adding this to VS ? Does anything exist for this already ?
If you are using Visual Studio 2012 you can use Web Essentials 2012. It uses syntax highlighting similar to Visual Studio's CSS syntax highlighter. It compiles to CSS on save.
Update
2.4-2.5 Less syntax highlighting was disabled
As of 2.6 Less syntax highlighting was turned back on
As of 3.8 Less syntax highlighting is disabled for VS2012.
http://www.mindscapehq.com/products/web-workbench
Update (07 Mar 2012)
After a week or so of using this, I have uninstalled it due to:
Annoying nagging adverts telling you to upgrade
A weird bug that stopped me being able to save my .less files intermittently
This extension seems better : LessExtension
Here is the author description :
Autocompile on save (using dotless)
Highlight matching braces
Syntax highlight (No multiline comment support)
Word highlight when a word occurs multiple times
Word completion using Visual Studios css 2.1 definition
Outlining so { ... } sections can be collapsed
And it work nice for me.
I can't find one on the Visual Studio Gallery (as of 5/2/10) besides CSS Is Less, which only hooks up the built-in CSS language service.
If you want to learn how to write one yourself, you can start by looking at the Ook Language Integration sample. Implementing the extension points in that sample (classification, quick info source, completion source) will give you the features you asked for (syntax highlighting, hover tips, intellisense completion).