Fsharp: Wrong completions for "member val x = 0 with get,"

Created on 11 Apr 2017  路  4Comments  路  Source: dotnet/fsharp

Repro steps

Type in code:

type Foo() = 
    member val a = 12 with get

If you enter "," after the completion tooltip shows, code gets expanded to:

type Foo() = 
    member val a = 12 with Array.get,

The completion tooltip is shown here:

image

Expected behavior

When pressing ",", it should just leave "get" there as it's legal syntax. Current workaround is wait for the tooltip, dismiss it with ESC and then type in the ","

Area-IDE Language Service Severity-Medium bug

Most helpful comment

I think it should commit on Enter and Tab only.

All 4 comments

I'm sure there is no AST available for such incomplete code. In such case we have no choice but suggest all unqualified symbols. We could use the lexer to try to parse such code on ourselves, but it's complex and error prone.

The word I typed ("get") is already available in the suggested completions (as shown in the screenshot), it's just not the first completion. The problem is in the UI flow - if I typed something and press "," (not tab or whatever), it should be satisfied with that completion and leave the code as is.

@vivainio and seems that fix is similar. If @vasily-kirichenko does not mind to add , to noCommitOnSpaceRules you could PR that fix your case.

I think it should commit on Enter and Tab only.

Was this page helpful?
0 / 5 - 0 ratings