forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't show completions on nested module identifier (dotnet#13089)
* Don't show completions on nested module identifier * Recover from incomplete module declaration * Blah * Fixes * Fix parser * Fix parser * Format * Add AST tests * Revert LexFilter changes * Readd LexFilter * Update baselines * Format * Update baselines --------- Co-authored-by: Tomas Grosup <[email protected]>
- Loading branch information
Showing
12 changed files
with
152 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
|
||
neg41.fs(3,1,3,5): parse error FS0010: Unexpected start of structured construct in definition. Expected '=' or other token. | ||
|
||
neg41.fs(4,1,4,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file | ||
neg41.fs(3,1,3,5): parse error FS0010: Unexpected keyword 'type' in definition. Expected '=' or other token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
|
||
neg42.fsi(3,1,3,5): parse error FS0010: Unexpected start of structured construct in signature file. Expected ':', '=' or other token. | ||
|
||
neg42.fsi(4,1,4,1): parse error FS0010: Incomplete structured construct at or before this point in signature file | ||
neg42.fsi(3,1,3,5): parse error FS0010: Unexpected keyword 'type' in signature file. Expected ':', '=' or other token. |
1 change: 1 addition & 0 deletions
1
tests/service/data/SyntaxTree/ModuleOrNamespace/EmptyModuleOrNamespaceShouldBePresent.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module A.B.C |
10 changes: 10 additions & 0 deletions
10
tests/service/data/SyntaxTree/ModuleOrNamespace/EmptyModuleOrNamespaceShouldBePresent.fs.bsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/EmptyModuleOrNamespaceShouldBePresent.fs", false, | ||
QualifiedNameOfFile A.B.C, [], [], | ||
[SynModuleOrNamespace | ||
([A; B; C], false, NamedModule, [], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--1,12), { LeadingKeyword = Module (1,0--1,6) })], (true, false), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
5 changes: 5 additions & 0 deletions
5
tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleShouldBePresent.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module A.B | ||
|
||
module C | ||
|
||
let a = () |
29 changes: 29 additions & 0 deletions
29
tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleShouldBePresent.fs.bsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/NestedModule/IncompleteNestedModuleShouldBePresent.fs", false, | ||
QualifiedNameOfFile A.B, [], [], | ||
[SynModuleOrNamespace | ||
([A; B], false, NamedModule, | ||
[NestedModule | ||
(SynComponentInfo | ||
([], None, [], [C], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, | ||
None, (3,0--3,8)), false, [], false, (3,0--3,8), | ||
{ ModuleKeyword = Some (3,0--3,6) | ||
EqualsRange = None }); | ||
Let | ||
(false, | ||
[SynBinding | ||
(None, Normal, false, false, [], | ||
PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
SynValData | ||
(None, SynValInfo ([], SynArgInfo ([], false, None)), None), | ||
Named (SynIdent (a, None), false, None, (5,4--5,5)), None, | ||
Const (Unit, (5,8--5,10)), (5,4--5,5), Yes (5,0--5,10), | ||
{ LeadingKeyword = Let (5,0--5,3) | ||
InlineKeyword = None | ||
EqualsRange = Some (5,6--5,7) })], (5,0--5,10))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--5,10), { LeadingKeyword = Module (1,0--1,6) })], (true, false), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
5 changes: 5 additions & 0 deletions
5
tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module A.B | ||
|
||
module C | ||
|
||
val a: unit |
27 changes: 27 additions & 0 deletions
27
tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
SigFile | ||
(ParsedSigFileInput | ||
("/root/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi", | ||
QualifiedNameOfFile A.B, [], [], | ||
[SynModuleOrNamespaceSig | ||
([A; B], false, NamedModule, | ||
[NestedModule | ||
(SynComponentInfo | ||
([], None, [], [C], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, | ||
None, (3,0--3,8)), false, [], (3,0--3,8), | ||
{ ModuleKeyword = Some (3,0--3,6) | ||
EqualsRange = None }); | ||
Val | ||
(SynValSig | ||
([], SynIdent (a, None), SynValTyparDecls (None, true), | ||
LongIdent (SynLongIdent ([unit], [], [None])), | ||
SynValInfo ([], SynArgInfo ([], false, None)), false, false, | ||
PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), None, | ||
None, (5,0--5,11), { LeadingKeyword = Val (5,0--5,3) | ||
InlineKeyword = None | ||
WithKeyword = None | ||
EqualsRange = None }), (5,0--5,11))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--5,11), { LeadingKeyword = Module (1,0--1,6) })], | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters