Language packages
Every language package CodePad ships, with its language ids, its grammar, the languages it embeds and its token names.
Install a package next to the core and pass one of its ids as language. A package can hold more than one grammar: markdown_inline is used only inside Markdown, php_only reads PHP without the <?php tag, and dtd reads a standalone DTD file.
The Embedded languages column lists the language names a package marks inside its own code, such as css inside HTML. That code highlights when a package or a custom language with the same id is installed. "From the source" means the document names the language, as the word after a Markdown fence does.
| Package | language | Grammar | Embedded languages |
|---|---|---|---|
react-native-codepad-lang-c | c | tree-sitter/tree-sitter-c | comment, doxygen, printf, re2c |
react-native-codepad-lang-css | css | tree-sitter/tree-sitter-css | comment |
react-native-codepad-lang-go | go | tree-sitter/tree-sitter-go | comment, printf, re2c, regex |
react-native-codepad-lang-html | html | tree-sitter/tree-sitter-html | comment, css, javascript, json, python, regex, toml |
react-native-codepad-lang-ini | ini | justinmk/tree-sitter-ini | comment |
react-native-codepad-lang-java | java | tree-sitter/tree-sitter-java | comment, javadoc, printf |
react-native-codepad-lang-javascript | javascript | tree-sitter/tree-sitter-javascript | angular, comment, css, glimmer, graphql, groq, html, jsdoc, regex, styled, from the source |
react-native-codepad-lang-json | json | tree-sitter/tree-sitter-json | comment |
react-native-codepad-lang-kotlin | kotlin | fwcd/tree-sitter-kotlin | comment, printf, regex |
react-native-codepad-lang-markdown | markdown, markdown_inline | tree-sitter-grammars/tree-sitter-markdown | html, latex, markdown_inline, toml, yaml, from the source |
react-native-codepad-lang-php | php, php_only | tree-sitter/tree-sitter-php | bash, html, phpdoc, regex, from the source |
react-native-codepad-lang-python | python | tree-sitter/tree-sitter-python | comment, printf, regex |
react-native-codepad-lang-rust | rust | tree-sitter/tree-sitter-rust | comment, re2c, regex, rust, from the source |
react-native-codepad-lang-sql | sql | DerekStride/tree-sitter-sql | comment |
react-native-codepad-lang-swift | swift | alex-pinkus/tree-sitter-swift | comment, regex |
react-native-codepad-lang-tsx | tsx | tree-sitter/tree-sitter-typescript | angular, comment, css, glimmer, graphql, groq, html, jsdoc, regex, styled, from the source |
react-native-codepad-lang-typescript | typescript | tree-sitter/tree-sitter-typescript | angular, comment, css, glimmer, graphql, groq, html, jsdoc, regex, styled, from the source |
react-native-codepad-lang-xml | dtd, xml | tree-sitter-grammars/tree-sitter-xml | comment, css, javascript, sql |
react-native-codepad-lang-yaml | yaml | tree-sitter-grammars/tree-sitter-yaml | bash, comment, promql |
Token names
Each grammar gives a name to every piece of code it highlights. These names are the keys of a theme's tokens. When a theme has no entry for a name, it uses the entry for the shorter name, so keyword.return falls back to keyword.
c
attribute, boolean, character, comment, comment.documentation, constant, constant.builtin, constant.macro, function, function.builtin, function.call, function.macro, keyword, keyword.conditional, keyword.conditional.ternary, keyword.directive, keyword.directive.define, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, number, operator, property, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, type, type.builtin, type.definition, variable, variable.builtin, variable.parameter
css
attribute, character.special, comment, constant, function, keyword, keyword.directive, keyword.import, keyword.modifier, keyword.operator, module, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, tag, tag.attribute, type, variable
go
boolean, character, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.coroutine, keyword.function, keyword.import, keyword.repeat, keyword.return, keyword.type, label, module, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape, string.regexp, type, type.builtin, type.definition, variable, variable.member, variable.parameter
html
character.special, comment, constant, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.italic, markup.link.label, markup.raw, markup.strikethrough, markup.strong, markup.underline, none, nospell, operator, spell, string, string.special.url, tag, tag.attribute, tag.delimiter
ini
comment, markup.heading, operator, property, punctuation.bracket, spell, string
java
attribute, boolean, character, character.special, comment, comment.documentation, constant, constant.builtin, function.builtin, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.exception, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter
javascript
attribute, boolean, character.special, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.italic, markup.link.label, markup.raw, markup.strikethrough, markup.strong, markup.underline, module, module.builtin, none, number, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, string.special.url, tag, tag.attribute, tag.builtin, tag.delimiter, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter
json
boolean, comment, conceal, constant.builtin, number, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape
kotlin
attribute, boolean, character, character.special, comment, comment.documentation, constant, constructor, function, function.builtin, function.call, keyword, keyword.conditional, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.repeat, keyword.return, keyword.type, label, module, none, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter
markdown
keyword.directive, label, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.link.label, markup.link.url, markup.list, markup.list.checked, markup.list.unchecked, markup.quote, markup.raw.block, punctuation.delimiter, punctuation.special, spell, string.escape
markdown_inline
character.special, conceal, markup.italic, markup.link, markup.link.label, markup.link.url, markup.raw, markup.strikethrough, markup.strong, nospell
php
attribute, boolean, comment, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, module.builtin, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter
php_only
attribute, boolean, comment, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, module.builtin, number, number.float, operator, property, punctuation.bracket, punctuation.delimiter, spell, string, string.escape, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter
python
attribute, attribute.builtin, boolean, character.special, comment, constant, constant.builtin, constructor, function, function.builtin, function.call, function.macro, function.method, function.method.call, keyword, keyword.conditional, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.operator, keyword.repeat, keyword.return, keyword.type, module, module.builtin, none, nospell, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.documentation, string.escape, string.regexp, type, type.builtin, type.definition, variable, variable.builtin, variable.member, variable.parameter
rust
attribute, attribute.builtin, boolean, character, character.special, comment, comment.documentation, constant, constant.builtin, function, function.call, function.macro, keyword, keyword.conditional, keyword.coroutine, keyword.debug, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter
sql
attribute, boolean, comment, function.call, keyword, keyword.conditional, keyword.modifier, keyword.operator, keyword.repeat, number, number.float, operator, punctuation.bracket, punctuation.delimiter, spell, string, type, type.builtin, variable, variable.member, variable.parameter
swift
attribute, boolean, character.special, comment, comment.documentation, constant.builtin, constant.macro, constructor, function.call, function.macro, function.method, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, number, number.float, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, type, variable, variable.builtin, variable.member, variable.parameter
tsx
attribute, boolean, character.special, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, markup.heading, markup.heading.1, markup.heading.2, markup.heading.3, markup.heading.4, markup.heading.5, markup.heading.6, markup.italic, markup.link.label, markup.raw, markup.strikethrough, markup.strong, markup.underline, module, module.builtin, none, number, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, string.special.url, tag, tag.attribute, tag.builtin, tag.delimiter, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter
typescript
attribute, boolean, character.special, comment, comment.documentation, constant, constant.builtin, constructor, function, function.builtin, function.call, function.method, function.method.call, keyword, keyword.conditional, keyword.conditional.ternary, keyword.coroutine, keyword.directive, keyword.exception, keyword.function, keyword.import, keyword.modifier, keyword.operator, keyword.repeat, keyword.return, keyword.type, label, module, module.builtin, none, number, operator, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, string.regexp, string.special.url, type, type.builtin, variable, variable.builtin, variable.member, variable.parameter
dtd
attribute, character, character.special, comment, constant, constant.builtin, function.macro, keyword, keyword.directive, keyword.directive.define, keyword.import, keyword.modifier, label, number, operator, punctuation.bracket, punctuation.delimiter, spell, string, string.special, string.special.url, tag, tag.attribute, tag.delimiter, type.builtin
xml
attribute, boolean, character, character.special, comment, constant, constant.builtin, function.macro, keyword, keyword.directive, keyword.directive.define, keyword.modifier, label, markup.raw, module, none, number, operator, punctuation.bracket, punctuation.delimiter, spell, string, string.special, string.special.url, tag, tag.attribute, tag.delimiter, type.builtin, type.definition
yaml
boolean, comment, constant.builtin, keyword.directive, label, number, property, punctuation.bracket, punctuation.delimiter, punctuation.special, spell, string, string.escape, type