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

Bug: Slice parameters are tokenized as part of the function itself #182

Open
Duckapple opened this issue Jan 30, 2023 · 2 comments
Open

Comments

@Duckapple
Copy link

Describe the bug
Slice parameters are tokenized as part of the function itself

To Reproduce
Steps to reproduce the behaviour:

  1. Insert the following test into a text file (the other numbers in the screenshot are to demonstrate the color they should have):
let test1 (word: char list) = List.rev word[0 .. 1]

Expected behaviour
I would expect the numbers to still be highlighted as numbers, though I think parsing them as expressions is the correct move.

Screenshots
image

Environment (please complete the following information):

  • OS: Linux (6.1.6-arch1-1)
  • Ionide version: v7.4.0
  • VSCode version: 1.74.3
  • dotnet SDK version: 7.0.102
  • mono / .Net Framework version: (didn't know how to check / probably not relevant?)

Additional context
I would fix this myself, but I don't have the expertise with TextMate grammars I'd probably need.
It also seems like GitHub gets this part right with its grammar.

@MangelMaxime
Copy link
Contributor

Hello,

Looking at the inspector I think the problem is not in the fsgrammar but in the semantic highlighter. The code responsible for the semantic highlight is hosted in https://github.com/fsharp/FsAutoComplete and can sometimes need a fix in https://github.com/dotnet/fsharp.

image

@baronfel Am I right to say the problem is in the semantic highlighter ?

@baronfel
Copy link

yeah, that's right - anything in the semantic token type is FSAC, textmate tokens are this repo.

FSAC is pretty much a straight pass-through of the semantic highlighting from the FSharp.Compiler.Service library - so it's likely that any real fix would end up in dotnet/fsharp eventually.

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

No branches or pull requests

3 participants