How to search for subroutines/modules within MS Visual Studio 2010 - visual-studio

Is there a way in MS Visual Studio 2010 (I use Intel Visual Fortran Composer XE 2011) to search for subroutines and modules? For example if I am in a subroutine (written by somebody else) that calls another subroutine subname, I usually use "find in files" to find this latter subroutine, but is there a more direct way, e.g by right clicking on the function (or module) name? i could not find any.
Thanks

As of Composer XE 2011 update 6 (compiler version 12.1), the style of source browsing that you are after is available within the Intel Fortran Visual Studio integration. You need to make sure that you have enabled it - under Tools > Options in the Text Editor > Fortran > Advanced category set Collect Call/Callers graph information and Collect Object Browser information to true and Disable Database to false.
A restart of Visual Studio may be required. Modules and procedures in the current solution can then be browsed using the drop down lists at the top of the source code editing windows and various options on the right click menu in the editor window.
For solutions with large code bases, acquisition and maintenance of the of information that the source browser relies on can be rather resource hungry. Support for procedures accessed via a generic interface is poor.

Source Editor Enhancements by Fortran CodeNav.
Fortran CodeNav is an useful extension for fortran coding with MS VS. It supports "Jump to declaration of member","List usages of element","Auto-complete" and search. I recommand Fortran CodeNav because it supports shortcut keys. Fortran CodeNav for VS2010 can be downloaded at its old site.
Source Editor Enhancements by IVF
#IanH's answer has mentioned about it. Maybe you could find the guide to Source Editor Enhancements in developer guide and reference book of your IVF version. As of XE2018 update 1(IVF Compiler 18.0), the guide is here. But it doesn't support shortcut keys.

Related

Uninstall F# from VS 2015

I have recently installed Visual Studio 2015 (Enterprise), and although I only selected C++ from the programming languages list, it has also installed F#. A language I have never used and will not use, simply because I'm working with C# and VB currently, and I'm satisfied with the results I get. My plan is moving to C++ after I learn C#, so I have nothing to do with F#. It's only taking up space from my disk and I want to remove it. I've been looking all morning about an easy way to do so, but all I could find was a lot of questions regarding earlier VS releases and somehow managed to successfully remove the F# project templates. But the rest is still there - screenshot:
As you can see I cannot uninstall it via Extensions and Updates, nor I can find it in Programs and Features. I could find some F# SDK and F# for VS stuff in the registry, but I'm not experienced enough with it to find the uninstallers. Any ideas?
Goto Programs and Features in Windows, and select Visual Studio Enterprise 2015 and click Change, when the Setup dialog appears, select Modify then untick the following:

How to use the C# editor in a Visual Studio Isolated Shell application?

I wanted to take a look to the Visual Studio extensibility SDK, specifically developing over the Isolated Shell. I would like to be able to use the C# code editor with syntax highlighting, intellisense, etc...
I've already read a bit about how to define your own content to support these features but I understand that for a language already supported like C# the needed package exists in the VSSDK and can be loaded into the isolated shell.
So, when creating an Isolated Shell application from the standard VS template and running the generated project, I can create a new C# file containing a class definition, but it is missing the syntax highlighting and the intellisense. I've found some very basic documentation on extending the Isolated Shell, but I cannot find how to enable the standard editors.
Is it possible to load/enable the standard VS editor extensions? If so, can you point me to any documentation or code example that can guide me a bit?
Thanks!
You can't do that. It's more a licensing issue. If you could put/enable everything in the isolated shell, then nobody would buy Visual Studio anymore.
Here is a more official answer from here: How to connect C# VSPackage to Visual Studio Shell Isolated Mode to have syntax highlighting
VS languages like C#, VB, and C++ cannot be loaded in the isolated
shell. Hence the reason we call it isolated :-)
Additionally it should be noted, the integrated shell does not include
these packages, nor are they licensed for redistribution; as they are
distributed with the Visual Studio product.
The integrated shell is basically the core VS IDE, wherease the
isolated shell is essentially the same IDE, but runs using a different
stub application (so you can customize it to suite your needs). But
the isolated shell does not ship with, or will it load any of the
mainstream language/project services that ship with VS Pro.

Visual Studio 2010 generated executable size larger

I've got an C++ application originally written with Visual Studio 6.0
The application is standard and raw Win32 API, no MFC(*Edit 2), no .NET, statically linked, multi-threaded executable.
I have migrated through all versions of Visual Studio up to 2010 (today) and never had any problems until now:
It compiles and runs perfectly with VS2010 BUT the generated executable size is four (4) times larger!
I've tried all the options I know (optimizations, remove debug info, etc..) with no results. Granted, I am new to VS2010, but not to Visual Studio.
Has anyone encountered this problem? Again: I am NOT using any frameworks, it is a raw, statically linked, Win32 application, no DLLs, no ODBC, no network, no .NET
Hoping to see my executables small once again, I thank you for any input.
Edit 1:
Original Size=626KB (VS6.0, VS2008)
Bloated size=2.013KB (VS2010)
Edit 2:
After some research and dumps, I discovered a hidden reference to MFC.
Originally I said it did NOT use MFC, but it does.
The increase in size may be caused by changes to the MFC. Here is an explanation, and here is a workaround by the same author that brings the executable's size back down into regions where it was with 2008. The workaround involves editing copies of MFC source files, though, a process not everybody may be happy with, and which needs to be repeated after every update, e.g. after installing a Visual Studio service pack.
Update:
It looks like the OP does not use MFC, so these might be two different issues. I have experienced the size increase myself but unfortunately cannot say whether caused by MFC or not since my project statically links to the MFC.
If you are using static linking, I suggest using the linker switches if you are compiling at the command line using the syntax:
cl /Ox [your C++ source file(s)] [libraries required if any] [resource files required if any] /link /FILEALIGN:512 /OPT:REF /OPT:ICF /INCREMENTAL:NO
If you are building within the Visual Studio IDE, you check the linker settings by selecting the project properties from the menu. In the configuration, select the Release and then click the linker settings found on the left pane, this will show you a list of configurations corresponding to the linker settings currently set by default.
In the Command Line under the linker, specify the option /FILEALIGN:512 in the Additional options entry then click the Apply button. In the General option under the linker, disable the incremental linking by selecting No(/INCREMENTAL:NO ). In the debugging option of the linker, select No for Generate Debug Info. For the linker optimization, you select the Eliminate Unreferenced Data(/OPT:REF) in the References and Remove Redundant COMDATs(/OPT:ICF) in the Enable COMDAT folding.
For the compiler optimization, make sure the Release configuration is selected, click the C/C++ tree view on the left pane and under that, click the Optimization, Select Full Optimization(/Ox). In the General setting under C/C++, Select Disabled for the Debug Information Format.
Don't forget to click the Apply button for every changes you make.
I hope everything I've mentioned here would be helpful to you and all of these applies to Visual C++ 2005 and 2008 but hopefully, it would also apply to Visual C++ 2010, if not, kindly check the documentation included with your Visual C++ 2010 installation.
Any chance you've left the default platform target at "Any CPU"? If so, change it to x86 for 32-bit only code. I'm guessing that will make up most of the difference. The remainder is likely in changes in compiler optimizations (more aggressive loop unrolling and whatnot where size has been traded for speed since RAM is cheap). I believe all the granular optimizations are still available from the command line, but many have been obscured in the UI options panels.
See Are there any tools for tracking down bloat in C++? - some techniques how to analyze what contributes to the executable size are described there. Once you perform analysis on both VC 6 and VS 2010 output, hopefully you will find something useful.
There is one particular gotcha which has hit me when porting from VC 6 to some Visual Studio edition: meaning of some optimization options has changed and the values I was using in the VC 6 project were no longer supported, and as a result the exe produced by VS was not optimized at all, causing both executable bloat and slow performance. Check your optimization settings in Properties/C/C++/Optimization and make sure optimization is on /Ox, /O2 or /O1.
This is because in VS2010 Microsoft added functionality allowing HTML components in a dialog windows so a bunch of stuff is pulled in and linked in even if you aren't using it and the optimizations and options and removing unreferenced code do not help. There is not a "good" way of removing the code, but there are some hacked up ways. We compile our size-critical stuff on VS2008 still because of this. Side note, our non-GUI code actually compiles smaller for what that's worth. Hoping MS comes up with an option for this in a fix/patch so I can do everything on VS2010 but I'm not holding my breath...

Which parts of the Visual Studio IDE are open source?

Which parts of the Visual Studio IDE (if any) are open source? Thanks!
Here are the components in Visual Studio that I am aware of which have some level of source accessibility.
MEF
Iron Languages
DLR
F#
CLR: subset of the CLR known as Rotor is open source
BCL, WinForms an WPF: source is available under the Source Reference License
Plugin's: Many of the Visual Studio employee plugins available on the Visual Studio gallery have source accessibility.
Note: I intentionally used "some level of source accessibility" instead of "open source". The term "open source" has a very specific meaning to certain portions of the developer population which does not align with the components I've listed here. In particular they deam it to mean source which is contributable by anyone. There is no part of Visual Studio today (that I'm aware of) which has that level of open source about it.
None of it, so far as I know.
AFAICT, none of it, though I can see where the confusion came frome.
Microsoft did give "Visual Studio Industry Partners" access to the Visual Studio source code. This falls under their umbrella of "shared source".
But their umbrella of "shared source" is really, really wide. Microsoft uses this term for a whole cornucopia of licenses that range from completely open-source to completely proprietary.
In this case, it doesn't look like the Visual Studio IDE is available under any of the open-source licenses.

No IntelliSense for C++/CLI in Visual Studio 2010?

I just moved from Visual Studio 2008 to Visual Studio 2010 (final) and noticed one major flaw:
When I try to use AutoComplete in a C++ source file for managed C++, a small note in the footer appears:
IntelliSense for C++/CLI is not available
Uh, has IntelliSense for C++/CLI been dropped from Visual Studio 2010? Is there any way to get this back? It is rather useful...
You are correct. Unfortunately it has been dropped. You can check this opened issue on Microsoft's Connect website.
I'll just quote them for the sake of the answer:
Unfortunately in this release we had to cut the intellisense support for C++/CLI due to time constraints. If you want to get some intellisense like quick info and memberlist on the native classes you can get it by choosing no /clr support in the project properties.
About getting back intellisense, your best chances for now are using third-party tools like VA Assist for example. I've tried it with Visual Studio 2008 and its IntelliSense is a whole lot better than the default one.
It is available again in Visual Studio 2012.
If you want to get IntelliSense back, install Visual Assist X from Whole Tomato Software. Here you can get a 30-days trial to check the intellisense.
According to the Visual C++ Team Blog, C++/CLI Intellisense will be in the next version of Visual Studio, but not in a service pack for VS2010. That blog post also gives some detail as to what went wrong and led to this sad state.
I don't know if you can use this settings but it work for me. I only check the Common Language RunTime Support for the cpp files that use it. I do not check it for the whole project and I've got intellisense for all the files that don't use the CLI.
Yes! you can enable the IntelliSence, but in a tricky way. Follow these instructions:
Go to your project properties. (Right click on your project name in
Project Explorer, and select Properties. or simply Alt + Enter)
From Configuration Properties, select General
In the right-hand section, find "Common Language Runtime Support"
and change it to "No Common Language Runtime Support".
Click the OK Button.
Now the IntelliSence is working. But a problem is an error when you compile your code! (The error is: error LNK1123: failure during conversion to COFF: file invalid or corrupt)
You can simply go back to Project Properties an change Common Language Runtime Support to "Common Language Runtime Support, Old Syntax (/clr:oldSyntax)".
Good luck.
This solution is only if you don't want Common Language Runtime
It worked for me in VS2010
Go to Project Propreties > Configuration Properties > General > Common Language Runtime Support and set it to No Common Language Runtime Support.
This will work fine just after hitting Apply button.
As mentioned you could install some paid software such as "Visual Assist X from Whole Tomato Software".
or
You could use open source tools that contain intellisense*, one such tool is Qt Creator 3.3.1 (opensource). You have two options, either setup your entire project with Qt to compile using VS2010 compiler, or use Qt to link to your source files and compile with VS2010. You write your code in Qt, save, flip windows to vs2010 and compile and debug.
When changes are saved in Qt, vs2010 will automatically reload the source file in the project and you can compile.

Resources