-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SuperCollider language support #749
Conversation
Hm. It looks like the Python lexer also says https://fileinfo.com/extension/sc |
|
In general, I'd like to refactor the guessers to use more specific disambiguators, like GitHub's |
ahh I see! well, I can push a change for that if you want. I don't want to break things that are already in use. .sc files in SuperCollider have a predictable scheme: a few lines of comments followed by some form of class or class extension declaration. could I make use of that somehow with the existing guesser implementation? |
btw, I'm already using this branch to generate HTML for my github-pages blog. thanks for making this tool so easy to use & extend! |
I'm happy just to give the extension to supercollider for now, and revisit the guessers later. Though if you want to make an attempt at it in a separate MR that would be super helpful! |
great! ok, pushed the change and tests now pass. |
ping. could this please be merged? if there's anything else I should change please let me know. Thanks! |
Yes! And now we can use the specific disambiguators to solve the guessing problem. |
@gfx this lgtm. we should add a disambiguator before the next release, though. |
ping - any updates? |
still waiting on an update. is there any plan to integrate this? |
The SuperCollider project is redoing its website at the moment which has revived discussion about this PR. Is there any plan to merge this, or should I and my collaborators just preprocess our code blocks ourselves? |
+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I'm trying to help triage old pull requests so we can try to work them down. Can you please take a look at the comments.
a002c8b
to
d794108
Compare
@vidarh Thanks for the comments; I've made the rest of the changes. |
What's the status on this? |
@brianlheim Hi, I started as a maintainer at the end of last month and am working through the backlog of outstanding PRs. I'm sorry this has been in the queue for so long :( I realise this will feel like you're being jerked around even more but I'll have some additional comments on the lexer I'll send as a review. To explain, there are a couple of things that we're trying to change with lexers for performance reasons and, while there are existing lexers not doing these things (fixing these is on the list), we're tying to ensure new lexers are all good in this regard. The other point is with respect to the |
if you can guarantee a clear timeline for when this will get merged, i'll gladly help out. this is the third time someone has promised a merge if i only change a few things. |
@brianlheim Yeah, I understand. Honestly, I wouldn't blame you if you wanted to wash your hands of this and walk away. I can only point at the commit history since I came on board. I have committing rights and will be ready to merge this PR once: (1) the changes are made in the review just submitted; and (2) I have a disambiguation rule written (I'll get this done as soon as possible). |
i'll wait for (2) then, thanks. |
@brianlheim That's fair. Can you explain what you meant in the comment I referenced earlier? Basically, I need to write code that will distinguish between Python and SuperCollider. You can see how this works for existing disambiguation in the Disambiguation class: rouge/lib/rouge/guessers/disambiguation.rb Lines 69 to 109 in 88a4009
Without having thought too deeply about it, my initial idea is that the |
…erator for array unpacking
@pyrmont Thanks! I've pushed a commit that removes local variables and another to update the visual sample. Not sure I understand your other comments. IIRC I copied this one mostly from the JavaScript lexer. Re this comment:
nothing special at the beginning of a file. if you think I can remove some of this logic, just let me know and I'll do that. |
@brianlheim It's probably easiest if I make some edits to the file and then submit them to you again as a PR. That'll make the thoughts clearer, I think. I'll try to do that sometime today. |
@pyrmont Got it! I'll look at it tomorrow evening. Thanks so much. |
I've submitted a simplified lexer that produces the same output (or at least seems to based on the visual sample). |
@pyrmont thanks! is there anything else you need now? |
@brianlheim My first pass is that it looks right! I'll take a look at the visual sample during lunch (in Tokyo) and if it's all good, should be able to merge! :) |
fantastic! |
Merged it in now. Sorry it took so long. I'm discussing with the other maintainers at the moment when the next release of the Rouge gem will be but it should be soon. Thanks for contributing! |
Thanks so much @pyrmont. To be honest, I was quite skeptical when you revived this thread. But, I have to say that this PR since you took it up has been the best experience I've had contributing to a 3rd party OSS project. You're doing a really great job as a maintainer. :) |
Thanks @brianlheim :) That's nice of you to say. It was a very unfortunate sequence of events really but I think we're back on track now! |
Wish you all the best! Where can I go to be informed of your release schedule? I'm really looking forward to being able to use this in github-pages! |
@brianlheim I don't intend to squash your bubble, but please do not expect to see the next release on GitHub Pages anytime soon.. They've their own way of managing dependencies. The latest release is still locked to |
no worries, i understand there are two release cycles to deal with here :) still, it would at least allow people to easily grab this project and use it to colorize their own code. |
@brianlheim We haven't formalised anything in terms of release schedules yet. My initial preference while we clear the backlog is to try to do a new release each month but that's not something I've discussed yet with the other maintainers. Projects like GitLab use Rouge and they may prefer to see more rapid updates since a number of the outstanding PRs were generated by their users. To keep track of future releases, I'd suggest turning on notifications from the front page of this project. You can choose there to be notified about releases only :) |
This adds support for the SuperCollider language.
The visual sample contains a near-complete rundown of general language cases, including corner cases that I've found as a maintainer of the language's own backend lexer. The highlighting is mostly adapted from the project's IDE's lexing regexes, which I've found to be the most solid set among all the lexers out there for the language.
Let me know if I missed anything. Thanks!