dparkins / language-fortran

Syntax highlighting for FORTRAN for atom
MIT License
35 stars 16 forks source link

Feature request: Toggle to switch snippets to be all caps #105

Closed bcaddy closed 6 years ago

bcaddy commented 6 years ago

Currently all of the snippets are in all lowercase. I edited the snippets file to put all intrinsic functions in all uppercase to be compliant with the Fortran 90/95 standard. I also changed the print *, statement with WRITE (*,*). A checkbox or toggle to switch between these two options in settings would be awesome. The edited snippets file is attached.

language-fortran.txt

dparkins commented 6 years ago

The scope of the snippets matches to the file type and the grammar, and cannot be selected through a toggle or switch (it seems), as (I believe) the snippets package is looking for a unique file that matches the package (in this case fortran language) name. We could create a new grammar for these cases, but given what I understand about the snippets package, I don't think a toggle is possible at the moment.

bcaddy commented 6 years ago

That's a bummer. Could that functionality be added by moving files around? Like have a storage directory that has both files in it then just copying them into the snippets directory with an appropriate name change when the toggle is activated? It wouldn't be elegant but it might work.

dparkins commented 6 years ago

That really doesn't sound very elegant, or indeed very secure! I would be very hesitant to add that, even if it could be done. If you look in our README, we state:

To access these additional grammars either select them manually via ctrl-shift-L or modify your init.coffee file to associate the desired grammar with the desired file extension as described here.

This looks like the best option to me, and snippets can change its behavior based on the grammar. So if there was a new grammar (called "Fortran 90/95 standard"), and you were to switch to that grammar using ctrl-shift-L, then the snippets should change accordingly.

bcaddy commented 6 years ago

Sounds good, thanks