fix(language-service): provide hover for interpolation in attribute value (#35494)
I think the bug is introduced in my PR#34847. For example, 'model="{{title}}"', the attribute value cannot be parsed by 'parseTemplateBindings'. PR Close #35494
This commit is contained in:
@ -39,6 +39,16 @@ describe('hover', () => {
|
||||
expect(toText(displayParts)).toBe('(property) MyComponent.name: string');
|
||||
});
|
||||
|
||||
it('should be able to find an interpolated value in an attribute', () => {
|
||||
mockHost.override(TEST_TEMPLATE, `<div string-model model="{{«title»}}"></div>`);
|
||||
const marker = mockHost.getReferenceMarkerFor(TEST_TEMPLATE, 'title');
|
||||
const quickInfo = ngLS.getQuickInfoAtPosition(TEST_TEMPLATE, marker.start);
|
||||
expect(quickInfo).toBeTruthy();
|
||||
const {textSpan, displayParts} = quickInfo !;
|
||||
expect(textSpan).toEqual(marker);
|
||||
expect(toText(displayParts)).toBe('(property) TemplateReference.title: string');
|
||||
});
|
||||
|
||||
it('should be able to find a field in a attribute reference', () => {
|
||||
const fileName = mockHost.addCode(`
|
||||
@Component({
|
||||
|
Reference in New Issue
Block a user