How do I make Intellisense sort alphabetically? - vb.net

How do I configure Intellisense to sort alphabetically in Visual Basic in Visual Studio 2019?
I don't have and don't want Resharper. But if that's the only way to get Intellisense to sort alphabetically, I might be forced to consider installing it.
So far I've:
disabled the extension Visual Studio Intellicode.
found nothing helpful at Menu > Edit > Intellisense > *
found nothing helpful at Menu > Tools > Options > Text Editor > Basic > Intellisense.
found nothing helpful here on StackOverflow.
found nothing helpful on Google.

Normally, Visual Studio’s IntelliSense will help to let the IntelliCode suggested codes(methods, properties) to show at the very beginning of the Completion List and usually they will with a * mark. Following them are normal codes(methods, properties) which should be sorted alphabetically.
There are many options for changing behaviors of IntelliSense in Visual Studio, but indeed they are few. To my knowledge, there is no option to change the order of the default completion list(IntelliSense). But actually, the default order is alphabetical.
Suggestions:
If you installed some extensions which may affect the IntelliSense/text editor, please try to disable them(or try to run VS in safe mode), and you may see the IntelliSense sort alphabetically.
You can also try to repair VS(in VS Installer), or reset VS settings(choose General on step 4) to avoid the impact from VS and related settings.
If you are still trapped by this issue, feel free to let me know, and perhaps you can share a screenshot or some steps which may be useful for me to reproduce your issue and check deeper:)

Related

Where has the Code Analysis window gone?

In Visual Studio 2013, I used the Code Analysis window to provide reports to both the Development and Management teams.
In Visual Studio 2015 Enterprise RTM, these errors have returned to the error window and I can no longer just see CA issues for a single project, or filter them by type.
Is there a way to bring the Code Analysis window back?
Visual Studio Code Analysis has been merged with Intellisense and can now be viewed from the Error window. When you select "Build+Intellisense" or "Intellisense" your code analysis warnings will show up there. You no longer need to build your solution to see them there.
This is one of the perks of the new Roslyn based editor.
Setting it to Intellisense Only should show you your code Analysis Warnings and on the left there is now an option to select "Entire Solution", "Current Project", "Current Document" or "Open documents".
I personally really like the last option, as it works really well for people wanting to leave the campground cleaner than they found it.
If you add additional analyzers (through a vsix or Nuget), they show up as additional rules for Code Analysis.
You can add the "Category" column:
And then filter by category:

How to prevent Visual Studio from displaying double values with 18 decimal places

Recently I noticed in my current vb.net project that sometimes (depending on the value), if I enter a double value the editor changes my input, for example:
When I type ...
Dim x As Double = 0.6
...after commiting the line by pressing Enter it becomes:
Dim x As Double = 0.59999999999999998
If I directly undo the action, then it gets reverted back to the original value I typed in. Any future edit in that line will again produce the undesired results.
I'm aware that internally 0.6 is calculated as 0.59999999999999998 so it doesn't make a difference for the running application, but it's very annoying and the strange thing is: this hasn't always happened and, if I create a new project, it doesn't happen there either.
So my questions are: How can I prevent VS from doing this? Why does it happen at all? Why isn't it always like this (previously in my current project or in a new one)?
I'm running 64bit-Windows 8.1 on an Intel CPU - if that has anything to do with it.
Has anyone got any ideas?
EDIT: I'm using Visual Studio 2013 Professional (12.0.31101.00 Update 4) and, yes, the project has been migrated from several earlier VS versions. There are no relevant Add-Ins or extensions installed. Disabling "Pretty Listing" does indeed prevent the problem, but of course then the other highly useful aspects of the option are disabled as well :o(
EDIT2: After the tip leading to "Pretty Listing" I found the following SO article, but there also no solution was found: Visual Studio VB pretty listing settings
Several years ago I had a project where this was happening. As you wrote, the reason for the number is that some numbers can't be represented exactly in a binary floating point variable. More on this here.
My project had been upgraded through several versions of Visual Studio. It was also shared with developers using VS Express.
If I ran into this problem again today I would open and check the project-file manually, or just simply create a new project and re-add the files if I could not quickly locate the problem and the project was small enough.
If you have upgraded the project through multiple versions of Visual Studio like I had, it might be dragging some settings along that are no longer visible in the projects options dialog.
Just as an interesting experiment you could also try to turn off Visual Studio's Pretty Listings to see if that is what is actually changing your code.

Only Shows Error List For One vb File

