python-syntax icon indicating copy to clipboard operation
python-syntax copied to clipboard

Upstreaming?

Open WhyNotHugo opened this issue 5 years ago • 9 comments
trafficstars

First off, thanks for maintaining this!

I'm wondering if there are plans to upstream these improvements into the upstream Vim syntax highlighting, so that this is directly bundled with Vim.

It seems there's been a lot of improvements on this fork, so I'm curious why not merge them back.

I've looked around a bit and haven't seen mentions of this, so I'm not sure if this has been discussed or not.

It mostly feels odd that Vim ships a "less enhanced" version, and that there's a fork with further improvements -- maybe efforts could be unified?

WhyNotHugo avatar Jun 01 '20 10:06 WhyNotHugo

Also, what's the state of this project? Perhaps someone else should help out with maintaining this since it can take quite a while to get responses for pull requests.

Lilja avatar Jun 09 '20 13:06 Lilja

Ditto. In theory, the liberal license doesn't prevent one from just forking it, if necessary. The config toggles would have to be ripped out (and a default agreed upon), but that shouldn't be too hard. Vim already ships with other syntax files that have very fine grained rules.

I cannot judge whether the ruleset is robust enough in its current state, looking at those unresolved error reports.

Edit: Actually, the config toggles don't have to be ripped out – I looked at the file shipped with Vim and it has some too. But I nonetheless think a sane default is better than multiple toggles.

adrian5 avatar Sep 09 '20 11:09 adrian5

If the upstream maintainers feel like this is a good addition, then I'd be all for it. But don't really feel like doing the leg work currently. If anyone wants to start the ball rolling, then I'd help out.

nfnty avatar Dec 02 '20 19:12 nfnty

NOTE: This was a reply to a now-deleted comment.

In some areas vim and neovim progress rapidly, and have been doing so for a long time, but in others there are these eternal deadlocks. See also: rust.vim. I use vim-polyglot, but for ubiquitous languages like Python, highlighting should be top out of the box imo.

For neovim there's promise ahead, since tree-sitter grammar should make it into the next stable release (0.5), offering superior syntax highlighting (and more) for the most popular languages.

adrian5 avatar Mar 03 '21 13:03 adrian5

Yeah, I've moved onto tree-sitter on neovim-nightly, and I think that's the way to go in future.

It's honestly far simpler (and lighter) than having to keep track of a bunch of plugins (polyglot includes lots of highlight-unrelated features which get in the way for me).

WhyNotHugo avatar Mar 03 '21 13:03 WhyNotHugo

I would avoid the suggestion by @adrian5 and @WhyNotHugo. The grammars seem to all be written in JavaScript:

https://github.com/tree-sitter/tree-sitter-ruby/blob/master/grammar.js

Also only 26 languages currently supported it seems:

https://github.com/search?q=org%3Atree-sitter+grammar&type=Repositories

As I use D, Dart and Nim, they are all missing.

89z avatar Mar 03 '21 14:03 89z

Why is it funny that grammar definitions are in JS? It's really the end result that counts, IMHO.

I agree on the amount of languages missing being pretty high -- however, we're specifically discussing python in this issue.

WhyNotHugo avatar Mar 03 '21 16:03 WhyNotHugo

@89z Well I didn't suggest it, but mentioned that nvim is taking another route. From what I can tell, the Node.js dependency–alluded to in the issue–applies to developers only; end-users can consume and build the (C) parsers directly. I've been using nvim-treesitter before and don't recall needing a JavaScript runtime for that. I dislike the whole JavaScript ecosystem as well, so I sympathize, but if the burden falls on developers alone, I think that's a fair tradeoff.

In term of highlighting quality, Tree-Sitter (in Atom) has been better than anything I've used before. Anyway, we're strongly veering off-topic, a better Python syntax in vanilla vim remains a worthwhile pursuit!

adrian5 avatar Mar 03 '21 16:03 adrian5

You are correct, @adrian5. While the grammars are written in JS, that's just used as input to generate and build C code. Hence, the efficiency of it.

Having written a [very simple] grammar, I have to admit that it's very easy and simple, and provides incredibly efficient results.

Anyway, we're strongly veering off-topic, a better Python syntax in vanilla vim remains a worthwhile pursuit!

Since tree-sitter will be part of the next neovim stable release anyway, I don't feel very motivated to go through the whole process of upstreaming and then waiting for it to be merged back down.

I do appreciate all the work into maintaining vim-python for all these years, it's been great!

I'm okay with closing, unless someone wants to pick this up or a maintainer prefers to leave it open.

WhyNotHugo avatar Mar 03 '21 19:03 WhyNotHugo