pulsar/packages/language-c
Andrew Dupont cb7d4aad6c [language-c] C/C++ highlighting fixes…
Changes: 

* `#define FOO 1` and `#define FOO` will _always_ scope `FOO` as `constant.other.c`, even when `FOO` is mixed-case or lower-case.
* `#define FOO()` will _always_ scope `FOO` as `entity.name.function.preprocessor.c`, even when `FOO` is mixed-case or lower-case.
* Usages of bare identifiers in other contexts in preprocessor directives should always scope them as `constant.other.c` — unless I’m made aware of any counterexamples where that shouldn’t happen. For example: in `#if TABLE_SIZE > 200`, `TABLE_SIZE` should always be `constant.other.c`, no matter its casing.
* All-caps variable declarations and assignments (`int FOO = 0`, etc.) should scope `FOO` as `variable` rather than `constant`. We should only scope an arbitrary identifier as `constant` if we think it’s been used in the context of a macro definition.

However:

* When deciding whether something outside of a directive refers to a macro constant, we have no choice but to use the `ALL_CAPS` heuristic. Ideally we’d be able to determine that from some sort of analysis of the source code files — but even if we could keep track of that sort of thing in a single buffer, it’d fall down when macro constants _defined in other files_ are used. All we can do here is make a best guess.
2024-02-03 23:39:12 -08:00
..
grammars [language-c] C/C++ highlighting fixes… 2024-02-03 23:39:12 -08:00
lib Convert all modern Tree-sitter TODO/hyperlink injections into services 2024-01-18 13:53:22 -08:00
settings ➡️ Migrate all language packages 2022-06-25 19:58:57 +00:00
snippets ➡️ Migrate all language packages 2022-06-25 19:58:57 +00:00
spec Apply lost tabs to c specs 2023-07-09 23:29:32 -07:00
.envrc Add C and C++ grammars 2023-03-28 17:03:42 -07:00
.gitignore ➡️ Migrate all language packages 2022-06-25 19:58:57 +00:00
.tool-versions Add C and C++ grammars 2023-03-28 17:03:42 -07:00
LICENSE.md rebrand and relicence 2022-12-03 02:46:08 +00:00
package-lock.json add or update packages/*/package-lock.json 2022-12-10 19:13:50 +01:00
package.json Convert all modern Tree-sitter TODO/hyperlink injections into services 2024-01-18 13:53:22 -08:00
README.md rebrand and relicence 2022-12-03 02:46:08 +00:00

C/C++ language support in Pulsar

Adds syntax highlighting and snippets to C/C++ files in Pulsar.

Originally converted from the C TextMate bundle.

Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.