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

Feat: improve completion items #10

Open
EmileRolley opened this issue Jun 14, 2024 · 3 comments · May be fixed by #25
Open

Feat: improve completion items #10

EmileRolley opened this issue Jun 14, 2024 · 3 comments · May be fixed by #25
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed server/completion

Comments

@EmileRolley
Copy link
Collaborator

As the rule names are often really long, it's difficult to choose the right item from the completion menu:

image

We need to find a way to make it more readable. Here a few ideas (don't hesitate to suggest others @johangirod @Clemog):

  1. Put in first position children rules of the current rule + remove the namespace of this rule.
  2. Only put the first letters of each name segment (e.g. logement . électricité . photovoltaique . présent becomes log . éle . pho . présent)
  3. Directly put the title of the rule and the full rule name as hint after it.
@EmileRolley EmileRolley self-assigned this Jun 14, 2024
@EmileRolley EmileRolley added enhancement New feature or request help wanted Extra attention is needed server/completion labels Jun 14, 2024
@johangirod
Copy link
Member

I think the full name is a good choice. But I would rather prioritize for the shorter namespace, and not proposing the childrens. The idea is to achieve a flow of multiple autocompletion by narrowing the context. I find myself trying to do that with the extension, but it's not supported for now.

Here is an example :

  1. Let say I know I want to reference a rule for « clé de répartition retraie complémentaire pour les cotisation auto-entrepreneur », but I don't remember the exact name.
  2. I start by narrowing the context by typing « autoentrepreneur ». In this case, we would want to have only « dirigeant . auto-entrepreneur » that match, but none of its children rules!
  3. I find the rule « dirigeant . auto-entrepreneur » and type « Enter »
  4. Then, I want to see if there is a « cotisation » rule. I immediately type « space + Enter » for toggling autocompletion, and the autocomplete only provides rules that are children of the current one. I type « cotisation » and then « retraite » and here I go.

Presently, the behavior in bold are not implemented, but I think it would benefit greatly to the DX.

The second improvement would be to prioritize child rules of the current namespace, and then the parents' one. And not autocomplete from the root when a rule is found, instead just having the relative path from the common ancestor.

@EmileRolley
Copy link
Collaborator Author

The idea is to achieve a flow of multiple autocompletion by narrowing the context.

It would be great for sure! However, I'm not sure that's possible as spaces are allowed in rule names 🤔

@johangirod
Copy link
Member

It would be great for sure! However, I'm not sure that's possible as spaces are allowed in rule names 🤔

Mmmh, good point. It could be done so that when the selected autocompleted rule has children (is a namespace), the inserted string automatically adds a trailing . at the end.

Or maybe I'm missing a technical limitation of some other kind?

@EmileRolley EmileRolley linked a pull request Sep 5, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed server/completion
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants