zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.83k stars 3.06k forks source link

Some TypeScript code actions are not applied #20384

Open mykytabatrak opened 1 week ago

mykytabatrak commented 1 week ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When using "code_actions_on_format" in .ts, or .tsx files only "source.organizeImports" actually modifies the code.

Zed settings:

{
  "format_on_save": "on",
  "code_actions_on_format": {
    "source.addMissingImports": true,
    "source.removeUnusedImports": true,
    "source.sortImports": true
  }
}

Repository I used for reproducing - https://github.com/mykytabatrak/zed-ts-code-actions.

I set up two files with a bunch of imports that need formatting: src/main.tsx and src/test.ts. With "source.organizeImports" imports get sorted and unused one are removed, while "source.addMissingImports", "source.removeUnusedImports", and "source.sortImports" do not affect the code in any way.

Also, I took a look at the vtsls code and I am not sure that it supports three actions I outlined above, so as per documentation I configured Zed to use typescript-language-server, and tried formatting code with the following configuration:

{
  "languages": {
    "TypeScript": {
      "language_servers": ["typescript-language-server", "!vtsls"],
      "prettier": { "allowed": false }
    },
    "TSX": {
      "language_servers": ["typescript-language-server", "!vtsls"],
      "prettier": { "allowed": false }
    },
    "JavaScript": {
      "language_servers": ["typescript-language-server", "!vtsls"],
      "prettier": { "allowed": false }
    }
  },

  "format_on_save": "on",
  "code_actions_on_format": {
    "source.addMissingImports": true,
    "source.removeUnusedImports": true,
    "source.sortImports": true
  }
}

Unfortunately results were the same.

Environment

Zed: v0.160.7 (Zed) OS: macOS 15.1.0 Memory: 36 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

First video is using Zed config with only code actions specified:

https://github.com/user-attachments/assets/f01667d9-3a95-4693-a87c-4c25b7ef12a5

Second video is with typescript-language-server configured in Zed:

https://github.com/user-attachments/assets/a7aa611c-7abf-450e-8c48-058dd3ff013d

If applicable, attach your Zed.log file to this issue.

Zed.log ``` { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:54:26.185291-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:54:26.18981-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 11 } 2024-11-07T15:54:30.725226-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T15:54:30.725398-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es5.d.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:54:30.7255-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es5.d.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:54:30.725597-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/vite@5.4.10/node_modules/vite/dist/node/index.d.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:54:30.725687-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/vite@5.4.10/node_modules/vite/dist/node/index.d.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:54:30.733903-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:54:30.734112-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.core.d.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:54:30.742389-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:54:30.767969-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:54:30.768125-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts", "state": 1, "validationTime": 0 } 2024-11-07T15:54:30.777234-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.array.d.ts", "state": 1, "validationTime": 0 } 2024-11-07T15:54:30.792526-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.promise.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:54:30.800048-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.promise.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:54:34.788934-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T15:54:34.789134-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:54:42.945908-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 5 } 2024-11-07T15:54:42.949196-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:54:44.53329-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 10 } 2024-11-07T15:54:44.54401-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:54:46.316428-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 14 } 2024-11-07T15:54:51.55896-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T15:54:52.075461-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 14 } 2024-11-07T15:54:52.128436-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:54:52.194586-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 13 } 2024-11-07T15:54:52.442458-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 10 } 2024-11-07T15:54:53.059533-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T15:54:53.068052-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:54:57.559709-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 12 } 2024-11-07T15:54:58.276619-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:54:59.092153-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T15:54:59.643768-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:55:01.911637-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 13 } 2024-11-07T15:55:02.111733-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 13 } 2024-11-07T15:55:02.168621-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:02.250712-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:02.367702-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:55:02.436488-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:02.743763-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:03.250264-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:07.533711-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:08.260979-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:08.568683-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 13 } 2024-11-07T15:55:08.601873-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:08.752101-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:55:08.843928-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:55:09.025835-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:09.092947-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:10.262158-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:10.269671-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:12.569301-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:12.578337-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:14.035806-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T15:55:20.626173-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:24.983152-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 14 } 2024-11-07T15:55:25.193314-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:25.417165-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:30.608675-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 15 } 2024-11-07T15:55:30.692117-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:55:30.72689-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:31.219354-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:55:32.576833-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 17 } 2024-11-07T15:55:34.701695-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:55:34.85154-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T15:55:35.184523-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:35.324871-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:35.651821-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 7 } 2024-11-07T15:55:36.183794-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:37.621445-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/vite@5.4.10/node_modules/vite/dist/node/index.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:55:37.682848-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:55:37.684385-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:55:38.852496-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T15:55:45.283532-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 10 } 2024-11-07T15:55:47.287157-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 9 } 2024-11-07T15:55:52.931277-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 0 } 2024-11-07T15:55:53.864562-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T15:55:56.531609-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T15:55:58.121441-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 11 } 2024-11-07T15:55:58.129517-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T15:55:58.988046-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 9 } 2024-11-07T15:56:07.533627-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T15:56:07.538326-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 7 } 2024-11-07T15:56:09.020441-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:56:09.020613-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:56:09.112183-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T15:56:09.903195-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T15:56:11.722983-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 9 } 2024-11-07T15:56:11.984306-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T15:56:12.123565-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 5 } 2024-11-07T15:56:14.521659-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T15:58:26.653506-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T15:58:26.660042-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 14 } 2024-11-07T15:58:30.117044-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/server.d.ts", "state": 1, "validationTime": 0 } 2024-11-07T16:02:37.604634-06:00 [ERROR] oneshot canceled 2024-11-07T16:03:01.766812-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 7 } 2024-11-07T16:03:34.073907-06:00 [INFO] open paths ["/Users/mykytabatrak/.config/zed/settings.json"] 2024-11-07T16:03:34.088569-06:00 [INFO] attempting to start language server "json-language-server", path: "/Users/mykytabatrak/.config/zed/settings.json", id: 25 2024-11-07T16:03:34.088866-06:00 [INFO] using project environment for language server LanguageServerName("json-language-server") 2024-11-07T16:03:34.089045-06:00 [INFO] starting language server process. binary path: "/Users/mykytabatrak/.volta/bin/node", working directory: "/Users/mykytabatrak/.config/zed", args: ["/Users/mykytabatrak/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-langservers-extracted/bin/vscode-json-language-server", "--stdio"] 2024-11-07T16:03:59.650346-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T16:04:00.730745-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T16:04:00.858653-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T16:04:04.946169-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T16:04:06.279614-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 7 } 2024-11-07T16:04:14.28253-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 12 } 2024-11-07T16:04:14.513906-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 5 } 2024-11-07T16:04:14.846356-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 5 } 2024-11-07T16:04:14.989759-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 14 } 2024-11-07T16:04:48.688558-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 7 } 2024-11-07T16:04:48.693994-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T16:04:50.863297-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 12 } 2024-11-07T16:04:54.739993-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T16:15:46.967525-06:00 [ERROR] Formatting failed: default prettier instance failed to format buffer: error during message '{"jsonrpc":"2.0","id":66,"method":"prettier/format","params":{"text":"..snip..","options":{"plugins":[],"parser":null,"filepath":"/Users/mykytabatrak/.config/zed/settings.json","prettierOptions":{"tabWidth":2,"printWidth":80,"useTabs":false}}}}' handling: SyntaxError: Unexpected token, expected "," (22:3) 20 | } 21 | > 22 | "format_on_save": "on", | ^ 23 | "code_actions_on_format": { 24 | "source.organizeImports": true 25 | // "source.addMissingImports": true, 2024-11-07T16:15:46.968041-06:00 [ERROR] default prettier instance failed to format buffer Caused by: error during message '{"jsonrpc":"2.0","id":66,"method":"prettier/format","params":{"text":"..snip..","options":{"plugins":[],"parser":null,"filepath":"/Users/mykytabatrak/.config/zed/settings.json","prettierOptions":{"tabWidth":2,"printWidth":80,"useTabs":false}}}}' handling: SyntaxError: Unexpected token, expected "," (22:3) 20 | } 21 | > 22 | "format_on_save": "on", | ^ 23 | "code_actions_on_format": { 24 | "source.organizeImports": true 25 | // "source.addMissingImports": true, 2024-11-07T16:15:47.090746-06:00 [ERROR] Failed to load user settings: expected `,` or `}` at line 22 column 3 2024-11-07T16:15:47.167319-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T16:15:47.172247-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 10 } 2024-11-07T16:15:50.521038-06:00 [INFO] attempting to start language server "typescript-language-server", path: "/Users/mykytabatrak/Developer/zed-ts-code-actions", id: 26 2024-11-07T16:15:50.524791-06:00 [INFO] fetching latest version of language server "typescript-language-server" 2024-11-07T16:15:50.58621-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 7 } 2024-11-07T16:15:50.586397-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T16:15:51.982015-06:00 [INFO] downloading language server "typescript-language-server" 2024-11-07T16:15:52.243655-06:00 [INFO] using project environment for language server LanguageServerName("typescript-language-server") 2024-11-07T16:15:52.243774-06:00 [INFO] starting language server process. binary path: "/Users/mykytabatrak/.volta/bin/node", working directory: "/Users/mykytabatrak/Developer/zed-ts-code-actions", args: ["/Users/mykytabatrak/Library/Application Support/Zed/languages/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs", "--stdio"] 2024-11-07T16:15:52.301898-06:00 [INFO] Language server with id 26 sent unhandled notification $/typescriptVersion: { "version": "5.6.3", "source": "user-setting" } 2024-11-07T16:16:01.815388-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T16:16:01.815619-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 11 } 2024-11-07T16:16:01.948992-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T16:16:01.957185-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T16:16:23.846406-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T16:16:23.851334-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 10 } 2024-11-07T16:16:26.860353-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 12 } 2024-11-07T16:16:29.721809-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/server.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:16:29.744896-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 3 } 2024-11-07T16:16:30.555907-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 9 } 2024-11-07T16:16:32.247796-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/server.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:16:32.853174-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 11 } 2024-11-07T16:16:43.903928-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T16:16:43.9087-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 11 } 2024-11-07T16:16:45.31349-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 15 } 2024-11-07T16:19:20.708897-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T16:19:20.709298-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 10 } 2024-11-07T16:19:22.998317-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 11 } 2024-11-07T16:19:24.888859-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:20:30.22733-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T16:20:30.228446-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 10 } 2024-11-07T16:20:31.787843-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:20:31.801418-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:20:32.383232-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 10 } 2024-11-07T16:20:33.270371-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/server.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:20:33.381707-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 8 } 2024-11-07T16:20:34.950517-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 2 } 2024-11-07T16:20:35.421016-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 6 } 2024-11-07T16:20:36.024483-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/vite@5.4.10/node_modules/vite/dist/node/index.d.ts", "state": 1, "validationTime": 0 } 2024-11-07T16:20:36.24734-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T16:20:41.115023-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 5 } 2024-11-07T16:20:41.115241-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T16:21:06.046006-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 0 } 2024-11-07T16:21:06.070404-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:21:09.045339-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 2 } 2024-11-07T16:21:16.165019-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 6 } 2024-11-07T16:21:16.165251-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 10 } 2024-11-07T16:21:16.887173-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/client.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:21:17.751045-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 11 } 2024-11-07T16:21:18.617135-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:21:18.854992-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/main.tsx", "state": 1, "validationTime": 7 } 2024-11-07T16:21:20.102593-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/client.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:21:20.21726-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 8 } 2024-11-07T16:21:21.427827-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 13 } 2024-11-07T16:21:21.805818-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react-dom@18.3.1/node_modules/@types/react-dom/client.d.ts", "state": 1, "validationTime": 1 } 2024-11-07T16:21:22.812575-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 9 } 2024-11-07T16:21:23.994203-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/src/test.ts", "state": 1, "validationTime": 5 } 2024-11-07T16:21:23.994383-06:00 [INFO] Language server with id 22 sent unhandled notification eslint/status: { "uri": "file:///Users/mykytabatrak/Developer/zed-ts-code-actions/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts", "state": 1, "validationTime": 1 } ```
mrnugget commented 3 days ago

First of all: thank you for this perfect issue! I have to call this out: reproducible steps, a repo (!), videos (!!) — thank you!

Now, as to your problem: yes, given the settings you provided, the code actions don't work with vtsls, but the code actions you defined are also not supported by vtsls.

Instead of

{
  "format_on_save": "on",
  "code_actions_on_format": {
    "source.addMissingImports": true,
    "source.removeUnusedImports": true,
    "source.sortImports": true
  }
}

Try this:

{
  "format_on_save": "on",
  "code_actions_on_format": {
    "source.organizeImports": true
  }
}

That works for me:

https://github.com/user-attachments/assets/a29ae0d0-b838-4273-a3de-eb8cd71e1c99

mykytabatrak commented 2 days ago

That's what I thought. Do you know if these actions are compatible with typescript-language-server? Because it seems like they aren't from my testing that I outlined in the issue's description.

My issue is that on my job we have eslint config that defines rules for import order, and for files with large amount of imports eslint and "source.organizeImports" run into a race condition where the latter sometimes wins and I get an error in our CI/CD chain.

I have to manually disable "source.organizeImports", format the file and then re-enable it because I need it to remove unused imports.

mrnugget commented 1 day ago

Have you tried using the code actions as the formatter? You can define multiple formatters, for example, and then specify a order in which they are applied:

{
    "TypeScript": {
      "formatter": [
        { "language_server": { "name": "vtsls" } },
        {
          "code_actions": {
            "source.organizeImports": true,
            "source.fixAll.eslint": true
          }
        }
      ]
  }
}
mykytabatrak commented 1 day ago

Unfortunately that doesn't solve my issue.

I updated src/main.tsx and src/test.ts files and eslint config in the example repo (https://github.com/mykytabatrak/zed-ts-code-actions) to illustrate the issue I'm facing.

I tried to implement your suggestion in two ways. First with the configuration matching what you suggested, and then separating "source.organizeImports" and "source.fixAll.eslint" into two separate "code_actions" entries. You can see these configs and related videos down below.

With config matching the suggestion

{
  "languages": {
    "TypeScript": {
      "formatter": [
        { "language_server": { "name": "vtsls" } },
        {
          "code_actions": {
            "source.organizeImports": true,
            "source.fixAll.eslint": true
          }
        }
      ]
    },
    "TSX": {
      "formatter": [
        { "language_server": { "name": "vtsls" } },
        {
          "code_actions": {
            "source.organizeImports": true,
            "source.fixAll.eslint": true
          }
        }
      ]
    }
  }
}

https://github.com/user-attachments/assets/6bfecdfe-8bfc-400d-b57d-0c03b698bea6

With modified config

{
  "languages": {
    "TypeScript": {
      "formatter": [
        { "language_server": { "name": "vtsls" } },
        {
          "code_actions": {
            "source.organizeImports": true
          }
        },
        {
          "code_actions": {
            "source.fixAll.eslint": true
          }
        }
      ]
    },
    "TSX": {
      "formatter": [
        { "language_server": { "name": "vtsls" } },
        {
          "code_actions": {
            "source.organizeImports": true
          }
        },
        {
          "code_actions": {
            "source.fixAll.eslint": true
          }
        }
      ]
    }
  }
}

https://github.com/user-attachments/assets/c25bb867-8aae-4e5a-89e2-84a0299ab23a