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

Source-aware completions and more completer settings #549

Merged
merged 7 commits into from
Mar 22, 2021

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Feb 27, 2021

References

Small step towards #495 and #236. Fixes #492.

Code changes

  • trim spaces in insertText when merging completions (was the source of duplicated completions as Python kernel was returning 'return' and 'return ')
  • generalised completion merging code so that plugin in kite or another will be easier in the future
  • extend CompletionHandler.ICompletionItemsReply to include source information (ICompletionsReply)
  • define ICompletionsSource for source metadata storage
  • extend CompletionHandler.ICompletionItem to include source info and others (IExtendedCompletionItem)
  • source in IExtendedCompletionItem and ICompletionsReply can be null/undefined at different stages. How to handle this safely for future us?

User-facing changes

  • detail is now shown instead of the type by default; if no detail is available, then type or source ("Kernel" for kernel completions) is shown instead.

detail-and-source-opt

  • exposed settings:
    • caseSensitive: old behaviour retained by default
    • includePerfectMatches: old behaviour retained by default
    • labelExtra: new behaviour - display detail from LSP rather than the type in the completion label

new-completion-settings

Backwards-incompatible changes

Chores

  • linted
  • tested
  • documented
  • changelog entry

@krassowski krassowski changed the title [wip] Initial work on source-aware completionItem and completionReply Source-aware completionItem, completionReply and more completer settings Mar 21, 2021
@krassowski krassowski changed the title Source-aware completionItem, completionReply and more completer settings Source-aware completions and more completer settings Mar 21, 2021
@krassowski
Copy link
Member Author

I am not 100% sure if the new behaviour with detail should be enabled as default. It seems to work fine, but there can be this awkward delay visible on the GIF when ggplot2 and geom_ functions are being typed, when the completion items are being resolved (i.e. the detail gets fetched from the server).

@krassowski krassowski merged commit 4219986 into master Mar 22, 2021
@krassowski krassowski deleted the refactor-completion-item branch March 22, 2021 09:22
@krassowski krassowski added this to the 3.5 milestone Aug 1, 2021
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.

Use completion item detail in completion renderer
1 participant