Commit graph

17598 commits

Author SHA1 Message Date
liruifengv
843919dd14
docs: Update configuring_zed__key_bindings.md (#6974)
Release notes: N/A
2024-01-29 14:08:12 +02:00
d1y
8263da02bd
Make .jsonc icon use storage icon (#6972)
Jsonc is a simplified json format which allows comments and unquoted
values delimited by whitespace. A jsonc formatted file can be
unambiguously transformed to a json file. Comments will be stripped out
and quotes added.

Release Notes:

- Added an icon for .jsonc files
2024-01-29 13:47:23 +02:00
George Munyoro
49542757fd
Correctly check existence of target directory in copy_recursive function (#6875)
Fixes https://github.com/zed-industries/zed/issues/6778

Release Notes:

- Fixed issue where copy-paste for folders was not working in the
project panel
([#6778](https://github.com/zed-industries/zed/issues/6778)).
2024-01-29 12:06:02 +02:00
Piotr Osiewicz
9ef830e9bb
update: Add arch and os to release query parameters. (#6976)
This is no-op right now, but we need it for multi-platform support and
(potentially) to split the Universal Binary on mac into two
non-universal targets.
Related to: #6837 
Release Notes:
- N/A
2024-01-29 10:48:54 +01:00
Piotr Osiewicz
8fbc88b708
Load embedded fonts directly from .rdata instead of cloning (#6932)
The fonts we embed in Zed binary (Zed Sans & Zed Mono) weigh about 30Mb in total and we are cloning them several times during startup and loading of embedded assets (once explicitly in Zed and then under the hood in font-kit). Moreover, after loading we have at least 2 copies of each font in our program; one in .rdata and the other on the heap for use by font-kit.
This commit does away with that distinction (we're no longer allocating the font data) and slightly relaxes the interface of `TextSystem::add_fonts` by expecting one to pass `Cow<[u8]>` instead of `Arc<Vec<u8>>`. Additionally, `AssetSource::get` now returns `Cow<'static, [u8]>` instead of `Cow<'self, [u8]>`; all existing implementations conform with that change.

Note that this optimization takes effect only in Release builds, as the library we use for asset embedding - rust-embed - embeds the assets only in Release mode and in Dev builds it simply loads data from disk. Thus it returns `Cow<[u8]>` in it's interface. Therefore, we still copy that memory around in Dev builds, but that's not really an issue. 
This patch makes no assumptions about the build profile we're running under, that's just an intrinsic property of rust-embed.

Tl;dr: this should shave off about 30Mb of memory usage and a fair chunk (~30ms) of startup time.

Release Notes:
- Improved startup time and memory usage.
2024-01-29 10:06:57 +01:00
Joseph T. Lyons
e22ffb6740 Run weekly update each day 2024-01-29 02:47:25 -05:00
Kieran Gill
00a6ac6141
docs: Consistent shortcut style (#6961)
Hey all. This is a follow-up to my last PR
https://github.com/zed-industries/zed/pull/6821. I went through and
applied the same style changes to more pages so your docs are more
consistent.

<img width="1330" alt="image"
src="https://github.com/zed-industries/zed/assets/18583882/b9adbb38-b98d-47c6-b585-7e298ffae854">


Note that some pages from your old docs repo haven't been ported to
`zed-industries/zed` yet.

Release Notes:

- Improved documentation consistency.
2024-01-28 22:33:07 -05:00
Brian Ginsburg
6cd306e4c9
docs: Add initial language settings documentation (#6957)
This pull request implements the following documentation changes:

- [x] Copy existing language settings docs from old docs repo
- [x] Add new pages for Zig, Haskell, Gleam, Deno and PureScript
- [x] Add `rust-analyzer` target directory section to Rust language page

Release Notes:

- Added initial language settings documentation
([#4264](https://github.com/zed-industries/zed/issues/4264)).
2024-01-28 22:07:27 -05:00
Marshall Bowers
5d0c144ce7
theme_importer: Define more colors in VsCodeTheme (#6960)
This PR extends the `VsCodeTheme` struct with more of the colors
available on a VS Code theme.

Release Notes:

- N/A
2024-01-28 21:55:40 -05:00
Conrad Irwin
331b6e7e6e
Support "dtx" vim key combination when "x" is immediately to the right of the cursor (#6830)
Closes #4358

The bug originates on this line:
5db7e8f89e/crates/vim/src/motion.rs (L451)

- When running "dtx" on "ˇabcx", the range to delete is 0 -> 2 ("abc")
- When running "dtx" on "abˇcx", the range to delete is 2 -> 2 ("c"), so
`new_point == point` and the function incorrectly returns `None` and "c"
is not deleted
- We need to disambiguate between the "not found" case and the "found
immediately to the right" case
- This bug does not apply to the backwards case ("dTx")

Release Notes:
- Fixed "dtx" vim key combination when "x" is immediately to the right
of the cursor (#4358)
2024-01-28 19:46:14 -07:00
Conrad Irwin
4ab1d8af62
Add support for u and U in vim visual mode (#6948)
This pull request adds support for upper / lower casing a visual
selection with `u` or `U` respectively, and resolves #6901.

I took an approach to split out the logic of the existing `ChangeCase`
action into something that could be reused for the two new actions. One
area that I could use feedback on is whether or not vim binding updates
make sense. Judging purely from the way things work from a clean install
of Vim / Neovim, I'm pretty sure that it's a bug that `u` applies an
undo in visual mode, so I think it's safe to make this change, but it
changes a behavior that some users may be used to by now in Zed.

Release Notes:

- Added support for `u` and `U` in Vim visual mode
([#6901](https://github.com/zed-industries/zed/issues/6901)).
2024-01-28 19:37:46 -07:00
Joseph T. Lyons
7c93f6244d Reinstate requirements.txt 2024-01-28 18:30:47 -05:00
Joseph T. Lyons
92911def96
Update top ranking issues script to take in a day interval (#6951)
Switch to `poetry`
Update script to take in a `query-day-interval` argument, so we can make
a report from all issues or just n last days.

Release Notes:

- N/A
2024-01-28 18:26:01 -05:00
Joseph T. Lyons
80cdd60d4c Add a weekly report 2024-01-28 18:22:39 -05:00
Joseph T. Lyons
6305761064 Update top ranking issues script to take in a day interval 2024-01-28 18:09:11 -05:00
Iván Molina Rebolledo
db68fc5130
Add PureScript LSP/Highlighting support (#6911)
This PR adds basic support for the language using the
`purescript-language-server`.

Release Notes:

- Added support for PureScript.
2024-01-28 17:44:50 -05:00
Kirill Bulatov
7767062c09
Add missing workspace edit capabilities (#6950)
Closes https://github.com/zed-industries/zed/issues/6916

Specification:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspaceEdit
Adds a safe minimum of the capabilities that Zed supports already,
allowing rust-analyzer to send file edits on rename.

Release Notes:

- Fixed rust module rename from editor not renaming the FS entries
([6916](https://github.com/zed-industries/zed/issues/6916))
2024-01-28 23:46:10 +02:00
Marshall Bowers
444f918e51
Retrieve credentials for saved conversations (#6949)
This PR fixes an issue where credentials for saved conversations weren't
being fully retrieved, which was preventing continuing a conversation
with the assistant in a saved conversation.

Release Notes:

- Fixed continuing a saved conversation with the Zed assistant.
2024-01-28 15:25:57 -05:00
Brooks Swinnerton
52f7f2d770
Update name of function to match other implementation 2024-01-28 15:20:50 -05:00
Brooks Swinnerton
c0c0abae56
Add support for u and U in vim visual mode 2024-01-28 15:13:09 -05:00
Julia
8e523d812f
Fix #4628: npm install to a wrong location (#6742)
By default `npm install` will walk up the folder tree checking for a
folder that contains either a package.json file, or a node_modules
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands.
This caused npm dependencies for language servers sometimes to be
installed in the wrong folder, described in #4628.
Adding `--prefix ./` to `npm install` forces
node_runtime.npm_install_packages to install packages in provided path
even if node_modules dir exists somewhere up the filesystem tree from
installation path.
2024-01-28 14:10:10 -05:00
Marshall Bowers
1f82a2aca1
Remove obviated comment in zed-licenses.toml (#6946)
This PR removes a comment from `zed-licenses.toml`, as it no longer
applies now that we don't have `buildLicenses.ts` anymore.

Release Notes:

- N/A
2024-01-28 14:07:53 -05:00
Ikko Eltociear Ashimine
b213458803
Fix typo in copilot.rs (#6933)
specifcially -> specifically

Release Notes:

- N/A
2024-01-28 19:56:50 +02:00
d1y
4fc01163da
Add Vue file icon (#6930)
https://github.com/vuejs/art/blob/master/white-on-dark-logo.svg
<img width="222" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/2839dd7e-ea25-4f9b-aac9-2437f1c3df23">

Release Notes:

- Added icon for `.vue` files.
2024-01-28 12:32:43 -05:00
ge
42e605a766 fix: adding prefix arg to npm subcommands 2024-01-28 19:09:50 +02:00
Marshall Bowers
027f055841
Update casing of "OpenAI" in identifiers to match Rust conventions (#6940)
This PR updates the casing of "OpenAI" when used in Rust identifiers to
match the [Rust naming
guidelines](https://rust-lang.github.io/api-guidelines/naming.html):

> In `UpperCamelCase`, acronyms and contractions of compound words count
as one word: use `Uuid` rather than `UUID`, `Usize` rather than `USize`
or `Stdin` rather than `StdIn`.

Release Notes:

- N/A
2024-01-28 12:01:10 -05:00
Marshall Bowers
e8bf06fc42
Style crate names in CONTRIBUTING.md (#6939)
This PR styles the crate names in `CONTRIBUTING.md` using inline code.

Release Notes:

- N/A
2024-01-28 11:07:37 -05:00
Marshall Bowers
5dec9f7163
Link to the Zed roadmap in CONTRIBUTING.md (#6937)
This PR updates `CONTRIBUTING.md` to link to the public Zed roadmap.

Release Notes:

- N/A
2024-01-28 10:48:38 -05:00
Piotr Osiewicz
f7b6bfefe6
chore: Remove rerun-if-changed clause that might cause spurious rebuilds (#4193)
Something is stomping over the timestamp of generated scene.h right
after the build script finishes:
`Dirty gpui v0.1.0 (/Users/someonetoignore/work/zed/zed/crates/gpui):
the file target/debug/build/gpui-ca04eedfe8d0e13c/out/scene.h has
changed (1705922004.637000680s, 1s after last build at
1705922003.507431315s)`
^ That's an output of `-v` flag added to either `cargo run` or `cargo
build`.
This comes up when you do `cargo build` followed by `cargo run` or
another `cargo build`; the artifact is not getting reused, even though
it should be possible?
Release Notes:
- N/A
2024-01-28 15:35:53 +01:00
d1y
e38489196d
Make .gitkeep icon use VCS icon (#6931)
This should be a standard recognized by everyone

```bash
mkdir todo
touch todo/.gitkeep # just placeholder
git add todo
git commit
```

Release Notes:

- Added icon for `.gitkeep` files.
2024-01-28 16:30:30 +02:00
Noritada Kobayashi
3493e71ad4
Add Ruby file icon (#6922)
This icon is designed based on [Ruby's official logo], to harmonize with
the other icons.
It is deformed and simplified to be human-recognizable, even at letter
size.

[Ruby's official logo]: https://www.ruby-lang.org/en/about/logo/

Release Notes:

- Added Ruby file icon.
2024-01-28 13:46:32 +02:00
Marshall Bowers
3eb0a2c3c7
theme_importer: Map more colors (#6913)
This PR extends the `theme_importer` to map more colors from VS Code
themes.

Release Notes:

- N/A
2024-01-27 23:38:07 -05:00
Marshall Bowers
ff76b2ec4d
Replace IIFE with maybe! (#6909)
This PR replaces a usage of an IIFE with `maybe!`.

Release Notes:

- N/A
2024-01-27 22:34:37 -05:00
Marshall Bowers
bbdf401a78
Use async_maybe! instead of inline IIFEs (#6906)
This PR replaces instances where we were using an async IIFE with the
`async_maybe!` macro.

Release Notes:

- N/A
2024-01-27 20:49:56 -05:00
Marshall Bowers
5b9cc26194
Gracefully handle errors when loading themes (#6904)
This PR improves the theme loading to gracefully handle when a theme
couldn't be loaded.

Trying to debug a panic that happens on startup in Nightly.

Release Notes:

- N/A
2024-01-27 19:37:01 -05:00
Marshall Bowers
dfad36f668
Upgrade tree-sitter-php to v0.21.1 (#6902)
This PR upgrades `tree-sitter-php` to v0.21.1.

Here is the diff between our current version and this version:
d43130fd15...29a49d3a53

The primary impetus for this change is to get this change that adds the
`license` field to the `Cargo.toml`:
https://github.com/tree-sitter/tree-sitter-php/pull/193

This will silence the warning that is shown when running
`script/generate-licenses`.

Release Notes:

- Upgraded `tree-sitter-php` to v0.21.1.
2024-01-27 17:43:39 -05:00
Marshall Bowers
96a02dec7a
Bump tree-sitter-haskell (#6899)
This PR bumps our version of `tree-sitter-haskell` for the addition of
the `license` field in
https://github.com/tree-sitter/tree-sitter-haskell/pull/112.

This will silence the warning that is shown when running
`script/generate-licenses`.

Release Notes:

- N/A
2024-01-27 17:13:23 -05:00
Marshall Bowers
9b453d2cbc
Remove old themes using UserTheme constructs (#6897)
This PR removes the themes defined using the `UserTheme` types, as we're
now loading the themes via JSON.

The `theme_importer` has also been reworked to read in a VS Code theme
and output a new JSON theme.

Release Notes:

- N/A
2024-01-27 16:55:37 -05:00
Marshall Bowers
5f1dcb76fe
Load JSON themes (#6893)
This PR changes the theme loading to use the JSON themes bundled with
the binary rather then the Rust theme definitions.

### Performance

I profiled this using `cargo run --release` to see what the speed
differences would be now that we're deserializing JSON:

**Before:** `ThemeRegistry::load_user_themes` took 16.656666ms
**After:** `ThemeRegistry::load_user_themes` took 18.784875ms

It's slightly slower, but not by much. There is probably some work we
could do here to bring down the theme loading time in general.

Release Notes:

- N/A
2024-01-27 16:03:04 -05:00
Bjerg
f7fc4ffbe5
Disable Discord URL embed (#6892)
Wrapping links in `<` and `>` disables auto-embeds in Discord, even if
it's a markdown-style link.

Closes #6884

Release Notes:

- N/A
2024-01-27 15:34:36 -05:00
Marshall Bowers
a2efc8da7a
Add player colors to serialized themes (#6887)
This PR adds player colors to serialized themes.

Release Notes:

- N/A
2024-01-27 13:50:33 -05:00
Marshall Bowers
0fe0683ef4
Add serialized versions of themes (#6885)
This PR adds serialized versions of each of the themes that currently
ship with Zed.

In a future PR we'll be looking to make these the canonical
representations of the built-in themes.

Note that we're intentionally repurposing the `theme_importer` to do
this, so that crate is a bit rough-and-ready at the moment.

Release Notes:

- N/A
2024-01-27 13:35:43 -05:00
Viktor Szépe
9d6414b0cc
Fix typos configuration (#6877)
- check hidden files
- fix a typos in a hidden file
- ignore "ba" typos in a more specific way
- ignore a typo in collab/migrations/ literally

Release Notes:

- N/A
2024-01-27 11:03:25 -05:00
Marshall Bowers
1564bd82f2
Add installation instructions to README (#6870)
This PR adds installation instructions to the README, with a note on
which platforms we currently support.

Release Notes:

- N/A
2024-01-27 09:54:13 -05:00
Stuart Hinson
bd39258fc7
Address a couple comments re Ruby file associations (#6863)
Release Notes:

- Fixed: Address a [couple comments re Ruby file
associations](https://github.com/zed-industries/zed/pull/6812#discussion_r1468437144)
2024-01-27 16:09:15 +02:00
William Desportes
ac3e0afb3d
fix: move anyhow dependency to dependencies (#6866)
Was moved by mistake in: ebbe52e6b0

This was throwing errors everywhere on Linux because anyhow is needed by
the code and is not macOS dependent.


Release Notes:

- N/A
2024-01-27 16:08:06 +02:00
Piotr Osiewicz
0a0a866dd5
Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535)
Release Notes:
- N/A
2024-01-27 13:51:16 +01:00
Amin Yahyaabadi
0e4d9472a9
fix: isolate macos-specific dependencies (#6854)
Release Notes:
- N/A
2024-01-27 13:38:55 +01:00
Alex Kladov
1f83b5c508
FileFinder: use idiomatic definition for Ord/PartialOrd (#6851) 2024-01-27 13:07:24 +02:00
Brian Strauch
5b9f15e075 add test_data 2024-01-26 20:02:59 -08:00