Omnisharp-vscode: Suggest correct types when using new keyword

Created on 29 Nov 2017  路  5Comments  路  Source: OmniSharp/omnisharp-vscode

VS Code version:
1.18.1
C# Extension version:
1.13.1

Steps to reproduce

For example, write "int[] intArray = new" and then press control + space, there is no int[] suggested.

Expected behavior

I would expect for "int[]" to pop out first like it does in visual studio.

Actual behavior

Here is an image of current behaviour:
image

Most helpful comment

@akshita31 The appropriate VS Code API has been implemented for us to support this (https://github.com/Microsoft/vscode/issues/35551#issuecomment-398100658). Let's chat about what we need to do to get this feature working.

All 5 comments

I believe int[] is in the list but it isn't selected. Is that correct? Otherwise, this is tracked with https://github.com/OmniSharp/omnisharp-vscode/issues/1765.

int[] is not in the list. Even if I suggest an int it won't suggest array:
image

Actually, I was incorrect. Visual Studio (and thus VS Code) doesn't show int[] in the list. However, it should preselect int so that you can keep typing. That's the bit that is being tracked by #1765. Is that right @rchande?

@DustinCampbell Correct. The trigger is wired up, but there's some more work to be done with preselection. Also, there's ongoing discussion with VSCode about whether they want to support a C#-style preselection experience. The only way to do something like preselection right now is to manipulate the sort text of your best item so it gets sorted to the top of the list. There's no support for what we do in VS where the list comes up scrolled to a particular item.

@akshita31 The appropriate VS Code API has been implemented for us to support this (https://github.com/Microsoft/vscode/issues/35551#issuecomment-398100658). Let's chat about what we need to do to get this feature working.

Was this page helpful?
0 / 5 - 0 ratings