Visual Studio 2012 no autocompletion during variable instantiation - vb.net

While variable instantiation code is being written by the programmer, IntelliSense should display an appropriate autocomplete suggestion based on the variable type, right? But it does not work in my IDE (Visual Studio 2012 with Visual Basic programming presets).
Let's say I declared a variable in Visual Basic
Dim myList As List(Of String)
and I start writing instantiation code
myList = New
At this point IntelliSense should show me a suggestion of 'List(Of String)', but it doesn't. I always have to write the complete type name manually. Is there a way to fix it?
I remember that it worked for a while just after I installed VS2012, but it stopped either after I changed programming presets to Visual Basic or after I installed some external components.
Thanks!

Try resetting it...
Tools->Options->Text Editor->C# (or All Languages)->General
and enable Auto List Members and Parameter Information in right hand side pane.
If that doesn't work try this below...
Tools->Import and Export settings->Reset all settings.
EDIT
1: Close all the tabs and open your file again.
2: Clean the Build > Close the Solution > Restart Visual Studio > Open the Solution again
3: Goto: Edit > IntelliSense > Refresh Local Cache
4: Close Visual Studio 2012 and delete this folder: %AppData%\Microsoft\VisualStudio\11.0\ReflectedSchemas

Related

Reporting template in Visual Studio 2017

The Reporting template seems missing in VS2017 (I am using Visual Basic). Any way to get it back?
I have already tried installing SQL Server Data tools and the rdlc extension from the marketplace, but it still doesn't show up.
The template is available in the Add New Item window. Select Visual C# and then look for the Report and Report Wizard templates. These templates are only visible under Visual C#, not under any subitem.
Try updating ReportViewer to version 14.0.0.0 and installing Microsoft.RdlcDesigner. This worked for me for Visual C# and then just like J.Bunch said there is no sub item Reporting like there was before so you just scroll down thorough all items. Also try this although the example is for C# I think it should at least help you with VB.Net as well. Hope it helps.

Visual Studio 2013 Update 3 - No Intellisense?

Visual Studio 2013 Experts:
How do you enable intellisense when editing a single source file (or can you)?
Start Visual Studio 2013 Professional (Version 12.0.30626.00 Update 3 RC) -- fully registered.
Click on "File -> Open -> File ..." and select a VB.Net source file, ie: filename.vb
Type a statement such as:
if ( String.
^--- at that point isn't intellisense supposed to list
all members of the ASP.NET String class?????
Nothing happens; what setting am I missing?
OR
Does intellisense only work in Projects and not with individual source files?
Thanks in advance.
It depends on the file type. In your case, for a VB source file there will be no intellisense without a project.
On the other hand, for files such as Html, js it is available even without a project.
Intellisense only works when working within a project. The project type determines the internal compilers used to create intellisense - without this, you just have a plain text editor.

Disabling Intellisense Auto Line Return [duplicate]

When editing C# code in Visual Studio 2010, the ENTER key makes IntelliSense complete the current suggestion, without adding a new line.
In VB.NET, the default IntelliSense behavior for the ENTER key is to add a new line after completing the current suggestion.
How can I configure IntelliSense to change the VB.NET behavior to the C# one?
I already know that I could press TAB or SPACE, but out of habit I always end up hitting ENTER (and changing line).
UPDATE VISUAL STUDIO 2017:
Now with Visual Studio 2017 you can change it. Tools -> Options -> Text Editor -> Basic -> IntelliSense.
In Enter key behavior select Never add new line on enter
ANSWER FOR VISUAL STUDIO 2015 AND PREVIOUS:
If you want to avoid inserting new line on enter with autocomplete suggestion, just don't press enter. Instead of Enter press Space bar which completes your autofill and just inserts a space.
Or you may use this third party app:
Resharper makes it possible overriding Visual Studio intellisense and using its own intellisense. It is the only way I've found.
It has a 30 days free trial if you want to test it.
Unfortunately the set of trigger keys for intellisense completion is not a configurable item for VB.Net. There is no way in the default Visual Studio environment to change this behavior.
It would be possible to develop a plugin of sorts to accomplish this. However that's a pretty extreme measure.
EDIT
As of Visual Studio 2017, it is now possible to change this. See the answer below

View Designer Code in Visual Studio 2010

What is a standard way to open the Designer (automatically generated) code for a VB file?
As a workaround, I can get to it by searching the entire solution for some keyword that is usually only found in those files: Global, Partial, etc.
Open the Solution Explorer. Along the toolbar at the top there is a tool Show All Files (it is the 2nd from the left on my version of visual studio). Click on that tool. All of your Form files will now have an arrow beside them. click on that arrow to expand. Look for the code file named FormName.designer.vb. Double-click on it to open.
You have to click the "show all files"-Button. Then you can also see the Designer.vb-files.
Note: For C# and VS 2008, but the same applies to VB in VS 2010.
http://peterkellner.net/2007/12/31/visualstudioshowallfiles/
http://blog.brianhartsock.com/2009/09/14/visual-studio-tip-show-all-file/
Keyboard shortcut for Show All Files
Show All Files is a useful little button in the Visual Studio solution explorer to give us a full view of the directory structure our project files are sitting in. When it is off, we only see the files that are explicitly included in the project, but when it is on, we see everything. This makes it very easy to explicitly opt a file into the project without doing an add -> existing item -> find existing item in directory structure and add to project.
The default when creating a new Visual Basic application in Visual Studio is to not show all files, and unfortunatly there is no setting you can adjust to change that.
Open the code file, and in the top-right corner of the code window is a drop-down containing all methods. Open this and select "InitializeComponent".
A screenshot from a newer version. Visual Studio 2015 and 2017 will look like this.

Stop showing SQL errors in Visual Studio 2010

How can I stop VS2010 showing errors in .sql files, attached to a project? I don't want to check them at all, just C# code. The files are used as resources, Build Action set to Content. I'd like to keep .sql extension for syntax coloring purpose.
Regards,
Looks like your question was answered here: https://stackoverflow.com/a/8593877/2798869:
Visual Studio 2010
Tools -> Options -> Text Editor -> Transact-SQL -> IntelliSense
Uncheck "Enable IntelliSense".
Visual Studio 2012 & 2013
Tools -> Options -> Text Editor -> SQL Server Tools -> IntelliSense
Uncheck "Underline errors"
Note that you have to close then re-open any .sql files you may have open.
In VS 2012.
Go to the sql file properties in VS.
Under "Advanced", change the "Build Action" option to "None".
Unfortunately you have to do this for each sql file in the project.
This is what gave me the behavior that I wanted. It not only compiles without errors but shows no sql related build errors.
Update
It is possible to select multiple files in Solution Explorer by using Shift + Click (select the file at the top of the list -> hold down shift -> click the file at the bottom of the list). Once you have selected the group of files, you can then change the Build action to None for all of them at once. (This worked for me in VS2013.)
While you still have to select files per folder you don't have to select each file to set the property.
VS2015
right click in editor of the sql file > Intellisense Enabled
May be a sledge hammer to the problem but I manually deploy my SQL changes and only use them to house the scripts for my builds, so I do not need the functionality provided by SQL Projects.
Open the VS Solution File properties (right-click the solution in VS Solution Explorer and select Properties) and in the left pane select "Configuration Properties" -> "Configuration". In the right-pane you will see the projects in the solution. Un-check these projects to prevent them from building, this will prevent them from showing errors.
Is it possible you have a .cs extension on those files but it's not shown? I added some .sql files to my project and the compiler is not complaining.
Change the type of files to content and then the intellisense will never try and parse the contents of the files.
I just built a test project with one class file .cs and added one .sql file. It automatically set the build type to content. It built fine like John Fraser said in VS2010, so I changed it to compile, and obviously it failed.
This isn't the answer yet but perhaps the next step is to try and create a new solution, and import a few of the files from the original project to try to narrow down the source of the problem. If it builds then it would tell you it is something about the settings in your project/solution. Otherwise it could also be a VS setting.
Steps to stop showing SQL errors in bulk:
Open the SQL project file which has the .sqlproj extension in a text editor.
Find and replace <Build Include= with <None Include=. (This one has the same effect as right-clicking and changing Build Action to None in the solution explorer.)
The SQL errors should disappear in Visual Studio.