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

ERROR on indented expressions that aren't really indented #433

Closed
KaranAhlawat opened this issue Oct 19, 2024 · 5 comments
Closed

ERROR on indented expressions that aren't really indented #433

KaranAhlawat opened this issue Oct 19, 2024 · 5 comments

Comments

@KaranAhlawat
Copy link
Contributor

Commit of tree-sitter-scala you tested this on

v0.23.2

A code sample showing the error

def hi =
    e match
    case 1 => "Ok"
    case _ => "Also Ok"

Show the error node

(function_definition name: def (identifier) body: =
 (indented_cases
  (ERROR (identifier) match)
  (case_clause case pattern: (integer_literal) body: => (string))
  (case_clause case
   pattern: (wildcard _)
   body: => (string))))

What do you expect the tree to look like

(function_definition name: def (identifier) body: =
 (indented_block
  (match_expression value: (identifier) match
   body: 
    (indented_cases
     (case_clause case pattern: (integer_literal) body: => (string))
     (case_clause case
      pattern: (wildcard _)
      body: => (string))))))

Where are you experiencing this error?

Emacs

@KaranAhlawat
Copy link
Contributor Author

Not really sure if this is an error or expected behavior, since technically the cases aren't indented in relation to the match expression, but this is valid Scala code

@eed3si9n
Copy link
Collaborator

Thanks for the report! If it's a valid Scala code, then it's tree-sitter-scala's bug.

@SethTisue
Copy link

SethTisue commented Oct 23, 2024

I kind of hate that it's valid Scala 3 code, but it is.

@KaranAhlawat
Copy link
Contributor Author

Add me to the camp 😄

@susliko
Copy link
Collaborator

susliko commented Nov 21, 2024

Looks like a duplicate of #264

@eed3si9n eed3si9n closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 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

No branches or pull requests

4 participants