-
Notifications
You must be signed in to change notification settings - Fork 75
[Testing] FSharp.Compiler.Service 43.10 #770
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
Draft
Numpsy
wants to merge
2
commits into
fsprojects:master
Choose a base branch
from
Numpsy:fcs10
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -237,7 +237,7 @@ module Ast = | |
| | SynPat.Attrib(pattern, _, _) | ||
| | SynPat.Paren(pattern, _) -> add <| Pattern pattern | ||
| | SynPat.Named(_) -> () | ||
| | SynPat.Record(patternsAndIdentifier, _) -> List.revIter (fun (_, _, pattern) -> pattern |> Pattern |> add) patternsAndIdentifier | ||
| | SynPat.Record(patPairFieldList, _) -> patPairFieldList |> List.revIter(_.Pattern >> Pattern >> add) | ||
| | SynPat.Const(_) | ||
| | SynPat.Wild(_) | ||
| | SynPat.FromParseError(_) | ||
|
|
@@ -256,6 +256,8 @@ module Ast = | |
| add <| Pattern lhs | ||
| add <| Pattern rhs | ||
|
|
||
|
|
||
| // fsharplint:disable FL0025 | ||
| let inline private expressionChildren (node: SynExpr) (add: AstNode -> unit) = | ||
| let addMany = List.iter add | ||
|
|
||
|
|
@@ -303,13 +305,6 @@ module Ast = | |
| | SynExpr.DotNamedIndexedPropertySet(expression, _, expression1, expression2, _) | ||
| | SynExpr.For(_, _, _, _, expression, _, expression1, expression2, _) -> | ||
| addMany [Expression expression2; Expression expression1; Expression expression] | ||
| | SynExpr.LetOrUseBang(_, _, _, pattern, rightHandSide, andBangs, leftHandSide, _, _) -> | ||
| addMany [Expression rightHandSide; Expression leftHandSide] | ||
| // TODO: is the the correct way to handle the new `and!` syntax? | ||
| List.iter (fun (SynExprAndBang(_, _, _, pattern, body, _, _)) -> | ||
| addMany [Expression body; Pattern pattern] | ||
| ) andBangs | ||
| add <| Pattern pattern | ||
| | SynExpr.ForEach(_, _, _, _, pattern, expression, expression1, _) -> | ||
| addMany [Expression expression1; Expression expression; Pattern pattern] | ||
| | SynExpr.MatchLambda(_, _, matchClauses, _, _) -> | ||
|
|
@@ -327,9 +322,22 @@ module Ast = | |
| | SynExpr.Upcast(expression, synType, _) | ||
| | SynExpr.Downcast(expression, synType, _) -> | ||
| addMany [Type synType; Expression expression] | ||
| | SynExpr.LetOrUse(_, _, bindings, expression, _, _) -> | ||
| // regular let or use | ||
| | SynExpr.LetOrUse(_, _, _, false, bindings, expression, _, _) -> | ||
| add <| Expression expression | ||
| List.revIter (Binding >> add) bindings | ||
| // let! or use! | ||
| | SynExpr.LetOrUse(_, _, _, true, bindings, leftHandSide, _, _) -> | ||
| match bindings with | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change based on the FCS release notes at https://github.com/dotnet/fsharp/blob/c1b13e3d4542d1de7439b34de00384934365aeb9/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md?plain=1#L63 |
||
| | firstBinding :: andBangs -> | ||
| match firstBinding with | ||
| | SynBinding(headPat = pattern; expr = rightHandSide) -> | ||
| addMany [Expression rightHandSide; Expression leftHandSide] | ||
| List.iter (fun (SynBinding(headPat = pattern; expr = body)) -> | ||
| addMany [Expression body; Pattern pattern] | ||
| ) andBangs | ||
| add <| Pattern pattern | ||
| | [] -> () // error case. @@TODO@@ any other handling needed here? | ||
| | SynExpr.Ident(ident) -> add <| Identifier([ident.idText], ident.idRange) | ||
| | SynExpr.LongIdent(_, SynLongIdent(ident, _, _), _, range) -> | ||
| add <| Identifier(List.map (fun (identifier: Ident) -> identifier.idText) ident, range) | ||
|
|
@@ -375,6 +383,8 @@ module Ast = | |
| expr2 |> Option.iter (Expression >> add) | ||
| | _ -> () | ||
|
|
||
| // fsharplint:enable | ||
|
|
||
| let inline private typeSimpleRepresentationChildren node add = | ||
| match node with | ||
| | SynTypeDefnSimpleRepr.Union(_, unionCases, _) -> List.revIter (UnionCase >> add) unionCases | ||
|
|
@@ -414,7 +424,7 @@ module Ast = | |
| | SynArgPats.Pats(patterns) -> | ||
| patterns |> List.revIter (Pattern >> add) | ||
| | SynArgPats.NamePatPairs(namePatterns, _, _) -> | ||
| namePatterns |> List.revIter (fun (_, _, pattern) -> pattern |> Pattern |> add) | ||
| namePatterns |> List.revIter (_.Pattern >> Pattern >> add) | ||
|
|
||
| let inline private typeRepresentationChildren node add = | ||
| match node with | ||
|
|
@@ -471,7 +481,7 @@ module Ast = | |
| | Else(expression) | ||
| | Expression(expression) -> expressionChildren expression add | ||
|
|
||
| | File(ParsedInput.ImplFile(ParsedImplFileInput(_, _, _, _, _, moduleOrNamespaces, _, _, _))) -> | ||
| | File(ParsedInput.ImplFile(ParsedImplFileInput(contents = moduleOrNamespaces))) -> | ||
| moduleOrNamespaces |> List.revIter (ModuleOrNamespace >> add) | ||
|
|
||
| | UnionCase(unionCase) -> unionCaseChildren unionCase add | ||
|
|
||
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
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
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
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
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
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
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
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
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
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
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
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.
temporarily turned this off as the self check was failing because this function is now 105 lines long and selfcheck wants if to be less than 100