The current version of the extension tries to download the Windows
binary files for lua-language-server like this:
`lua-language-server-3.9.3-win32-x64.tar.gz`
The [Windows binary
files](https://github.com/LuaLS/lua-language-server/releases) are only
released as zip archives, so it will fail to get the required files.
This pr changes the following:
- Add check for Windows specific zip archive
- Add check for Windows specific .exe executable
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR updates the extension API to use structured slash command
completions instead of plain strings.
This allows slash commands defined in extensions to take advantage of
the improvements made in #13876.
Release Notes:
- N/A
This PR updates the Gleam docs provider to include the package name as a
suffix for docs entries:
<img width="639" alt="Screenshot 2024-07-03 at 5 48 28 PM"
src="https://github.com/zed-industries/zed/assets/1486634/0d98ffba-fbab-4511-ae16-e1e742d56f93">
This will help disambiguate modules with the same names from different
packages, as well as help out with providing better completions when the
package name and top-level module name do not match.
Release Notes:
- N/A
This PR improves the indexing of HexDocs content for Gleam packages.
We now index each of the modules in the package instead of just the
root.
Release Notes:
- N/A
This PR updates the `extension` crate's tests to use a dedicated test
extension for its tests instead of the real Gleam extension.
As the Gleam extension continues to evolve, it makes it less suitable to
use as a test fixture:
1. For a while now, the test has failed locally due to me having `gleam`
on my $PATH, which causes the extension's `get_language_server_command`
to go down a separate codepath.
2. With the addition of the `indexed_docs_providers` the test was
hanging indefinitely.
While these problems are likely solvable, it seems reasonable to have a
dedicated extension to use as a test fixture. That way we can do
whatever we need to exercise our test criteria.
The `test-extension` is a fork of the Gleam extension with some
additional functionality removed.
Release Notes:
- N/A
This PR reverts the changes from #13709, now that we've published a new
version of the Zig extension with them.
This reverts commit 464a4439f7.
Release Notes:
- N/A
This PR temporarily rolls back the changes in #12173 so that we can
publish a new version of the Zig extension.
There was a problem stemming from #12614 that caused v0.1.2 of the Zig
extension to get re-published with unreleased `zed_extension_api`
changes.
Once we publish v0.1.3 we'll be able to revert this change.
Release Notes:
- N/A
Note that right now we can't attach a language server to arbitrary
buffer, which is why I've listed a bunch of languages verbatim.
See
https://github.com/zed-industries/simple-completion-language-server/tree/main
for docs on how to define your snippets. They should be placed in
~/.config/zed/snippets ; `snippets.(toml|json)` file can be used to
define language-agnostic snippets, and any other name (e.g.
`python.toml`) will apply only to buffers of that particular type.
There's https://github.com/rafamadriz/friendly-snippets you can use as a
repository of snippets, for your convenience.
Fixes https://github.com/zed-industries/zed/issues/4611
Release Notes:
- Added support for snippets via simple-completion-language-server
This PR extends the interface for slash commands defined in extensions
to have them return `SlashCommandOutput`.
This allows for slash commands to return multiple output sections for a
single piece of generated text.
Note that we don't allow specifying the icon to display in the
placeholder, as we don't want to commit to that in our API at the
moment.
Release Notes:
- N/A
Hi, this pull request superseeds the
https://github.com/zed-industries/zed/pull/12624
and removes queries for runnables from `outline.scm`. This pull request
has couple things to mention:
- Removed task for running tests with `minitest` as I think it's not
reliable in its state because, AFAIK, the only way to run `minitest`
with the specific line, i.e. `bundle exec rake test
spec/models/some_model.rb:12` is to use it with Rails. The support for
`minitest` is still there and users can add their own task, for
instance, when they use `minitest` in Rails to get support for running
tests:
```json
{
"label": "test $ZED_RELATIVE_FILE:$ZED_ROW",
"command": "./bin/rails",
"args": ["test", "\"$ZED_RELATIVE_FILE:$ZED_ROW\""],
"tags": ["minitest-test"]
}
```
**Question:** Perhaps that should be mentioned in the Ruby extension
documentation?
- Adjusted runnables queries to work without `ZED_SYMBOL`.
Release Notes:
- N/A
This fixes#12728 as much as I can tell.
The problem was that inside ERB files, when inside Ruby code, we didn't
treat `-` as part of the word, which broke completions.
So, with the change in here, and the following Zed settings, it works.
```json
{
"languages": {
"Ruby": {
"language_servers": ["tailwindcss-language-server", "solargraph"]
}
},
"lsp": {
"tailwindcss-language-server": {
"settings": {
"includeLanguages": {
"erb": "html",
"ruby": "html"
},
"experimental": {
"classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
}
}
}
}
```
This enabled `tailwindcss-language-server` for Ruby files and tells the
language server to look for classes inside `class: ""` strings.
See demo video.
Release Notes:
- Fixed `tailwindcss-language-server` not being activated inside Ruby
strings (inside `.erb`)
([#12728](https://github.com/zed-industries/zed/issues/12728)).
Demo video:
https://github.com/zed-industries/zed/assets/1185253/643343b4-d64f-4c4e-98a1-d10df0b24e31
Co-authored-by: Max Brunsfeld <max@zed.dev>
# Summary
Hi. Current `heredoc` injection for Ruby language captures the
`heredoc_end` token. That's a bit incorrect because we want to capture
the content only. Suppose we have the following Ruby code:
```ruby
<<~JS
function myFunc() {
const myConstant = [];
}
let a = '1'
JS
```
And this is its syntax tree:
```
[program] [0, 0] - [7, 0]
[heredoc_beginning] [0, 0] - [0, 5]
[heredoc_body] [0, 5] - [6, 2]
[heredoc_content] [0, 5] - [6, 0]
[heredoc_end] [6, 0] - [6, 2]
```
Current injection capture all content of the `heredoc_body`:
![CleanShot 2024-05-31 at 17 03
31@2x](https://github.com/zed-industries/zed/assets/1894248/ff8c5195-b532-42d2-91b1-48405a6d3b50)
But we want to capture the `heredoc_content` only and this PR resolves
that, additionally it downcases the language like Zed does in other
languages like Terraform.
![CleanShot 2024-05-31 at 17 05
17@2x](https://github.com/zed-industries/zed/assets/1894248/e81dabd0-3246-4ef2-9524-a7adcb9242ab)
Release Notes:
- N/A
This PR fixes the location of the `injections.scm` query within the Ruby
extension.
Same as #12532, but without the content changes to `injections.scm`.
Release Notes:
- N/A
$ZED_SYMBOL doesn't really work here once that will try to do something
like this:
mix test MyModule.MyModuleTest
instead of using the path of the file:
mix test test/my_module/my_module_test.exs
Release Notes:
- Fix mix test $ZED_SYMBOL to use ZED_RELATIVE_FILE instead
- Use ZED_RELATIVE_FILE instead of ZED_FILE to improve mix tasks results
on Elixir umbrella projects
- Confirming a completion now runs the command immediately
- Hitting `enter` on a line with a command now runs it
- The output of commands gets folded away and replaced with a custom
placeholder
- Eliminated ambient context
<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/b1927a45-52d6-4634-acc9-2ee539c1d89a">
Release Notes:
- N/A
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
This PR adds initial support for defining slash commands for the
Assistant from extensions.
Slash commands are defined in an extension's `extension.toml`:
```toml
[slash_commands.gleam-project]
description = "Returns information about the current Gleam project."
requires_argument = false
```
and then executed via the `run_slash_command` method on the `Extension`
trait:
```rs
impl Extension for GleamExtension {
// ...
fn run_slash_command(
&self,
command: SlashCommand,
_argument: Option<String>,
worktree: &zed::Worktree,
) -> Result<Option<String>, String> {
match command.name.as_str() {
"gleam-project" => Ok(Some("Yayyy".to_string())),
command => Err(format!("unknown slash command: \"{command}\"")),
}
}
}
```
Release Notes:
- N/A
In #12003 we found ourselves in need for precise region tracking in
which a given runnable has an effect in order to grab variables from it.
This PR makes it so that in task modal all task variables from queries
overlapping current cursor position.
However, in the process of working on that I've found that we cannot
always use a top-level capture to represent the full match range of
runnable (which has been my assumption up to this point). Tree-sitter
captures cannot capture sibling groups; we did just that in Rust
queries.
Thankfully, none of the extensions are affected as in them, a capture is
always attached to single node. This PR adds annotations to them
nonetheless; we'll be able to get rid of top-level captures in extension
runnables.scm once this PR is in stable version of Zed.
Release Notes:
- N/A
This PR updates the Gleam runnables to detect tests using the `describe`
API in Startest.
This isn't entirely functional yet, as it is still just uses the test
function name to run the tests (which Startest doesn't yet support).
Release Notes:
- N/A
This PR updates the Zig extension to pin ZLS to v0.11.0, as the more
recent releases of ZLS don't have `.tar.gz` assets available.
Note that this depends on the next version of the `zed_extension_api`,
which has yet to be released.
Release Notes:
- N/A