fwcd / kotlin-language-server

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

Can pick wrong ClassPathResolver #456

Open halfninja opened 1 year ago

halfninja commented 1 year ago

I've got a Gradle project whose build plan is defined by Bamboo Specs, which means there is a file called bamboo-specs/pom.xml in the project. This causes the server to use the MavenClassPathResolver, which is no good for building the actual app. If I rename pom.xml and restart the language server it picks the Gradle resolver and things work fine.

I'm not sure what the best way is to get around this - maybe rather than picking the first one, collect them all and prioritise based on which is highest up in the directory structure?

fwcd commented 1 year ago

Hm yeah, this is a tricky one. Haskell's language server solves this by letting the user place an hie.yaml in the project root to specify the preferred build tool, perhaps we could do something similar (e.g. kls.yaml, kotlin-language-server.yaml or similar)?