d0142b8
Change on remote setup and one more SSH command as example (#12591)
Click to expand commit body
Release Notes:
- N/A
Francisco Rivas
created
b218d87
Fix TSX and JavaScript shorthand property syntax highlighting (#12512)
Click to expand commit body
This replicates the fix for the TypeScript language for
https://github.com/zed-industries/zed/issues/5239 in
https://github.com/zed-industries/zed/pull/12505 for the TSX and
JavaScript languages, fixing
https://github.com/zed-industries/zed/issues/12510 and fixing
https://github.com/zed-industries/zed/issues/12509 .
See
https://github.com/zed-industries/zed/pull/12505#issuecomment-2141002505
.
Keep in mind I don't have a proper Zed local development environment
setup to test these simple changes.
Release Notes:
- Fixed TSX shorthand property syntax highlighting
([#12510](https://github.com/zed-industries/zed/issues/12510)).
- Fixed JavaScript shorthand property syntax highlighting
([#12509](https://github.com/zed-industries/zed/issues/12509)).
Jayden Seric
created
de8ef08
Disable indent guides for single line editors (#12584)
Click to expand commit body
This PR disables indent guides by default for single line editors. Right
now indent guides show up in the project search editor (which is only a
single line)
<img width="715" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/0b61da71-6f64-424d-9612-6a34eac4686a">
Release Notes:
- Fixed an issue where indent guides would show up in a single line
editor (e.g. project search, buffer search)
ab8d25e
indent guides: Respect language specific settings in multibuffers (#12528)
Click to expand commit body
Indent guides can be configured per language, meaning that in a multi
buffer we can get excerpts where indent guides should be
disabled/enabled/styled differently than other excerpts.
Imagine the following scenario, i have indent guides disabled in my
settings, but want to enable them for JS and Python. I also want to use
a different line width for python files. Something like this is now
supported:
<img width="445" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/0c91411c-145c-4210-a883-4c469d5cb828">
And the relevant settings for the example above:
```json
"indent_guides": {
"enabled": false
},
"languages": {
"JavaScript": {
"indent_guides": {
"enabled": true
}
},
"Python": {
"indent_guides": {
"enabled": true,
"line_width": 5
}
}
}
```
Release Notes:
- Respect language specific settings when showing indent guides in a
multibuffer
- Fixes an issue where indent guide specific settings were not
recognized when specified in local settings
Add runnable tasks for Python, starting with `unittest` from the
standard library. Both `TestCase`s (classes meant to be a unit of
testing) and individual test functions in a `TestCase` will have
runnable icons. For completeness, I also included a task that will run
`unittest` on the current file.
The implementation follows the `unittest` CLI. The unittest module can
be used from the command line to run tests from modules, classes or even
individual test methods:
```
python -m unittest test_module.TestClass
python -m unittest test_module.TestClass.test_method
```
```python
import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertEqual(s.split(), ['hello', 'world'])
# check that s.split fails when the separator is not a string
with self.assertRaises(TypeError):
s.split(2)
if __name__ == '__main__':
unittest.main()
```
From the snippet provided by `unittest` docs, a user may want to run
test_split independently of the other test functions in the test case.
Hence, I decided to make each test function runnable despite `TestCase`s
being the unit of testing.
## Example of running a `TestCase`
<img width="600" alt="image"
src="https://github.com/zed-industries/zed/assets/16619392/7be38b71-9d51-4b44-9840-f819502d600a">
## Example of running a test function in a `TestCase`
<img width="600" alt="image"
src="https://github.com/zed-industries/zed/assets/16619392/f0b6274c-4fa7-424e-a0f5-1dc723842046">
`unittest` will also run the `setUp` and `tearDown` fixtures.
Eventually, I want to add the more commonly used `pytest` runnables
(perhaps as an extension instead).
Release Notes:
- Added runnable tasks for Python `unittest`.
([#12080](https://github.com/zed-industries/zed/issues/12080)).
Rayduck
created
f0d9795
collab_ui: remove branch menu popover in favor of opening a modal (#12562)
Click to expand commit body
This commit also removes a bunch of dead code.
Fixes #12544
Release Notes:
- Removed branch popover menu - clicking on the branch name in left-hand
corner now always opens a branch modal
Piotr Osiewicz
created
fbcc5cc
typescript: Add completions for tsconfig.json properties (#12560)
Click to expand commit body
Release Notes:
- Added completions for tsconfig.json config file.
Release Notes:
- Added runnable tasks to Elixir tests (modules, `describe` and `test`
blocks)
https://github.com/zed-industries/zed/assets/7737375/06f1b4cb-0364-4c30-982d-6dda3193b5d2
João Otávio Biondo
created
d12b8c3
Simplify and improve concurrency of git status updates (#12513)
Click to expand commit body
The quest for responsiveness in large git repos continues. This is a
follow-up to https://github.com/zed-industries/zed/pull/12444
Release Notes:
- N/A
Max Brunsfeld
created
356fcec
ruby: Add a new injection for regular expressions (#12533)
Click to expand commit body
# Summary
Hello. This pull request adds a new injection to `injections.scm` for
Ruby language to highlight regular expressions. Thanks.
## Before

## After

Release Notes:
- N/A
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Vitaly Slobodin
and
Marshall Bowers
created
08123a2
ruby: Add proper indentation for singleton methods (#12535)
Click to expand commit body
Hi. Currently, Zed uses incorrect indentation for singleton methods:
```ruby
def self.build
| # <= cursor position after hitting Enter
end
```
Handling the `singleton_method` token indentation
changes this behavior to the following:
```ruby
def self.build
| # <= cursor position after hitting Enter
end
```
## Before
https://github.com/zed-industries/zed/assets/1894248/40fc2b37-692f-469f-9cbe-05cbb1ab4c3c
## After
https://github.com/zed-industries/zed/assets/1894248/d9ba8d27-fd17-4c74-b22c-a4de124739a3
Release Notes:
- N/A
This follows up the changes in #11611 and #11898
Release Notes:
- N/A
张小白
created
4c51ee7
assistant: Allow passing module paths to `/rustdoc` command (#12536)
Click to expand commit body
This PR updates the `/rustdoc` command to accept module paths in
addition to just a crate name.
This will return the docs.rs page just for that particular module.
### Examples
```
/rustdoc bevy
/rustdoc bevy::ecs
/rustdoc bevy::ecs::component
```
<img width="641" alt="Screenshot 2024-05-31 at 11 18 25 AM"
src="https://github.com/zed-industries/zed/assets/1486634/d88af19f-5ba1-4073-8108-63cccd138db6">
<img width="641" alt="Screenshot 2024-05-31 at 11 18 35 AM"
src="https://github.com/zed-industries/zed/assets/1486634/9c414ab1-0be8-4d79-8c64-b45f19266556">
Release Notes:
- N/A
Marshall Bowers
created
660cf21
ruby: Capture the heredoc content only and downcase the language (#12532)
Click to expand commit body
# 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`:

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.

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
Marshall Bowers
created
2cff075
elixir: Fix `mix test $ZED_SYMBOL` task (#11879)
Click to expand commit body
$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
Fixed bug introduced in:
https://github.com/zed-industries/zed/pull/12502
Filtering before `enumerate` call breaks project order and instead of
hiding current project it hides some other project.
Release Notes:
- N/A
22cf73a
indent guides: Use primary buffer language to determine tab size (#12506)
Click to expand commit body
When indent guides were still WIP, I thought it might be a good idea to
detect the tab size for every line individually, so we can handle files
with mixed indentations. However, while optimizing the performance of
indent guides I found that getting the language at a given anchor was
pretty expensive, therefore I only resolved the language for the first
visible row. However, this could lead to some weird flickering, where
the indent guides would use different tab sizes depending on the first
visible row (see #12492). This can be fixed by just using the primary
buffer language size.
So as of right now indent guides cannot handle files with mixed
indentations. Im not sure if anyone actually does/expects this, but one
use case I could imagine is something like this:
User x has a svelte file, where the tab size is set to `4`. However the
svelte code uses typescript inside a script tag, which User x wants to
use a tab size of `2`. The approach used here would not work for this,
but then again I think our formatter does not even support something
like this. Im probably overcomplicating things, so let's stick with the
simple solution for now.
Release Notes:
- Fixed an issue where indent guides would use an incorrect tab size
([#12492](https://github.com/zed-industries/zed/issues/12492)).
Bennet Bo Fenner
created
1d46a52
rustdoc_to_markdown: Don't push blank space after newline (#12504)
Click to expand commit body
This PR fixes a small issue in `rustdoc_to_markdown` where we could push
a blank space after a newline, leading to an unwanted leading space.
Release Notes:
- N/A
Marshall Bowers
created
fda975f
Re-subscribe to channels after signing back out
Max Brunsfeld
created
0f32145
Skip current project in recent projects (#12502)
Click to expand commit body
Discussion: https://github.com/zed-industries/zed/discussions/12497
Release Notes:
- Removed current project from the recent projects modals
Vladas Zakrevskis
created
6fe665a
rustdoc_to_markdown: Support bold and italics (#12501)
Click to expand commit body
This PR extends `rustdoc_to_markdown` with support for bold and italic
text.
Release Notes:
- N/A
Marshall Bowers
created
279c5ab
Reduce DB load upon initial connection due to channel loading (#12500)
Click to expand commit body
#### Lazily loading channels
I've added a new RPC message called `SubscribeToChannels` that the
client now sends when it first renders the channels panel. This causes
the server to load the channels for that client and send updates to that
client as channels are updated. Previously, the server did this upon
connection.
For backwards compatibility, the server will inspect clients' version,
and continue to do this work immediately for old clients.
#### Optimizations
Running collab locally, I realized that upon connecting, we were running
two concurrent transactions that *both* queried the `channel_members`
table: one for loading your channels, and one for loading your channel
invites. I've combined these into one query. In addition, we now use a
join to load channels + members, as opposed to two separate queries.
Even though `where id in` is efficient, it adds an extra round trip to
the database, keeping the transaction open for slightly longer.
Release Notes:
- N/A
This PR improves `rustdoc_to_markdown`'s paragraph handling to produce
better output.
Specifically, there should now be fewer instances where a space is
missing between words as the result of line breaks in the source HTML.
Release Notes:
- N/A
Marshall Bowers
created
4dc9802
rustdoc_to_markdown: Add helper methods for checking HTML attributes (#12496)
Click to expand commit body
This PR adds some helper methods to `HtmlElement` to make it easier to
interact with the element's attributes.
This cleans up a bunch of the code by a fair amount.
Release Notes:
- N/A
Marshall Bowers
created
c83d1c2
rustdoc_to_markdown: Handle "stabs" in item name entries (#12494)
Click to expand commit body
This PR extends `rustdoc_to_markdown` with support for rustdoc's
"stabs".
These are used in item name lists to indicate that the construct is
behind a feature flag:
<img width="641" alt="Screenshot 2024-05-30 at 1 34 53 PM"
src="https://github.com/zed-industries/zed/assets/1486634/0216f325-dc4e-4302-b6db-149ace31deea">
We now treat these specially in the Markdown output:
<img width="813" alt="Screenshot 2024-05-30 at 1 35 27 PM"
src="https://github.com/zed-industries/zed/assets/1486634/96396305-123d-40b2-af49-7eed71b62971">
Release Notes:
- N/A
Marshall Bowers
created
39a2cdb
rustdoc_to_markdown: Strip "Copy item path to clipboard" button (#12490)
Click to expand commit body
This PR strips the "Copy item path to clipboard" button from the rustdoc
output.
Release Notes:
- N/A
Marshall Bowers
created
8f942bf
Use repository mutex more sparingly. Don't hold it while running git status. (#12489)
Click to expand commit body
Previously, each git `Repository` object was held inside of a mutex.
This was needed because libgit2's Repository object is (as one would
expect) not thread safe. But now, the two longest-running git operations
that Zed performs, (`status` and `blame`) do not use libgit2 - they
invoke the `git` executable. For these operations, it's not necessary to
hold a lock on the repository.
In this PR, I've moved our mutex usage so that it only wraps the libgit2
calls, not our `git` subprocess spawns. The main user-facing impact of
this is that the UI is much more responsive when initially opening a
project with a very large git repository (e.g. `chromium`, `webkit`,
`linux`).
Release Notes:
- Improved Zed's responsiveness when initially opening a project
containing a very large git repository.
Max Brunsfeld
created
1ecd13b
Support copying permalink in multibuffer (#12435)
Click to expand commit body
Closes #11392
Release Notes:
- Added support for copying permalinks inside multi-buffers
([#11392](https://github.com/zed-industries/zed/issues/11392))
Bennet Bo Fenner
created
c118012
rustdoc_to_markdown: Add table support (#12488)
Click to expand commit body
This PR extends `rustdoc_to_markdown` with support for tables:
<img width="1007" alt="Screenshot 2024-05-30 at 12 05 35 PM"
src="https://github.com/zed-industries/zed/assets/1486634/4e9a2a65-8aaa-4df1-98c4-4dd4e7874514">
Release Notes:
- N/A
This PR sorts the `file_types.json` file alphabetically.
This is the command I used to sort it:
```
pnpm --package=json-sort-cli dlx jsonsort assets/icons/file_icons/file_types.json
```
Release Notes:
- N/A
Marshall Bowers
created
3c5d141
Force 60 minutes timeout for all regular CI jobs (#12486)
Click to expand commit body
After gazing at
https://github.com/zed-industries/zed/actions/runs/9296132630/job/25596939148
for some time, I've decided to add a hard limit on every test-related CI
job.
Release Notes:
- N/A
Kirill Bulatov
created
bf7c6a6
rustdoc_to_markdown: Recognize code blocks in other languages (#12484)
Click to expand commit body
This PR updates `rustdoc_to_markdown` to be able to recognize code
blocks using non-Rust languages.
Release Notes:
- N/A
Marshall Bowers
created
a259042
Make slash commands more discoverable (#12480)
436a8fa
php: Update Pest tree-sitter queries to capture single quotes (#12467)
Click to expand commit body
Improved PHP Pest outline and runnables to support single quoted
arguments
([#12461](https://github.com/zed-industries/zed/issues/12461)).
Release Notes:
- N/A
| Before | After |
|--------|--------|
|

| 
|
| 
| 
|
Sean Washington
created
55c4730
Align the inline assistant correctly (#12478)
Click to expand commit body
Release Notes:
- Fixed the the alignment for the inline assistant.
Antonio Scandurra
created
6ff01b1
Improve model selection in the assistant (#12472)
Click to expand commit body
https://github.com/zed-industries/zed/assets/482957/3b017850-b7b6-457a-9b2f-324d5533442e
Release Notes:
- Improved the UX for selecting a model in the assistant panel. You can
now switch model using just the keyboard by pressing `alt-m`. Also, when
switching models via the UI, settings will now be updated automatically.
When running the tests for linux, I found a lot of benign errors getting
logged. This PR cuts down some of the noise from unnecessary workspace
serialization and SVG renders
Release Notes:
- N/A
This PR fixes an issue in `rustdoc_to_markdown` with code blocks being
trimmed incorrectly.
We were erroneously popping from the current element stack even if we
didn't push an element onto the stack.
Added test coverage for this case as well, so we don't regress.
Release Notes:
- N/A
This PR makes it so Rust code blocks are recognized and
syntax-highlighted when converting from rustdoc to Markdown.
Release Notes:
- N/A
Marshall Bowers
created
b8d9713
Make prompt library icon in context panel staff-only for now (#12457)
Click to expand commit body
This is still pretty raw, so I'd like to hold off on shipping it to all
users.
Release Notes:
- Hide the prompt library for non-staff until it is in a more complete
state.
Nathan Sobo
created
abec028
rustdoc_to_markdown: Clean up heading spacing (#12456)
Click to expand commit body
This PR cleans up the spacing around the Markdown headings in the output
so that they are consistent.
Release Notes:
- N/A
This PR adds a `/rustdoc` slash command for retrieving and inserting
rustdoc docs into the Assistant.
Right now the command accepts the crate name as an argument and will
return the top-level docs from `docs.rs`.
Release Notes:
- N/A
Marshall Bowers
created
dd328ef
Compute git statuses using the bundled git executable, not libgit2 (#12444)
Click to expand commit body
I realized that somehow, the `git` executable is able to compute `git
status` much more quickly than libgit2, so I've switched our git status
logic to use `git`. Follow-up to
https://github.com/zed-industries/zed/pull/12266.
Release Notes:
- Improved the performance of git status updated when working in large
git repositories.
- Added support for xdg trash when deleting files on linux
- moved ashpd depency to toplevel to use it in both fs and gpui
If I need to add test, or change anything, please let me know. I tested
locally by creating and deleting a file and confirming it showed up in
my trashcan, but that probably a less than ideal method of confirming
correct behavior
Also, I could remove the delete directory function for linux, and change
the one configured for macos to compile for both macos and linux (they
are the same, the version of the function they are calling is
different).
Release Notes:
- N/A