Additional languages (dipping my toes into code contribution)
-
I opened my big mouth in an issue, and suddenly I might have volunteered myself to “give it a go” to add Go/Golang.
(Until today, I never thought I had an environment that would be able to build Notepad++ from source, since I don’t have VS installed at home, and wasn’t planning on it. But that series of posts in the issue, I tried using my gcc, even though it’s not an MSYS-like environment for mingw gcc, and was able to build the current Notepad++, so apparently I do have a successful build environment. Which means that excuse is now gone for me. ;-))
In addition to the Go request, there have been historic requests around SAS & Stata, which have Lexilla lexers but have never been enabled:
- forum request for SAS+Stata
- forum request for Stata
- issue#9743 and issue#9833 asked about a UDL implementation for SAS, but not specifically asking for native support for SAS
- issue#4116 asked about UDL implementation for Stata, but not specifically asking for native support for Stata
I had played around in those old forum discussions of enabling the lexers using PythonScript, since they weren’t built in, but always thought that they should be enabled, since our copy of Lexilla has them available.
I could just implement the Go for now, and wait on SAS+Stata… But I was thinking if I was touching that section of code, it might make sense to add three languages in one swoop, rather than doing one PR per language.
But since I don’t have as much direct experience with how Don decides on accepting PR for such things:
- Would he likely reject if I did all three in one PR, or would it be a good effort-saving to make only a single PR for the multiple languages?
- Would he accept the tangential mentions of SAS and Stata as sufficient request for enabling those existing-but-hidden lexers, or would he want an issue that specifically requested those be built-in rather than with UDL? And if a specific issue, would it increase or decrease the chances of the PR being accepted if I’m the one who also did an issue? or should I wait until a “random user” specifically asks for SAS+Stata built-in support?
- Or should I not waste any time with SAS+Stata because they have UDLs?
- But based on the same logic as for 3, should I not even spend any time on Go, because there’s already a UDL for it?
update: oh, right, there’s a lexer for Raku, which was mentioned in issue #4465, so that would be a fourth language on my list for either one-at-a-time or in-bulk adding.
-
Doing more research, Hollywood appears to be the most recent language added. That person did the PR without an associated issue, so that argues that there might not be strenuous objection to not having a specific issue to add SAS + Stata.
Given the numbering problem that occurred during the addition of Hollywood, it would either mean that I’d have to do them all at once (so I can decide on the numbers), or I’d have to do them truly sequentially (waiting for one to be incorporated before doing the others), because N parallel PR would conflict with each other in terms of the L_XXX enumeration / lexer numbering.
The Hollywood addition included the functionList and API/autoCompletion definitions. Are those something that are expected with every new language? Or could I get away with submitting just the core changes to enable the lexers and add the langs.model.xml and stylers.xml/theme updates?
-
I don’t really contribute to the Npp code but from my point of view
small, manageable PRs are much easier to review and are therefore more likely to be accepted than a bunch of changes, especially if they are not “logically” related. If there is a problem, they can simply be reverted and the rest can continue to be used. Regarding an issue/feature request, what’s stopping you from opening one? Personally, I believe that EVERYTHING should go through this process, issues or feature requests, so that others can comment/discuss if necessary. This is of course also possible in a PR but it should be used for code related discussions without exception. As I said, my opinion. -
@Ekopalypse said:
a bunch of excellent stuff; could not be said better.
-
@Ekopalypse said in Additional languages (dipping my toes into code contribution):
small, manageable PRs are much easier to review and are therefore more likely to be accepted than a bunch of changes, especially if they are not “logically” related
One could argue that enabling multiple existing-but-hidden lexers would be “logically related”. ;-)
But after starting work on just the first, with the number of different source files I’ve had to touch just to get the one language, I think it does make more sense to do one language per PR.
So I’ll just submit the Golang first… And if that one is accepted, I’ll go and do Raku, which has had an open request since before they’d finalized on the name of Raku instead of their original, confusing “Perl 6” – though probably, at this point, most Raku developers have probably chosen one of the many editors that’s supported them for years…)
edit: fixed link
-
@PeterJones said in Additional languages (dipping my toes into code contribution):
at this point, most Raku developers have probably chosen one of the many editors that’s supported them for years…)
Geany only just recently integrated Raku themselves, so N++ isn’t too far behind.
Looks like your clipboard lopped off the feature request link’s domain name (or, more likely, some Chromium-based browser’s address bar did). The current markup is a relative path that resolves to a non-existent forum post:
https://community.notepad-plus-plus.org/issues/4465
-
@PeterJones said in Additional languages (dipping my toes into code contribution):
But after starting work on just the first, with the number of different source files I’ve had to touch just to get the one language, I think it does make more sense to do one language per PR.
The Indent lexer might be a good warm up. Just does folding and needs no keywords as it is an option to use instead of the None (Normal Text) lexer for indent structured text.
The goal of adding multiple languages to Notepad++ seems very ambitious so good luck with it.
-
So I was able to get Go/Golang working, so I’ve submitted the first PR#14966
If that gets accepted, I’ll work on Raku next.
-
@PeterJones said in Additional languages (dipping my toes into code contribution):
If that gets accepted
Accepted and merged today! 🎉🥳
-
@PeterJones said in Additional languages (dipping my toes into code contribution):
Accepted and merged today! 🎉🥳
I saw, downloaded and tested. Already updated my custom theme for Go. Now I just have to learn how to actually use that language :-P
Congratulations!
Cheers.