Pass completion context to properties #2

Merged
knpwrs merged 1 commit from patch-1 into main 2023-12-22 17:54:49 +01:00
knpwrs commented 2023-12-21 21:54:53 +01:00 (Migrated from github.com)

This would be very useful for me as I am basing completions not only on variables passed to liquid templates, but also locally-defined variables (e.g., for <varname> in <array> or assign). Consider:

{% for person in people %}
  - {{ person }}
{% endfor %}

As best I can tell right now, given the current API, there is no way to make CodeMirror autocomplete person, though once I do type person and press . then properties is called, but I don't have any context available to determine that person is even available in scope in order to provide properties to complete.

This would be very useful for me as I am basing completions not only on variables passed to liquid templates, but also locally-defined variables (e.g., `for <varname> in <array>` or `assign`). Consider: ```liquid {% for person in people %} - {{ person }} {% endfor %} ``` As best I can tell right now, given the current API, there is no way to make CodeMirror autocomplete `person`, though once I do type `person` and press `.` then `properties` is called, but I don't have any context available to determine that `person` is even available in scope in order to provide properties to complete.
marijnh commented 2023-12-22 17:54:58 +01:00 (Migrated from github.com)

That seems reasonable. Merged.

That seems reasonable. Merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/lang-liquid!2
No description provided.