I'm kind of new to Visual Studio. I've built a few simple programs in it, but now I'm in the process of rewriting a huge system I wrote in VBA. What is frustrating me is the Error List in VS is only listing errors for one .vb File in my project, lets call that VBFile1. Now, when I work on another vb File, VBFile2, which is in the same project as VBFile1 no red squiggles or errors are listed for VBFile2. I don't understand how this could happen. This is what I've tried/checked:
Filter is set to 'Current Project' and I played around with the other Filter settings but no change.
Checked the Text Editor under Options and according to the research that I've already done it is fine. Plus, I have never changed any of these settings anyway.
Closed and re-opened Visual Studio.
Closed all open files in the Project and still displays the same error list
Close all files except the VBFile2 but still shows the same error list of VBFile1.
I have Visual Studio 2012 Ultimate. I feel like this should be an easy fix...I just am really confused what's going on.
Hope this makes sense!
UPDATE: Excluded from project, VBFile1 and finally errors are listed for VBFile2...why would this be?
I am not sure if it has been fixed in Visual Studio 2012, but there is a Connect Request for Visual Studio 2010 with a resolution of won't fix because of performance issues. The effect your are seeing is because you have exceeded the maximum number of errors for that project (what I am used to seeing is 102 as the threshold), it will not show you anymore till you fix the ones that it has already shown you.
According to this MSDN article, which I found through this SO question the limitation is still there for the IDE but has been removed for the command line compiler.
From above MSDN Link:
Limitless (Command-line) Errors!
This is actually a good thing, let me explain. For performance reasons, the Visual Basic IDE maxes out at 101 errors (with error #102 being “Maximum number of errors exceeded.”) This can make it difficult to estimate the amount of work remaining in certain situations, particularly in upgrade scenarios. We have removed this limit from the command-line compiler in this release, though it still there in the IDE. What this means is if you want to know exactly how many errors there are for a project, just invoke the compiler through msbuild.exe or vbc.exe and you’ll get your answer.

Where does Visual Studio get the data intellisense and name-space completion

I admit...I am posting this question because I still don't have an answer to my other question and thought I would take a different tact.
Can someone explain to me WHERE the values for intellisense and namespace/class/member completion works. I figured if I can drill into where/how it is deriving that data I can try to reconfigure my project so that it will resolve my namespaces correctly.
Seth
The name space and intellisense information, for the CLR, comes from a database hidden inside the VS install.
The information for the working project, is scanned and archived (I think in a file) when you open the project. It then periodically updates it as you work.
If you want the exact path, I doubt that Microsoft publishes that information.
After looking at your other question, I wanted to add that it is possible (somehow) to have Visual Studio rebuild the index information for a given project. It eludes me on how to do this right now. Have you tried this and did you end up with the same results?
Update in regards to comments:
Refreshing the cache is easy but not
necessarily obvious. There are two
ways to refresh the cache: 1) Go to
Edit -> IntelliSense -> Refresh Local
Cache and 2) Hit Ctrl+Shift+R
Source: Dan's Blog - Refreshing the IntelliSense Cache
I don't know how it's done in Visual Studio, but here is the general approach:
Collect all the public members and methods.
This is done, in case of managed libraries like those produced by VB.NET, by reflection. The documentation comes from xml files related to those libs. That's the approach for Referenced libraries.
For the project you are currently working on, it just constantly parses the source files where the documentation is combined with the code.
How the namespace resolving is done depends on the language offcourse, but that is answered in your other question.

IntelliSense not working VS2008 VB.Net

I realize this question has been asked before, but I was not able to find anything that worked for me yet.
Things I have tried:
Switched settings back to default (mulitple ways)
Project Builds/Compiles fine
Closed VS and restarted
The only thing I haven't been able to try is deleting the ".ncb" file, but that's only because I can't find it. In fact not a single one of all our projects have such a file!
So the first question is why can't I find this file in the solution's root directory? The only file I have there besides the .sln is the .suo.
Then if that doesn't work what other options do I have short of un-installing and re-installing?
As for how it happened this might help. While using VS2008 and VSS6.0 (yuck) I made a number of changes to a lot of files via Find&Replace that I didn't mean to(had Entire Solution selected instead of current document). To undo the changes I exited without saving, reopened the solution, then Undid checkout. After that I lost intellisense! I can't imaging how they're related but it might help.
Thanks,
Jeff
IntelliSense usually stops working when it can't compile correctly. Try a new simple project from scratch and see if it works, if it does you have your answer.
Is this for C++ code? If it is, my suggestion is not to try fixing built-in IntelliSense at all, rather try some 3rd party replacement. My favourite is definitely Visual Assist X, which is lot more robust (it almost never stops working, and it is able to parse even very complicated templated and preprocessed stuff, which often makes IntelliSense "lost".
Visual Assist works with other languages including Visual Basic, however this is something I have no practical experience with. Still, there is a free trial - you may try it, I expect it will be superior to IntelliSense even for VB.
Answer:
I figured out how to fix it. Apparently while I was undoing those changes I somehow excluded the file that I wasn't getting intellisense in from the project.
I just right-clicked on it and said "Include in Project" and viola! Intellisense worked again.
Sorry for the false alarm but I appreciate the effort.
Jeff