Are there any free components out there that will give highlighting and/or intellisense for HLSL?
I've seen mentions of something called "InteliSense.Net," but the author's site is down and I can't find a download anywhere.
Not a direct answer to your question, but this is what I do to solve the same problem:
I set Visual Studio to open *.fx files in Notepad++. (Right click the file, Open With, Add Notepad++, Set Default). Of course, you can use any editor you like.
I use a HLSL syntax highlighting file for Notepad++ that I found on Google. I think it's this one.
And finally, I keep this MSDN page open in my browser: Intrinsic Functions (DirectX HLSL). Because HLSL is so simple - with no way to mess around defining classes and such - and the programs are usually quite small and self-contained, I find that this is sufficient.
Try NShader that is a VS2012/2010/2008 extension for HLSL/CG/GLSL syntax highlighting.
With a little effort you can configure manually MSVC2010 IDE in a way it will highlight HLSL files and will do partial auto-completion/intelisense:
Part 1)
In 'Tools' menu click 'Options'
In the 'Options' dialog box expand to 'Text Editor' node and select 'File Extension'
Now on the right side you can add extensions and configure editor for them
Add extensions: hlsl and fx with 'Editor' field set to 'Microsoft Visual C++'
Check 'Map extensions files to' and set it to 'Microsoft Visual C++'
Part 2)
Create 'usertype.dat' text file beside VCExpress.exe or devenv.exe (typically located "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\"). Populate 'usertype.dat' file with hlsl keywords you want highlighted i.e:
float2
float3
float4
float4x4
matrix
cbuffer
tbuffer
Part 3) Restart MSVC
Part 4) In VC Open 'Tools'\'Options' dialog box again and navigate to 'Environment'\'Fonts and Colors' and configure it to your liking. Color of user keywords added via 'usertype.dat' is controlled through 'C/C++ User Keywords' display item (Personally I matched it with 'Keyword' settings).
Part 4a) In VC 'Tools'\'Options'\'Text Editor'\'C/C++'\'Advanced' on the right side you might want to consider setting field 'Disable Squiggles' to true (since hlsl is not a valid C++ code VC would normally underline C++ compile errors in your shader code)
ShaderSense project seems to solve syntax highlighting and some kind of intellisense for HLSL files
HLSL Tools for Visual Studio brings IntelliSense to HLSL in Visual Studio. It includes statement completion, signature help, live errors, quick info, and more.
Disclaimer - I'm the author of HLSL Tools.
Related
I was wondering if anyone has had any luck disabling the HTML element tooltips in Visual Studio 2015. I find them to be a real annoyance, especially when dragging/ctrl+dragging text around (they get in the way most the time). Here's a screenshot the feature in action (updated):
I Googled and was only able to find the post where the feature was announced, but no mentions of how to disable it. I checked my Visual Studio preferences and have "Auto list members" and "Parameter information" disabled for the HTML text editor.
Any ideas or suggestions?
Update (10/16/2015): I think this issue may be related to the Web Essentials package. I disabled the package and was able to make the tooltip show up, however, I don't currently have a computer with a default Visual Studio 2015 install to test my theory on. I updated the screenshot to reflect the actual tooltip I'm getting (the original one was the screenshot included in the linked blog post).
Try this:
Go to: Tools > Options... > Text Editor > HTML > General
In the 'Statement completion' section you will see an 'Auto list members' checkbox, uncheck it.
However, I'm not sure if the feature above reffers to an in-design html editing or will only affect in specific html development environment (editing an html file for example), so I'll give an additional solution:
Go to: Tools > Options... > Environment > Keayboard
Here, find the command Edit.ToggleCompletionMode and assign the keyboard shortcut that you desire.
Then just use it when you wish to toggle the auto completion of members (including html members I supose).
Update
Sorry If I confussed what you want, because with the absence of auto completion it will remove existance of tooltips but I don't know if you need auto completion suggestions or not.
Anyways, for tooltips you could try doing the same procedure I explained in the images above but with the "Parameter Information" checkbox and/or the corresponding keyboard shortcut, Edit.ParameterInfo. Because seems that html element tooltips are treated as parameter info.
This was annoying the Hell out of me as well & I found that ElektroStudios' solution wasn't suitable in my case. I'm fairly sure that they are VS-native (definitely not Web-Essentials or ReSharper).
For VS2015 at least, the offending tool-tips are located within the file:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Schemas\1033\HTML\html.loc
Deleting the contents of this file has "disabled" the tool-tips for me, although I can't say whether this will be a permanent fix.
Used to have that extension under Visual Studio 2010 but I can't find it again.
The extension provide the following helper :
When hovering mouse over a type in the code editor a small window would pop-up and show members inside the type, saving the hassle to open the file to see what members that type contains.
You might be talking about Solution Navigator feature of Productivity Power Tools.
Solution Navigator also provides interactive tooltips in C# and VB code (replacing the default “quick info” tooltips) that give you the same kind of data, but right at your fingertips.
Is there a built-in feature or available add-on for Visual Studio 2010 that will clean up spacing in C++ code so that annoying blocks like this:
RandomVar=RandomList.RandomMethod();
will become
RandomVar = RandomList.RandomMethod();
(Same goes for spacing in loops, etc.)
...or do I need to do this myself with find/replace and regex?
I think You are looking for Edit->Advanced->Format document. This will re-format your current document according to settings in Tools->Options->Text Editor->c/c++->Formatting.
It's keyboard shortcut Ctrl+E+D in my case.
Although originally for C code formatting lint has been modified to cover C++ and ported to many platforms.
Some lint variants only report inconsistent layout, others can fix it for you. some are free others paid for versions.
This would be an outside the IDE fix as this is a sperate tool (at least traditionally it is!)
This wikipeadia article lists a few possible sources for lint tools
(this was a footer in my orginal question, but as that posed two solutions I extracted it here so you can accept a specifc answer should you find one apropriate)
This is not a proper "Solution" but a possible work-around without the need for finding external tools
In the "Tools" menu pick "Options..."
In this dialog navigate to
"Text Editor -> C/C++ -> Formatting"
Set the layout options as you
would like your code to look.
Click OK.
Now in a unit with "bad"
formatting from the menu select "Edit->Advanced->Format document" and the IDE wil reformat the
document to match your settings.
For C#, VB etc the "Formating" option has several sub nodes that provide a fine grain of control for the sort of spacing options you ask for. The list for C/C++ is flat and very limited by comparison. I suspect there is not enough flexability for the layout you want.
So you probably cannot get the formatting you want directly. How about...
Set the spacing rules you want for C++ in the C# settings
Temporarily adding a C# project to your solution
adding a class to that
emptying it.
paste the C++ in (causing a reformat)
copy back to the original file
rinse and repeat
remove the temporary C# project
I have to say this is not pretty, but given the syntactical similarities between C++ and C# its probably a close match.
The auto-formatting settings for C++ in Eclipse are more extensive than in Visual Studio, so I ended up using that instead.
I have to turn in a hard copy of some code with an assignment. Is there any way in Visual Studio 2010 to print C# source code with syntax highlighting?
PS: The assignment is solving a math problem, so the choice of language isn't important and the teacher doesn't need to compile and run the program. She just wants to see our approach and results.
There is an extension now :) Visual Studio 2010 Color Printing Extension
Works well! :)
The best way I've found to accomplish this is to copy from Visual Studio and paste into something like MS Word or OpenOffice Writer.
This gives you full source code, with syntax highlighting. You can then print from Word (including adding your intro documentation before the code, etc).
Just to let everyone know, unfortunately printing in color was cut from Visual Studio 2010 because of resource constraints. Since we've rewritten the editor from scratch in WPF, we didn't have time to reimplement everything so we had to sacrifice this feature. We will try to implement this in the next version of Visual Studio. For now, copy to clipboard and paste into other app such as Microsoft Word is the recommended solution for printing code with color.
If you go to Tools -> Options -> Environment -> Fonts and Colors you can change settings to print with syntax highlighting (change 'Show settings for' dropdown to 'Printer'). But you will need to change all the individual settings to match your IDE (I don't know of a way to make it automatic)
Edit: you can use that "Use..." button next to the dropdown to copy settings from the Text Editor
Simplest of all copy code to clipboard and paste into MS-Word is the way I do and it works...
Have a look at VS.NETcodePrint 2010 availabe from www.starprinttools.com. You will be able to print and export the color coded output to PDF.
Joginder Nahil
Due the fact MSVS does not support it anymore I think the best way is really to copy the code and paste it into WinWord.
The advantages are listed below. You can
set the font/size exactly how you want it.
set the format of line numbers.
have your own header/footer.
remove #region from printing.
add a watermark to the output.
For me - I print once in 2 months a source code - it is a very comfortable way which I never could achieve with any 3rd party extension.
Can you program/configure Visual Studio to produce custom intellisense for your own server controls.
eg can you get it to do this:
alt text http://www.yart.com.au/test/vs.gif
for a tag of your own like:
<MyCompany:MyTag ...
You should be getting this for free (default behavior of control). Are the references all in place while you are typing the custom control?
There is an attribute to hide properties from intellisense:
[EditorBrowsableAttribute (EditorBrowsableState.Never)]
Use the description attribute to provide additional help:
[Description("My extra helpful description")]
There are some other attributes that affect intellisense and the property explorer you might want to look up...
Bluevision have a nice plugin for Visual Studio to do this for you. Last time I looked, it was free. (yep, it's still free!)
IntellisenseAttribute class allows you to specify members for which intellisense symbols will be generated.
Ability to generate default intellisense symbols for assemblies when you don't have access to the source code.
NEW Snaps right into the IDE so that intellisense generation can be automated during the build process.
Supports two visual views: Full Mode and Skin Mode.
Full source code.
FREE!
http://www.bluevisionsoftware.com/WebSite/ProductsAndServicesInfo.aspx?ID=9