area / language-latex

Syntax highlighting for LaTeX for Atom.
Other
79 stars 47 forks source link

Add comment env support #166

Closed Aerijo closed 6 years ago

Aerijo commented 6 years ago

Description of the Change

Adds support for the comment environment.

Alternate Designs

The current design is based almost entirely off the generic environment pattern, just made specific to comments.

The interior scope is consistent with the textmate manual, as it specifies comment.block as a possible scope.

Benefits

The fairly common (and unambiguous) comment environment will have it's contents correctly scoped as comments, ensuring they appear consistent with other comments and the contents do not interfere with other syntax highlighting.

Possible Drawbacks

I am getting a bug due to 'name': 'meta.function.environment.comment.latex' where the begin and end commands are shown as italic (when using a theme that puts comments in italics; tested with one dark and solarized dark). This is specifically caused by the comment term, and removing it or changing it fixes the issue.

However, this should be a syntax package issue and is not our concern. The pattern should remain with the meta scope, to keep it consistent with other environment patterns.

Applicable Issues

165

Aerijo commented 6 years ago

PR is straightforward enough, matches the preexisting format, and the scope is explicitly given in the textmate documentation. Merging.