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
coc-nvim hardcode nodejs path #91447
Conversation
let node = expand(g:coc_node_path) | ||
else | ||
- let node = $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH | ||
+ let node = '@nodejs@' == '' ? 'node' : '@nodejs@' |
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.
+ let node = '@nodejs@' == '' ? 'node' : '@nodejs@' | |
+ let node = '$COC_NODE_PATH' == '' ? '@nodejs@' : $COC_NODE_PATH |
Don't we rather want to override the default nodejs location, and still allow overriding it with $COC_NODE_PATH
?
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.
you could export COC_NODE_PATH or ask coc to default to g:node_host_prog
that is set in neovim wrapper ?
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.
Don't we rather want to override the default nodejs location, and still allow overriding it with
$COC_NODE_PATH
?
@regnat I'm happy to defer to you here. I wasn't sure what the idiomatic way to do this was, my thinking was that if someone configured a path in nix they wouldn't then want to override it.
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.
you could export COC_NODE_PATH or ask coc to default to
g:node_host_prog
that is set in neovim wrapper ?
-
Setting COC_NODE_PATH would be ideal if executed directly but since it's a vim plugin I'm not sure whether it would be desirable to export
COC_NODE_PATH
to neovim. Is there a way to do this cleanly? -
Defaulting to g:node_host_prog may make sense but since that's not nix specific functionality so maybe that should be handled upstream?
update patch
@jonringer any thoughts on this, would love to get it merged. |
I marked this as stale due to inactivity. → More info |
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.
we should probably change the patch to be just
postPatch = ''
substituteInPlace autoload/coc/util.vim \
--replace "'' ? 'node'" "'' ? '${nodejs}/bin/node'"
'''
just to avoid the inflexibility that patches have to minor changes.
Otherwise LGTM
@sheeldotme are you still interested in this PR? if not i'd be happy to make the change's suggested. would the right thing to do be to open another PR with the suggested changes? |
I’ll look at this tomorrow. Thanks for the reminder! |
Ping |
I'm no longer the best person to commit this as I no longer use coc / nvim and it seems the way coc plugins are imported has changed. |
Motivation for this change
coc-nvim complains that it cannot find the nodejs executable. This PR fixes that by patching the path.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)