How to hook into the Visual Studio IntelliSense completion keys to change when it triggers - plugins

Visual Studio 2015 does not have a way to only select IntelliSense when I press Enter or Tab anymore in C# for 2015. It's available for JavaScript but not C#.
I'm trying to create a MEF project and hook into the IntelliSense to change this behaviour for C# files. Just to get started, I tried to implement this sample plugin from Microsoft:
https://msdn.microsoft.com/en-us/library/ee372314.aspx
The sample compiles, but it does not work. Nothing in the code is triggered from the debugged IDE. The samples tells to start a new text file and press "a" to get demo IntelliSense, but it never trigger.
Here's the code project if anyone want to look into it:
http://ontime.zdata.no/donwload/ProperIntellisense.zip
Could someone guide me in the right direction here, the documentation in this area is very fluid.

There isn't a supported way to use the APIs to customize this. The behavior you're looking to change falls under the Roslyn project on GitHub so you're more than welcome to file a bug there as feedback. You're also welcome to send a pull request, but at this point it's really tricky to make a change to the editor components of Roslyn and apply those to your locally installed Visual Studio. It's something we're working on fixing but it's not done yet.

The workaround is to press Ctrl+Alt+Space when inside the editor. That will toggle into the correct IntelliSense behaviour. Not a very easy thing to find, but it saved my day. They should probably give better information about this toggle feature, and make it more visible.. Still, it will not be remembered after closing the IDE, so you have to do it every time you start the IDE.

Related

Visual Studio Code Cobol Extension - Code Navigation using F12

I'm using this Cobol extension for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=bitlang.cobol
It works very well and I've got it all set up. The only problem remaining is that I want to use the functionality to press F12 to jump to a definition in my code, so if I click "styledocument.sd" in the code of a program and press F12 it's supposed to open the styledocument file, but all the editor does is say "No definitions found for "styledocument"." Our lead developer says the functionality used to be there and it just vanished at some point for no reason.
Is there any way to get this functionality back? It'd be really useful, I'm very new at programming and this would be a godsend as it'd help me find my way around the code at a reasonable pace, as everything seems really difficult right now.
Thank you everyone for your replies!

How to activate intellisense in VScode? (c#)

I just want to activate autocompletion in VS code. There's a lot of answers to that questions but NONE of it actually helped me. (so please don't mark as duplicate when other answers DON'T help) Apparently, you have to press "Ctrl+Alt+Spacebar" but this doesn't work or me. I don't see any option in the nav menu to toggle a completion mode either. Or maybe you need to create a file in your folder? I don't know! non of this worked and I don't even know how it did work when I've seen intellisense! So please help me find a way to do this, and it'll better if this would be permanent. Thanks.
First you must have an internet connection.
Then you should find extensions sidebar in vs code(you can open it by press 'Ctrl+Shift+X' or open it in top of the screen, View->Extensions).
After that you should search for C# extension that made by Microsoft(search C# in search textbox and click on first result)
Picture of searching C# extension
Then install that extension by clicking on install button
Wait a few minutes to install (e.g it took 15 minutes for me)
Now you have C# extension.
After that you should close the VsCode and open again.
Now you have auto completion (if not, you probably should press 'Ctrl+Space' while coding)
If you want to have smart auto completion, VsCode doesn't have IntelliCode for C#. IntelliCode is just for Visual Studio.
But you can use Tabnine or Copilot extension(you can search and install it like installing C# extension but you should search tabnine instead of C#)
Tabnine is good but it couldn't help me like Intellicode in Visual Studio.

visual studio code editor not autocompleting, colour coding or giving suggestions

UPDATE: I solved my own problem. Solution is at end of this post
Original Post:
Intro:
Hi, I had Visual Studio Code (VSCode) installed a long time back for use with Unity but ended up not using it and opted for Visual Studio instead because that was what my Unity course was using.
I am now learning HTML so I now want to use the Visual Studio Code as the editor.
Problem:
When I type out my HTML code, VSCode is not autocompleting any of my code or giving me any suggestions or colour coding the text.
Troubleshooting steps done:
I completely uninstalled Visual Studio Code including the user data folders: .vscode in users and Code in Appdata/Romaning (which were advised on the visual Studio code website uninstall instructions).
I then installed a fresh version. But the same problem persists.
Update: I have learnt that the feature that I have an issue with is called Intellisense. CTRL-SHIFT-R is supposed to refresh this feature module. So did this and I get the message "No refactorings available". So perhaps I am missing a module or plugin that I am supposed to also install?
I'd appreciate someone's help to solve this.
Many thanks.
PS This is my first StackOverflow question, I hope it's not a forehead slapping debut!
UPDATE: SOLUTION
I just solved my own problem...and it's probably a beginner's mistake...
I discovered at the bottom right corner of the editor, this a menu tray. One of these items showed "Plain Text". On clicking it, it showed a list of programming languages. Naturally HTML was one of them and I upon clicking it. The editor Intellisense auto completion, suggestions etc kicked in.
If I may comment, I wonder why this element is somewhat conspicuous. It's not obvious for a beginner to know to click on "Plain Text" at the bottom right corner without scouring the interface or try to find a third party tutorial video. Perhaps, I can give that as a feedback to the developers.
I just solved my own problem...and it's probably a beginner's mistake.
I discovered at the bottom right corner of the editor, this a menu tray. One of these items showed "Plain Text". On clicking it, it showed a list of programming languages. Naturally HTML was one of them and I upon clicking it. The editor Intellisense auto completion, suggestions etc kicked in.

Visual Studio Code: where does MS WScript IntelliSense support come from?

I've been working on some scripts for Windows using Visual Studio Code and was surprised that when I type WScript on a line the IntelliSense pops up the correct code completion information, even on my Mac.
I've read the documentation on the VSC website and suspect its either coming out of the built-in JavaScript support or Automatic Type Acquisition from some included library but really would like to find out exactly where this is coming from. So far either my Google-Fu is or nobody has written a thing about it because I can't find any information anywhere. Can anyone answer this one?
It's built into TypeScript. In VSCode, it's actually easy to find the source because you can press F12 on the definition in code, and it will show you the .d.ts:

AutoComplete dissapears when importing typescript module namespace in vs 2013

Imagine:
Ok, so in vs 2013 (update 2) this works fine, no red squiggles or anything. But in the "OtherClass", when writing "im.", i get no auto-complete with suggestions of "MyInterface", as I would expect.
If i write something that does not exist in the namespace, the red squiggles appear. So some kind of intellisense exist.
If I however skip the "import" part and write the whole namespace: "foo.bar.a." I get auto-complete all the way and suggestion of MyInterface at the end.
I would like to use the import syntax to get shorter lines, but if I won't get auto-complete, suggestions, it's not worth it.
Does anyone have a solution for this? Getting the auto-complete while using import i mean.
Thanks!
The interface is auto generated by web essentials from a c# model, if that would help.
Update
Ok, so I found a setting under Tools -> Text Editor -> Typescript -> General
called "Auto list members". It was unchecked so I checked it and it does come up with the suggestion, but, it looks weird.
If you look closely you see that the suggestion is sort of on top of other the suggestions. Even in the second case which worked fine before. It does look like the screen shot Steve Fenton took, with the small white down arrow under the blue thing(an arrow that does not show for me when writing entire namespace in the First case), so I guess he might have this option checked. But it seems for me it does not work as well.
Update 2
Ok so the thief was resharper. Sorry I forgot to mention i used it.
I fixed it by changing to use vs 2013 Auto list members for typescript and shut it off for resharper like so: http://www.cloud-developer.eu/blog/2013/12/03/solved-intellisense-working-typescript-resharper-installed-using-visual-studio-2012/
But i checked "Visual Studio", instead of "Limited ReSharper Intellisense"
It works for me™, which suggests one of the following...
It could be a problem with the language service. This normally resolves when you close and re-open the file or when you restart Visual Studio.
If this isn't the case, it may be a bug in Visual Studio - something is making it mess up. You will almost certainly be asked to uninstall/reinstall before anyone will look at your bug, so do that if you still have a problem and see if it fixes it.
If neither of these help, it will be time to raise a bug for Visual Studio :(
Here is my screen shot of the working code:
Ok, as I stated it seems it was ReSharper intellisense vs Visual Studio 2013 intellisense.
The link under my Update 2 was a fine solution for me before, when I had Resharper 8.1 installed.
But it seems they have improved it and in 8.2 the original issue is fixed. So I have now unchecked the "auto list members" in vs2013 options and only use resharper.
I got the same problem using VS2013 and Resharper 8.2 but this was due to a error on my side in the path to the module I required. So I guess there is a bug that misses the error from my side...