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

Add an auto-completer for editor references #1581

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Add an auto-completer for editor references #1581

merged 4 commits into from
Nov 6, 2023

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Nov 6, 2023

Summary:

This PR adds a custom MetaCompleter class, a context menu that is triggered on lines starting with the @ character. It has the following features:

  • On typing @, a list of keyword options appear. The list is shortened when more characters are typed. Typing @c will list @char and @custom. Hitting enter on an option will insert it and a :.
  • Typing anything after a keyword, like a space, will open a list of up to 15 tags in that category. Any further typing will look for the typed characters in the list and filter it down. The lookup needs to be consecutive characters, but it's not case sensitive. So "an" will match "Jane" and "Jannet", but not "John".
  • The auto-completer will treat multiple references separated by a comma. It uses the same evaluation function as the syntax highlighter for the parsing.

Related Issue(s):

Closes #823

Reviewer's Checklist:

  • The header of all files contain a reference to the repository license
  • The overall test coverage is increased or remains the same as before
  • All tests are passing
  • All flake8 checks are passing and the style guide is followed
  • Documentation (as docstrings) is complete and understandable
  • Only files that have been actively changed are committed

@vkbo vkbo added this to the Release 2.2 Beta 1 milestone Nov 6, 2023
@vkbo vkbo changed the base branch from main to dev November 6, 2023 18:33
@vkbo vkbo merged commit 1ab35b5 into dev Nov 6, 2023
8 checks passed
@vkbo vkbo deleted the autocomplete branch November 6, 2023 18:35
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.

Tags and references auto-completion
1 participant