-
Notifications
You must be signed in to change notification settings - Fork 743
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
added basic Haxe support #815
Conversation
Also: <3 Haxe support. Thanks for building this! |
Any news on this? |
Hi there! What need to be done here to make it merged? |
@olleolleolle any guidance here on what needs to be done would be greatly appreciated. |
@pyrmont @olleolleolle @jneen Hey guys 👋 any updates on what needs to be done to get this merged? The guys at dev.to use this to syntax highlight their articles and this would be great for all the Haxe posts out there. |
@RichardBray Sorry it's taken so long to get to this. I'm afraid that I've been working my way through the PRs in reverse chronological order which admittedly isn't great for the older PRs. I do prioritise ones where there's activity, though, so am happy to move this to the front of my queue! Will take a look on where things are and get back to you :) |
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.
Thanks for this submission and apologies for how long it has taken to review it.
In addition to the specific comments below, the lexer also needs to have a spec. At a basic level, the spec just needs to test a handful of things. The Perl one is a very similar example:
rouge/spec/lexers/perl_spec.rb
Lines 1 to 26 in 73662c9
# -*- coding: utf-8 -*- # | |
# frozen_string_literal: true | |
describe Rouge::Lexers::Perl do | |
let(:subject) { Rouge::Lexers::Perl.new } | |
describe 'guessing' do | |
include Support::Guessing | |
it 'guesses by filename' do | |
# *.pl needs source hints because it's also used by Prolog | |
assert_guess :filename => 'foo.pl', :source => 'my $foo = 1' | |
assert_guess :filename => 'foo.pm' | |
assert_guess :filename => 'test.t' | |
end | |
it 'guesses by mimetype' do | |
assert_guess :mimetype => 'text/x-perl' | |
assert_guess :mimetype => 'application/x-perl' | |
end | |
it 'guesses by source' do | |
assert_guess :source => '#!/usr/local/bin/perl' | |
end | |
end | |
end |
Oh, two more things:
Let me know if any of the above or any of the comments are unclear! |
@RichardBray No worries! Let me know if you get stuck! |
Hi! I'm going on vacation these days and I couldn't add a better sample. I think all other changes are done. @RichardBray , could you add a proper sample? |
@josuigoa Yeah sure, I will see what I can do. Thanks for your work on this so far. |
I'm on vacation but not disconnected, just away from a computer...
what you prefer, I think I've given @RichardBray permission, but you can
merge the 'part 2' branch, it doesn't matter
|
@josuigoa Ah cool thanks for giving me permission. I'll see if I can push my changes to this PR |
@josuigoa @RichardBray I'm sorry for the force push—there's been some important changes made to Rouge's Gemfile and Rake tasks that I wanted to pick up so I've rebased against the current master. I've corrected some remaining indentation mistakes and added a The last thing to check are the errors in the visual sample. If you run |
@pyrmont Hmmm, I guess there must be a rule where if an But if someone does want syntax highlighting for a Haxe Macro then there might be an issue 🤔 |
What do you mean? Haxe metas can be used in various places. |
@kLabz sorry I meant an error in the rouge lexer not an error with Haxe. I feel like rouge will need to be updated in the future to accommodate the |
I'm testing things locally and yeah this version is very limited but I guess that's already better than current state (no highlighting at all) |
@kLabz Can you provide some examples (you can just paste them here) that aren't being parsed properly? I'm more inclined to want to fix this while we're reviewing this lexer now than put it off to later. |
removed failing @ symbols
There's not much missing actually 👍
|
@kLabz I think I've added all the features you mentioned but let me know if I broke something or if I missed something. |
Indeed it works pretty well, thanks! |
Thanks for sorting things out and approving this PR @pyrmont. I owe you a coffee when I'm next in Tokyo ☕️ |
Thanks everyone :) We're on a two-week cadence for releases of Rouge as we go through the backlog of pull requests. The next release (v3.9.0) is scheduled for Tuesday 20 August and this lexer will be included with that version. |
No description provided.