fwcd / kotlin-language-server

Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol
MIT License
1.68k stars 212 forks source link

Using the KLS with a spring project + mvn + launching within remote docker container #290

Open thedewpoint opened 3 years ago

thedewpoint commented 3 years ago

I really love using the remote docker container extension so I don't have to install all of these runtimes on my host PC. I'm wondering if this is causing the issue. But essentially I've started a boilerplate spring rest api using kotlin and added the fwcd kls. It's not able to resolve any imports at all. Attaching image below as well as the relevant repo. Any help is greatly appreciated.

Edit: I updated the dev container docker file to install kotlin in the remote container as I think I was missing this. But still getting the same unresolved errors.

RUN su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install kotlin"

https://github.com/thedewpoint/weather-service image

dq-dd commented 3 years ago

I'm using the shell wrapper below with vim. Two things I had to tweak

~/bin/lsp-kotlin.sh

#!/usr/bin/env bash

KLS_VERSION="1.1.1"

docker run \
 --name lsp_kotlin \
 --rm -i \
 -e "ARTIFACTORY_USERNAME:${ARTIFACTORY_USERNAME:?ARTIFACTORY_USERNAME not set}" \
 -e "ARTIFACTORY_PASSWORD:${ARTIFACTORY_PASSWORD:?ARTIFACTORY_PASSWORD not set}" \
 -v "$HOME/Projects:$HOME/Projects" \
 "docker.pkg.github.com/fwcd/kotlin-language-server/server:$KLS_VERSION" \
 "/server/bin/kotlin-language-server" \
 "$@"
RolKau commented 3 years ago

I can't say if this is the same problem or not, but have you seen #222 ?