GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — language-server: external templates permanently lose language service in solution-style (Nx) workspaces — getDefaultProjectForScriptInfo lacks the #2165 fallback · Issue #69768 · angular/angular Closed Labels area: language-serviceIssues related to Angular's VS Code language serviceIssues related to Angular's VS Code language service Milestone DescriptionWhich @angular/* package(s) are the source of the bug?language-server (vscode-ng-language-service/server) Is this a regression?Partially. The class of bug was reported in angular/vscode-ng-language-service#2149 and fixed by angular/vscode-ng-language-service#2165, but that fix only covers one of the two code paths that need it. DescriptionIn workspaces whose app and returns Root causeA solution-style https://github.com/angular/angular/blob/main/vscode-ng-language-service/server/src/session.ts (in // https://github.com/angular/vscode-ng-language-service/issues/2149 if (result.configFileName === undefined && languageId === LanguageId.HTML) { const maybeComponentTsPath = filePath.replace(/\.html$/, '.ts'); ... However, if (!project || project.projectKind !== ts.server.ProjectKind.Configured) { const {configFileName} = this.projectService.openClientFile(scriptInfo.fileName); if (!configFileName) { // Failed to find a config file. There is nothing we could do. this.error(`No config file for ${scriptInfo.fileName}`); return null; } ... So whenever a template's project attachment is torn down after open (tab lifecycle, project updates), the server can never recover it. The template stays dead until the user opens the sibling This is editor-agnostic: reproduced both in Zed (where an aggressive buffer lifecycle makes template features unusable in Nx workspaces — see nathansbradshaw/zed-angular#89 for user reports) and in VS Code itself with the Angular extension v22.0.1 (server 22.x — see VS Code reproduction below). It is likely also a contributing factor in "No config file" reports that persist post-#2165 (e.g. #65514 shows the same terminal error string for a different trigger). ReproductionAgainst a large Nx monorepo (Angular 19 app, ~30 projects, solution-style
With VS Code reproduction (Angular extension v22.0.1)Same workspace, no custom LSP client involved:
Angular Language Service output panel: Notably this is a template-opened-first session — the scenario #2149/#2165 was meant to cover — so the open-time best-effort is not sufficient on its own, and there is no recovery at request time. Proposed fixMirror the #2165 fallback inside We have been running exactly this patch (applied to the compiled 21.1.5 bundle) in daily use on the Nx monorepo above: template features now self-heal on the next request after any detach, with an A/B experiment confirming stock code fails (40+ Happy to submit a PR with this change. Please provide the environment you discovered this bug in
Activity
MetadataMetadataAssigneesLabelsarea: language-serviceIssues related to Angular's VS Code language serviceIssues related to Angular's VS Code language service TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |