Skip to content
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

refactor: Adjust inlay rendering and improve completion logic #3494

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lkk214
Copy link
Contributor

@lkk214 lkk214 commented Dec 21, 2024

Description

  • Single-line completion sometimes does not work
  • There is a blank area after the cursor when completing multiple lines
  • Incompatible line breaks cause accept to fail

Screenshots

fix14

Testing

fix15

- Replace `ContinueCustomElementRenderer` and `ContinueMultilineCustomElementRenderer` with `ContinueInlayRenderer`.
- Add `Editor.addInlayElement` to handle inline and block inlay elements.
- Refactor `AutocompleteService` to use new inlay renderer and improve completion rendering conditions.
- Update `AcceptAutocompleteAction` to match new changes.
Copy link

netlify bot commented Dec 21, 2024

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 0a7da20
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/676d43827239050008f5be58

Copy link
Contributor

@sestinj sestinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great for me, I'm just curious if the url -> path was the solution to something that was previously broken

val column = editor.caretModel.primaryCaret.logicalPosition.column
val input = mapOf(
"completionId" to completionId,
"filepath" to virtualFile?.url,
"filepath" to virtualFile?.path,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change url to path?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(was this the solution to a clear problem?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just about to comment on it. I didn't pay attention to #3247, need to revert it here.

Because using File(URI(filepath)) will cause an error in Windows, I made temporary changes locally and submitted this by mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, maybe it's better to fix it than revert it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants