Advice on merging new filetype support to Neovim/Vim for said language that has a tree-sitter grammar

I have finished a grammar for a language I use recently, and said language isn’t available in Neovim/Vim currently already (I do have runtime files available). I’m kind of confused as to how I should proceed with getting the filetype support merged into Neovim and Vim with conjunction with the grammar I need to get merged into nvim-treesitter

I have never contributed to Neovim or Vim and not sure where to start with a filetype addition that applies to both editors

The procedure is still the same as it has always been: (almost all) runtime files are “owned” by Vim, so the correct approach is to make a PR to vim/vim first. Filetype detection is fairly trivial (if it only requires looking at the filename instead of the contents):

  1. add a line to runtime/filetype.vim
  2. add a line to src/testdir/test_filetype.vim

You can look at previous commits for Vim that have a description like “Problem: not recognized”.

Once the PR is merged (which usually happens quickly), Neovim will port it without you having to do anything.

It’s similar with other runtime (syntax, indent, ftplugin) files: make a PR to Vim. These changes get bundled into one of the infrequent “runtime file updates” commits, which Neovim also ports.

For tree-sitter grammars, make a PR to GitHub - nvim-treesitter/nvim-treesitter: Nvim Treesitter configurations and abstraction layer (again, look at prior PRs adding parsers).

Do I make the PR to Vim with all runtime files or one for each?

Up to you, but Bram will cherry-pick so one PR for all files is fine.