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

Underscores or special names with backticks are problematic with auto-completion #3406

Closed
abelbraaksma opened this issue Jul 30, 2017 · 4 comments
Labels
Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@abelbraaksma
Copy link
Contributor

When you have a name of an identifier, field etc that has an underscore in it, auto-completion does not work as expected:

xanbdgvbeq

Special names (or whatever the term is for escaped names like these):

t9lnaddbph

Names in backticks are especially useful when writing unit tests, and auto-complete can help tremendously with those readable, but awkward-to-type descriptive test-case names.

Repro steps

  1. Have an identifier with an underscore (fieldname, class name, let binding etc)
  2. Start typing until after the underscore, and hit Ctrl-space
  3. Instead of automatic completion, you will get a dropdown list of one item
  4. Selecting it will add it to the already typed partial name, instead of completing it.

Similar things happen with escaped names, the backticks are sometimes even doubled.

Expected behavior

Whether or not there's an underscore in the name, auto-completion should work the same way.

Actual behavior

As described above and in the vidcap. Ctrl-space doesn't work properly when names have underscores in them or when they are specially escaped with double backticks.

Known workarounds

None. Or don't use autocomplete when names are created with backticks, or have underscores.

Related information

  • Visual Studio 2017 any version (VS2015 wasn't much better though)
  • F# 4.4.0.0 and F# 4.4.1.0 (didn't check older versions)
  • any runtime or Core
@dsyme dsyme added Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels Aug 5, 2017
@dsyme
Copy link
Contributor

dsyme commented Aug 5, 2017

@abelbraaksma Thanks for the bug report!

@cartermp cartermp added this to the VS 2017 Updates milestone Aug 30, 2017
@cartermp cartermp modified the milestones: VS 2017 Updates, 16.0 Jun 20, 2018
@ricksladkey
Copy link

ricksladkey commented Jun 28, 2018

A specific case of this general bug report occurs for identifiers that begin with an underscore and contain no further underscores. In that case, typing the initial underscore brings up a very long list of seemingly every function available:

image

Typing further characters of the identifier does eventually find it:

image

but hitting <Tab> replaces the characters typed so far and appends an extra leading underscore:

image

@cartermp
Copy link
Contributor

This should be addressed by #10500

@abelbraaksma
Copy link
Contributor Author

Wonderful work, thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
None yet
Development

No branches or pull requests

4 participants