Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: TypeScript with Yarn PnP configuration not working in Zed v0.154.2 #18410

Open
1 task done
Brayan233 opened this issue Sep 26, 2024 · 11 comments
Open
1 task done
Labels
bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors regression A bug that was introduced in a recent release setting Feedback for preferences, configuration, etc tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support

Comments

@Brayan233
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

After upgrading to Zed v0.154.2, the TypeScript Yarn Plug'n'Play (PnP) configuration in local project settings (.zed/settings.json) stopped working. This setup was functional in Zed v0.153.7, but the recent update seems to have reverted the fix, causing the language server to ignore the local project settings.

Here is the local settings configuration that is not working:

{
  "lsp": {
    "vtsls": {
      "initialization_options": {
        "typescript": {
          "tsdk": ".yarn/sdks/typescript/lib"
        },
        "vtsls": {
          "autoUseWorkspaceTsdk": true
        }
      }
    }
  }
}

Steps to Reproduce:

  1. Upgrade to Zed v0.154.2.
  2. In the local project folder, create or update .zed/settings.json with the following configuration:
{
  "lsp": {
    "vtsls": {
      "initialization_options": {
        "typescript": {
          "tsdk": ".yarn/sdks/typescript/lib"
        },
        "vtsls": {
          "autoUseWorkspaceTsdk": true
        }
      }
    }
  }
}
  1. Start the editor and observe the behavior of the language server.

Expected Behavior:

The language server should pick up the configuration from the local project's .zed/settings.json and correctly use the specified TypeScript SDK path.

Actual Behavior:

The language server ignores the local .zed/settings.json settings. This results in the failure of the expected functionality in the project environment.

Additional Notes:

Related issues

Environment

Zed: v0.154.2 (Zed)
OS: macOS 15.0.0
Memory: 16 GiB
Architecture: x86_64

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

No response

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

No response

@Brayan233 Brayan233 added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Sep 26, 2024
@JosephTLyons JosephTLyons added typescript TypeScript programming language support language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc language server An umbrella label for all language servers tooling An umbrella label for language tools, linters, formatters, etc regression A bug that was introduced in a recent release and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 12, 2024
@ai212983
Copy link

Any update on this? This is a showstopper for me, as it totally breaks TypeScript projects with Yarn PnP.

@github-actions github-actions bot added admin read Pending admin review triage Maintainer needs to classify the issue labels Nov 5, 2024
@notpeter notpeter removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 5, 2024
@dimasd-angga
Copy link

any update on this ? i cannot use ZED for my project :(

@noverby
Copy link

noverby commented Nov 21, 2024

Any workarounds for this?

@akeating
Copy link

Rolling back to Zed v0.153.7 restores the expected functionality

Also add "auto_update": false, to your settings to avoid the inconvenience of zed immediately trying to upgrade again.

@ZayneLiu
Copy link

ZayneLiu commented Dec 17, 2024

Had the a similar issue with vtsls config not working properly, I was using the initialization_options key to pass the config, but it stopped working for me couple months back.

Just had a look again on their doc here, I think they've changed the key in the vtsls config object from initialization_options to settings.

Anyway, changing to settings seems to work for me. So maybe give it a try.

"lsp": {
  "vtsls": {
    "settings": {
      "typescript": {
        "preferences": {
          "importModuleSpecifier": "non-relative"
        }
      }
    }
  }
}

@raska-vilem
Copy link

Hi, thank you @ZayneLiu, your solution works!

Someone should update the documentation to reflect this.

@cu8code
Copy link

cu8code commented Jan 7, 2025

hey @ZayneLiu solution did not solve this! also in vtsls I could not find option called importModuleSpecifier did anyone else have the same problem?

@cu8code
Copy link

cu8code commented Jan 7, 2025

hey I got it working!

  "lsp": {
    "vtsls": {
      "settings": {
        "typescript": {
          "tsdk": "~/.local/share/pnpm/global/5/node_modules/typescript/bin"
        }
      }
    }
  }

global install typescript-language-server
get the exact path I had to rename a file called tsserver to tsserver.js

Give a thumbs up its will heal my sole and make my 45 min worth it!

@ZayneLiu
Copy link

ZayneLiu commented Jan 7, 2025

hey @ZayneLiu solution did not solve this! also in vtsls I could not find option called importModuleSpecifier did anyone else have the same problem?

@cu8code

importModuleSpecifier is here in the schema.

My use case is not the same as stated in the issue, but the solution applies, as long as the config passed matches vtsls schema.

@cu8code
Copy link

cu8code commented Jan 7, 2025

Thx @ZayneLiu I missed it; I don't know why It did not work! my solution is so much annoying!

@xcrap
Copy link

xcrap commented Jan 11, 2025

Having the same issues all the suddenly, not even using typescript in some projects where this appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors regression A bug that was introduced in a recent release setting Feedback for preferences, configuration, etc tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support
Projects
Status: No status
Development

No branches or pull requests