**Changelog:**
- Replace default tasks with a stub message (#16752)
- Update tree-sitter grammar for the Ruby language (#16892)
- Rename `rbs` to `RBS` (#16893)
- Upgrade `zed_extension_api` to v0.1.0 (#16907)
Release Notes:
- N/A
The Ruby world has many testing frameworks:
- Minitest
- RSpec
- quickdraw
- tldr
- and many others.
Attempting to support all of them through a single `tasks.json` file is
a challenging task and nearly impossible. All testing frameworks have
different running options and commands. It's still possible to use
tree-sitter queries to detect runnables in Ruby code but Zed lacks the
ability to detect the testing framework in a project that can be used to
detect the correct commands to run tests or runnables. The end user
knows the correct command and it's wise to delegate creating the command
to them. It would be a bit strange to leave the user without any
guidance, so this commit adds example tasks for various Ruby testing
frameworks.
Closes#12579
Here is the screenshot how it looks:
![CleanShot 2024-07-01 at 19 37
08@2x](https://github.com/zed-industries/zed/assets/1894248/e9659822-6c02-4afb-a0e4-e9966b9fb2f5)
Release Notes:
- N/A
This PR reverts the addition of extension capabilities from #16953.
While these may end up being useful at some point, after some discussion
they don't seem like the exact fit for what we're looking to do right
now.
This reverts commit 8ec36f1e2b.
Release Notes:
- N/A
This PR updates the `zed_extension_api` to v0.1.0 for the extensions
that live in this repo.
The changes in that version of additive, so none of the extensions need
to change their usage in order to upgrade.
Release Notes:
- N/A
This PR adds an initial notion of extension capabilities.
Capabilities are used to express the operations an extension is capable
of doing. This will provide further insights into what an extension can
do, as well as provide the ability to grant or deny the set of
capabilities.
Capabilities are defined in the `capabilities` field in the extension
manifest. This field contains an array of capabilities.
Each capability has a `kind` to denote the known capability it
corresponds to. Individual capabilities may have additional fields,
based on the `kind`.
Here's an example of some capabilities:
```toml
capabilities = [
{ kind = "download-file", host = "github.com", path_prefix = "owner/repo" },
{ kind = "npm:install", package = "@vue/language-server" },
]
```
In order to avoid a breaking change, the `capabilities` field is
currently optional and defaults to an empty array. This will allow us to
add support for extensions to define capabilities before we start
enforcing them.
Release Notes:
- N/A
Closes:
- #15802
This PR fixes an issue in the `elixir-ls` language server installation
where some of the required scripts was not being made executable when
installed from GitHub.
Release Notes:
- Fixed elixir-rs files not being executable ([#15802](https://github.com/zed-industries/zed/issues/15802))
This PR removes the `tooltip_text` from the extension manifests.
We stopped reading this value in #16306, as it wasn't being used, so we
don't need to include it in the manifest anymore.
Release Notes:
- N/A
This PR updates the Zig extension to use v0.1.0 of the Zed extension
API.
This allows us to pin ZLS to v0.11.0, as the more recent releases of ZLS
don't have `.tar.gz` assets available.
Release Notes:
- N/A
This PR cleans up the slash command functionality in preparation for an
upcoming release:
- Removed arguments to `/gleam-project` that were just used as an
example
- Removed `/gleam-docs` in favor of `/docs` with the `gleam-hexdocs`
provider
- Pulled a list of all Gleam packages to use as suggestions
Release Notes:
- N/A
Hi, I bump the tree-sitter-erlang to a newest version and sync the
hightlight query to fix long standing issue in the Zed erlang extension
about incorrect function highlighting, not support the triple quote
string and many more.
Release Notes:
- N/A
Signed-off-by: Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
* renames `/tabs` to `/tab`
* allows to insert multiple tabs when fuzzy matching by the names
* improve slash command completion API, introduce a notion of multiple
arguments
* properly fire off commands on arguments' completions with
`run_command: true`
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <marshall@zed.dev>
This PR adds an `HttpRequestBuilder` to the extension API to allow for a
more ergonomic way for constructing HTTP requests within extensions.
The HTTP client functionality is now also exposed via the
`zed_extension_api::http_client` module instead of top-level.
Release Notes:
- N/A
# HTTP Client Improvements for Extension API
This PR enhances the HTTP client functionality in the Zed extension API,
providing more control over requests and allowing for streaming
responses.
## Key Changes
1. Extended `HttpRequest` struct:
- Added `method` field to specify HTTP method
- Added `headers` field for custom headers
- Added optional `body` field for request payload
2. Introduced `HttpMethod` enum for supported HTTP methods
3. Updated `HttpResponse` struct:
- Added `headers` field to access response headers
- Changed `body` type from `String` to `Vec<u8>` for binary data support
4. Added streaming support:
- New `fetch_stream` function to get a response stream
- Introduced `HttpResponseStream` resource for chunked reading
5. Updated internal implementations to support these new features
6. Modified the Gleam extension to use the new API structure
## Motivation
These changes provide extension developers with more flexibility and
control over HTTP requests. The streaming support is particularly useful
for handling large responses efficiently or ideally streaming into the
UI.
## Testing
- [x] Updated existing tests
- [ ] Added new tests for streaming functionality
## Next Steps
- Consider adding more comprehensive examples in the documentation
- Evaluate performance impact of streaming for large responses
Please review and let me know if any adjustments are needed.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR refactors the language server loading in the Ruff extension to
mirror our other extensions.
Also fixed an issue where the cached binary path was not being
respected.
Release Notes:
- N/A
Hello, this pull request adds support for specifying and using the
"binary" settings for Rubocop and Solargraph LSPs. AFAIK, Ruby LSP does
not require the bundler context but that could be added later easily.
In Ruby world, like in Node.js world, almost all
projects rely on project specific packages (gems) and their versions.
Solargraph and Rubocop gems are usually installed as project
dependencies. Attempting to use global installation of them fail in most
cases due to incompatible or missing dependencies (gems).
To avoid that, Ruby engineers have the `bundler`
gem that provides the `exec` command. This command executes the given
command in the context of the bundle.
This pull request adds support for pulling the `binary` settings to use
them in starting both LSPs. For instance, to start the Solargraph gem in
the context of the bundler, the end user must configure the binary
settings in the folder-specific settings file like so:
```json
{
"lsp": {
"solargraph": {
"binary": {
"path": "/Users/vslobodin/Development/festivatica/bin/rubocop"
}
}
}
}
```
The `path` key must be an absolute path to the `binstub` of the
`solargraph` gem. The same applies to the "rubocop" gem. Side note but
it would be awesome to use Zed specific environment variables to make
this a bit easier. For instance, we could use the `ZED_WORKTREE_ROOT`
environment variable:
```json
{
"lsp": {
"solargraph": {
"binary": {
"path": "${ZED_WORKTREE_ROOT}/bin/rubocop"
}
}
}
}
```
But this is out of the scope of this pull request. The code is a bit
messy and repeatable in some places, I am happy to improve it here or
later.
References:
- https://bundler.io/v2.4/man/bundle-exec.1.html
- https://solargraph.org/guides/troubleshooting
- https://bundler.io/v2.5/man/bundle-binstubs.1.html
This pull request is based on these two pull requests:
- https://github.com/zed-industries/zed/pull/14655
- https://github.com/zed-industries/zed/issues/15001
Closes https://github.com/zed-industries/zed/issues/5109.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Hi, this pull request adds support for RBS files for the Ruby language.
[RBS](https://github.com/ruby/rbs) is a language to describe the
structure of Ruby programs.
This pull request:
- adds a new grammar to the Ruby extension for RBS
https://github.com/joker1007/tree-sitter-rbs
- configures the Ruby extension to use the added grammar.
Release Notes:
- N/A
This PR updates the extension API to make the `worktree` argument to
`run_slash_command` optional.
We may not always have a worktree, and not all slash commands need them,
so by making it optional we can allow individual slash commands to
decide what to do when there is no worktree.
Release Notes:
- N/A
Hi. This is a small pull request that changes the "language" field to
the "languages" field
because the `language` field is deprecated.
Additionally, allow the Ruby LSP to run in `*.erb` files.
Release Notes:
- N/A
Release Notes:
- N/A
Currently Windows environments do not have a `shell_env`. This causes
the Zig extension to error when trying to call `worktree.shell_env()`
since extensions api isn't yet on `0.0.7` and thus not using wasm-host
`0.0.7` we need to only call for the shell env only on non-windows
systems. 0.0.7 and onward at the moment return a Result from
`shell_env()`. The binary path is also slightly different on windows.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>