scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Document support for kakoune #91

Open joeitu opened 4 years ago

joeitu commented 4 years ago

Question Installation seems to be specific to editor but theere is no documentation on how to install metals for kakoune.

ckipp01 commented 4 years ago

I've gone ahead and moved this over to the feature requests @joeitu since we currently don't have any explicit documented support for kakoune, but it'd be great to either keep an eye on it or to actually add it if there is enough support.

I actually looked into this a while ago as I had a colleague that wanted to try it out, but one of the initial blockers was that window/showMessageRequest wasn't supported by kak-lsp (no idea if it is now), so right off the bat, when you opened up a project the user would never be prompted to import the build. However, there are ways around this.

In the meantime, if you'd like to try this out, you can follow the instructions found here, but switch out vim for kakoune, so it'd look like below:

curl -L -o coursier https://git.io/coursier-cli
chmod +x coursier
./coursier bootstrap \
  --java-opt -Xss4m \
  --java-opt -Xms100m \
  --java-opt -Dmetals.client=kakoune \
  org.scalameta:metals_2.12:0.8.1 \
  -r bintray:scalacenter/releases \
  -r sonatype:snapshots \
  -o /usr/local/bin/metals-kakoune -f

Putting in kakoune won't really do anything since we don't account for it in the MetalsServerConfig. However, we could introduce it if needed. Then, you can register the server with kak-lsp by referencing metals-kakoune. Then, since you won't be prompted to import the project, you may have to run sbt bloopInstall manually. After that, it should actually work depending on the level of lsp support that kakoune has.

If I get some more time, I can look into this since it is something that interests me.