Skip to content

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Apr 27, 2022

In this PR, I'd like to address #11893.
The key concept is that the Idents are enriched with additional information where applicable.
@dsyme I must say this approach is growing on me.
I've addressed all the review remarks and would happily address any other feedback.

The build is green I believe, there is one error about [error]Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\_work\1\s\artifacts\log\Release which looks unrelated.

@nojaf nojaf changed the title LongIdentWithTrivia. SynLongIdent Apr 28, 2022
@nojaf nojaf requested a review from dsyme April 28, 2022 19:54
@nojaf nojaf marked this pull request as ready for review April 28, 2022 19:54
@nojaf nojaf closed this Apr 28, 2022
@nojaf nojaf reopened this Apr 28, 2022
@nojaf
Copy link
Contributor Author

nojaf commented May 2, 2022

This is ready for review and I've tested out these changes inside Fantomas.
Along with some other recent AST changes, Fantomas can be up to 2.5 times faster.
Having this information really makes a difference.
Looking forward to your reviews.

let mLparen = mkFileIndexRange m.FileIndex m.Start (mkPos m.StartLine (m.StartColumn + 1))
let mRparen = mkFileIndexRange m.FileIndex (mkPos m.EndLine (m.EndColumn - 1)) m.End
SynExpr.Paren(SynExpr.Ident($1), mLparen, Some mRparen, m) }
let ident, trivia = $1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing: We should gradually try to remove long chunks from pars.fsy and put them in ParseHelpers.fs. But this is by no means the worst of sins in that regard :)

@dsyme dsyme merged commit 2de4045 into dotnet:main May 2, 2022
@nojaf nojaf deleted the LongIdentWithTrivia branch May 5, 2022 07:02
charlesroddie pushed a commit to charlesroddie/fsharp that referenced this pull request May 2, 2023
* Refactor LongIdentWithDots to LongIdentWithTrivia.

* Start using IndentWithTrivia in SyntaxTree.

* Address aesthetic feedback.

* Refactored IdentWithTrivia and LongIdentWithTrivia to SynIdent and SynLongIdent.
Restored SynExpr.Ident.

* Capturing some additional IdentTrivia.OriginalNotation.

* SurfaceArea 🎉

* Update operator ident nodes in ServiceUntypedParse.fs.

* Fix remaining Visual Studio tests.

* Change the Ident of SynPat.Named to SynIdent to capture active patterns without parameters.

* Replace LongIdentWithDots function usage with SynLongIdent.

* Correct notation of prefix operators.
jaccarmac added a commit to jaccarmac/ShenSharp that referenced this pull request Nov 23, 2023
dotnet/fsharp#13057 is the PR in question; I suspect
I've done something wrong as there's a whole page of errors. However, the
errors don't have to do with mscorlib!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants