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

When field expression is on a new line the . is marked as a number #23

Closed
ckipp01 opened this issue Mar 24, 2021 · 1 comment
Closed

Comments

@ckipp01
Copy link
Collaborator

ckipp01 commented Mar 24, 2021

Alright, given the following snippet, the . will actually be marked as a number.

val myList = List(1, 2, 3)

myList
	.map(_ * 2) // <- . here is marked as a number

A corpus for this bug would look like this:

===============================
Chained expressions 
===============================

def main() {
  val myList = List(1, 2, 3)

  myList.map(_ * 2)

  myList
    .map(_ * 2)
}

---

(compilation_unit
  (function_definition
    (identifier)
    (parameters)
    (block
      (val_definition (identifier) (call_expression
        (identifier)
        (arguments (number) (number) (number))))
      (call_expression
        (field_expression (identifier) (identifier))
        (arguments (infix_expression
          (identifier) (operator_identifier) (number))))
      (call_expression
        (field_expression (identifier) (identifier))
        (arguments (infix_expression
          (identifier) (operator_identifier) (number)))))))

You can see what it actually does here:

Screenshot 2021-03-24 at 21 00 27

I think this is actually a automatic semi insertion issue where we don't account that the .call can be on a new line.

stevanmilic added a commit to stevanmilic/tree-sitter-scala that referenced this issue Aug 31, 2021
stevanmilic added a commit to stevanmilic/tree-sitter-scala that referenced this issue Aug 31, 2021
@stevanmilic
Copy link
Contributor

@maxbrunsfeld I think we can close this one.

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