-
Notifications
You must be signed in to change notification settings - Fork 231
Broken behaviour when using unimplemented inheritance #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems to apply to basically everything I'm working on now, not just that isolated case :l |
The stack trace you are showing happens a lot, yes... It happens because of failing to fetch hover information. Unsure on why it happens. Any variations on the stack traces is very appreciated if they happen and you want to post them 🙂 May get time to look into some issues in this repo this summer (vacation/off work soon), so all information that can help to make fixes are awesome! Invoking the code action issue, and nothing happening, is another issue. The reason for that one is that the current implementation of implement abstract members expect there to be a body for the class. So it just silently fails. I'm planning on looking into a fix this week unless you want to 🙂 EDIT: One more thing! At least on my local machine with lsp-mode in Emacs, I have to mark the entire class (i.e, |
It doesn't just apply to the original issue, it applies to (in the project I work on) every operation in every file. I tested a few other dummy kotlin projects and unless I have everything perfect (and use gradle) I get no code actions anywhere. The stack traces that have been thrown are exactly the same, except the code they complain about is different. On looking at other issues, I'm far from a kotlin expert but I can at least lend my emacs expertise for sure :) A useful starting point to understand what's happening would be appreciated! |
The indexing often takes a tiny bit of time to complete as well, especially for the "add missing imports"-quickfix. Did you wait for it to finish? Also, there aren't that many code actions. The only one two that works for me without issue is the add missing import and implement abstract members one. To fix the issue with the "Implement abstract members" code action not showing up (unless marking the code described above), I would start by looking at the Range-calculations in the quickfix for implement abstract members (the tests might also be a bit of help when it comes to what LSP type requests are sent, and the parameters). Now it checks that the range is exactly a given bound at the moment. To my experience, Emacs does not give the same range, but gives the position of the cursor. VSCode on the other hand gives these ranges like expected. Should the fix be in lsp-mode in Emacs? I'm unsure, but based upon my experience of implementing "add missing imports", it should be pretty straightforward to make it work like expected in Emacs without changing lsp-mode. Could probably fix it myself, but I would be super happy if you try instead 🙂 More people getting familiar with the codebase and possibly contributing is awesome! Let me know if you need additional details 🙂 Hope the above makes sense. My brain is tired after work and the heat here 😛 |
No idea how long that is meant to take, but yeah this has been a project left in emacs for days 😛
I know there are at least a few, but no matter what I do (outside of the "perfect" project), even though the server complains about things, everything always says "no actions available" As for the rest, I'll try and find time to look into it :D |
@elken , did you find time to look into it? 🙂 If not, I will probably take a look at it very soon. Gotten way too tired of having to do the workaround I described above for the "Implement abstract members" code action to show up 😛 |
Have been super busy and don't use kotlin anymore now 😅 I can be around to help test stuff! |
So using a dummy maven application generated from https://start.spring.io/ and the below files added:
IThing.kt
Thing.kt
trying to invoke a code action in emacs throws the exception below:
Java version:
Environment:

Emacs 28.1 (built from nix)
The text was updated successfully, but these errors were encountered: