Skip to content

Conversation

@mribeirodantas
Copy link

@mribeirodantas mribeirodantas commented Nov 27, 2022

Hello, there! I'm trying to update the syntax highlighting but I'm a bit new to this so I apologize if I did something wrong. This pull request:

  1. Remove white spaces at the end of lines
  2. Update [partially] the process directives
  3. Update input and output channel qualifiers
  4. Update channel factories and channel operators

I would like to help more, but it's not clear to me why the operators are separated into categories. Could you direct me to some nice reading on how to create these syntax highlighting files for sublime?

One missing thing that I'm not sure how to add (copy what was done for emit?) is the optional keyword for input/output channels.

Signed-off-by: Marcel Ribeiro-Dantas <mribeirodantas@seqera.io>
There are still some missing, but it's not clear to me
exactly how this should be handled so I added a few only.

Signed-off-by: Marcel Ribeiro-Dantas <mribeirodantas@seqera.io>
Signed-off-by: Marcel Ribeiro-Dantas <mribeirodantas@seqera.io>
Signed-off-by: Marcel Ribeiro-Dantas <mribeirodantas@seqera.io>
@mribeirodantas mribeirodantas force-pushed the update-syntax-highlighting branch from 88f1da1 to 4e37342 Compare November 27, 2022 15:45
@mribeirodantas mribeirodantas changed the title Remove white spaces at the end of the lines Update syntax highlighting Nov 27, 2022
@peterk87
Copy link
Owner

Hi @mribeirodantas

Thanks for the PR! The changes look good to me.

Could you direct me to some nice reading on how to create these syntax highlighting files for sublime?

The official docs are a good place to start: http://www.sublimetext.com/docs/index.html

I used the default Groovy syntax as a base for the Nextflow syntax since Nextflow builds off Groovy.

When I'm making changes to the syntax file, I'm constantly checking the shift+ctrl+alt+p keyboard shortcut to see what the scope is when making changes to the syntax file:

image

There is also a syntax test file to ensure that scopes are being set properly: https://github.com/peterk87/sublime-nextflow/blob/master/syntax_test_.Nextflow

but it's not clear to me why the operators are separated into categories.

I separated some of the operators and keywords into different categories/scopes to have better syntax highlighting and to allow search by scope with some commands and tooltips.

One missing thing that I'm not sure how to add (copy what was done for emit?) is the optional keyword for input/output channels.

I think a context would need to be defined to capture optional: (true|false) and it'd need to be included under the process-output-channel context like process-output-emit:

https://github.com/peterk87/sublime-nextflow/blob/master/Nextflow.sublime-syntax#L376

@mribeirodantas
Copy link
Author

Thanks, @peterk87 !

How do you think we should proceed on this? Merge this PR, and then I open a new PR when I have more time to work on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants