Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Scala support #399
Scala support #399
Changes from 30 commits
c329560
26ac29c
08b602d
f24eb6c
d83fcdf
4d580a8
04ae183
7b9d03e
c3bf94a
22b9d50
2ae25db
8f032d5
c738eee
6c99cca
54b59fa
12e69bf
b56c559
0bfcfc1
5f6f9ce
065d064
f4b8b8c
db2f0b6
4fa8085
f47a418
3dee158
491dff6
7df7ac5
f35bfb8
8ac2acb
f83f8ea
1f53671
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we hard-code them? Not saying you need to do it in this PR, but this comment implies that we can't do it, whereas I thought we were just punting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are just classes, not a syntax / language construct like
[]
in JS or whatever. Scala comes with a bunch of them but people will also use other random libraries as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Almost feels like we need LSP support for this one? Let's just call it out in the missing language features issue and discuss there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to support
"AL" -> "Alabama"
expressions? For these, "key" would be"AL"
, "value" would be"Alabama"
, and "item" would be the pair.collectionItem
is also supposed to include list elements, tho since those are just function calls you would basically use an argument matcher and check that the parent is aList
. For fancy stuff like this, you might check out the Clojure implementation. That one took tons of custom matchers to get workingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd have to write something custom for that:
("AL" -> "Alabama")
comes out as:So I'd need to take the left or right of an operator, when that operator === '->'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that looks like it should be doable, but a bit custom. I think I'd be ok with shipping without it for now but filing an issue to capture all the missing things. I believe cursorless will generate a helpful message so that users can just see it hasn't been implemented yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw I'd capture your example here into the follow-up issue for remaining scala features; it's quite helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't scala support inline html elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does (well, XML), but it's deprecated and will be dropped in 3.x, to be replaced with string formatting (I think, I don't know much about 3.x). I'm not sure how much people use it. The tree sitter implemention also errors with it.