danr / kakoune-languageclient

WIP: Language server protocol client for the Kakoune text editor
MIT License
9 stars 0 forks source link

initialization directory is set to the same directory as `yarn run main` #3

Open jacobdufault opened 6 years ago

jacobdufault commented 6 years ago

The initialization directory should actually be the project root.

danr commented 6 years ago

I'm open for ideas to determine how the root should be determined. Running kak processes have a working directory and that one could be used. That solution will not work if you want to run servers for projects in different directories (without changing Kak's working directory).

Then one could try to find the project root starting from the current buffer, but this is language-dependent (for example find package.json for javascript or *.cabal or stack.yaml for haskell, and I wouldn't know what for C/C++ projects), so it would be a bit sad to have to hardcode heuristics for different languages in the source code. One could make an option to the running kak process to say what files indicate that the project root has been found.