Commit Graph
7 Commits
Author SHA1 Message Date
Karthik Prakash af6436c20c Add filetype highlighting to block string literals (#3642)
This PR adds filetype highlighting support to block string literals in
the TextMate grammar.

After adding the regex in the `begin` of the block string literal,
`beginCaptures` is used to access the first capturing group of the regex
(which captures the filetype) and apply the `constant.character.escape`
rule.


![image](https://github.com/carbon-language/carbon-lang/assets/116057817/edabc820-ed0f-4f5f-a180-f3ac90045b0a)

Closes #3641
2024-01-24 18:56:25 +00:00
czapiga ef842736f0 Fix block string literals highlighting (#3635)
Replace block string literals quotes.

Highlighting after change:

![image](https://github.com/carbon-language/carbon-lang/assets/24532774/4c55c021-b8ce-4933-9742-81a8eee6ffe1)


Closes #3634
2024-01-24 09:44:18 +00:00
czapiga 507e47d732 Fix syntax highlighting in VSCode (#3630). (#3631)
Add missing escape backslash to `string_escapes` matching string.

Closes #3630

VSCode highlighting working after change:

![image](https://github.com/carbon-language/carbon-lang/assets/24532774/92be2aa3-5f12-4430-9b9e-169edfa1da4a)
2024-01-20 23:16:30 +00:00
Manmeet Singh 1646ba1182 update keywords in textmate syntax (#2953)
keywords were taken from docs/design/lexical_conventions/words.md
2023-06-28 15:24:04 -07:00
Richard Smith 4daaa4866f Rename Type -> type, per #2360. (#2507)
Also make minor updates to the skeletal design in
docs/design/name_lookup.md following #2113, as there are no longer any prelude names that are made available to unqualified name lookup by default.

Add `type` to the keyword list in
docs/design/lexical_conventions/words.md, following #2360.
2023-01-04 14:22:30 -08:00
Jon Ross-Perkins 25d824ef15 Pre commit update (#2098)
codespell now sees "falsy" as a mis-spelling of either "false" or "falsely"; adding it since I think this it's occasionally used this way in programming. e.g., https://developer.mozilla.org/en-US/docs/Glossary/Falsy

Adjusts to use the new check-copyright support for lines starting with a dash.
2022-08-25 08:56:46 -07:00
Mats Larsen 8ba4916ab4 Implement minimal textmate language definition (#1595)
TextMate is the go-to definition language for syntax highlighting for editors lack dedicated language support for a given programming language. This patch contains a very minimal, yet functional TextMate bundle definition for Carbon.

This allows Carbon users to import the TextMate bundle into their editors to get basic syntax highlighting for Carbon code until we have a more solid specification for the language (that's when the fun with dedicated plugins/extensions begins!).

**Support**
- String literals with escape codes (currently using C highlighting rules)
- Numeric literals in decimal, hexadecimal and binary (lacks _ separator support though)
- Single and multi-line comments
- Highlighting of all? (let me know if some are missing) keywords in the language

Here is an image of the highlighting in action in IntelliJ Dracula mode
![image](https://user-images.githubusercontent.com/42585241/180587912-23b5ae3e-2bdb-49a1-83e8-24e6e0b7cfb5.png)
2022-07-28 11:32:41 -07:00