feat(search): Add Syntax Highlighting for Magik language#62919
Conversation
|
I would also like to say that I am a Magik developer and I have been using this tree-sitter for a few months now in my daily work. We appreciate the feedback you have given us by raising the issues. In my daily work I found out that it covers most cases and only has some edge-cases which need to be fixed. If I need to express the coverage in a percentage, I would say it covers 90%-95% of all of the grammar in Magik. Since I am one of the contributors of the tree-sitter-magik, please let us know if we could help you to integrate this any easier into sourcegraph. |
|
@sebastiaanspeck Thanks for the quick work there. I pulled the changes in and they work great! |
kritzcreek
left a comment
There was a problem hiding this comment.
We're currently depending on a rust-bindings branch for our fork of the upstream grammar, could we instead have our main be ahead of the upstream so it's easier to see at a glance how they compare when browsing via GH?
|
Code looks good from my side WDYT about the branch management?
Does this change need an entry in the changelog as well? |
|
@kritzcreek Thanks for the feedback. I updated change log and our forked repo as you suggested |
| (global_reference) | ||
| (identifier) | ||
| (slot_accessor) | ||
| (label) |
There was a problem hiding this comment.
This one is interesting. Labels are not really variables. However, we don't really have a SyntaxKind in SCIP to mark labels. GoLand does highlight labels differently, using bold in the theme that I have.
We should probably add a ControlFlowLabel syntax kind to SCIP and use that here. I've filed a follow-up issue: https://linear.app/sourcegraph/issue/GRAPH-661/add-syntaxkindcontrolflowlabel-to-scip
|
@sebastiaanspeck does Magik have a standard nil/null value? I don't see it in the grammar, but other Smalltalk languages typically have |
You could say |
|
Once the highlights.scm (and other files that originate from tree-sitter-magik) look good, we can backport any changes to the tree-sitter-magik-repo, so feel free to mention me in any follow-up PRs |
|
|
||
| (procedure (label) @function) | ||
|
|
||
| (documentation) @comment |
There was a problem hiding this comment.
| (documentation) @comment | |
| (documentation) @attribute |
There was a problem hiding this comment.
This doesn't seem right to me @sebastiaanspeck . Why would this be an attribute?
There was a problem hiding this comment.
In Magik we have something called a class browser and the documentation will be shown as an attribute of a method or class in that browser. Documentation is always in the form of ## documentation about a method or class, where a comment is just for other developers etc and always in the form of # comment about a line of code.
| "_method" | ||
| "_optional" |
There was a problem hiding this comment.
| "_method" | |
| "_optional" | |
| "_method" | |
| "_not" | |
| "_optional" |
|
Addressed new comments in this PR |
Fixes GRAPH-621
Key notes
Links
Following links I used to find about the language
Screenshots
Test plan
Changelog