Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense: Autocomplete to offer known types as VSPro #851

Closed
Novack opened this issue Oct 29, 2016 · 23 comments
Closed

IntelliSense: Autocomplete to offer known types as VSPro #851

Novack opened this issue Oct 29, 2016 · 23 comments

Comments

@Novack
Copy link

Novack commented Oct 29, 2016

Environment data

.NET Command Line Tools (1.0.0-preview2-003133)
Product Information:
Version: 1.0.0-preview2-003133
Commit SHA-1 hash: 74df06500c

Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64

VS Code version: 1.6.1
C# Extension version: 1.5.0-beta4

Steps to reproduce

Follow the example images.

Expected behavior

This is the standard Visual Studio Pro intellisense:

Example Case 1: Enums.


Example Case 2: Initializations.

Actual behavior

This not only could save a lot of typing, but also save a lot of frustration when coming from environments like VS Pro :)

Thanks! 👍

@Novack
Copy link
Author

Novack commented Nov 4, 2016

@DustinCampbell I noted that this issue received no labels. Do you want/need more details?

@Novack
Copy link
Author

Novack commented Nov 19, 2016

@DustinCampbell for what I understand from other threads is that omnisharp already has this information, this would only require to implement the autocomplete, that is correct?

@DustinCampbell
Copy link
Member

@Novack- OmniSharp has access to this information, but we need a new endpoint to expose it. That's a bigger work item that I'm tracking here: OmniSharp/omnisharp-roslyn#78.

Above, you mentioned to specific completion features that we have in Visual Studio:

  1. Enum pre-selection: This is where VS displays the completion list on several specific contexts where an enum will likely occur.
  2. Completion after "new": When typing "space" after the "new" keyword, the completion is displayed. In addition, a special completion item is inserted if necessary to make it easier to instantiate generic types. We're tracking this with No suggestions after typing new keyword #146.

@Novack
Copy link
Author

Novack commented Nov 21, 2016

Awesome @DustinCampbell thanks for the update. I will be following the events!

@Novack
Copy link
Author

Novack commented Feb 20, 2017

Any progress changes on this? I have been following the referenced threads without any luck either.

While I enjoy working with VSCode, I can't use it daily for proffesional work until I can achieven the same level of productivity and smooth code writing than I get on other environments.

We really need feature parity in terms of code completion!

@Novack
Copy link
Author

Novack commented Apr 17, 2017

6 months now. I dont think this request is exotic, I consider it basic functionality, but meh! Maybe is just me. Moved away from code months ago, will check from time to time if its improved.

@DustinCampbell
Copy link
Member

Sorry for the delay on this, but most effort has gone toward making sure that we have parity in VS Code for .NET Core .csproj projects with what we previously had with project.json projects.

@DustinCampbell
Copy link
Member

Looking a little more closely, it looks like we're going to need an API from VS Code to be able to support this. AFAICT, VS Code does not support specific selection in the completion list, which is what this feature requires.

@Novack
Copy link
Author

Novack commented May 4, 2017

Would you elaborate on what you mean by supporting specific selection in the completion list?

@DustinCampbell
Copy link
Member

There's two problems here:

  1. VS Code does not provide a good way to trigger completion on a space character. You can do it, but it is not distinguishable in VS Code's API from Ctrl+Space, which is problematic.
  2. VS Code does not seem to provide a way to select an item when the list appears.

It's those two behaviors that make the features you've described here really great in Visual Studio. An enum gets selected in the list based on the current context in the code. E.g. if you're in the position of an argument list that would take an enum, that enum gets selected to make typing easier. Bringing up completion on "new" is similar. Recent changes will put the correct suggestion in the list, but it won't be selected until you type more characters. Does that make sense?

@Novack
Copy link
Author

Novack commented May 4, 2017

Oh, yes does much more sense. Thanks.
Bollocks! This seemed like so near when I createds the ticket...

@DustinCampbell
Copy link
Member

It's OK. I'll file an issue to get what we need in VS Code.

@Novack
Copy link
Author

Novack commented Dec 13, 2017

No news yet?

@DustinCampbell
Copy link
Member

Sorry that I haven't updated this issue in awhile. We're tracking a lot of this work on #1765. No. 1 from my list above should be done. However, No.2 is still outstanding. cc @rchande

@Novack
Copy link
Author

Novack commented Dec 7, 2018

Hello guys! Two years :)
Any news? Thanks!

@akshita31
Copy link
Contributor

@Novack In the latest version of the C# extension I am able to see the completion for "new" with the dictionary completion preselected as well. Do you think this issue is fixed now or is there something that is still missing out
dict

@Novack
Copy link
Author

Novack commented Dec 8, 2018

Hello @akshita31 thank you for the quick reply. I have not been using vscode recently, didn't knew this was solved.

I will check it and poke back. Lists, enums, dictionaries are a few examples. And not just on instantiation, also when passing parameters and such, are things I'd like to confirm.

@Novack
Copy link
Author

Novack commented Dec 12, 2018

For some reason is not working for me, not with dictionaries, nor lists, and neither auto displays autocompletion list for enum parameters, and stuff like that.

Im not sure if its a problem on my end, or not, because setting up code with unity can be tricky sometimes, and I only did now for this test.

Speaking of the wider context, is not just looking at dictionaries tbh, if you see the issue reported, there is more to it: would be basically interesting to have feature parity with Visual Studio regarding intellisense. Stuff like this is common in every code editor out there.

@SirIntruder
Copy link

There was a bug in previous versions of vscode where preselected items were not properly focused in the dropdown: microsoft/vscode#63245. Can you check if you have problems with the latest version of VSCode (that just came out today)?

@Novack
Copy link
Author

Novack commented Jan 8, 2019

Finally got time to get VSCode working with Unity again... Now Omnisharp is working, but for the topic of this thread, not even the basics are working:

imagen

imagen

Some cases indeed seem a problem of focus on the right item of the completion list, because if I keep typing, it shows the item is actually there:

imagen

But for Enums, it doesnt work at all, nor for new variables, not for method calls autocompletes:
imagen

@rchande
Copy link

rchande commented Jan 8, 2019

@Novack It seems to work very reliably for me on 1.31 insiders. What build of VS Code do you have?

@Novack
Copy link
Author

Novack commented Jan 8, 2019

@rchande Im using latest VSCode (1.30.1) with corresponding Omnisharp (and Unity).

@JoeRobich
Copy link
Member

Closing this issue as a lot has changed with completion since this issue was opened. If you are still seeing issue with item selection, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants