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

Rewrite #56

Merged
merged 13 commits into from
Jun 18, 2024
Merged

Rewrite #56

merged 13 commits into from
Jun 18, 2024

Conversation

nikku
Copy link
Member

@nikku nikku commented Jun 15, 2024

Proposed Changes

This PR aims to improve the following:

  • significantly improve the inner workings of the editor
  • properly configure language and autocompletion together (preventing silly bugs)
  • improving completion UX in various small ways
  • fixing completion bugs
  • making built-ins pluggable
  • prevent bogus snippet completions within paths and/or identifiers

capture 534KSo_optimized

You can try out the changes via

npx @bpmn-io/sr bpmn-io/feel-editor#rewrite

Related to camunda/camunda-modeler#3983

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

nikku added 11 commits June 15, 2024 13:49
* allow to bootstrap with position
* configure language with provided context
In case where `baa|` is user input we only suggest `baawaap` and not
`foo` as variables.
* group semantically
* slight renames of specs
* remove duplicate test
Fixes recovery on function positional arguments.
  * You can now provide built-ins (other than Camunda)
    as you instantiate the editor.

feat(autocompletion): filter completed built-ins

chore: simplify internal structure

  * This is a larger rewrite of the inner structure of the tool,
    fixing some longer standing bugs

chore: treat built-ins like special variables

fix: recognize built-ins in the language grammar

  * We properly configure the language based on built-ins provided
    this allows the grammar to recognize `get or else` or other
    bogus built-ins that would otherwise be recognized as language
    constructs

  Related to camunda/camunda-modeler#3983
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Jun 15, 2024
@nikku nikku requested review from marstamm, barmac and a team June 15, 2024 11:59
@nikku nikku removed the request for review from a team June 15, 2024 20:17
Comment on lines 70 to 72
if (!label.includes(match)) {
return -100;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed in the walkthrough, this will remove fuzzy search from the suggestions. We can limit how many Items are shown by configuring maxRenderedOptions (default is 100), but I think ordering them is good enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Restored via e3477fb.

This is done by @codemirror/autocomplete itself.
@nikku nikku requested review from marstamm and barmac June 18, 2024 07:39
@nikku
Copy link
Member Author

nikku commented Jun 18, 2024

Ready for review (again). Please have a look!

@nikku nikku merged commit 7e696fe into main Jun 18, 2024
8 checks passed
@nikku nikku deleted the rewrite branch June 18, 2024 07:40
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Jun 18, 2024
@barmac
Copy link
Member

barmac commented Jun 18, 2024

thumbsup

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.

3 participants