-
Notifications
You must be signed in to change notification settings - Fork 4.1k
initial commit for InlineCompletionProvider #5360
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
Conversation
✅ Deploy Preview for continuedev canceled.
|
|
Hi! Sorry to bother you, I'm one of the authors of the Inline Completion API in IntelliJ. I noticed that you're using an older version of the API, which was part of a highly experimental stage and is no longer available in the platform. I recommend switching to the version introduced in IntelliJ 2024.1. It's much more stable and production-ready now. Please let me know if you have any questions. |
|
Thanks for reaching out @kkarnauk! The purpose of this PR is to migrate to the new API, which we are very excited to do. We need a bit more time to be able to prioritize finishing this, but plan to get to it very soon |
| null, | ||
| { response -> | ||
| val responseObject = response as Map<*, *> | ||
| val completions = responseObject["content"] as List<*> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsafe type casting of response content. The code assumes the content is List<> while other parts of the codebase (CoreMessengerManager.kt and IdeProtocolClient.kt) handle it as Map<, *>. This inconsistency will cause ClassCastException at runtime. Add type checking before casting and proper error handling.
React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
|
😱 Found 1 issue. Time to roll up your sleeves! 😱 |
|
@coinzz I'd suggest to use the API starting from 2024.1. The one in 2023.3 has lots of deprecated methods/classes. They may be removed at some point of time (since almost 2 years already passed). Unfortunately, there is no documentation on the IJ page. There are lots of KDocs in the code, though. |
@kkarnauk ah no worries, do you have a link to the current implementation with the KDocs for me then? I have scheduled a meeting with a colleague to take a look on that next friday 🙂 |
|
@coinzz great to hear, thanks a lot for that! Basically, you need to implement this interface. A brief overview:
|
|
I had some build problems which I figured out now. But @kkarnauk I still was not able to take a deeper look at your brief overview, because I still try to create a testable environment. So far I figured out:
When I start the intellij sandbox env with version 2024.2.6 and the AI Assistant Plugin I get this message:
When I start the intellij sandbox env with version 2024.3.6 and the AI Assistant Plugin I get this message:
Only this one is talking about "Built-in local inline completion", therfore I guessed that I need to update this far. But it could be only a textual issue as well? I guess the goal is as described in the ticket (#2061) to disable the "Enable Tab autocompletion" and then being able to enable "Enable cloud completion suggestions" on one of the screenshots. So which version do you think @kkarnauk ?
And @sestinj should I fork this branch and do a draft PR into this branch, because I guess I am not allowed to push directly here and this is your branch? |
|
Closing in favor of #6947 |



WIP migrating to the native JetBrains InlineCompletionProvider API. This may not be picked up again for a week or two. If anyone comes across this and has interest in cleaning up more of the details to get it across the finish line earlier, please feel free to help out!