chbk
|
0708d476ca
|
Improve Bash heredoc highlighting (#28185)
Release Notes:
- Improved Bash heredoc highlighting
| Zed 0.180.2 | With this PR |
| --- | --- |
|

|

|
```bash
cat << EOT >> hello.txt
hello world
EOT
```
- `<<`: `operator`
- `EOT`: `string`
|
2025-04-06 11:14:05 -04:00 |
|
 chbkandJoão Marcos
|
f4d1e7901c
|
Improve Regex syntax highlighting (#25332)
Release Notes:
- Improved Regex syntax highlighting
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `(?P=`, `<`: `punctuation.bracket`
- `group_name`: `property` -> `label`
- `^`, `$`: `string.escape` -> `operator`
- `\b`, `\B`, `\k`: `string.escape` -> `keyword.operator`
- added `regex` scope to target regex tokens specifically
```js
regex = /^(?<group>[!\.\?])\b[a-z]+word\k<group>$/g
```
---------
Co-authored-by: João Marcos <marcospb19@hotmail.com>
|
2025-03-22 16:11:19 -03:00 |
|
 chbkandMarshall Bowers
|
8f40bcc86c
|
Improve JavaScript and TypeScript syntax highlighting (#25328)
Release Notes:
- Improved JavaScript and TypeScript syntax highlighting.
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `regex_flags`: `keyword.regex`, see the [Regex
PR](https://github.com/zed-industries/zed/pull/25332) for other Regex
scopes
- `@`: `punctuation.special`, as in Python
- `jsx_text`: `text.jsx`
- `=`: `operator` -> `punctuation.jsx.delimiter`, `punctuation` as in
[VS
Code](https://github.com/microsoft/vscode/blob/0fe195613ed9901f669cd0f799fe807f0189d029/extensions/html/syntaxes/html.tmLanguage.json#L78)
and
[Atom](https://github.com/atom/language-html/blob/ee750a014a003c3d6f10b91e3cd5f9bfa0f051e6/grammars/tree-sitter-html.cson#L47)
- added `jsx` scope to target JSX tokens specifically
```javascript
/**
* @keyword comment
*/
@log
class X {
render() {
return (
<div jsx_attribute="value">
<Input onKeyPress={super.bind(this)}/>
jsx_text
</div>
);
}
}
const IDENTIFIER = true
```
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
|
2025-02-21 21:54:16 +00:00 |
|
 chbkandMarshall Bowers
|
3e75a661dd
|
Improve Rust syntax highlighting (#25333)
Release Notes:
- Improved Rust syntax highlighting.
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `identifier`: `variable`
```rust
let identifier = true;
const IDENTIFIER: i32 = 3;
```
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
|
2025-02-21 16:20:53 -05:00 |
|
 chbkandMarshall Bowers
|
59a153b2e1
|
Improve Python syntax highlighting (#25331)
Release Notes:
- Improved Python syntax highlighting.
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `identifier`: `variable`
- `.`, `,`, `:`: `punctuation.delimiter`
- `@`: `operator`, for matrix multiplication
```python
class Mat(list):
def __matmul__(self, b):
...
a, b = Mat(), Mat()
identifier = a @ b
IDENTIFIER = True
```
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
|
2025-02-21 20:52:04 +00:00 |
|
 chbkandMarshall Bowers
|
144d8a1db6
|
Improve C and C++ syntax highlighting (#25325)
Release Notes:
- Improved C and C++ syntax highlighting.
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `NULL`, `nullptr`: `constant` -> `constant.builtin`
```cpp
#include <stdbool.h>
int a[] = {true, false};
const int * IDENTIFIER = nullptr;
```
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
|
2025-02-21 12:01:39 -05:00 |
|
 chbkandMarshall Bowers
|
7deceb62dc
|
Improve Go syntax highlighting (#25327)
Release Notes:
- Improved Go syntax highlighting.
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `package_identifier`: `namespace`, language-agnostic scope for
modules, packages, namespaces
- `method_elem`: `function.method`
- `;` ,`.` ,`,` ,`:`: `punctuation.delimiter`
```go
package my_package
import (
pkg "fmt"
)
type A interface {
method_elem(foo int, bar float64) int
}
func main() {
identifier := true
const constant int = 3
for i := 0; i <= 3; i++ {
pkg.Println(identifier)
}
}
```
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
|
2025-02-21 11:32:14 -05:00 |
|
chbk
|
5e4bdbbcde
|
Improve JSON syntax highlighting (#25329)
Release Notes:
- Improved JSON syntax highlighting.
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `null`: `constant` -> `constant.builtin`
- `,`, `:`: `punctuation.delimiter`
```json
{
"property": null,
"boolean": true
}
```
|
2025-02-21 15:59:32 +00:00 |
|
chbk
|
d0a0303428
|
Improve Bash syntax highlighting (#25324)
Release Notes:
- Improved Bash syntax highlighting
| Zed 0.174.6 | With this PR |
| --- | --- |
|

|

|
- `string`: `string`
- `variable`: `property` -> `variable`
- `number`: `number`
- `regex`: `string.regex`
- `>&`, `>&-`, `:`, `//`, `/`, `%`, `%%`, `#`, `##`, `=`, `==`:
`operator`
- `-lt`, `-le`, `-gt`, `-ge`, `-eq`, `-ne`, `-z`, `-n`:
`keyword.operator`
- `;`: `punctuation.delimiter`
- `(`, `)`, `{`, `}`, `[`, `]`: `punctuation.bracket`
- `$`, `${ }`, `$( )`: `punctuation.special`, as defined in other
languages
```bash
variable=I\ like\ Zed
function my_function() {
echo "Hello world, ${variable//regex/string}" > file
}
if [ $(uid) -lt 600 ]; then
my_function;
cat file | grep hello >&3
fi
```
|
2025-02-21 10:36:07 -05:00 |
|
chbk
|
2f416aebbe
|
Add syntax scopes to themes (#25323)
Release Notes:
- Added syntax scopes to themes
Supports:
- [Improve CSS syntax
highlighting](https://github.com/zed-industries/zed/pull/25326)
- [Improve Go syntax
highlighting](https://github.com/zed-industries/zed/pull/25327)
- [Improve Markdown syntax
highlighting](https://github.com/zed-industries/zed/pull/25330)
Changes:
- Adds highlighting rules for the following new scopes, using theme
colors:
- `heading`
- `namespace`
- `selector`
- `strikethrough`
- `unit`
- Renames scopes that are no longer used in `zed/crates/languages/src`
or `zed/extensions` to their new names:
- `punctuation.list_marker` -> `punctuation.markup`
- `link_text` -> `link`
- `link_uri` -> `link.url`, as defined in the [gitcommit
grammar](https://github.com/zed-industries/zed/blob/dff47a843695d03160680502e6d94634e376698e/crates/languages/src/gitcommit/highlights.scm#L5)
- `text.literal` -> `raw`
|
2025-02-21 09:21:18 -05:00 |
|