Open GrantFleming opened 11 months ago
I get the same problem, but I'm on macos. My project compiles fine when I run gradle build
. I have tried both the automatically downloaded language server and a local build from Github.
@MagnusMG , would you like to share some logs? Would help a lot when debugging causes for the issues 🙂
My guess based upon this and my earlier experiences makes me think that the recently introduced caching solution (#337 ) have some bugs. Some projects have been behaving weirdly, and I've had to delete the symbol database to get it working again. This is usually found in the root of your project, called kls_database.db
. Might be a temporary workaround for someone experiencing weird issues like this.
Absolutely. I put the log here.
I'm afraid I cannot find the file kls_database.db
.
Seems like VSCode saves the files in a special workspace directory, example on my Mac: Library/Application\ Support/Code/User/workspaceStorage/184e57edab10e06220a4a0d28a068565/fwcd.kotlin/kls_database.db
. Think it is somewhere inside APPDATA or whatever on Windows. Might not be the issue, but always good for the person googling in the future to get some suggestions 😛 (or if any of you want to fiddle with deleting these files as a workaround).
I found the file kls_database.db
and deleted it. (Well, I deleted the entire folder workSpaceStorage
). Still the same problem.
I noticed that I don't have any problems in other, similar projects. So it is nothing particular with my VSCode setup, but just this project. I'll create a new project fresh from gradle init
, copy my source files into it, and see if I can get it to work.
I created a new folder, ran gradle init
, and then copied the source code files from the old folder into the new one, and the gradle.build
files, and then it all worked fine. I would be great to know more precisely what went wrong, but this workaround is much better than nothing.
I have VSCode setup on Windows remoting into WSL.
I have the fwcd extension installed, as well as Gradle for Java + others.
When I download a fresh gradle project from, say, spring initializr - I get some declaration/definition support immediately (I can go-to-definition of @SpringBootApplication for example) and the extension appears to work more-or-less like expected.
However on closing the project - it never works correctly again. Anytime I reopen the project, it either shows no errors, but I cannot go to any definition that is not local to the file I'm working on, or it cannot find any reference at all.
I do notice a big ol' stack trace in the Kotlin language server logs, but I'm unsure what the root cause of the compilation error is here.
I suspect that when I don't see the unresoved reference errors, but cannot go-to-definition as the definition is not found, this may be a different error and can open seperately.
Fresh startup logs from the Kotlin language server: