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 Raku (Perl 6) filetype support (lexer and ctags parser) #3169
Conversation
@kugel- I added a patch updating HACKING with some changes related to adding a lexer and also mentioning updates to meson.build. Would you have a look if the changes look good to you? |
Speaking only for HACKING it seems alright |
I just repushed with all the keyword groups and keywords from Scintilla. |
No Rakuist has tested in the time this has been here, maybe its not worth adding. |
One way to promote user participation might be configuring the CI workflow to pack a binary tarball and save it with the upload-artifact action. Not that Geany users need coddling, but source builds really are problematic when the |
The problem with this is "for what system"? All the Linuxes have their own quirks, and most distros have their own patches for Geany to meet their requirements. Somewhat ironically Windows and Macos are more consistent, although (IIUC) both have occasional forward/backward compatibility lapses and are somewhat harder to build for. Making a source tarball is more likely portable, but its not really much less work for the user than using the git repo.
On Linux its actually quite easy to build a fully isolated copy of Geany from git that can't clobber the system install (because its installed without privileges). I did once try to add the instructions to Assuming you have installed the required tools (eg on Debuntu In your home
Any time you cd to When you are finished or something breaks your repository (damn force pushes) just delete the whole
correct. |
Well, even though I'm not a big fan of anything perl-related, I think Geany should support Raku. We have 3 open issues related to this language so people seem to be interested in it and I think it's a relatively common language (compared to some rather esoteric languages that Geany supports) and shouldn't be omitted. This patch does the "hard work" (especially for someone who knows only scripting languages and has no experience with Geany hacking) and even if e.g. the keyword selection isn't perfect, once the support is in, any subsequent improvement should be much easier for Raku users. |
Agree with @techee and I could give it a bit of testing, though this might takes a few weeks. |
bde72f7
to
5cdead4
Compare
So I guess this PR will have to wait for the next release, right? I'm a bit sad about that because Perl 6 was requested several times and this PR was waiting for a year and a half for merging but I guess it's too late now... Should I extract the changes from HACKING to a separate PR? It contains the most up-to-date info about how to add ctags parsers and Scintilla lexers. |
@techee yeah I'd think it's wiser to wait, but probably get it in soon after. And yeah, HACKING changes are probably useful nonetheless. |
OK, I removed the 2.0 milestone from this PR and posted the HACKING update separately in #3586. |
s/few weeks/few years/ but we are all patient :). I gave it some testing and it works fine. I want to repeat I'm really bad at Perl and saw Raku the first time now. Btw, I did not fell in love with it :D. The perl6.c parser is taken from uctags, I assume. If so, we probably should to rename it as it was done in universal-ctags/ctags#3777. Geany detects https://github.com/Raku/examples/blob/master/categories/games/blackjack.p6 as Perl even the file extension tells Raku. This is because of the shebang in the file. The following change should solve it by first checking for "perl6" and only then "perl". @@ -604,6 +605,7 @@ static GeanyFiletype *find_shebang(const gchar *utf8_filename, const gchar *line
{ "sh", GEANY_FILETYPES_SH },
{ "bash", GEANY_FILETYPES_SH },
{ "dash", GEANY_FILETYPES_SH },
+ { "perl6", GEANY_FILETYPES_RAKU },
{ "perl", GEANY_FILETYPES_PERL },
{ "python", GEANY_FILETYPES_PYTHON },
{ "php", GEANY_FILETYPES_PHP }, |
Good, I was worried we'd have to rewrite Geany in it :-)
I'm aware of that, I was just thinking it could be done during the next "ctags sync" if it's not a problem.
I totally missed that one, thanks! I've just made a fixup commit with the proposed fix. Is anything else missing? If there are no other problems, I'd like to merge this PR so we are finally done with it. |
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.
I have no clue about Rakut, but looks pretty good (as expected), minor comments/questions inline.
I gave it some testing and it works fine. I want to repeat I'm
really bad at Perl and saw Raku the first time now. Btw, I did not
fell in love with it :D.
Good, I was worried we'd have to rewrite Geany in it :-)
Maybe I'll change my mind in two weeks, what about Reany?
:)
The perl6.c parser is taken from uctags, I assume. If so, we
probably should to rename it as it was done in
universal-ctags/ctags#3777
<universal-ctags/ctags#3777>.
I'm aware of that, I was just thinking it could be done during the next
"ctags sync" if it's not a problem.
Alright, sounds good.
Is anything else missing? If there are no other problems, I'd like to
merge this PR so we are finally done with it.
I'm fine with it and when @b4n is also, let's get it in.
|
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.
I still have no clue about Raku, but LGTM and works as far as super-basic testing goes.
Sounds like Geany written in R, doesn't it? :) I'm not gonna suggest Geary… 😆 |
Surely he means Racket, its lisp (well Scheme, but similar) and it has its own portable native GUI library built in, no more GTK on windows issues .. hmm I just might convince myself at this rate :-) |
Surely he means Racket, its [lisp](https://xkcd.com/297/) (well
Scheme, but similar) and it has its own portable native GUI library
built in, no more GTK on windows issues .. hmm I just might convince
myself at this rate :-)
Raku, R, Racket, Rust, Ruby, I'll leave the important questions to
@elextr.
|
Meh, I forgot how github handles fixup commits and kind of assumed they get auto-squashed when merging a PR (which didn't happen). So there's a slight mess as the fixup commits were preserved. Sorry for that. |
The dropdown to the right of the big green button has a squash and merge option. |
Note: I have never used Perl 6 (and did my best to avoid Perl) so I largely don't know what I'm doing. There just are several open issues requesting this language and I believe Geany should support it. And even if this PR isn't perfect, it should be much easier for real Raku users to improve it once this PR is in (e.g. by providing better keywords or highlighting).
I based the keyword list on
https://github.com/Raku/vim-raku/blob/master/syntax/raku.vim
and also fixed one lexilla bug here
ScintillaOrg/lexilla#76
Fixes #3054, fixes #3053, fixes #2456.