Functions on property sheet macros (Visual Studio) - visual-studio

On Property sheet macro PlatformShortName inconsistent between Win32 and x64 versions I learned that when editing e.g. project properties, you can use functions on Visual Studio macros to modify their value like this:
$(PlatformShortName.Replace("amd", "x"))
The above works, but I wasn't able to find any hints regarding this feature in Microsoft's documentation. Can anyone give me a hint if there are any other functions in addition to Replace() available and where I can find a list or some documentation of it? For example I would like to have something that can change a value to all uppercase or lowercase.

Related

XML Documentation Comments in VS Code?

In Visual Studio (C#/VB.NET, not sure in other languages?), if you add three slashes at the top of a method or property, Visual Studio auto-creates a structured way giving information for the method and its parameters and return values, where applicable. It's useful for creating developer documentation, but mostly I use it to reference information about a method I'm calling if, for example, I have multiple overloads and need to see which one I'm calling. See MS docs link here.
Does VS Code have anything like that? I can't seem to find it in the key bindings in preferences. Maybe there's something similar in VS Code that I'm not aware of?
Solved. Single line comments don't produce the XML documentation but the following syntax does:
/**
* include a description of your method to be viewed when you mouse over the method call
*/

Get Visual Studio 2015 to recognize Doxygen comments

I have a function documented like this:
/**
* Does something useful
*/
int foo(Bar bar)
{
// my function
}
But Intellisense doesn't display it when i hover the function in other places. When i hover it at the definition, i see * Does something useful, which isn't right either (the star should not be in there). Doxygen runs fine and eclipse CDT displays the doc comments as you would expect.
As of version 2016.2, JetBrains ReSharper provides support for Doxygen documents in C++ files. From this blog post I quote:
Doxygen is arguably the most popular format and tool for code
documentation in the C++ world. ReSharper C++ now understands Doxygen
syntax, and provides several key features to facilitate editing of
documentation blocks.
Typing assist helps with creating new comment blocks and maintaining the
structure of existing ones.
Code completion suggests Doxygen commands with accompanying short descriptions.
Function parameter references introduced with \param commands will be reported by Find Usages and will get updated when Rename is used to change a function parameter’s name.
Warnings are issued when function parameter references do not resolve to an existing function parameter.
Documentation generation: You can now generate documentation for C++ declarators, classes and macro definitions.
Quick Documentation: Documentation now works in C++. The documentation pop-up (bound to Ctrl+Shift+F1 in the Visual Studio scheme or Ctrl+Q in the IntelliJ IDEA scheme) will display documentation from Doxygen comment blocks, or the symbol’s signature if no documentation is found.
It should be noted that this product is not free and to use it, you need to procure a license.

Setting language for xml documentation

I have localized version of Visual Studio and in new solutions XML-documentation from Base Class Library is displayed in IntelliSense in my language. But when I open solutions downloaded from Internet, this documentation is displayed in English. How can I choose this language?
I looked over project and solution properties and but did not found such setting. Changing language of assembly does not affects this. Possibly IntelliSense language setting is stored in hidden .suo file, but is is in binary format.
Actually I need to change documentation language because I am using GhostDoc and it generates documentation for member overloads in current IntelliSense language while generating all other documentation in English. GhostDoc also does not have such setting.
A little late but the answer is:
There is no such setting.
GhostDoc searches for the documentation of the .NET assemblies which are referenced.
Therefore if an english dll is referrenced, the documentation is in english
It is even worse, existing comments for own written methods seem tobe from file code model of VS, base classes from their documentation.
So you can have the case that you try to "ghostcomment" a method and get english, and another one is displayed in spanish )...

How to highlight dynamic code in visual studio

Is it possible and if so how, to make Visual Studio highlight dynamic expressions in code?
When I just hovered above some code, visual studio told me it was a dynamic expression. This made me realize I made a mistake in my code and used one dynamic too many. But I also realized that if I had not hovered, a 'huge swath' of dynamic code that was supposed to be static would have escaped.
So I wondered if it is possible to make Visual Studio change the background color of dynamic expressions, so those pieces will be clearly recognizable.
[edit]
With dynamic expressions I mean the use of the dynamic keyword in regular code.
You would need an Extension. You can create your own, but I would suggest getting pre-built ones.
Visual Studio has a lot of extensions lately, because of it's popularity.
There are many options I could suggest, but many are rather buggy, so I would suggest using one of the safer, more well known ones like Resharper (my all time favorite and that of many others as well)
I also like JustCode.
There are so many others available though, and if you want to find them, cruise down the Visual Studio Gallery like Morvader said.
Visual Studio Gallery
EDIT:
2 notes I forgot to mention:
Dynamic Intellisense is included in Resharper
Dynamic Highlighting is included as well. If you want to modify the color from the default light blue you can go to Tools->Options...->Environments->Fonts and Colors->Display items->ReSharper Late Bound Identifier
Also make sure that in Resharper->Options...->Code Inspection->Settings "Enable code analysis" and "Color identifiers" are checked.

visual studio: is it possible to color custom tags in code?

Is it possible somehow to color specified code in specified color in any version of visual studio? For example, make background of
if( VERIFY( ... ) )
green and background of
if( ! VERIFY( ... ) )
red? Maybe some addon exists or some version of visual studio has such functionality?
NO PLUGIN NEEDED
According to MSDN and this tutorial, you can set user-defined keywords for syntax highlighting in a
usertype.dat file, which you should save in the same directory as Visual Studio's msdev.exe, or devenv.exe for VS.NET.
Now restart Visual Studio.
Then in VS you can set the font properties for those keywords.
Edit: BTW, see the download here for a predefined usertype.dat with a lot of keywords ready to use.
You can use Resharper's "ToDo Items" to accomplish this.
Resharper -> Options
Create a pattern.
Here you can specify the color, pattern, icon etc. This should already give you colorized code, the rest is optional, but makes it easier to find the patterns.
(look at existing patterns for the syntax, or check the docs)
You can use filters to find the patterns, and combinations of patterns
You could create a filter that contains both your patterns for instance.
use Resharper -> Tools -> ToDo-Items to search for the patterns
I don't know of an existing addin that does anything like that but I do know that Developer Express, the company that makes CodeRush, makes the addin engine freely available as a product called DxCore. This makes is much easier to create an addin that decorates the Visual Studio text editor. In Visual Studio 2010, a lot of the extremely difficult code that DxCore abstracts is no longer necessary as there is an official extensibility model for decorating the editor.
Here's a link to some DxCore plugin samples on Google Code.
No, but you may be interested in FxCop, it's more elaborate, but it should allow you the ability to detect the case you're talking about (via a custom rule, if it doesn't exist). It may be more work to set up, but it's worth it (especially if work in a team, and/or, have an existing CI system).
According to the VS Extensibility form Moderator, Ed Dore, it is not possible:
http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/93fc6d61-cfdb-432d-8541-d7dce498cef5/
Unfortunately, no. The code implementing the document tabbing was developed with native Win32 code, and currently doesn't have any VS SDK or automation hooks into it.
It is too bad as this would be beyond useful. (Keep track of different types of files and such.)

Resources