Closed Bug 1998712 Opened 9 months ago Closed 9 months ago

Apply a kind of syntax highlighting to yaml files

Categories

(Webtools :: Searchfox, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

We already support indexing StaticPrefs.yaml, but we don't apply any syntax highlighting, given yaml doesn't have any reserved words.
but given that it has similar looking as CSS, it would be nice to apply color to the keys, and also do the same for other yaml files.

I've looked into some yaml files, but there's no good example for linkification.
the task definition yaml files have script paths, but they are relative path from random subdirectories for each value,
so there's no easy way to linkify them.

thus I'm going to focus just a highlighting here.

Although a bunch of the hyperblame stuff is still WIP, the cst_tokenizer.rs did land and could potentially form the basis of a tree-sitter-based tokenizer. It's what generates main%40big_cpp.cpp__tokenize__file.snap. Bug 1796870 tracks the generic tokenizer support. That said, I see no problem in following our current tokenizing approach for yaml, and to properly set expectations, I am unlikely to be able to do meaningful searchfox enhancement hobby stuff before mid-late December, and even then that might be optimistic, so it's not like there's any risk of contention on this.

See Also: → 1796870

Thank you for the references.
Supporting bug 1879185 at the same time would be reasonable.
I'll look into it.

Adding a nesting range to each key automatically applies highlighting.
I'll fix them at once.

Attached file GitHub Pull Request
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: