Skip to content

Commit 869dce4

Browse files
Skip source-less signature declarations in API responses
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
1 parent dc4fa25 commit 869dce4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tsc/internal/api/session.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ func (sd *snapshotData) newSignatureResponse(projectID project.Handle, sig *chec
501501
Flags: uint32(sig.Flags()),
502502
}
503503

504-
if sig.Declaration() != nil {
505-
resp.Declaration = sd.nodeHandleFrom(sig.Declaration())
504+
if declaration := sig.Declaration(); declaration != nil && ast.GetSourceFileOfNode(declaration) != nil {
505+
resp.Declaration = sd.nodeHandleFrom(declaration)
506506
}
507507

508508
if len(sig.TypeParameters()) > 0 {

0 commit comments

Comments
 (0)