Commit Graph
32 Commits
Author SHA1 Message Date
Joseph T. Lyons 56f118ce03 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 ca6e1659eb 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 5b838d928b 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 2ade0cd94b 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 92c7c9d729 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 50829b7b48 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 f0c0bf5039 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 dbd0a760e6 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 bd0743f1f3 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 6d130cd691 fix: adding prefix arg to npm subcommands 2024-01-28 19:09:50 +02:00
Piotr Osiewicz 4ef5a925ad 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 5cb6fc5776 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 1e1b434acc 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 OsiewiczandDavid 3fe512e1aa 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 1be1e3b5b5 Upgrade async-compression dep 2023-12-06 14:29:09 -08:00
Kirill Bulatov 08dc019824 Use proper npm arguments and clean its inherited env vars 2023-11-28 18:39:03 +02:00
Julia 94e9acda9a Avoid user NPM config/cache & put NodeRuntime installation behind a lock 2023-11-14 14:49:31 -05:00
Conrad Irwin a1fb3523d3 Merge branch 'main' into zed2 2023-10-27 10:55:15 +02:00
Antonio Scandurra a184c6aa02 Checkpoint 2023-10-24 16:15:20 +02:00
Kirill Bulatov ab12b3c6e1 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 7c90ad59a6 Make the first prettier test pass 2023-10-12 13:30:49 +03:00
Kirill Bulatov 41d699ac40 Prettier server style fixes 2023-10-12 12:31:30 +03:00
Kirill Bulatov 61f321016d Add prettier tests infrastructure 2023-10-11 19:13:28 +03:00
Julia 5e815dbf58 Remove NodeRuntime static & add fake implementation for tests 2023-09-06 11:18:55 -04:00
Julia 4cc33332ae 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 4f85bd2ec3 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
JuliaandAntonio Scandurra 4c47d64262 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 4a51852e68 Reinstall Node whenever a NodeRuntime operation has serious error 2023-06-28 16:43:45 -04:00
Julia e0728c7789 Source ESLint server from Github rather than 3rd party NPM package 2023-04-28 16:42:36 -04:00
Max Brunsfeld d1f33d7052 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
Max Brunsfeld a17f009b00 Use a workspace dependency for the futures crate 2023-04-24 09:43:31 -07:00
Mikayla Maki 58f6902229 Refactor out the node runtime crate and hook up all related imports 2023-03-28 10:27:31 -07:00