-
Notifications
You must be signed in to change notification settings - Fork 833
Make semicolons optional between attributes when on separate lines #18303
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
386664c
Make semicolons optional between attributes when on separate lines
edgarfgp d99c24c
Merge branch 'main' into multiple-attributes-no-semicolon
edgarfgp 1c66f66
more tests
edgarfgp 65a4286
Merge branch 'multiple-attributes-no-semicolon' of github.com:edgarfg…
edgarfgp 73f6fcb
follow the logic in LexFilter for sequential expressions
82d22c0
Merge branch 'main' into multiple-attributes-no-semicolon
edgarfgp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
3 changes: 3 additions & 0 deletions
3
tests/service/data/SyntaxTree/Attribute/MultipleAttributes01.fs
This file contains hidden or 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,3 @@ | ||
|
||
[<MyAttribute(foo ="bar"); MyAttribute(foo ="bar")>] | ||
do () |
53 changes: 53 additions & 0 deletions
53
tests/service/data/SyntaxTree/Attribute/MultipleAttributes01.fs.bsl
This file contains hidden or 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,53 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Attribute/MultipleAttributes01.fs", false, | ||
QualifiedNameOfFile MultipleAttributes01, [], [], | ||
[SynModuleOrNamespace | ||
([MultipleAttributes01], false, AnonModule, | ||
[Attributes | ||
([{ Attributes = | ||
[{ TypeName = SynLongIdent ([MyAttribute], [], [None]) | ||
ArgExpr = | ||
Paren | ||
(App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Equality], [], | ||
[Some (OriginalNotation "=")]), None, | ||
(2,18--2,19)), Ident foo, (2,14--2,19)), | ||
Const | ||
(String ("bar", Regular, (2,19--2,24)), | ||
(2,19--2,24)), (2,14--2,24)), (2,13--2,14), | ||
Some (2,24--2,25), (2,13--2,25)) | ||
Target = None | ||
AppliesToGetterAndSetter = false | ||
Range = (2,2--2,25) }; | ||
{ TypeName = SynLongIdent ([MyAttribute], [], [None]) | ||
ArgExpr = | ||
Paren | ||
(App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Equality], [], | ||
[Some (OriginalNotation "=")]), None, | ||
(2,43--2,44)), Ident foo, (2,39--2,44)), | ||
Const | ||
(String ("bar", Regular, (2,44--2,49)), | ||
(2,44--2,49)), (2,39--2,49)), (2,38--2,39), | ||
Some (2,49--2,50), (2,38--2,50)) | ||
Target = None | ||
AppliesToGetterAndSetter = false | ||
Range = (2,27--2,50) }] | ||
Range = (2,0--2,52) }], (2,0--2,52)); | ||
Expr (Do (Const (Unit, (3,3--3,5)), (3,0--3,5)), (3,0--3,5))], | ||
PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
4 changes: 4 additions & 0 deletions
4
tests/service/data/SyntaxTree/Attribute/MultipleAttributes02.fs
This file contains hidden or 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,4 @@ | ||
|
||
[<MyAttribute(foo ="bar") | ||
MyAttribute(foo ="bar")>] | ||
do () |
52 changes: 52 additions & 0 deletions
52
tests/service/data/SyntaxTree/Attribute/MultipleAttributes02.fs.bsl
This file contains hidden or 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,52 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Attribute/MultipleAttributes02.fs", false, | ||
QualifiedNameOfFile MultipleAttributes02, [], [], | ||
[SynModuleOrNamespace | ||
([MultipleAttributes02], false, AnonModule, | ||
[Attributes | ||
([{ Attributes = | ||
[{ TypeName = SynLongIdent ([MyAttribute], [], [None]) | ||
ArgExpr = | ||
Paren | ||
(App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Equality], [], | ||
[Some (OriginalNotation "=")]), None, | ||
(2,18--2,19)), Ident foo, (2,14--2,19)), | ||
Const | ||
(String ("bar", Regular, (2,19--2,24)), | ||
(2,19--2,24)), (2,14--2,24)), (2,13--2,14), | ||
Some (2,24--2,25), (2,13--2,25)) | ||
Target = None | ||
AppliesToGetterAndSetter = false | ||
Range = (2,2--2,25) }] | ||
Range = (2,0--2,25) }], (2,0--2,25)); | ||
Expr | ||
(App | ||
(Atomic, false, Ident MyAttribute, | ||
Paren | ||
(App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Equality], [], [Some (OriginalNotation "=")]), | ||
None, (3,18--3,19)), Ident foo, (3,14--3,19)), | ||
Const | ||
(String ("bar", Regular, (3,19--3,24)), (3,19--3,24)), | ||
(3,14--3,24)), (3,13--3,14), Some (3,24--3,25), | ||
(3,13--3,25)), (3,2--3,25)), (3,2--3,25))], PreXmlDocEmpty, | ||
[], None, (2,0--3,25), { LeadingKeyword = None })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,2)-(3,13) parse error Unexpected identifier in attribute list | ||
(3,25)-(3,27) parse error Unexpected symbol '>]' in implementation file |
4 changes: 4 additions & 0 deletions
4
tests/service/data/SyntaxTree/Attribute/MultipleAttributes03.fs
This file contains hidden or 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,4 @@ | ||
|
||
[<MyAttribute(foo ="bar"); | ||
MyAttribute(foo ="bar")>] | ||
do () |
53 changes: 53 additions & 0 deletions
53
tests/service/data/SyntaxTree/Attribute/MultipleAttributes03.fs.bsl
This file contains hidden or 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,53 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Attribute/MultipleAttributes03.fs", false, | ||
QualifiedNameOfFile MultipleAttributes03, [], [], | ||
[SynModuleOrNamespace | ||
([MultipleAttributes03], false, AnonModule, | ||
[Attributes | ||
([{ Attributes = | ||
[{ TypeName = SynLongIdent ([MyAttribute], [], [None]) | ||
ArgExpr = | ||
Paren | ||
(App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Equality], [], | ||
[Some (OriginalNotation "=")]), None, | ||
(2,18--2,19)), Ident foo, (2,14--2,19)), | ||
Const | ||
(String ("bar", Regular, (2,19--2,24)), | ||
(2,19--2,24)), (2,14--2,24)), (2,13--2,14), | ||
Some (2,24--2,25), (2,13--2,25)) | ||
Target = None | ||
AppliesToGetterAndSetter = false | ||
Range = (2,2--2,25) }; | ||
{ TypeName = SynLongIdent ([MyAttribute], [], [None]) | ||
ArgExpr = | ||
Paren | ||
(App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Equality], [], | ||
[Some (OriginalNotation "=")]), None, | ||
(3,18--3,19)), Ident foo, (3,14--3,19)), | ||
Const | ||
(String ("bar", Regular, (3,19--3,24)), | ||
(3,19--3,24)), (3,14--3,24)), (3,13--3,14), | ||
Some (3,24--3,25), (3,13--3,25)) | ||
Target = None | ||
AppliesToGetterAndSetter = false | ||
Range = (3,2--3,25) }] | ||
Range = (2,0--3,27) }], (2,0--3,27)); | ||
Expr (Do (Const (Unit, (4,3--4,5)), (4,0--4,5)), (4,0--4,5))], | ||
PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth having a test where the second one is not indented far enough? Would it be considered offsides? What about a mixture of semicolons and newlines?