This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Commit 9ca675a
committed
fix: unchanged files sometimes have no Angular information for string… (#1453)
* fix: unchanged files sometimes have no Angular information for strings when first opened
The `TextStorage` in TS server calls `useScriptVersionCacheIfValidOrOpen` in many places
when dealing with a `ScriptInfo`. One of the conditions in that function
is to switch to version _if the script is open_. This change in version
results in an identity change for the `SourceFile` which is problematic
for the compiler because we store references to string literals for
inline templates, template URLs, and style URLs. These references will
not be valid if the `SourceFile` changed identity.
To ensure that the compiler is aware of the change, we mark the project
as dirty when a text document is opened. This will cause the project to
call `updateGraph`, determine that the file changed versions, and create
a new program. This is done so that the Angular compiler can reprocess
the file.
This also appears to be one of, if not the only issue, that's currently
causing the e2e tests to be flaky.
* test: Stabalize e2e tests
* Fix test output so that it logs to console.
* Disable hover tests because they are flaky.
(cherry picked from commit a751e61)1 parent ae6faba commit 9ca675a
File tree
4 files changed
+40
-3
lines changed- integration/e2e
- server/src
4 files changed
+40
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
12 | 34 | | |
13 | 35 | | |
14 | 36 | | |
15 | 37 | | |
16 | 38 | | |
17 | 39 | | |
18 | 40 | | |
19 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
641 | 651 | | |
642 | 652 | | |
643 | 653 | | |
| |||
0 commit comments