Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7b7776e

Browse files
vasily-kirichenkoTIHan
authored andcommitted
no completion on name of value and function declaration (#5083)
1 parent0e851c6 commit7b7776e

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

‎src/fsharp/service/ServiceUntypedParse.fs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,9 @@ module UntypedParseImpl =
12481248
|_-> defaultTraverse synBinding
12491249

12501250
match headPatwith
1251+
| SynPat.LongIdent(longDotId= lidwd)when rangeContainsPos lidwd.Range pos->
1252+
// let fo|o x = ()
1253+
Some CompletionContext.Invalid
12511254
| SynPat.LongIdent(_,_,_,ctorArgs,_,_)->
12521255
match ctorArgswith
12531256
| SynConstructorArgs.Pats(pats)->
@@ -1264,6 +1267,9 @@ module UntypedParseImpl =
12641267
|_-> visitParam pat
12651268
)
12661269
|_-> defaultTraverse synBinding
1270+
| SynPat.Named(range= range)when rangeContainsPos range pos->
1271+
// let fo|o = 1
1272+
Some CompletionContext.Invalid
12671273
|_-> defaultTraverse synBinding
12681274

12691275
member__.VisitHashDirective(range)=

‎vsintegration/tests/UnitTests/CompletionProviderTests.fs‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,37 @@ type T
457457
VerifyNoCompletionList(fileContents,"type T")
458458

459459
[<Test>]
460-
let``No completion onfunctionnameat declaration site``()=
460+
let``No completion on nameof unfinished function declaration``()=
461461
letfileContents="""
462462
let f
463463
464464
"""
465465
VerifyNoCompletionList(fileContents,"let f")
466466

467+
[<Test>]
468+
let``No completion on name of value declaration``()=
469+
letfileContents="""
470+
let xyz = 1
471+
472+
"""
473+
VerifyNoCompletionList(fileContents,"let xy")
474+
475+
[<Test>]
476+
let``No completion on name of function declaration``()=
477+
letfileContents="""
478+
let foo x = 1
479+
480+
"""
481+
VerifyNoCompletionList(fileContents,"let fo")
482+
483+
[<Test>]
484+
let``No completion on name of tupled function declaration``()=
485+
letfileContents="""
486+
let foo (x, y) = 1
487+
488+
"""
489+
VerifyNoCompletionList(fileContents,"let fo")
490+
467491
[<Test>]
468492
let``No completion on member name at declaration site``()=
469493
letfileContents="""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp