LWS-264: Lxlquery grammar and highlighting #1159
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Tickets involved
LWS-264
Summary of changes
Tags
for certain nodestry some searches from the help page:
pippi långstrump språk:(engelska OR franska) ÅR>2002]
språk:svenska ÅR>2010 ÅR<=2024 ämne:"sao:Drakar"
träd* bibliografi:"sigel:DST" NOT typ:Text
Or a 'special' qualifier
includeEplikt
Notes:
The (somewhat) straighforward way of highlighting using nodes -> tags -> classes/styles seems to be the cheapest (compared to iterating through the syntax tree adding decorators - even though we'll be doing that later on) but is limited in that it does not produce nested structures, only an inline element for the most specific exported node in a given place. On the other hand, I don't know if we want/need highlighting at all. But for now I think it's nice for evaluating/debugging purposes. The styling itself is not carefully done :)
The highlighter extension now belongs to lxlweb. Since it's language specific, it doesn't belong to supersearch and is not a core part of the language either. It imports stuff from codemirror/lezer that lxlweb does not directly depend on, don't know if that's a problem?
(Another solution could be to let the language package export the Highlighter, import it in lxlweb and pass it as a special prop (how many can we handle?) to supersearch that then turns it into an extension.)