Skip to content

fix(language-server): Do best-effort to initialize composite project … #2165

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

atscott
Copy link
Collaborator

@atscott atscott commented Mar 28, 2025

…when HTML is opened first

An upstream TypeScript performance-motivated change ( microsoft/TypeScript@02b07a1) made it so composite projects are not opened unless the opened file is in the includes/files list of the tsconfig. This means that external HTML files do not trigger project loading when they are the first and only file opened.

As a best-effort, we attempt to open a TS file with the same name, which will most often be the file for the component of the external template. This is not guaranteed to be the case, so the only way to guarantee this works correctly would be for developers to add the **/*.html files to the includes list of their tsconfig[.lib].json.

resolves #2149

…when HTML is opened first

An upstream TypeScript performance-motivated change (
microsoft/TypeScript@02b07a1) made it so composite projects are not opened unless the opened file is in the includes/files list of the `tsconfig`. This means that external HTML files do not trigger project loading when they are the first and only file opened.

As a best-effort, we attempt to open a TS file with the same name, which
will most often be the file for the component of the external template.
This is not guaranteed to be the case, so the only way to guarantee this
works correctly would be for developers to add the `**/*.html` files to
the `includes` list of their `tsconfig[.lib].json`.

resolves angular#2149
Copy link

@jarpoole jarpoole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for my team, this fix would be 100% successful across our entire monorepo!

See #2149 (comment)

@atscott atscott marked this pull request as ready for review April 2, 2025 21:52
@atscott atscott added target: patch This PR is targeted for the next patch release action: merge Ready to merge and removed target: patch This PR is targeted for the next patch release labels Apr 16, 2025
@atscott atscott merged commit f0c8831 into angular:main Apr 16, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge Ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go to Definition from angular template no longer working
3 participants