FuelLabs / sway.vim

Vim syntax file for Sway.
Apache License 2.0
18 stars 11 forks source link

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

Open sdankel opened 6 months ago

sdankel commented 6 months ago

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.

yehia67 commented 5 months ago

Hi @sdankel! Can I help?

sdankel commented 5 months ago

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

yehia67 commented 5 months ago

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 commented 5 months ago

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

yehia67 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

Thank you for your support 🙏
I created the PR👇 https://github.com/nvim-treesitter/nvim-treesitter/pull/6251

yehia67 commented 5 months ago

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 commented 5 months ago

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