Chapel syntax highlighting for geany editor is available

Hello. I have developed a usable Chapel syntax highlighting for the Geany Editor
(http://geany.org). I myself use emacs and am quite happy with chapel-mode, but it appears that geany is quite popular among my grad students. Moreover, it runs in Linux, Windows and MacOS, so maybe this will be useful for a larger group of people wanting to try Chapel but not willing to face emacs or vi. You can find the README instructions and the two files needed in http://nldias.github.io/software.html.

Cheers

Nelson

1 Like

Cool! I am also an emacs user, but the more syntax highlighters for Chapel that meet users in their tool of choice, the better, I think. If you know: how would Geany users typically find and install language-specific capabilities like this? E.g., are they affiliated with the Geany project itself, or with the individual languages, or is there any sort of community package manager or the like?

(Also, since you mentioned the Chapel emacs mode, I'm curious: Are you using the version that's bundled into the Chapel tree, or the one at MELPA, say? Though maybe we should fork that onto its own topic...)

-Brad

Hi Brad. Geany has a local configuration directory in ~/.config/geany. To make the editor recognize a new extension (.chpl) and provide highlighting, it is enough to put two files in that directory (and a subdirectory).
In Windows, the local config directory is C:\Users\"user"\AppData\Roaming\geany.
In the link that I provided, there are instructions where to place them, and the two files. Not too hard; the tricky part was to get the contents in the file filetypes.Chapel.conf right.

I got chapel-mode from Melpa. Actually, I never bothered to look at the subdirectories of chapel-1.23.0 (my bad), perhaps because I assumed that this was only stuff needed for the (awesome) compilation process for the compiler. It may help to add in the documentation a line calling attention to "resources", including highlighting, available within the directory.

I really hope that this small contribution helps to make Chapel more readily usable by more people.

Cheers

Nelson

Hi Nelson —

Thanks for the additional information. If you'd be interested in maintaining your geany support in the $CHPL_HOME/highlight directory and want to contribute it through a PR, I think we'd definitely be open to that (this is why I was asking how people usually installed it). If you'd prefer to keep it a separate/local effort, that's completely fine as well of course, and now that we know about it, we can help herd people in that direction if they don't find this thread on their own.

I think that, currently, the Melpa Chapel emacs mode is better than the one in our repository. It has some quirks to it that I hope will continue to improve (e.g., some of my identifiers have a different color for the first character than subsequent ones), but overall I've liked its quirks better than the ones in our repo's version and have been considering retiring our local support and just pointing to Melpa's... This is what made me curious what your experience was.

Thanks again,
-Brad

Hi Brad. I will be more than happy to contribute to $CHPL_HOME/highlight with the Geany syntax files. Let me know how to proceed. Yes, I think I remember there are some weird colors in chapel-mode now and then. I guess that the brain filters them out after some time, but I will pay some attention.

Regards,

Nelson

Hi Nelson,

I'm not Brad but I have worked with the highlighting tools in the past
as well so I figured I'd offer my two cents. You'll probably want to
make a separate subdirectory in there named Geany and include a
README.md file on how to modify and use the files you're providing.

Here's our resource on Contributing in general:

Definitely feel free to ask more questions!

Thanks,
Lydia

1 Like

Hi Lydia; thanks! I will do it in my own github (to practice) and when it's working will contribute to chapel-lang. Will ask you if I have doubts about how to do it.

Regards

Nelson

1 Like

Hi again Lydia: I have successfully forked the chapel repository, and have created a new directory geany with a README.md and the two files needed for the highlighting to work. The full path is

https://github.com/nldias/chapel/tree/master/highlight/geany

Can you tell me how this is now incorporated into the main chapel repository? Is it something that you guys do?

Regards

Nelson

Hi Nelson,

I'm neither Brad nor Lydia, but I can help with your question.

You'll want to open a pull request from your fork to the main repo. See the "Contributing Changes" section of the document that Lydia posted a link to, and also noting the DCO section.

You'll probably want to put your changes onto a feature branch, rather than your fork's master branch. And while you're at it, please give the commits more descriptive commit messages. (You can squash them into one commit if you'd prefer that to writing descriptions for the second two.)

Paul

Hi Paul.

I believe I have taken all actions as you suggested. Please bear with me: I had never used github collaboratively before. Please let me know if I need to take any more actions.

Regards

Nelson

For posterity: This support will be available in $CHPL_HOME/highlight/geany as of the Chapel 1.24 release. Thanks Nelson!

-Brad