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

Impl completion lens #2425

Merged
merged 1 commit into from
Jun 4, 2023
Merged

Conversation

MinusGix
Copy link
Member

@MinusGix MinusGix commented Jun 4, 2023

  • Added an entry to CHANGELOG.md if this change could be valuable to users

This PR reimplements completion lens from #1968, with similar limitations

  • No multiline (need multiline phantom text)
  • Doesn't display every possible way of displaying a completion item. Ex: If you type r and there's a suggestion for println!()', then it won't display that as then lens since it doesn't start with 'r'.

There is also various added comments to the completion logic, and some rearranging of logic.

I've changed the config font size functions to fallback, which I believe is the more correct option based on the docs we have for them. As well, using font_size directly when error lens font size == 0 has the issue that then error lens font size won't be clamped to a reasonable value like font_size() does, which this fixes.


I'm a bit uncertain that storing that last editor id is the best method for completion lens.
Updating the document's completion lens needs the EditorData::cursor field, to get the offset. However, it is received in window_tab.rs and thus wouldn't know which editor data it should utilize.
I thought of passing the EditorId as a field on the request, but I don't think that's a better solution either...

@MinusGix MinusGix added the A-lsp Area: LSP, assists and code completion label Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lsp Area: LSP, assists and code completion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants