-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Labels
area: language-serviceIssues related to Angular's VS Code language serviceIssues related to Angular's VS Code language servicebugcross-cutting: signals
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
language-service
Description
While for some signal in a service it's not working (it doesn't get the definition)

- A normal property of an object works fine

- A property as a signal doesn't work (it doesn't get the definition)

These are either issues with function calling or getting the correct definition for function calls in the template.
Tested with this code:
import { Component, Injectable, inject, signal } from '@angular/core';
@Injectable()
export class SomeService {
someSignal = signal(0);
someMethod() {
console.log('hello world!');
}
}
@Component({
selector: 'app-root',
standalone: true,
template: `
<div>{{ someProp }}</div>
<div>{{ someSignal() }}</div>
<div>{{ someService.someSignal() }}</div>
<div>{{ someObject.someProp }}</div>
<div>{{ someObject.someSignalProp() }}</div>
<button (click)="someSignal.set(1)">Increment</button>
<button (click)="someService.someSignal.set(1)">Increment Service</button>
<button (click)="someObject.someSignalProp.set('hello world!')">Change Object</button>
<button (click)="someService.someMethod()">Call Service Method</button>
`,
})
export class AppComponent {
someService = inject(SomeService);
someProp = 'hello world!';
someSignal = signal(0);
someObject = {
someSignalProp: signal('hello world!'),
someProp: 'hello world!',
}
}PR with test cases #56506
Proposed solution
Add better handling for function calls in language-service
Alternatives considered
YidingW, msmallest, Harpush, ViktorTyultinov, keatkeat87 and 2 more
Metadata
Metadata
Assignees
Labels
area: language-serviceIssues related to Angular's VS Code language serviceIssues related to Angular's VS Code language servicebugcross-cutting: signals
Type
Projects
Status
Done

