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

Add sway to nvim-treesitter and deprecate syntax file #11

Open
sdankel opened this issue Feb 29, 2024 · 11 comments
Open

Add sway to nvim-treesitter and deprecate syntax file #11

sdankel opened this issue Feb 29, 2024 · 11 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sdankel
Copy link
Member

sdankel commented Feb 29, 2024

We should deprecate the syntax highlighting file in this repo and instead add sway to nvim-treesitter. That way we only need to keep the tree-sitter-sway grammar updated.

@sdankel sdankel added enhancement New feature or request good first issue Good for newcomers labels Feb 29, 2024
@yehia67
Copy link

yehia67 commented Mar 2, 2024

Hi @sdankel!
Can I help?

@sdankel
Copy link
Member Author

sdankel commented Mar 2, 2024

@yehia67 Please do! The package is published at https://www.npmjs.com/package/tree-sitter-sway.

@yehia67
Copy link

yehia67 commented Mar 2, 2024

On it 🏃
My solution:

  1. Delete the syntax/sway.vim file
  2. Create init.vim file.
  3. Add nvim-treesitter to the init.vim file
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}

Wdyt @sdankel ?

@sdankel
Copy link
Member Author

sdankel commented Mar 2, 2024

We want to make sway a supported language in nvim-treesitter. See https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md

@yehia67
Copy link

yehia67 commented Mar 2, 2024

Yeah, You successfully supported it here tree-sitter-sway.
So I need to find a way to install tree-sitter-sway syntax on the syntax/sway.vim instead of this highlighting syntax block, yes? (Just to confirm if I understood the requirements 🙏)

@sdankel
Copy link
Member Author

sdankel commented Mar 2, 2024

The flow for the user would be that they simply install nvim-treesitter, and then run :TSInstall sway to install the sway syntax. They would no longer need to copy a syntax/sway.vim from this repo.

To do this, we'll need to submit a PR to that repo to add the tree-sitter-sway parser. Here are example PRs:
https://github.com/nvim-treesitter/nvim-treesitter/pulls?q=is%3Apr+add+label%3A%22new+language%22

@yehia67
Copy link

yehia67 commented Mar 3, 2024

Ah, that makes perfect sense. Sorry for the confusion. I've created a draft pull request (PR) on my forked repository, which you can find here. Please let me know if there's anything else you need me to add; I would be happy to do so.

Additionally, I've designated you as the maintainer of the language in this section of the README. If you would prefer that I tag someone else or mention myself instead, please let me know.

@sdankel
Copy link
Member Author

sdankel commented Mar 4, 2024

The PR looks good to me, and thanks for adding me as the maintainer. Once it's merged and we can verify it, the next steps will be removing the syntaxes file from this repo and updating the README. Thank you for contributing!

@yehia67
Copy link

yehia67 commented Mar 4, 2024

Thank you for your support 🙏
I created the PR👇
nvim-treesitter/nvim-treesitter#6251

@yehia67
Copy link

yehia67 commented Mar 9, 2024

Hi @sdankel,
The parser compiler for the queries is giving some "Invalid capture" errors, I fixed some of the errors with his commit I am not 100% sure about my fixes tbh as I just copied from other projects, May you please point me to any resource for fixing the parser issue and I can work on it

@yehia67
Copy link

yehia67 commented Mar 10, 2024

The maintainer of transmitter told me how to fix the queries, By using syntaxes of the Contribue.md I will check and keep you updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants