-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: add query for nushell #438
Conversation
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.
Could you add a test file to this directory https://github.com/stevearc/aerial.nvim/tree/master/tests/treesitter and update the snapshots with make update_snapshots and confirm that the symbols look correct?
Is there a way to provide a literal
@name
?
No, but you can add all kinds of custom behavior via an extension in extensions.lua. Would that serve your purpose?
Is there a way to provide custom HL?
No, because all the highlight groups have to be defined and well known so that users can supply their own overrides. This isn't a concept that maps to other languages, so there's nothing in the current highlight groups that would support it.
Nice! Yep I realized right after submitting the PR and by a quick look couldn't tell how it worked, I'll do it now! I'll check extensions I wasn't aware of this mechanism, but like that it definitely seems like what I was after! |
I made the update, strangely locally: groovy, julia, lua, ruby, ruby_singleton & swift returned a different "snapshot" Some notes on potential future improvements:
|
Yep playing around with extensions there is surely and nifty way to solve all the cases I mentioned but that's definitely better in a dedicated PR |
Would
There are a couple of languages that support To get that test to pass, it looks like you'll need to add a filetype rule to the test setup aerial.nvim/tests/minimal_init.lua Lines 7 to 15 in b886c4b
|
Yep I will change it, my logic was that
Interesting! I will need more experience with queries (and live experiment with it) to grasp what's possible as like that I don't fully understand all the syntax used |
Looks good, thanks for the PR! |
This adds basic symbol support for nushell
outliner-queries-nushell.mp4
I'm also curious about two things:
@name
? For instance I wanted to collect nushell'sexport-env
that don't have name, (I tried(#set! "name" "MyName")
but it still returns Anonymous):export def
andexport --env def
, the later is allowed to modify the caller's environment variables