ZIm/crates/languages/src
Jake 5e286897d3
Escape carets (^) in Go test regex (#27746)
This is a follow up to https://github.com/zed-industries/zed/pull/14821,
which escaped `$` but not `^`.

This is fine for `bash`, but causes issues with `zsh`. This change
escapes the `^`. I tested this against `bash`, `zsh` and `fish`

I suspect such escaping would probably need to be done at some
shell-specific layer of the code, but for now it seems like the tasks
provided by the `ContextProvider` are supposed to be shell agnostic.

To reproduce the original issue:
1. Create a Go test file in a module that just contains a single test
`TestABC`.
2. Run `zsh -i -c "go test -run ^TestABC\$"` which is what Zed tries to
run when the task for a specific Go test is executed.
3. An error that there are no tests to run will be produced even though
there is a test.
4. Run `zsh -i -c "go test -run \^TestABC\$"` (note the backslash before
^).
5. The test will run successfully.

Example:
``` go
package bar

import "testing"

func TestABC(t *testing.T) {}
```

Release Notes:

- fix: Escape the ^ in the Go test -run regex to improve shell
compatibility (notably with zsh).
2025-04-04 12:04:38 +02:00
..
bash Use shell script language for APKBUILD files (#27099) 2025-03-19 22:00:44 +00:00
c Improve C and C++ syntax highlighting (#25325) 2025-02-21 12:01:39 -05:00
cpp Recognize ixx as part of the cpp suffix (#26333) 2025-03-10 09:10:29 -05:00
css Add completion_query_characters in language (#27175) 2025-03-20 16:45:35 +05:30
diff Improve diff syntax highlighting queries (#21740) 2024-12-12 15:18:36 -08:00
gitcommit Fix syntax highlighting of git commit messages (#26988) 2025-03-18 18:18:56 +00:00
go Improve Go syntax highlighting (#25327) 2025-02-21 11:32:14 -05:00
gomod Add "tool" support to go.mod (#22995) 2025-01-15 17:44:28 +02:00
gowork File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
javascript languages: Fix JS/TS imports not showing correct suggestions after using period (#27235) 2025-03-21 15:13:31 +05:30
jsdoc Add language icons to the language selector (#21298) 2024-12-02 15:01:09 -03:00
json Add completion_query_characters in language (#27175) 2025-03-20 16:45:35 +05:30
jsonc Treat bun.lock as JSONC (#27359) 2025-03-24 09:46:23 -04:00
markdown Add completion_query_characters in language (#27175) 2025-03-20 16:45:35 +05:30
markdown-inline Hide Markdown-Inline language from users with a new 'hidden' flag on language configs (#17104) 2024-08-29 11:23:33 -07:00
python python: Fix incorrect highlighting of function parameters (#26815) 2025-03-31 01:23:03 +02:00
regex Improve Regex syntax highlighting (#25332) 2025-03-22 16:11:19 -03:00
rust rust: Improve runnable detection for test modules (#28024) 2025-04-03 14:56:28 +00:00
tsx tsx: Insert newline between open and close tags on enter (#27618) 2025-03-27 19:15:12 +00:00
typescript languages: Fix JS/TS imports not showing correct suggestions after using period (#27235) 2025-03-21 15:13:31 +05:30
yaml vim: Update anyquotes and anybrackets to behave like mini.ai plugin (#24167) 2025-02-17 14:55:48 -07:00
bash.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
c.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
css.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
go.rs Escape carets (^) in Go test regex (#27746) 2025-04-04 12:04:38 +02:00
json.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
lib.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
python.rs python: Add recognition of worktree -> venv links (#26759) 2025-04-01 19:12:16 +02:00
rust.rs debugger: Add args argument to debugger launch config (#27953) 2025-04-02 15:37:12 -04:00
tailwind.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
typescript.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
vtsls.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
yaml.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00