Skip to content
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

Improved F# parsing, support for multi-line comments #2301

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

Thorium
Copy link
Contributor

@Thorium Thorium commented Apr 28, 2024

Effort to improve current initial F# parsing, support for multi-line comments.
ParseLineCJava was used as base for ParseLineFSharp.

@sdottaka sdottaka merged commit 042f957 into WinMerge:master Apr 29, 2024
3 checks passed
@sdottaka
Copy link
Member

Thank you for the PR. However, block comments were not colored correctly, so I fixed it in commit 131a7e2.
Also, as shown in the image below, it seems that there are improvements to be made, such as not supporting F#'s raw string literal, so I would appreciate it if you could fix it when you have time.

image

@Thorium
Copy link
Contributor Author

Thorium commented Apr 29, 2024

I'm often using WinMerge to compare F# code files, IMO WinMerge does the 2-way comparison better than e.g. KDiff. I think this kind of basic F# syntax highlighting is very nice addition already.

But I think it's not worth of implementing full F# parser independently: Lot of F# development relies on tooltips (check e.g. here), the compiler telling you the types. That is typically done in editors by referencing F# compiler service which parses the F# for you. As general IDE, I don't think WinMerge will want this dependency, people will probably not use WinMerge as primary F# editor anyway.

Rather than creating all parsers separately, in general one possible better long-term future addition for WinMerge
could be supporting tree-sitter. That would make it easier to parse any programming language and having big community effort behind (and there is also tree-sitter for F#).

@Thorium
Copy link
Contributor Author

Thorium commented Apr 29, 2024

I tried to add raw string literal support Thorium@1cf5458 but it's not working... I have to say my C++ is a little bit rotten as I've not used it in last 25 years.

@sdottaka sdottaka added this to the v2.16.41 milestone Apr 29, 2024
@Thorium Thorium mentioned this pull request Apr 30, 2024
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.

None yet

2 participants