/cc @RemcoSmitsDev new task indicators weren't showing for me in JSON
files.
`tasks.json` of native grammars is not being read by anything by
default, so we tend to register tasks as Rust structs, foregoing the
deserialization step. This doesn't apply to tasks registered in
extensions, which have to have tasks.json.
Release Notes:
- N/A
Rust recently got the ability to check for typos or errors in `cfg`
attributes: https://blog.rust-lang.org/2024/05/06/check-cfg.html
This PR fixes the new warnings.
- gpui can be run with `RUSTFLAGS="--cfg gles"`, make this explicit in
`[workspace.lints.rust]`
- `cfg!(any(test, sqlite))` was just a bug, it should be
`feature(sqlite)`
- the `languages` crate had a `#[cfg(any(test, feature =
"test-support"))]` function without ever declaring the `test-support`
feature
- the `MarkdownTag` enum had a `cfg_attr` for serde without actually
having serde support
Now the only warnings when building are unused fields
`InlayHover.excerpt`, `SavedConversationMetadata.path` ,
`UserTestPlan.allow_client_reconnection` and `SyntaxMapCapture.depth`.
Release Notes:
- N/A
Follow-up of
https://github.com/zed-industries/zed/pull/12095#issuecomment-2123230762
reverting back part of https://github.com/zed-industries/zed/pull/11558
that was related to `language.toml` parsing.
Now all extensions that define `prettier_parser_name` in their language
configs, will enable formatting untitled buffers without any extra
language settings like
```json
{
"languages": {
"JSON": {
"prettier": {
"allowed": true,
"parser": "json"
}
}
}
}
```
Release Notes:
- Improved ergonomics of untitled buffer formatting with prettier, no
extra language settings are needed by default.
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
Highlight files ending in `mdwn` as Markdown.
(Ikiwiki uses `mdwn` as the file extension for Markdown.)
This pull request was inspired by this one:
- #1209/
Release Notes:
- Added ".mdwn" as a Markdown file extension.
This PR changes the interface of ContextProvider, allowing it to inspect
*all* variables set so far during the process of building
`TaskVariables`. This makes it possible to capture e.g. an identifier in
tree-sitter query, process it and then export it as a task variable.
Notably, the list of variables includes captures prefixed with leading
underscore; they are removed after all calls to `build_context`, but it
makes it possible to capture something and then conditionally preserve
it (and perhaps modify it).
Release Notes:
- N/A
Add config for tag autoclosing: add following to lsp section of your
settings:
"vscode-html-language-server": {
"settings": {
"html": { "tagAutoclosing": true }
}
}
It also accepts `css`, `js/ts` and `javascript` as options.
Disable HTML language server in JS/TS/TSX files for now. I decided to
disable it for now as it caused excessive edits in these types of files
(as reported by @mariansimecek in
https://github.com/zed-industries/zed/pull/11761#issuecomment-2122038107);
it looks like HTML language server tries to track language ranges (e.g.
whether a particular span is TS/HTML fragment etc) just like we do.
However in plain JS/TSX files it seems like it treats the whole file as
one big chunk of HTML, which is.. not right, to say the least.
No release note, as HTML extension goodies are not on Preview yet.
Release Notes:
- N/A
Fixes#5267
TODO:
- [x] Publish our fork of vscode-langservers-extracted on GH and wire
that through as a language server of choice for HTML extension.
- [x] Figure out how to prevent edits made by remote participants from
moving the cursor of a host.
Release Notes:
- Added support for autoclosing of HTML tags in local projects.
This adds the ability to configure the `tailwindcss-language-server`
integration to use a custom build of the server.
Example configuration in Zed `settings.json`:
```json
{
"lsp": {
"tailwindcss-language-server": {
"binary": {
"arguments": [
"/Users/username/tailwindcss-intellisense/packages/tailwindcss-language-server/bin/tailwindcss-language-server",
"--stdio"
]
}
}
}
}
```
This will cause Zed to use its own Node version and run it with the
given arguments.
**Note**: you need to provide `--stdio` as the second argument!
It's also possible to use a custom Node binary:
```json
{
"lsp": {
"tailwindcss-language-server": {
"binary": {
"path": "/Users/username/bin/my-node",
"arguments": [
"/Users/username/tailwindcss-intellisense/packages/tailwindcss-language-server/bin/tailwindcss-language-server",
"--stdio"
]
}
}
}
}
```
This is *super handy* when debugging the language server.
Release Notes:
- Added ability to configure own build of `tailwindcss-language-server`
in Zed settings. Example:
`{"lsp":{"tailwindcss-language-server":{"binary":{"arguments":["/absolute/path/to/tailwindcss-language-server/bin/tailwindcss-language-server",
"--stdio" ]}}}}`
Without this, we'd get constant errors when typing something with ESLint
enabled:
[2024-05-16T10:32:30+02:00 WARN project] Generic lsp request to node
failed: Request textDocument/codeAction failed with message: Cannot read
properties of undefined (reading 'disableRuleComment')
[2024-05-16T10:32:30+02:00 ERROR util]
crates/project/src/project.rs:7023: Request textDocument/codeAction
failed with message: Cannot read properties of undefined (reading
'disableRuleComment')
[2024-05-16T10:32:31+02:00 WARN project] Generic lsp request to node
failed: Request textDocument/codeAction failed with message: Cannot read
properties of undefined (reading 'disableRuleComment')
[2024-05-16T10:32:31+02:00 ERROR util]
crates/project/src/project.rs:7023: Request textDocument/codeAction
failed with message: Cannot read properties of undefined (reading
'disableRuleComment')
This is fixed by changing the default settings for ESLint language
server to have those fields.
I don't think we need to make these configurable yet. These are defaults
that multiple other plugins also use:
- vscode-eslint:
https://sourcegraph.com/github.com/microsoft/vscode-eslint@4d9fc40e71c403d359beaccdd4a6f8d027031513/-/blob/client/src/client.ts?L702-703
- nvim-lspconfig:
https://sourcegraph.com/github.com/neovim/nvim-lspconfig@a27179f56c6f98a4cdcc79ee2971b514815a4940/-/blob/lua/lspconfig/server_configurations/eslint.lua?L94-101
- coc-eslitn:
https://sourcegraph.com/github.com/neoclide/coc-eslint@70eb10d294e068757743f9b580c724e92c5b977d/-/blob/src/index.ts?L698:17-698:35
Release Notes:
- Changed the default ESLint configuration to include the following in
order to silence warnings/errors: `{"codeAction": {
"disableRuleComment": { "enable": true, "location": "separateLine", },
"showDocumentation": { "enable": true } }}`
Closes https://github.com/zed-industries/zed/issues/11517
* Removes forced prettier parser name for languages, making `auto`
command to run prettier on every file by default.
* Moves prettier configs away from plugin language declarations into
language settings
Release Notes:
- N/A
This fixes the issue mentioned here:
https://github.com/zed-industries/zed/issues/5830#issuecomment-2111947083
In order for other languages to work, we need to pass the following
settings along to the Tailwind language server.
With the following Zed settings, it then also works for Scala:
```json
{
"languages": {
"Scala": {
"language_servers": ["tailwindcss-language-server"]
},
},
"lsp": {
"tailwindcss-language-server": {
"settings": {
"includeLanguages": {
"scala": "html"
},
"experimental": {
"classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"]
}
}
}
}
}
```
Release Notes:
- Added ability to configure settings for `tailwindcss-language-server`,
namely the `includeLanguages` and `experimental` objects.
**NOTE**: I have only tested that the language server boots up for Scala
files and that the settings are forwarded correctly. I don't have a
Scala+Tailwind project with which to test that the actual completions
also work.
cc @nguyenyou
We were marking `#[cfg(test)]`ed function as a test, which is wrong.
Also allow for other attribute_items (such as #[should_panic]) between
test attribute and a function item.
Release Notes:
- N/A
![image](https://github.com/zed-industries/zed/assets/24362066/bc7cc3d3-d9fc-4be6-b9b6-e3d8edf5b533)
Release Notes:
- Improved tasks modal by highlighting a distinction between a task
template and concrete task instance and surfacing available keybindings
more prominently. Task templates are now always available in the modal,
even if there's already a history entry with the same label.
- Changed default key binding for "picker::UseSelectedQuery" to `opt-e`.
RustEmbed repeatedly compiled regexes for handling of
'include='/'exclude' statements in a hot loop, which caused each call to
Assets::iter() to take 600ms. Since it is being called twice on our
startup path, that alone contributed over a second to startup time in
debug builds. I've filed a PR with them
https://github.com/pyrossh/rust-embed/pull/244 which brings down the
time for a single iter() call to 6ms.
Release Notes:
- N/A
This PR moves the Ruby injections added in #8796 to the right location,
since Ruby support was extracted into an extension in #11360.
Release Notes:
- N/A
This PR extracts Ruby and ERB support into an extension and removes the
built-in Ruby and Ruby support from Zed.
As part of this, the new extension is prepared for adding support for
the `Ruby LSP` which has some blockers. See
https://github.com/zed-industries/zed/pull/8613 I was thinking of adding
an initial support for Ruby LSP but I think it would be better to start
with extracting the Ruby extension for now.
The implementation, as the 1st step, matches the bundled version but
with 3 differences:
1. Added signature output to the completion popup. See my comment below.
![CleanShot 2024-05-04 at 09 17
37@2x](https://github.com/zed-industries/zed/assets/1894248/486b7a48-ea0c-44ce-b0c9-9f8f5d3ad42d)
3. Use the shell environment for starting the `solargraph` executable.
See my comment below.
4. Bumped the tree sitter version for Ruby to the latest available
version.
Additionally, I plan to tweak this extension a bit in the future but I
think we should do this bit by bit. Thanks!
Release Notes:
- Removed built-in support for Ruby, in favor of making it available as
an extension.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
From now on, only top-level captures are treated as runnable tags and
the rest is appended to task context as custom environmental variables
(unless the name is prefixed with _, in which case the capture is
ignored). This is most likely gonna help with Pest-like test runners.
Release Notes:
- N/A
---------
Co-authored-by: Remco <djsmits12@gmail.com>
Originally reported by @mrnugget and @bennetbo
Also, instead of requerying them every frame, we do so whenever buffer
changes.
As a bonus, I modified tree-sitter query for Rust tests.
Release Notes:
- N/A
Hey guys! `emmet-language-server` author here. Thank you so much for the
amazing editor!
This PR adds more languages to the list for the `emmet-language-server`
to attach to.
I have a question though, I saw that you guys don't differentiate yet
between `JavaScript` and `JSX` files. I know that the tree-sitter parser
for `js` comes with the ability to parse both but we still need to make
that difference. Is that part of the plan? or do you have a reason for
doing that?
Aside from that, I've still added support for `JavaScript` files since
is important to have emmet completions in `JSX` files, but I would like
to know what are your thoughts on that since doing this may pollute the
completions in `.js` files.
And one last thing, the emmet language server accepts more filetypes
such as `pug`, `sass`, `scss` and `less` files, which are not currently
supported by zed. Should I create some extensions to add grammar support
to those files later? Should those extensions be part of the zed repo?
I'm just thinking that those are sort of core languages.
Aside from that, let me know if there's anything left to do on my side.
Greetings!
Fixes#10654.
Release Notes:
- N/A
This allows function call (i.e. snippet) completion with
`typescript-language-server`. So far that didn't work, because
`typescript-language-server` doesn't respond with `insertText` when
getting the completions, but only when then sending
`completionItem/resolve` requests. See:
https://github.com/hrsh7th/nvim-cmp/issues/646#issuecomment-992765479
What this PR does is to support text edits in the response to
`completionItem/resolve`, which means updating the completion item.
It then enables this feature by default for
`typescript-language-server`.
TODOs:
- [x] Make this work over collab
- [x] Test that this doesn't break existing language server support
- [x] Refactor duplicated code
Release Notes:
- Added support for function call completion when using
`typescript-language-server`. This will result in parameters being
added, which can then be changed and navigated with `<tab>`. For this to
work with `typescript-language-server`, the documentation for a given
completion item needs to be resolved, meaning that if one types very
quickly and accepts completion before `typescript-language-server` could
respond with the documentation, no full function completion is used.
Demo:
https://github.com/zed-industries/zed/assets/1185253/c23ebe12-5902-4b50-888c-d9b8cd32965d
This PR adds the ability for the ESLint language server (`eslint`) to be
controlled by the `language_servers` setting.
Now in your settings you can indicate that the ESLint language server
should be used for a given language, even if that language does not have
the ESLint language server registered for it already:
```json
{
"languages": {
"My Language": {
"language_servers": ["eslint", "..."]
}
}
}
```
Release Notes:
- N/A
https://github.com/zed-industries/zed/assets/2072378/18f0bb28-0546-4234-a11f-39af6c9fcc12
`rulesCustomizations` is an array of rule severity overrides. Globs can
be used to apply default severities for multiple rules. See
[docs](553e632fb4/README.md (L312-L333))
& [type
definitions](553e632fb4/%24shared/settings.ts (L168))
Example Zed `settings.json` to override all eslint errors to warnings:
```jsonc
{
"lsp": {
"eslint": {
"settings": {
"rulesCustomizations": [
// set all eslint errors/warnings to show as warnings
{ "rule": "*", "severity": "warn" }
]
}
}
}
}
```
Release Notes:
- Added support for configuring ESLint's `rulesCustomizations` settings,
ie. `{"lsp": {"eslint": {"settings": {"rulesCustomizations": [{"rule":
"*", "severity": "warn"}]}}}}`
This PR adds the ability for the Tailwind language server
(`tailwindcss-language-server`) to be controlled by the
`language_servers` setting.
Now in your settings you can indicate that the Tailwind language server
should be used for a given language, even if that language does not have
the Tailwind language server registered for it already:
```json
{
"languages": {
"My Language": {
"language_servers": ["tailwindcss-language-server", "..."]
}
}
}
```
Release Notes:
- N/A
Adds additional captures for theming rust code.
I'm uncertain about whether `#` belongs in the `@operator` capture, but
I didn't see a more appropriate capture name in my brief hunt in other
files. It is the prefix of an `attribute_item`.. suggestions welcome.
Release Notes:
- Added `@operator`, `@lifetime` and `@punctuation.delimiter` captures
to Rust highlights file.
This PR extracts Elixir support into an extension and removes the
built-in Elixir support from Zed.
As part of this, [Lexical](https://github.com/lexical-lsp/lexical) has
been added as an available language server for Elixir.
Since the Elixir extension provides three different language servers,
you'll need to use the `language_servers` setting to select the one you
want to use:
#### Elixir LS
```json
{
"languages": {
"Elixir": {
"language_servers": [ "elixir-ls", "!next-ls", "!lexical", "..."]
}
}
}
```
#### Next LS
```json
{
"languages": {
"Elixir": {
"language_servers": [ "next-ls", "!elixir-ls", "!lexical", "..."]
}
}
}
```
#### Lexical
```json
{
"languages": {
"Elixir": {
"language_servers": [ "lexical", "!elixir-ls", "!next-ls", "..."]
}
}
}
```
These can either go in your user settings or your project settings.
Release Notes:
- Removed built-in support for Elixir, in favor of making it available
as an extension.
[PKGBUILD] is a file used in the build system of arch linux, and it is
basically just a bash script with special functions.
Release Notes:
- Changed `PKGBUILD` files to be recognized as bash.
This fixes#9934 and does two things:
1. It registers ESLint as a secondary language server for Vue.js files
(`.vue`)
2. It registers ESLint as a _secondary_ (instead of primary) language
server for TypeScript, JavaScript and TSX.
The second point because I don't see any reason why ESLint should be
registered as a primary language server for these languages. I read
through the code in `project.rs` that uses the primary language server
and I don't think there will be any differences to how it previously
worked.
I also manually tested ESLint support in a Vue.js project, a Next.js
project and a plain old JS project — still works in all three.
Release Notes:
- Added ESLint support for Vue.js files by starting it as a language
server on `.vue` files.
([#9934](https://github.com/zed-industries/zed/issues/9934)).
This PR extracts Deno support into an extension and removes the built-in
Deno support from Zed.
When using the Deno extension, you'll want to add the following to your
settings to disable the built-in TypeScript and ESLint language servers
so that they don't conflict with Deno's functionality:
```json
{
"languages": {
"TypeScript": {
"language_servers": ["deno", "!typescript-language-server", "!eslint", "..."]
},
"TSX": {
"language_servers": ["deno", "!typescript-language-server", "!eslint", "..."]
}
}
}
```
Release Notes:
- Removed built-in support for Deno, in favor of making it available as
an extension.