Commit Graph

45 Commits

Author SHA1 Message Date
张小白
4976a9e9d8
windows: Fix eslint installation (#15331)
Close #13786. To make `eslint` running on Windows, I made the following
changes:

1. Ensure that `zed` downloads the `.zip` file.
2. Handle the `$shared` symbolic link by copying files to the link
location.
3. In #13891, I mentioned that the `npm` `post-install` script was
always failing. After debugging, I found it was due to missing
environment variables. This has been fixed, and I will submit a new PR
to address the changes in #13891.

With this PR, `eslint` can now successfully run on Windows. Video:



https://github.com/user-attachments/assets/e85451b8-0388-490a-8a75-01c12d744f7c



Release Notes:

- Fixed `eslint` not running on Windows
([#13786](https://github.com/zed-industries/zed/issues/13786)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-27 10:24:05 -04:00
Mikayla Maki
855048041d
Update http crate name (#15041)
Release Notes:

- N/A
2024-07-23 15:01:05 -07:00
Marshall Bowers
0a9d50bf01
http: Refactor construction of HTTP clients with a proxy (#14911)
This PR refactors the `http` crate to expose a better way of
constructing an `HttpClient` that contains a proxy.

Release Notes:

- N/A
2024-07-21 10:15:38 -04:00
Fabian
a072caab0b
node_runtime: Bump downloaded Node.js version to Current (Jod) (#14687)
This PR bumps the hard-coded Node.js version from v18.x (Hydrogen), which was LTS until October 2023, to v22.x (Jod) which will be the next LTS release in October 2024.

Release Notes:

- Updated Zed's node version (v18.x -> v22.x)
2024-07-20 01:18:56 +03:00
Piotr Osiewicz
55511d1591
JSON: Show package.json dependency tooltips on hover (#13481)
Fixes https://github.com/zed-industries/zed/issues/13303

Release Notes:

- Added package version tooltips when hovering over package.json
dependency entries.
2024-06-25 14:59:29 +02:00
Marshall Bowers
81475ac4cd
paths: Replace lazy_static! with OnceLock (#13213)
This PR replaces the `lazy_static!` usages in the `paths` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

The paths are now exposed as accessor functions that reference a private
static value.

Release Notes:

- N/A
2024-06-18 12:22:37 -04:00
Marshall Bowers
258a8a37d8
Extract paths out of util (#13182)
This PR extracts the definition of the various Zed paths out of `util`
and into a new `paths` crate.

`util` is for generic utils, while these paths are Zed-specific. For
instance, `gpui` depends on `util`, and it shouldn't have knowledge of
these paths, since they are only used by Zed.

Release Notes:

- N/A
2024-06-17 19:27:42 -04:00
Marshall Bowers
ace371a0d8
node_runtime: Restrict the windows dependency to the Windows target (#12284)
This PR fixes an issue where the `windows` dependency was being included
on non-Windows targets.

Resolves https://github.com/zed-industries/zed/issues/12282.

Release Notes:

- N/A
2024-05-25 11:04:22 -04:00
张小白
b451af4906
Fix npm install error with some languages (#12087)
If you have already installed `node` using `brew install node`, you are
fine. If you did not install `node` on you local machine, it fails.

The `node_binary` path is actually not included in environment variable.
When run `npm install`, some extensions like `eslint`, may run some
commands like `sh -c node .....`. Since `node_binary` path is not
included in `PATH` variable, `sh -c node ...` will fail complaining that
"command not found". If you have installed `node` before, `node` is
already included in `PATH`, so you are fine. If not, it fails.

Closes #11890

Release Notes:

- Fixed Zed's internal Node runtime not being put in `$PATH` correctly
when running language servers and other commands with `node`.
([#11890](https://github.com/zed-industries/zed/issues/11890))

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-05-22 06:14:44 +02:00
张小白
1b261608c6
Add basic proxy settings (#11852)
Adding `proxy` keyword to configure proxy while using zed. After setting
the proxy, restart Zed to acctually use the proxy.

Example setting: 
```rust
"proxy" = "socks5://localhost:10808"
"proxy" = "http://127.0.0.1:10809"
```

Closes #9424, closes #9422, closes #8650, closes #5032, closes #6701,
closes #11890

Release Notes:

- Added settings to configure proxy in Zed

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-05-16 19:43:26 +03:00
Conrad Irwin
5515ba6043
Extract http from util (#11680)
This avoids the CLI linking libssl etc...

Release Notes:

- N/A
2024-05-10 15:50:20 -06:00
Jason Lee
5e06ce4df3
Add zip extract support for Windows (#11156)
Release Notes:

- [x] Fixed install Node.js runtime and NPM lsp installation on Windows.
- [x] Update Node runtime command to execute on Windows with no window
popup.

Ref #9619, #9424

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-05-09 09:23:21 -04:00
Max Brunsfeld
d699b8e104
Allow extensions to define more of the methods in the LspAdapter trait (#9554)
Our goal is to extract Svelte support into an extension, since we've
seen problems with the Tree-sitter Svelte parser crashing due to bugs in
the external scanner. In order to do this, we need a couple more
capabilities in LSP extensions:

* [x] `initialization_options` - programmatically controlling the JSON
initialization params sent to the language server
* [x] `prettier_plugins` - statically specifying a list of prettier
plugins that apply for a given language.
* [x] `npm_install_package`

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-20 12:47:04 -07:00
Joseph T. Lyons
276139f792
Implement updating for node-based language servers (#9361)
Fixes: https://github.com/zed-industries/zed/issues/9234

This doesn't address `vue` as it has a slightly different install code,
but it should be fairly simple to add - I'll add it in in a follow-up.

This PR will allow all (except `vue`) node-based language servers to
update. It is mostly just throwing in a method into the `NodeRuntime`
trait that is used for checking if a package doesn't exist locally, or
is out of date, by checking the version against what's newest, and
installing. If any parsing of the `package.json` data fails along the
way, it assumes something has gone awry on the users system, logs the
error, and then proceeds with trying to install the package, so that
users don't get stuck on version if their package has some bad data.
Outside of adding this method, it just adds that check in all of the
language server's individual `fetch_server_binary` methods.

Release Notes:

- Added updating for node-based language servers
([#9234](https://github.com/zed-industries/zed/issues/9234)).
2024-03-15 11:40:28 -04:00
Marshall Bowers
22fe03913c
Move Clippy configuration to the workspace level (#8891)
This PR moves the Clippy configuration up to the workspace level.

We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table)
to configure the Clippy ruleset in the workspace's `Cargo.toml`.

Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:

```toml
[lints]
workspace = true
```

This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
```

Release Notes:

- N/A
2024-03-05 12:01:17 -05:00
Dzmitry Malyshau
cb75c57fc0
Cleanup dependencies (part 4) (#8468)
Follow-up to #8425 . Final part - adds the CI check.

Release Notes:
- N/A
2024-02-27 20:41:49 +02:00
Marshall Bowers
b29946130e
Hoist languages crate's dependencies to the workspace level (#8394)
This PR hoists all of the dependencies of the `languages` crate to the
workspace level.

Release Notes:

- N/A
2024-02-25 12:02:59 -05:00
bbb651
4616d66e1d
Download right language server binary for OS (#8040)
Release Notes:

- Download right language server binary for OS
2024-02-20 09:53:03 +02:00
Piotr Osiewicz
743f9b345f
chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Marshall Bowers
e338f34097
Sort dependencies in Cargo.toml files (#7126)
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.

This should make them easier to visually scan when looking for a
dependency.

Apologies in advance for any merge conflicts 🙈 

Release Notes:

- N/A
2024-01-30 21:41:29 -05:00
Marshall Bowers
0cb8b0e451
Clean up Cargo.toml files (#7044)
This PR cleans up some inconsistencies in the `Cargo.toml` files that
were driving me crazy.

Release Notes:

- N/A
2024-01-29 23:47:20 -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
ge
42e605a766 fix: adding prefix arg to npm subcommands 2024-01-28 19:09:50 +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
Piotr Osiewicz
f2ff7fa4d5
chore: Change AGPL-licensed crates to GPL (except for collab) (#4231)
- [x] Fill in GPL license text.
- [x] live_kit_client depends on live_kit_server as non-dev dependency,
even though it seems to only be used for tests. Is that an issue?

Release Notes:
- N/A
2024-01-24 00:26:58 +01:00
Piotr Osiewicz
21e6b09361
Remove license-file from Cargo.toml as it is apparently redundant (#4218)
Release Notes:

- N/A
2024-01-23 17:40:30 +01:00
Piotr Osiewicz
678bdddd7d
chore: Add crate licenses. (#4158)
- GPUI and all dependencies: Apache 2
- Everything else: AGPL

Here's a script that I've generated for it:
https://gist.github.com/osiewicz/6afdd6626e517da24a2092807e6f0b6e

Release Notes:
- N/A

---------

Co-authored-by: David <david@zed.dev>
2024-01-23 16:56:22 +01:00
Max Brunsfeld
2d18b949ad Upgrade async-compression dep 2023-12-06 14:29:09 -08:00
Kirill Bulatov
5451db9c96 Use proper npm arguments and clean its inherited env vars 2023-11-28 18:39:03 +02:00
Julia
59ec9e508b Avoid user NPM config/cache & put NodeRuntime installation behind a lock 2023-11-14 14:49:31 -05:00
Conrad Irwin
4a6a17d866 Merge branch 'main' into zed2 2023-10-27 10:55:15 +02:00
Antonio Scandurra
11953e613b Checkpoint 2023-10-24 16:15:20 +02:00
Kirill Bulatov
e9ce935991 Rework prettier tests
Do not infuse `FakeNodeRuntime` with prettier exceptions, rather keep
the default formatter installation method as no-op.
2023-10-24 14:25:46 +02:00
Kirill Bulatov
7f4ebf50d3 Make the first prettier test pass 2023-10-12 13:30:49 +03:00
Kirill Bulatov
a528c6c686 Prettier server style fixes 2023-10-12 12:31:30 +03:00
Kirill Bulatov
e50f4c0ee5 Add prettier tests infrastructure 2023-10-11 19:13:28 +03:00
Julia
8d672f5d4c Remove NodeRuntime static & add fake implementation for tests 2023-09-06 11:18:55 -04:00
Julia
46101bf110 Reattempt Node installation if the installation itself errors
This also makes us a bit more aggressive about reinstalling Node
2023-07-28 15:24:40 -04:00
Julia
2d8159998d Put our downloaded copy of Node in the env for every NPM action
Intelephense (PHP language server) has a dependency on `protobufjs`
which invokes `node` in the `postinstall` script and if the user did
not have a system Node runtime installed that would fail. Have this
use our downloaded installation too
2023-07-21 16:13:00 -04:00
Julia
aee008440b Detect Node broken-ness initially
This will help cases where Node is broken causing Copilot to fail to
start but because it doesn't install via NPM we would not have caught
it prior.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-07-18 10:02:14 -04:00
Julia
db2b3e47bc Reinstall Node whenever a NodeRuntime operation has serious error 2023-06-28 16:43:45 -04:00
Julia
1bf85214a4 Source ESLint server from Github rather than 3rd party NPM package 2023-04-28 16:42:36 -04:00
Max Brunsfeld
ebbe52e6b0 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
Max Brunsfeld
abdccf7393 Use a workspace dependency for the futures crate 2023-04-24 09:43:31 -07:00
Mikayla Maki
941da24f73 Refactor out the node runtime crate and hook up all related imports 2023-03-28 10:27:31 -07:00