core: Fix GitHub syntax highlighting#205
Conversation
|
Awesome. I didn't know about this. I can apply this for now but we should possibly look at other syntaxes. Weirdly, highlighting as powershell works pretty good in vscode... |
Ideally, a
PowerShell is also listed, so you could change this to the following, if that would render better highlighting… *.ys linguist-language=powershell |
|
do you know if |
I think that would only work after a merged PR entry to linguist… Until then, would have to just do: ``` yaml
!yamlscript/v0
say: 42
```or ~~~ yaml
!yamlscript/v0
say: 42
~~~ |
|
I can certainly test it out on a branch,,, |
|
I realized that I can retarget the PR myself. |
|
@danielbayley do you have any experience creating a new syntax highlighter for linguist? |
|
Merged into a branch intended for 0.1.88 |
|
YAML syntax highlighting is fine for now, but I'd like to get real ys token highlighting. |
@ingydotnet Iv'e done plenty of parsing stuff, but not really much in the context of syntax highlighting—apart from minor related things in Atom packages… I imagine Linguist probably uses something like TextMate grammars, or something RegEx-based.
Yeah ideally! I will say for sure, the much better approach would be the Tree-sitter/AST route… |
|
I've also done a bunch with parsing including creating the Pegex grammar language: https://github.com/pegex-parser I think the big thing that YS needs first is a language server.` Here's a visual of the comilper in action: The output of the build stage should have all the info we need, except for input position (line/col). |
Force GitHub to highlight
*.ysfiles as YAML.