Skip to content

Commit

Permalink
fix(60551): satisfies is shown on go-to-implementation (#60801)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tarasyuk authored Jan 17, 2025
1 parent 32e8f8b commit f99803d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/findAllReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ import {
isReferencedFile,
isReferenceFileLocation,
isRightSideOfPropertyAccess,
isSatisfiesExpression,
isShorthandPropertyAssignment,
isSourceFile,
isStatement,
Expand Down Expand Up @@ -2282,7 +2283,7 @@ export namespace Core {
addIfImplementation(body);
}
}
else if (isAssertionExpression(typeHavingNode)) {
else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) {
addIfImplementation(typeHavingNode.expression);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
12 changes: 12 additions & 0 deletions tests/cases/fourslash/goToImplementation_satisfies.ts
Original file line number Diff line number Diff line change
@@ -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');

0 comments on commit f99803d

Please sign in to comment.