-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Description
π Search Terms
jsx namespace namespaced attribute go to definition ctrl click cmd click vscode language service
π Version & Regression Information
Not a regression, I think.
It was made using TS 5.8.3 with this patch, near line 153122:
function getContainingObjectLiteralElementWorker(node) {
switch (node.kind) {
case 11 /* StringLiteral */:
case 15 /* NoSubstitutionTemplateLiteral */:
case 9 /* NumericLiteral */:
if (node.parent.kind === 167 /* ComputedPropertyName */) {
return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0;
}
// falls through
case 80 /* Identifier */:
case 295 /* JsxNamespacedName */:
return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 292 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
}
return void 0;
}
That way, the QuickInfo/Hovers are working the same between namespace/non namespaced JSX attributes in VSCode.
Previous issue/PR with Quick Info/Hovers:
- JSX
JsxNamespacedName
breaks JSDoc + QuickInfo in VSCodeΒ #61820 - Fixed JSDoc display on
JsxNamespacedName
attributesΒ #61825
β― Playground Link
No response
π» Code
const Pascal = (o: {
/**
* Hello
*/
'prop:foo': string
/**
* Bonjour
*/
'foo': string
}) => <></>;
<Pascal prop:foo='' foo='aaa'></Pascal>
Hover while Ctrl or Cmd is pressed.
Non namespaced attribute get an additional hover, with a context span, and an underlined, clickable definition link (and peeking, etcβ¦).
π Actual behavior




π Expected behavior
Should behave exactly like non namespaced attributes, for every IDE wired features.
Additional information about the issue
Looks like prop
and foo
symbols are treated separately, and not as a whole, breaking LS features downstream.
Also, unlike the previous (now resolved) Quick Info issue, I can inject programatically Go-to-Definition via LS (Monaco TS worker or TS Plugin) on namespaced attributes:
