Skip to content

Advanced Scala support #437

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

Open
5 tasks
SCdF opened this issue Jan 9, 2022 · 0 comments
Open
5 tasks

Advanced Scala support #437

SCdF opened this issue Jan 9, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@SCdF
Copy link
Contributor

SCdF commented Jan 9, 2022

The new scala implementation is basic and is missing some implementations for certain Cursorless keywords that I punted off to a later time:

  • list. This is weird for Scala because there isn't completely language-native syntax for lists. For lists generally you are just instantiating an object, e.g. val list = List(1,2,3), though there is a "fancy" list style: val foo = 1 :: (2 :: (3 :: Nil)) // List(1,2,3). Note that we can't just look for node.name === "List", because there are other ways to construct a list, and List could be qualified. See Scala support #399 (comment) for a bit more info
  • map. Similar to above, maps are just object instantiations, e.g. val map = Map("#000" -> "Black", "#F00" -> "Red"). The -> syntax is also just sugar for an infix expression that creates a tuple, e.g. "#000" -> "Black" is the same as "#000".->("Black") whic both generates ("#000", "Black").
  • collectionItem, collectionKey, and value (as used for RHS of a map item). See above, infix_expression, key on left, item on right, operator = "->". See Scala support #399 (comment) for a bit more info
  • regularExpression. "foo".r, value of type field_expression, value of type string, field of type identifier = "r"
  • attribute, xmlElement, xmlStartTag, xmlEndTag, xmlBothTags. All XMLey stuff which is in Scala 2x, but deprecated in 3.x, and isn't supported well by the current tree sitter anyway. There may be certain implementations / libraries that everyone uses, not sure yet.

Also, note that an advanced scala feature that cursorless doesn't support is pattern matching, see: #434

@pokey pokey added the enhancement New feature or request label Jan 10, 2022
@pokey pokey added the help wanted Extra attention is needed label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants