fix(60551): satisfies is shown on go-to-implementation (#60801)

This commit is contained in:
Oleksandr T. 2025-01-17 22:05:26 +02:00 committed by GitHub
parent 32e8f8b81c
commit f99803d05f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 44 additions and 1 deletions

View File

@ -179,6 +179,7 @@ import {
isReferencedFile,
isReferenceFileLocation,
isRightSideOfPropertyAccess,
isSatisfiesExpression,
isShorthandPropertyAssignment,
isSourceFile,
isStatement,
@ -2282,7 +2283,7 @@ export namespace Core {
addIfImplementation(body);
}
}
else if (isAssertionExpression(typeHavingNode)) {
else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) {
addIfImplementation(typeHavingNode.expression);
}
}

View File

@ -0,0 +1,30 @@
// === goToImplementation ===
// === /a.ts ===
// interface /*GOTO IMPL*/I {
// foo: string;
// }
//
// function f() {
// const foo = [|{ foo: '' }|] satisfies I;
// }
// === Details ===
[
{
"kind": "interface",
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "object literal",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
}
]
}
]

View File

@ -0,0 +1,12 @@
/// <reference path='fourslash.ts'/>
// @filename: /a.ts
////interface /*def*/I {
//// foo: string;
////}
////
////function f() {
//// const foo = { foo: '' } satisfies [|I|];
////}
verify.baselineGoToImplementation('def');