Skip to content

readonly input are not highlighted by the language service #58284

Description

@xkabylgSICKAG

Which @angular/* package(s) are the source of the bug?

language-service

Is this a regression?

No

Description

The Angular language service doesn't highlight readonly signal inputs as inputs. It also doesn't do this for decorator @Inputs but making those readonly doesn't make a lot of sense anyway.

Example code:

import { Component, Input, input } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';

@Component({
  selector: 'app-signal-test',
  standalone: true,
  template: '',
})
export class SignalTestComponent {
  public readonly readonlySignalInput = input<number>();
  public regularSignalInput = input<number>();

  @Input()
  public readonly readonlyDecoratorInput: number | undefined;
  @Input()
  public regularDecoratorInput: number | undefined;
}

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [SignalTestComponent],
  template: `<app-signal-test
    [readonlySignalInput]="123"
    [regularSignalInput]="123"
    [readonlyDecoratorInput]="123"
    [regularDecoratorInput]="123"
  />`,
})
export class PlaygroundComponent {}

bootstrapApplication(PlaygroundComponent);

Result when holding ctrl and hovering the readonly signal input in vscode:
Image

Compared to the regular signal input:
Image

readonly signal inputs also do not find any usage of them when clicking "Find All References".

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 18.2.9
Node: 20.14.0
Package Manager: npm 10.7.0
OS: linux x64

Angular: 18.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.9
@angular-devkit/build-angular   18.2.9
@angular-devkit/core            18.2.9
@angular-devkit/schematics      18.2.9
@angular/cdk                    18.2.9
@angular/cli                    18.2.9
@schematics/angular             18.2.9
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.10

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: language-serviceIssues related to Angular's VS Code language service

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions