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

Fantomas does not support extended interpolated strings #3012

Closed
DedSec256 opened this issue Dec 8, 2023 · 4 comments · Fixed by #3052
Closed

Fantomas does not support extended interpolated strings #3012

DedSec256 opened this issue Dec 8, 2023 · 4 comments · Fixed by #3052

Comments

@DedSec256
Copy link
Contributor

Issue created from fantomas-online

Code

$$$"""{{{5}}}"""

Result

$$$"""{{{5}"""

Problem description

Fantomas eats braces

image

Options

Fantomas main branch at 2023-12-06T16:47:58Z - 0f8ee23

Default Fantomas configuration

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

@nojaf
Copy link
Contributor

nojaf commented Dec 8, 2023

Thanks for the report Alex!
We'll take a look at it in the coming days.

@nojaf
Copy link
Contributor

nojaf commented Dec 11, 2023

So, this is a lexer problem, reported dotnet/fsharp#16418.

@josh-degraw
Copy link
Contributor

While we wait for the compiler to fix the range issue here, would it be feasible to calculate the correct range based on the source text & e.g. taking the number of $ and just generating our own, more correct range that way? Or would you expect that to be too error prone? Depending on how long we'll need to wait for that fix, it may be worth just monkey-patching this in the meantime. Otherwise I'd be happy to take a stab at trying to fix it in the lexer, though I worry I may be fighting an uphill battle if you and other core contributors already took a stab and couldn't figure it out 😅

@nojaf
Copy link
Contributor

nojaf commented Feb 5, 2024

You will wait forever if you expect someone else to fix the compiler. The team isn't going to pick this up, so I would suggest you take a stab at fixing this problem in the lexer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants