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

Feat: support commands with spaces #160

Closed
wants to merge 5 commits into from
Closed

Conversation

mrdgo
Copy link
Contributor

@mrdgo mrdgo commented Nov 28, 2024

Try what we discussed in this PR.

@blindFS
Copy link
Contributor

blindFS commented Nov 28, 2024

How about this way ?

Changing the identifier is dangerous since it's used in other places.

@fdncred
Copy link
Collaborator

fdncred commented Nov 29, 2024

Looks the same to me, highlights and syntax tree. But maybe I'm doing something wrong. I'm not sure how to tell if I'm using the latest changes. My nvim configuration for tree-sitter-nu points to my local tree-sitter-nu repo.
image

@blindFS
Copy link
Contributor

blindFS commented Nov 29, 2024

Sorry, I wasn't aware that the whole idea of long regex here is to sync with those generated for vscode.

But I think we have easier way to generate our own copy, such as
scope commands | get name | where {' ' in $in} o> list

And then we can read it from grammar.js to do whatever we want.

@mrdgo
Copy link
Contributor Author

mrdgo commented Nov 29, 2024

  1. this thing is not working yet, just a heads up that I pursue the regex idea
  2. yes, @blindFS this is about reusing the regex that is automatically created for vscode
  3. If we decide to do this, I'd love to build some automation to automatically sync the regex from the other repo. But one thing after the other.

@mrdgo
Copy link
Contributor Author

mrdgo commented Nov 29, 2024

Looks the same to me, highlights and syntax tree. But maybe I'm doing something wrong. I'm not sure how to tell if I'm using the latest changes. My nvim configuration for tree-sitter-nu points to my local tree-sitter-nu repo. image

yes, there is another problem regarding parsers: you have to fork [1] nvim-treesitter and set nu's config to your local checkout. Maybe even update the lockfile to the currently checked out commit, but I am not 100% sure about that.

Edit: [1] or at least locally checkout

@mrdgo mrdgo closed this Nov 29, 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

Successfully merging this pull request may close these issues.

3 participants