mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 03:09:39 -06:00
fix(60551): satisfies is shown on go-to-implementation (#60801)
This commit is contained in:
parent
32e8f8b81c
commit
f99803d05f
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
tests/cases/fourslash/goToImplementation_satisfies.ts
Normal file
12
tests/cases/fourslash/goToImplementation_satisfies.ts
Normal 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');
|
||||
Loading…
x
Reference in New Issue
Block a user