fannheyward/coc-rome

find rome binary from path or node path

joprice opened this issue · 2 comments

I'm trying to use this plugin with nix, where I have rome available on the path. I would expect the rome binary available on the path to be picked up, but the code currently looks in the workspace root https://github.com/fannheyward/coc-rome/blob/master/src/index.ts#L16. I think this could search the $PATH, then use $NODE_PATH to find the node_modules directory, and otherwise fall back to the local directory. I can also see it preferring the NODE_PATH so the project version takes preference over any globally installed one.

Actually the use of NODE_PATH is discourages here https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders. Having a config option for the path would be, and finding it from the $PATH still seem reasonable.

Added rome.bin configuration.