fix(compiler): let declaration span not including end character

Fixes that the span for `@let` declarations didn't include the end token.
This commit is contained in:
Kristiyan Kostadinov
2026-04-27 09:39:44 +02:00
committed by Alon Mishne
parent 2a6b6fafb0
commit 6bd1721662
8 changed files with 10 additions and 10 deletions
@@ -61,7 +61,7 @@ runInEachFileSystem(() => {
expect(diags.length).toBe(1);
expect(diags[0].category).toBe(ts.DiagnosticCategory.Warning);
expect(diags[0].code).toBe(ngErrorCode(ErrorCode.UNUSED_LET_DECLARATION));
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let unused = 2');
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let unused = 2;');
});
it('should report a solo @let declaration that is not used', () => {
@@ -77,7 +77,7 @@ runInEachFileSystem(() => {
expect(diags.length).toBe(1);
expect(diags[0].category).toBe(ts.DiagnosticCategory.Warning);
expect(diags[0].code).toBe(ngErrorCode(ErrorCode.UNUSED_LET_DECLARATION));
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let foo = 1');
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let foo = 1;');
});
it('should not report a @let declaration that is only used in other @let declarations', () => {