-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
runtime:compiler:feat: unify node-based makeprgs #18798
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
base: master
Are you sure you want to change the base?
Conversation
|
I don't have a good short term solution but these variables are really starting to make a mess of the global namespace. I know you've tried to broach this topic before. I wonder if sticking this under |
|
In " syntax/javascript.vim (line 77)
if exists("javaScript_fold")there is rather |
|
@djmoch When you say changes, do you mean any change to the file or in substance? Replacing get(g:, 'csslint_makeprg', '')to get(g:, 'csslint_makeprg', 'csslint')will fully restore the previous behavior of, for example, csslint. |
Any change. I have no plans to maintain these in the future. |
chrisbra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but I am not so happy with introducing a whole batch of new option variables and in addition use those javascript_node_ variables as fallback. Can't we stick to one single way to do it? This is quite hard to understand and maintain as it is now.
Also can you please revert those whitespace changes?
| " CompilerSet makeprg=npx\ biome | ||
| exe 'CompilerSet makeprg=' .. escape( | ||
| \ (!empty(get(b:, 'biome_makeprg', get(g:, 'biome_makeprg', ''))) ? | ||
| \ get(b:, 'biome_makeprg', get(g:, 'biome_makeprg', '')) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Biome is quite new, let's rather keep it simple and jut use the javascript_node_makeprg instead and get rid of the whole biome_makeprg option instead. This simplifies this whole thing here.
| " CompilerSet makeprg=npx\ csslint | ||
| exe 'CompilerSet makeprg=' .. escape( | ||
| \ (!empty(get(b:, 'csslint_makeprg', get(g:, 'csslint_makeprg', ''))) ? | ||
| \ get(b:, 'csslint_makeprg', get(g:, 'csslint_makeprg', '')) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, let's not introduce another block of settings but stick to javascript_node_makeprg
| " CompilerSet makeprg=npx\ eslint | ||
| exe 'CompilerSet makeprg=' .. escape( | ||
| \ (!empty(get(b:, 'eslint_makeprg', get(g:, 'eslint_makeprg', ''))) ? | ||
| \ get(b:, 'eslint_makeprg', get(g:, 'eslint_makeprg', '')) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar here please
applies to most of @dkearn's compiler files; issue as always some git setting suppressing white space changes
See #18798 (comment) regarding variable pollution; one could guard them behind their main file types as well, though, say, biome treats many. Having an executable in PATH to apply formatting independent of the repo one is in still has use cases, say scratch files, docs, ... From what I saw, |
Most natural would be simply inverting the order, Of course, one could also think even larger, and agree on a |
Sorry, I don't follow. Why can't you use consistently |
|
I strongly dislike the use of config variables for anything that can be trivially managed with the "after-directory" mechanism. I would be happy enough just to use npx for any of these NPM packaged tools and call it a day. A config variable to globally switch this approach with normal PATH based lookup might be convenient for some users but I wouldn't have added it myself. |
I tend to agree. Thanks |
I simply was not aware of it I thought one had to basically copy-paste the definition from VIMRUNTIME to HOME and adapt it. Instead, setting |
|
I thought a bit more about it and now disagree: Even though, say, only So overriding only So yes, I think from a user perspective, the safer and easier option is just to change the concerned property, say name of the executable, in a line in the vimrc. |
|
What one can do, say by a naming scheme, to contain the names of the variables to set these values, at the moment freely left to the maintainer's choice, be it ftplugin, syntax, compiler, ... , is an issue apart (elsewhere, @dkearns mentioned it but I cannot find it right now). |
A point of contention could be what counts as trivial here; what's trivial for experienced maintainers of Vim runtime files might be non-obvious for a user working on the Vim documentation level; less experienced users might prefer to set customizing options in the Vim help, instead of forking runtime files into the user's directory and editing suitably (which, as they might go out of sync, could also be a preferred option for those having that expertise, but that was already mentioned above). Another advantage to using a variable to tweak the makeprg options is that this is more easily done at a (node, python, ..) project local vimrc , with no need to add in it additional (after) runtime paths |
Follow-up to closed #18755
Now defaults to
npxas suggested by @romainl and @dkearns ; let the user optionally change it byb/g:node_makeprgand documented where documentation existed; @dkearns 'sb/g:tsc_makeprgkept for backwards compatibility; would that be acceptable, @djmoch ?