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

lsp-inline-completion, lsp-copilot: fix lints, package version and default behavior on inserting text #4662

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

kiennq
Copy link
Member

@kiennq kiennq commented Dec 27, 2024

Fix #4660 and #4656

@github-actions github-actions bot added the client One or more of lsp-mode language clients label Dec 27, 2024
@kiennq kiennq changed the title lsp-package-version: fallback to hardcode when fail lsp-inline-completion, lsp-copilot: fix lints, package version and default behavior on inserting text Dec 27, 2024
@kiennq kiennq force-pushed the fix/lsp-package-version-nil branch from 7a0e0c5 to f3b0ecb Compare December 27, 2024 23:57
(start-point (or start (point)))
(showing-at-eol (save-excursion
(goto-char start-point)
(eolp)))
(and (not (bolp)) (eolp))))
Copy link
Contributor

Choose a reason for hiding this comment

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

If I recall correctly, I had to handle this specifically because the overlay did not display at the right place when EOL. In this case, I had display the overlay at the character before eol (I believe this was a hint I took from the company preview frontend).

I don't remember seeing the same issue on bol (and have not been able to get copilot to answer anything at bol, so I can't test it), so I'm curious -- why shift the overlay display point when bol?

Copy link
Member Author

Choose a reason for hiding this comment

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

You can try with this elisp code where the <|> is cursor position.

;; fibonacci
<|>

Basically, in this case, the cursor will be moved back to the previous line since it's eol. However, we don't want that and will want to keep the cursor in the current line.

Here is before the fix
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@jcs090218
Copy link
Member

Consider rebasing this to check for any further errors in snapshots.

@kiennq kiennq force-pushed the fix/lsp-package-version-nil branch from f3b0ecb to b25000c Compare January 5, 2025 03:46
@kiennq kiennq merged commit f3bd38d into emacs-lsp:master Jan 5, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(lsp-package-version) error prevents lsp from initializing in buffer
3 participants