Roslyn: C# Auto-completion behavior with arrays

Created on 24 Jan 2018  路  3Comments  路  Source: dotnet/roslyn

Issue filled on behalf of Adomas Griskelis from Unity3D QA. cc @jbevain

Please have a look at the attached super simple and self-contained repro project:
AutoCompleteRepro.zip

Version Used:
VS 2017 Entreprise 15.5.4

Steps to Reproduce:

  1. Use the attached repro (pure C# project, referencing two included Unity3D assemblies)
  2. Open Program.cs, go to line 24
  3. Type Transform[] t = new Trans
  4. Press "["

Expected Behavior:
Should auto-complete to Transform[] t = new Transform[]

Actual Behavior:
No auto-complete.

If you retry with the following (actual class and not an array), it will work as expected:
Type Transform t = new Trans
Press "("
And you will get the expected Transform t = new Transform()

Area-IDE Bug Resolution-Fixed

All 3 comments

Thanks for reporting this. Does seem to be an issue.
In the array case, the completion is soft-selected and a suggestion mode is engaged (as if you'd want to type a never-seen word in that location), whereas in the constructor case it is hard-selected.

image

image

Fix is ready for review.

Thanks Julien

Was this page helpful?
0 / 5 - 0 ratings