Skip to content

Angular extension 0.0.6 cannot find locally installed @angular/language-server on Windows #95

Description

@guyhirsch

Hi,

The Angular language server does not start in Zed on Windows.

Zed displays the following error:

Language server angular:

from extension "Angular" version 0.0.6:
Expected Angular language server path
'node_modules/@angular/language-server/index.js'
was not found in the project.

Please ensure '@angular/language-server' is installed
in your project's node_modules.

However, @angular/language-server is installed locally in the project, and the expected file exists.

From the project root:

Test-Path .\node_modules\@angular\language-server\index.js

Output:

True

Node can also resolve both the Angular language server and TypeScript successfully:

node -p "require.resolve('@angular/language-server')"

Output:

C:\***\node_modules\.pnpm\@angular+language-server@22.0.8\node_modules\@angular\language-server\index.js
node -p "require.resolve('typescript/lib/tsserverlibrary')"

Output:

C:\***\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsserverlibrary.js

Environment

  • OS: Windows
  • Zed: latest version
  • Angular extension: 0.0.6
  • Angular project
  • @angular/language-server: 22.0.8
  • TypeScript: 5.9.3
  • Package manager: pnpm

Suspected cause

Looking at the extension source, the Angular language server path is checked as a relative path:

const SERVER_PATH: &str =
    "node_modules/@angular/language-server/index.js";

let server_exists = self.file_exists_at_path(SERVER_PATH);

The path does not appear to be joined with the active worktree root:

worktree.root_path()

The extension also later uses:

env::current_dir()

to construct the language server path and TypeScript SDK path.

If env::current_dir() points to the extension runtime directory rather than the opened project directory, the extension will search for node_modules in the wrong location.

Expected behavior

The extension should resolve the Angular language server relative to the active worktree, for example:

PathBuf::from(worktree.root_path())
    .join("node_modules")
    .join("@angular")
    .join("language-server")
    .join("index.js")

The TypeScript SDK path and probe locations should also be resolved relative to worktree.root_path().

Alternatively, the extension could use Node module resolution from the worktree root, which would work correctly with pnpm's virtual store layout.

Actual behavior

The extension reports that @angular/language-server is missing, even though:

  • The expected path exists.
  • Node resolves @angular/language-server successfully.
  • Node resolves typescript/lib/tsserverlibrary successfully.

This suggests that the issue is in the extension's path resolution rather than a missing dependency.

Could the extension use worktree.root_path() instead of a relative path or env::current_dir() when resolving the Angular language server and TypeScript?

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions