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
https://github.com/ScintillaOrg/lexilla/pull/76
Fixes #3054, fixes #3053, fixes #2456. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3169
-- Commit Summary --
* Add Raku (Perl 6) filetype support (lexer and ctags parser)
-- File Changes --
M ctags/Makefile.am (1) A ctags/parsers/perl6.c (338) M data/Makefile.am (1) A data/filedefs/filetypes.raku (83) M data/filetype_extensions.conf (1) M meson.build (2) M scintilla/Makefile.am (1) A scintilla/lexilla/lexers/LexRaku.cxx (1637) M scintilla/lexilla/src/Lexilla.cxx (1) M scintilla/scintilla_changes.patch (1) M src/filetypes.c (1) M src/filetypes.h (1) M src/highlighting.c (17) M src/highlightingmappings.h (41) M src/tagmanager/tm_parser.c (22) M src/tagmanager/tm_parser.h (1) M src/tagmanager/tm_parsers.h (3) M tests/ctags/Makefile.am (1) A tests/ctags/simple.raku (120) A tests/ctags/simple.raku.tags (26) M tests/meson.build (1)
-- Patch Links --
https://github.com/geany/geany/pull/3169.patch https://github.com/geany/geany/pull/3169.diff
@techee pushed 1 commit.
22e46db74fd0d370ba2976546f228269d624d151 Update HACKING regarding adding a lexer and using meson
@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
@techee pushed 1 commit.
103b8e12db4083ffb565d0cb7e6f089f8c95ae76 fixup! Add Raku (Perl 6) filetype support (lexer and ctags parser)
@techee pushed 2 commits.
c91b521e502fe61918077ec814f8fa4cabce96dd Add Raku (Perl 6) filetype support (lexer and ctags parser) 6e9133837cd3e3f4aa3af0fa0dcb77869bd7b581 Update HACKING regarding adding a lexer and using meson
I just repushed with all the keyword groups and keywords from Scintilla.
@techee pushed 1 commit.
e8c8b333ed65c5223e55bd4811a9a47833867e9d fixup! Update HACKING regarding adding a lexer and using meson
@techee pushed 2 commits.
4640330e69358e09d64d5ace37274f3ede51bbcb Add Raku (Perl 6) filetype support (lexer and ctags parser) a3efba039f37898074aa34fc9a7a72373c8ae1aa Update HACKING regarding adding a lexer and using meson
No Rakuist has tested in the time this has been here, maybe its not worth adding.
No Rakuist has tested in the time this has been here
One way to promote user participation might be configuring the CI workflow to pack a binary tarball and save it with the [upload-artifact][0] action.
Not that Geany users need coddling, but source builds really are problematic when the `make install` step could clobber your system's editor, and hacking the `LD_LIBRARY_PATH` is not advisable (although I've found it [does work in a pinch][1]).
[0]: https://github.com/actions/upload-artifact [1]: https://github.com/geany/geany/issues/3054#issuecomment-1237594886
CI workflow to pack a binary tarball and save it with the [upload-artifact](https://github.com/actions/upload-artifact) action.
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.
but source builds really are problematic when the make install step could clobber your system's editor
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 `README` or `INSTALL` (can't remember which) but it was sabotaged by other devs who kept adding more options and insisting it should not be in tree etc etc, so it was abandoned as it ended up no simpler.
Assuming you have installed the required tools (eg on Debuntu `build-essential`, `git`, `libgtk-3-dev`, `autoconf` and all its recommends and suggests). Many Geany users being developers will have at least some of these installed already.
In your home
``` mkdir git-geany; cd git-geany git clone https://github.com/geany/geany.git cd geany ./autogen.sh --prefix=/the/full/absolute/path/to/git-geany --disable-html-docs make install cd ../bin; ./geany -c ../config ```
Any time you cd to `git-geany/geany` you can follow (copy and paste) the command line instructions to checkout and test the PR on github and `make install`ing again. Each PR is in its own branch so they don't interfere. So you can test lots of PRs!!!!! :-)
When you are finished or something breaks your repository (damn force pushes) just delete the whole `git-geany` tree, I find its faster to re-clone something as small as Geany than it is to fix broken git repos.
hacking the LD_LIBRARY_PATH is not advisable
correct.
No Rakuist has tested in the time this has been here, maybe its not worth adding.
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. But my Perl is also as low as I managed to keep it.
@techee pushed 2 commits.
f8c11ecca5b47c40f76cc6392b01dcaf798ba0f0 Add Raku (Perl 6) filetype support (lexer and ctags parser) bde72f7fd692b83253dde38dd3abf8dcdb9723d8 Update HACKING regarding adding a lexer and using meson
@techee pushed 2 commits.
6d68dfdaaab28669a5af35867abe62902b12b927 Add Raku (Perl 6) filetype support (lexer and ctags parser) 5cdead43c65d866a3efc6e7fd2541b7f17c63d8d Update HACKING regarding adding a lexer and using meson
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.
Do we want this in 2.0?
@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.
@techee pushed 1 commit.
eb6efa91e364c40a841000ceb3e5fa4463120d56 Add Raku (Perl 6) filetype support (lexer and ctags parser)
OK, I removed the 2.0 milestone from this PR and posted the HACKING update separately in https://github.com/geany/geany/pull/3586.
@techee pushed 1 commit.
a9363bc15d2c66ea91eeec923961f93e41bff216 Add Raku (Perl 6) filetype support (lexer and ctags parser)
@techee pushed 1 commit.
1f3c9d53effcf0c242430f4cdd5ab843d9b4c1bd fixup! Add Raku (Perl 6) filetype support (lexer and ctags parser)
@eht16 if you can test this thats great, its the main thing missing which delayed it until it was too late for release. Since @techee has guaranteed he will support all these new languages lets take advantage of it :smile:
Agree with @techee and I could give it a bit of testing, though this might takes a few weeks.
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 https://github.com/universal-ctags/ctags/pull/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".
```diff @@ -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 }, ```
@techee pushed 1 commit.
3b666ca60dc70039b6ede71a9323eb994256f6b4 fixup! Add Raku (Perl 6) filetype support (lexer and ctags parser)
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 :-)
The perl6.c parser is taken from uctags, I assume. If so, we probably should to rename it as it was done in https://github.com/universal-ctags/ctags/pull/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.
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.
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.
@b4n commented on this pull request.
I have no clue about Rakut, but looks pretty good (as expected), minor comments/questions inline.
+functions=ACCEPTS AT-KEY EVALFILE EXISTS-KEY Filetests IO STORE abs accept acos acosec acosech acosh acotan acotanh alarm and antipairs asec asech asin asinh atan atan2 atanh base bind binmode bless break caller ceiling chars chdir chmod chomp chop chr chroot chrs cis close closedir codes comb conj connect contains continue cos cosec cosech cosh cotan cotanh crypt dbm defined die do dump each elems eof exec exists exit exp expmod fc fcntl fileno flat flip flock floor fmt fork formats functions get getc getpeername getpgrp getppid getpriority getsock gist glob gmtime goto grep hyper import index int invert ioctl is-prime iterator join keyof keys kill kv last lazy lc lcfirst lines link list listen local localtime lock log log10 lsb lstat map match mkdir msb msg my narrow new next no of open ord ords our pack package pairs path pick pipe polymod pop pos pred print printf prototype push quoting race rand read readdir readline readlink readpipe recv redo ref rename requires reset return reverse rewinddir rindex rmdir roots round samecase say scalar sec sech seek seekdir select semctl semget semop send set setpgrp setpriority setsockopt shift shm shutdown sign sin sinh sleep sockets sort splice split sprintf sqrt srand stat state study sub subst substr substr-rw succ symlink sys syscall system syswrite tan tanh tc tclc tell telldir tie time times trans trim trim-leading trim-trailing truncate uc ucfirst unimatch uniname uninames uniprop uniprops unival unlink unpack unpolar unshift untie use utime values wait waitpid wantarray warn wordcase words write
+types_basic=AST Any Block Bool CallFrame Callable Code Collation Compiler Complex ComplexStr Cool CurrentThreadScheduler Date DateTime Dateish Distribution Distribution::Hash Distribution::Locally Distribution::Path Duration Encoding Encoding::Registry Endian FatRat ForeignCode HyperSeq HyperWhatever Instant Int IntStr Junction Label Lock::Async Macro Method Mu Nil Num NumStr Numeric ObjAt Parameter Perl PredictiveIterator Proxy RaceSeq Rat RatStr Rational Real Routine Routine::WrapHandle Scalar Sequence Signature Str StrDistance Stringy Sub Submethod Telemetry Telemetry::Instrument::Thread Telemetry::Instrument::ThreadPool Telemetry::Instrument::Usage Telemetry::Period Telemetry::Sampler UInt ValueObjAt Variable Version Whatever WhateverCode atomicint bit bool buf buf1 buf16 buf2 buf32 buf4 buf64 buf8 int int1 int16 int2 int32 int4 int64 int8 long longlong num num32 num64 rat rat1 rat16 rat2 rat32 rat4 rat64 rat8 uint uint1 uint16 uint2 uint32 uint4 uint64 uint8 utf16 utf32 utf8 +types_composite=Array Associative Bag BagHash Baggy Blob Buf Capture Enumeration Hash Iterable Iterator List Map Mix MixHash Mixy NFC NFD NFKC NFKD Pair Positional PositionalBindFailover PseudoStash QuantHash Range Seq Set SetHash Setty Slip Stash Uni utf8 +types_domain=Attribute Cancellation Channel CompUnit CompUnit::Repository CompUnit::Repository::FileSystem CompUnit::Repository::Installation Distro Grammar IO IO::ArgFiles IO::CatHandle IO::Handle IO::Notification IO::Path IO::Path::Cygwin IO::Path::QNX IO::Path::Unix IO::Path::Win32 IO::Pipe IO::Socket IO::Socket::Async IO::Socket::INET IO::Spec IO::Spec::Cygwin IO::Spec::QNX IO::Spec::Unix IO::Spec::Win32 IO::Special Kernel Lock Match Order Pod::Block Pod::Block::Code Pod::Block::Comment Pod::Block::Declarator Pod::Block::Named Pod::Block::Para Pod::Block::Table Pod::Defn Pod::FormattingCode Pod::Heading Pod::Item Proc Proc::Async Promise Regex Scheduler Semaphore Supplier Supplier::Preserving Supply Systemic Tap Thread ThreadPoolScheduler VM +types_exceptions=Backtrace Backtrace::Frame CX::Done CX::Emit CX::Last CX::Next CX::Proceed CX::Redo CX::Return CX::Succeed CX::Take CX::Warn Exception Failure X::AdHoc X::Anon::Augment X::Anon::Multi X::Assignment::RO X::Attribute::NoPackage X::Attribute::Package X::Attribute::Required X::Attribute::Undeclared X::Augment::NoSuchType X::Bind X::Bind::NativeType X::Bind::Slice X::Caller::NotDynamic X::Channel::ReceiveOnClosed X::Channel::SendOnClosed X::Comp X::Composition::NotComposable X::Constructor::Positional X::Control X::ControlFlow X::ControlFlow::Return X::DateTime::TimezoneClash X::Declaration::Scope X::Declaration::Scope::Multi X::Does::TypeObject X::Dynamic::NotFound X::Eval::NoSuchLang X::Export::NameClash X::IO X::IO::Chdir X::IO::Chmod X::IO::Copy X::IO::Cwd X::IO::Dir X::IO::DoesNotExist X::IO::Link X::IO::Mkdir X::IO::Move X::IO::Rename X::IO::Rmdir X::IO::Symlink X::IO::Unlink X::Inheritance::NotComposed X::Inheritance::Unsupported X::Method::InvalidQualifier X::Method::NotFound X::Method::Private::Permission X::Method::Private::Unqualified X::Mixin::NotComposable X::NYI X::NoDispatcher X::Numeric::Real X::OS X::Obsolete X::OutOfRange X::Package::Stubbed X::Parameter::Default X::Parameter::MultipleTypeConstraints X::Parameter::Placeholder X::Parameter::Twigil X::Parameter::WrongOrder X::Phaser::Multiple X::Phaser::PrePost X::Placeholder::Block X::Placeholder::Mainline X::Pod X::Proc::Async X::Proc::Async::AlreadyStarted X::Proc::Async::BindOrUse X::Proc::Async::CharsOrBytes X::Proc::Async::MustBeStarted X::Proc::Async::OpenForWriting X::Proc::Async::TapBeforeSpawn X::Proc::Unsuccessful X::Promise::CauseOnlyValidOnBroken X::Promise::Vowed X::Redeclaration X::Role::Initialization X::Scheduler::CueInNaNSeconds X::Seq::Consumed X::Sequence::Deduction X::Signature::NameClash X::Signature::Placeholder X::Str::Numeric X::StubCode X::Syntax X::Syntax::Augment::WithoutMonkeyTyping X::Syntax::Comment::Embedded X::Syntax::Confused X::Syntax::InfixInTermPosition X::Syntax::Malformed X::Syntax::Missing X::Syntax::NegatedPair X::Syntax::NoSelf X::Syntax::Number::RadixOutOfRange X::Syntax::P5 X::Syntax::Perl5Var X::Syntax::Regex::Adverb X::Syntax::Regex::SolitaryQuantifier X::Syntax::Reserved X::Syntax::Self::WithoutObject X::Syntax::Signature::InvocantMarker X::Syntax::Term::MissingInitializer X::Syntax::UnlessElse X::Syntax::Variable::Match X::Syntax::Variable::Numeric X::Syntax::Variable::Twigil X::Temporal X::Temporal::InvalidFormat X::TypeCheck X::TypeCheck::Assignment X::TypeCheck::Binding X::TypeCheck::Return X::TypeCheck::Splice X::Undeclared +adverbs=D a array b backslash c closure delete double exec exists f function h hash heredoc k kv p q qq quotewords s scalar single sym to v val w words ww x + +[lexer_properties] +styling.within.preprocessor=1 + +[settings] +# default extension used when saving files +extension=raku + +# MIME type +mime_type=text/x-perl6
should this be `text/x-raku`? I have no clue, but seen both in a quick search, with no information with anything suggesting it's official, and no support in shared-mime-info (but an [issue](https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/133) with no info)
- { 2, "types_basic", FALSE },
+ { 3, "types_composite", FALSE }, + { 4, "types_domain", FALSE }, + { 5, "types_exceptions", FALSE },
Shouldn't one of those have `merge` set to TRUE?
@@ -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 },
Given the run command is `raku "%f"`, shouldn't `raku` be included in this list as well?
@techee commented on this pull request.
+functions=ACCEPTS AT-KEY EVALFILE EXISTS-KEY Filetests IO STORE abs accept acos acosec acosech acosh acotan acotanh alarm and antipairs asec asech asin asinh atan atan2 atanh base bind binmode bless break caller ceiling chars chdir chmod chomp chop chr chroot chrs cis close closedir codes comb conj connect contains continue cos cosec cosech cosh cotan cotanh crypt dbm defined die do dump each elems eof exec exists exit exp expmod fc fcntl fileno flat flip flock floor fmt fork formats functions get getc getpeername getpgrp getppid getpriority getsock gist glob gmtime goto grep hyper import index int invert ioctl is-prime iterator join keyof keys kill kv last lazy lc lcfirst lines link list listen local localtime lock log log10 lsb lstat map match mkdir msb msg my narrow new next no of open ord ords our pack package pairs path pick pipe polymod pop pos pred print printf prototype push quoting race rand read readdir readline readlink readpipe recv redo ref rename requires reset return reverse rewinddir rindex rmdir roots round samecase say scalar sec sech seek seekdir select semctl semget semop send set setpgrp setpriority setsockopt shift shm shutdown sign sin sinh sleep sockets sort splice split sprintf sqrt srand stat state study sub subst substr substr-rw succ symlink sys syscall system syswrite tan tanh tc tclc tell telldir tie time times trans trim trim-leading trim-trailing truncate uc ucfirst unimatch uniname uninames uniprop uniprops unival unlink unpack unpolar unshift untie use utime values wait waitpid wantarray warn wordcase words write
+types_basic=AST Any Block Bool CallFrame Callable Code Collation Compiler Complex ComplexStr Cool CurrentThreadScheduler Date DateTime Dateish Distribution Distribution::Hash Distribution::Locally Distribution::Path Duration Encoding Encoding::Registry Endian FatRat ForeignCode HyperSeq HyperWhatever Instant Int IntStr Junction Label Lock::Async Macro Method Mu Nil Num NumStr Numeric ObjAt Parameter Perl PredictiveIterator Proxy RaceSeq Rat RatStr Rational Real Routine Routine::WrapHandle Scalar Sequence Signature Str StrDistance Stringy Sub Submethod Telemetry Telemetry::Instrument::Thread Telemetry::Instrument::ThreadPool Telemetry::Instrument::Usage Telemetry::Period Telemetry::Sampler UInt ValueObjAt Variable Version Whatever WhateverCode atomicint bit bool buf buf1 buf16 buf2 buf32 buf4 buf64 buf8 int int1 int16 int2 int32 int4 int64 int8 long longlong num num32 num64 rat rat1 rat16 rat2 rat32 rat4 rat64 rat8 uint uint1 uint16 uint2 uint32 uint4 uint64 uint8 utf16 utf32 utf8 +types_composite=Array Associative Bag BagHash Baggy Blob Buf Capture Enumeration Hash Iterable Iterator List Map Mix MixHash Mixy NFC NFD NFKC NFKD Pair Positional PositionalBindFailover PseudoStash QuantHash Range Seq Set SetHash Setty Slip Stash Uni utf8 +types_domain=Attribute Cancellation Channel CompUnit CompUnit::Repository CompUnit::Repository::FileSystem CompUnit::Repository::Installation Distro Grammar IO IO::ArgFiles IO::CatHandle IO::Handle IO::Notification IO::Path IO::Path::Cygwin IO::Path::QNX IO::Path::Unix IO::Path::Win32 IO::Pipe IO::Socket IO::Socket::Async IO::Socket::INET IO::Spec IO::Spec::Cygwin IO::Spec::QNX IO::Spec::Unix IO::Spec::Win32 IO::Special Kernel Lock Match Order Pod::Block Pod::Block::Code Pod::Block::Comment Pod::Block::Declarator Pod::Block::Named Pod::Block::Para Pod::Block::Table Pod::Defn Pod::FormattingCode Pod::Heading Pod::Item Proc Proc::Async Promise Regex Scheduler Semaphore Supplier Supplier::Preserving Supply Systemic Tap Thread ThreadPoolScheduler VM +types_exceptions=Backtrace Backtrace::Frame CX::Done CX::Emit CX::Last CX::Next CX::Proceed CX::Redo CX::Return CX::Succeed CX::Take CX::Warn Exception Failure X::AdHoc X::Anon::Augment X::Anon::Multi X::Assignment::RO X::Attribute::NoPackage X::Attribute::Package X::Attribute::Required X::Attribute::Undeclared X::Augment::NoSuchType X::Bind X::Bind::NativeType X::Bind::Slice X::Caller::NotDynamic X::Channel::ReceiveOnClosed X::Channel::SendOnClosed X::Comp X::Composition::NotComposable X::Constructor::Positional X::Control X::ControlFlow X::ControlFlow::Return X::DateTime::TimezoneClash X::Declaration::Scope X::Declaration::Scope::Multi X::Does::TypeObject X::Dynamic::NotFound X::Eval::NoSuchLang X::Export::NameClash X::IO X::IO::Chdir X::IO::Chmod X::IO::Copy X::IO::Cwd X::IO::Dir X::IO::DoesNotExist X::IO::Link X::IO::Mkdir X::IO::Move X::IO::Rename X::IO::Rmdir X::IO::Symlink X::IO::Unlink X::Inheritance::NotComposed X::Inheritance::Unsupported X::Method::InvalidQualifier X::Method::NotFound X::Method::Private::Permission X::Method::Private::Unqualified X::Mixin::NotComposable X::NYI X::NoDispatcher X::Numeric::Real X::OS X::Obsolete X::OutOfRange X::Package::Stubbed X::Parameter::Default X::Parameter::MultipleTypeConstraints X::Parameter::Placeholder X::Parameter::Twigil X::Parameter::WrongOrder X::Phaser::Multiple X::Phaser::PrePost X::Placeholder::Block X::Placeholder::Mainline X::Pod X::Proc::Async X::Proc::Async::AlreadyStarted X::Proc::Async::BindOrUse X::Proc::Async::CharsOrBytes X::Proc::Async::MustBeStarted X::Proc::Async::OpenForWriting X::Proc::Async::TapBeforeSpawn X::Proc::Unsuccessful X::Promise::CauseOnlyValidOnBroken X::Promise::Vowed X::Redeclaration X::Role::Initialization X::Scheduler::CueInNaNSeconds X::Seq::Consumed X::Sequence::Deduction X::Signature::NameClash X::Signature::Placeholder X::Str::Numeric X::StubCode X::Syntax X::Syntax::Augment::WithoutMonkeyTyping X::Syntax::Comment::Embedded X::Syntax::Confused X::Syntax::InfixInTermPosition X::Syntax::Malformed X::Syntax::Missing X::Syntax::NegatedPair X::Syntax::NoSelf X::Syntax::Number::RadixOutOfRange X::Syntax::P5 X::Syntax::Perl5Var X::Syntax::Regex::Adverb X::Syntax::Regex::SolitaryQuantifier X::Syntax::Reserved X::Syntax::Self::WithoutObject X::Syntax::Signature::InvocantMarker X::Syntax::Term::MissingInitializer X::Syntax::UnlessElse X::Syntax::Variable::Match X::Syntax::Variable::Numeric X::Syntax::Variable::Twigil X::Temporal X::Temporal::InvalidFormat X::TypeCheck X::TypeCheck::Assignment X::TypeCheck::Binding X::TypeCheck::Return X::TypeCheck::Splice X::Undeclared +adverbs=D a array b backslash c closure delete double exec exists f function h hash heredoc k kv p q qq quotewords s scalar single sym to v val w words ww x + +[lexer_properties] +styling.within.preprocessor=1 + +[settings] +# default extension used when saving files +extension=raku + +# MIME type +mime_type=text/x-perl6
Yeah, no clue either. After not finding it in shared-mime-info I just googled for "text/x-perl6" and "text/x-raku" and the former returns about 300 results while the latter returns just 5. But it could just be that the various sources haven't been renamed after the language name change.
@techee commented on this pull request.
- { 2, "types_basic", FALSE },
+ { 3, "types_composite", FALSE }, + { 4, "types_domain", FALSE }, + { 5, "types_exceptions", FALSE },
If I understand it correctly, TRUE indicates the group into which dynamically obtained "keywords" from ctags are mapped. For C it's the various types like ScintillaObject or GeanyDocument, etc. which are then highlighted in the editor with the given style. I haven't seen it used by any scripting language though and there's a danger that the mapping of the given language, in our case ```C static TMParserMapEntry map_RAKU[] = { {'c', tm_tag_class_t}, // class {'g', tm_tag_struct_t}, // grammar {'m', tm_tag_method_t}, // method {'o', tm_tag_namespace_t}, // module {'p', tm_tag_package_t}, // package {'r', tm_tag_class_t}, // role {'u', tm_tag_variable_t}, // rule {'b', tm_tag_method_t}, // submethod {'s', tm_tag_function_t}, // subroutine {'t', tm_tag_variable_t}, // token }; ```
doesn't correctly match the hard-coded "typedef" types from the tag manager:
```C static TMTagType TM_GLOBAL_TYPE_MASK = tm_tag_class_t | tm_tag_enum_t | tm_tag_interface_t | tm_tag_struct_t | tm_tag_typedef_t | tm_tag_union_t | tm_tag_namespace_t; ```
(like mapping `grammar` to `struct` in the raku case - it probably is alright, I guess it's kind of type, but there isn't a guaranteed 1:1 correspondence)
Also, these types don't appear in function prototypes or variable declarations as these are dynamically-typed languages so I think it's not really that useful to have them colorized.
@techee pushed 1 commit.
fad5af87e74dbb3850c0e3a5cb764894dbc2151c fixup! Add Raku (Perl 6) filetype support (lexer and ctags parser)
@techee commented on this pull request.
@@ -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 },
Yeah, definitely, I've just added that.
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 <https://github.com/universal-ctags/ctags/pull/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.
@b4n commented on this pull request.
- { 2, "types_basic", FALSE },
+ { 3, "types_composite", FALSE }, + { 4, "types_domain", FALSE }, + { 5, "types_exceptions", FALSE },
You convinced me that we can at least wait for Rakuers to request/do it if they see fit.
FWIW I would think it fairly nice to have e.g. user-defined Python classes highlighted just like types in C -- not a must, but I wouldn't find this out of place -- and could make sense with annotations. Anyway, just saying that us not currently doing it for any scripting language is not necessarily a reason to keep it that way :)
@b4n commented on this pull request.
+functions=ACCEPTS AT-KEY EVALFILE EXISTS-KEY Filetests IO STORE abs accept acos acosec acosech acosh acotan acotanh alarm and antipairs asec asech asin asinh atan atan2 atanh base bind binmode bless break caller ceiling chars chdir chmod chomp chop chr chroot chrs cis close closedir codes comb conj connect contains continue cos cosec cosech cosh cotan cotanh crypt dbm defined die do dump each elems eof exec exists exit exp expmod fc fcntl fileno flat flip flock floor fmt fork formats functions get getc getpeername getpgrp getppid getpriority getsock gist glob gmtime goto grep hyper import index int invert ioctl is-prime iterator join keyof keys kill kv last lazy lc lcfirst lines link list listen local localtime lock log log10 lsb lstat map match mkdir msb msg my narrow new next no of open ord ords our pack package pairs path pick pipe polymod pop pos pred print printf prototype push quoting race rand read readdir readline readlink readpipe recv redo ref rename requires reset return reverse rewinddir rindex rmdir roots round samecase say scalar sec sech seek seekdir select semctl semget semop send set setpgrp setpriority setsockopt shift shm shutdown sign sin sinh sleep sockets sort splice split sprintf sqrt srand stat state study sub subst substr substr-rw succ symlink sys syscall system syswrite tan tanh tc tclc tell telldir tie time times trans trim trim-leading trim-trailing truncate uc ucfirst unimatch uniname uninames uniprop uniprops unival unlink unpack unpolar unshift untie use utime values wait waitpid wantarray warn wordcase words write
+types_basic=AST Any Block Bool CallFrame Callable Code Collation Compiler Complex ComplexStr Cool CurrentThreadScheduler Date DateTime Dateish Distribution Distribution::Hash Distribution::Locally Distribution::Path Duration Encoding Encoding::Registry Endian FatRat ForeignCode HyperSeq HyperWhatever Instant Int IntStr Junction Label Lock::Async Macro Method Mu Nil Num NumStr Numeric ObjAt Parameter Perl PredictiveIterator Proxy RaceSeq Rat RatStr Rational Real Routine Routine::WrapHandle Scalar Sequence Signature Str StrDistance Stringy Sub Submethod Telemetry Telemetry::Instrument::Thread Telemetry::Instrument::ThreadPool Telemetry::Instrument::Usage Telemetry::Period Telemetry::Sampler UInt ValueObjAt Variable Version Whatever WhateverCode atomicint bit bool buf buf1 buf16 buf2 buf32 buf4 buf64 buf8 int int1 int16 int2 int32 int4 int64 int8 long longlong num num32 num64 rat rat1 rat16 rat2 rat32 rat4 rat64 rat8 uint uint1 uint16 uint2 uint32 uint4 uint64 uint8 utf16 utf32 utf8 +types_composite=Array Associative Bag BagHash Baggy Blob Buf Capture Enumeration Hash Iterable Iterator List Map Mix MixHash Mixy NFC NFD NFKC NFKD Pair Positional PositionalBindFailover PseudoStash QuantHash Range Seq Set SetHash Setty Slip Stash Uni utf8 +types_domain=Attribute Cancellation Channel CompUnit CompUnit::Repository CompUnit::Repository::FileSystem CompUnit::Repository::Installation Distro Grammar IO IO::ArgFiles IO::CatHandle IO::Handle IO::Notification IO::Path IO::Path::Cygwin IO::Path::QNX IO::Path::Unix IO::Path::Win32 IO::Pipe IO::Socket IO::Socket::Async IO::Socket::INET IO::Spec IO::Spec::Cygwin IO::Spec::QNX IO::Spec::Unix IO::Spec::Win32 IO::Special Kernel Lock Match Order Pod::Block Pod::Block::Code Pod::Block::Comment Pod::Block::Declarator Pod::Block::Named Pod::Block::Para Pod::Block::Table Pod::Defn Pod::FormattingCode Pod::Heading Pod::Item Proc Proc::Async Promise Regex Scheduler Semaphore Supplier Supplier::Preserving Supply Systemic Tap Thread ThreadPoolScheduler VM +types_exceptions=Backtrace Backtrace::Frame CX::Done CX::Emit CX::Last CX::Next CX::Proceed CX::Redo CX::Return CX::Succeed CX::Take CX::Warn Exception Failure X::AdHoc X::Anon::Augment X::Anon::Multi X::Assignment::RO X::Attribute::NoPackage X::Attribute::Package X::Attribute::Required X::Attribute::Undeclared X::Augment::NoSuchType X::Bind X::Bind::NativeType X::Bind::Slice X::Caller::NotDynamic X::Channel::ReceiveOnClosed X::Channel::SendOnClosed X::Comp X::Composition::NotComposable X::Constructor::Positional X::Control X::ControlFlow X::ControlFlow::Return X::DateTime::TimezoneClash X::Declaration::Scope X::Declaration::Scope::Multi X::Does::TypeObject X::Dynamic::NotFound X::Eval::NoSuchLang X::Export::NameClash X::IO X::IO::Chdir X::IO::Chmod X::IO::Copy X::IO::Cwd X::IO::Dir X::IO::DoesNotExist X::IO::Link X::IO::Mkdir X::IO::Move X::IO::Rename X::IO::Rmdir X::IO::Symlink X::IO::Unlink X::Inheritance::NotComposed X::Inheritance::Unsupported X::Method::InvalidQualifier X::Method::NotFound X::Method::Private::Permission X::Method::Private::Unqualified X::Mixin::NotComposable X::NYI X::NoDispatcher X::Numeric::Real X::OS X::Obsolete X::OutOfRange X::Package::Stubbed X::Parameter::Default X::Parameter::MultipleTypeConstraints X::Parameter::Placeholder X::Parameter::Twigil X::Parameter::WrongOrder X::Phaser::Multiple X::Phaser::PrePost X::Placeholder::Block X::Placeholder::Mainline X::Pod X::Proc::Async X::Proc::Async::AlreadyStarted X::Proc::Async::BindOrUse X::Proc::Async::CharsOrBytes X::Proc::Async::MustBeStarted X::Proc::Async::OpenForWriting X::Proc::Async::TapBeforeSpawn X::Proc::Unsuccessful X::Promise::CauseOnlyValidOnBroken X::Promise::Vowed X::Redeclaration X::Role::Initialization X::Scheduler::CueInNaNSeconds X::Seq::Consumed X::Sequence::Deduction X::Signature::NameClash X::Signature::Placeholder X::Str::Numeric X::StubCode X::Syntax X::Syntax::Augment::WithoutMonkeyTyping X::Syntax::Comment::Embedded X::Syntax::Confused X::Syntax::InfixInTermPosition X::Syntax::Malformed X::Syntax::Missing X::Syntax::NegatedPair X::Syntax::NoSelf X::Syntax::Number::RadixOutOfRange X::Syntax::P5 X::Syntax::Perl5Var X::Syntax::Regex::Adverb X::Syntax::Regex::SolitaryQuantifier X::Syntax::Reserved X::Syntax::Self::WithoutObject X::Syntax::Signature::InvocantMarker X::Syntax::Term::MissingInitializer X::Syntax::UnlessElse X::Syntax::Variable::Match X::Syntax::Variable::Numeric X::Syntax::Variable::Twigil X::Temporal X::Temporal::InvalidFormat X::TypeCheck X::TypeCheck::Assignment X::TypeCheck::Binding X::TypeCheck::Return X::TypeCheck::Splice X::Undeclared +adverbs=D a array b backslash c closure delete double exec exists f function h hash heredoc k kv p q qq quotewords s scalar single sym to v val w words ww x + +[lexer_properties] +styling.within.preprocessor=1 + +[settings] +# default extension used when saving files +extension=raku + +# MIME type +mime_type=text/x-perl6
Fair enough, and I guess it a MIME type pops up it'll support this alias anyway -- and we can updated it later on if something appears out of the fog at some point.
@b4n approved this pull request.
I still have no clue about Raku, but LGTM and works as far as super-basic testing goes.
Maybe I'll change my mind in two weeks, what about Reany?
Sounds like Geany written in R, doesn't it? :)
Maybe I'll change my mind in two weeks, what about Reany?
Sounds like Geany written in R, doesn't it? :)
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 :-)
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.
Merged #3169 into master.
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.
github-comments@lists.geany.org