atom / language-c

C support in Atom
Other
117 stars 153 forks source link

Injection regex is specified too broadly for tree-sitter-c grammar #339

Open eugmes opened 4 years ago

eugmes commented 4 years ago

Summary

Injection regex is specified too broadly for tree-sitter-c grammar. It matches anything that contains letter 'c' in it.

Motivation

This behavior is confusing when one tries to add injection points for languages like ocaml (not possible right now anyway).

The current code is here: https://github.com/atom/language-c/blob/af1e7f5ec8a2db9337a7e0c86e5286d5cef47d3d/grammars/tree-sitter-c.cson#L6

Perhaps it should better be changed to something like:

injectionRegex: '^(c|C)$'