Skip to content

[BUG] changeDetection property incorrectly flagged as invalid (Angular LSP v0.0.4) #61

@ArtroxGabriel

Description

@ArtroxGabriel

When using Angular’s ChangeDetectionStrategy inside a component decorator, the Angular LSP incorrectly flags the property as invalid.

Example code:

@Component({
  selector: 'app-example-comp',
  templateUrl: './example.component.html',
  styleUrl: './example.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ExampleComponent {}

Error shown:

changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core
Value is of type 'ChangeDetectionStrategy$1'. (-991010)

LSP request/response log:

// Send:
{"jsonrpc":"2.0","id":55,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/gabrigas/example/src/app/example/example.component.ts"},"range":{"start":{"line":13,"character":49},"end":{"line":13,"character":49}},"context":{"diagnostics":[{"range":{"start":{"line":13,"character":19},"end":{"line":13,"character":49}},"severity":1,"code":-991010,"message":"changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core\n  Value is of type 'ChangeDetectionStrategy$1'."}],"only":["quickfix"]}}}

// Receive:
{"jsonrpc":"2.0","id":55,"result":[]}

Environment:

  • Angular LSP version: v0.0.4
  • Zed version: Zed 0.200.5 – /usr/lib/zed/zed-editor
  • Angular version: 19.2.15

Expected behavior:
The LSP should recognize ChangeDetectionStrategy.OnPush as a valid enum member without raising an error.

Actual behavior:
The LSP incorrectly reports that the value is not a valid member, blocking proper diagnostics.

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