Repository navigation
Support for SQL parser - #1403
DerekStride wants to merge 1 commit into
Conversation
|
This interests me. Anyway I can help out with this? |
|
Thanks for the offer @Mange, I've been fairly busy and haven't had the chance to finish adding all the highlight groups. A lot of changes have been made since I first opened this PR. If you could update the Maybe try to see if there's anything missing on some of the more gnarly queries from the tree-sitter-sql tests. I'm not too sure how complete the first pass needs to be. @theHamsta how much of the highlighting would you expect to be complete in a first pass? Getting every edge case seems to me to be high barrier for each new language, am I correct to assume we can incrementally add new highlight groups as we go? |
|
I'll see if I can allocate some time to this. Thanks! |
|
I forked my own version and rebased your commit on latest master, then I updated the revision. I'm not sure how to proceed from here. The SCM-files are very hard to understand for me, and it's very unclear to me what needs to be done for Is this correct? I based it on this: I could perhaps progress a bit more with some direction on what to do here. Is there some easy way to extract all the new keywords from the [EDIT:] My fork is here https://github.com/Mange/nvim-treesitter/tree/sql-parser |
|
@Mange your query looks ok. There is a nvim API function to list all anonymous nodes a of a language (search for vim.treesitter.inspect_language, it is also used by the query longer in nvim-treesitter/playground: https://github.com/nvim-treesitter/playground/blob/787a7a8d4444e58467d6b3d4b88a497e7d494643/lua/nvim-treesitter-playground/query_linter.lua#L71). The playground should also be best to see the parser tree of a language and to test queries. Probably faster is to go through the string literals in grammar.js. Every string literal is typically mapped to a key word of the language. |
|
@DerekStride are you still planing to submit this? |
|
Not anytime soon, I'll close it for now and re-open it if I circle back around |
@Mange Have you do some progress on your merge request ? |
No, I abandoned it. I didn't know what I was doing and didn't have time to learn everything about treesitter and how Neovim integrates it. |
What
I've been implementing a parser for SQL, specifically targeted at MySQL but right now it's pretty general.
https://github.com/derekstride/tree-sitter-sql
I'm opening this PR to act as an RFC for suggestions as this is my first time writing a grammar and subsequently writing the highlight queries for it.