mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Handle imports and exports in 'convert parameters to destructured object' (#30475)
* add test for imported function * start to implement import references check * fix imported function test * skip alias when looking for symbol target * recognize ES6 imports * recognize some export syntax * add tests for imports/exports * add test for imported function * start to implement import references check * fix imported function test * skip alias when looking for symbol target * recognize ES6 imports * recognize some export syntax * add tests for imports/exports * add test for imported function * start to implement import references check * fix imported function test * recognize ES6 imports * recognize some export syntax * add mode import/export syntax cases * fix entryToFunctionCall to deal with new calls through property/element access expressions * add more tests for imports/exports * allow function and class declarations that have no name but have a default modifier * rename tests * fix conflict * fix tests * add test for nameless class * rename function * minor refactor * remove old tests * delete old test * refactor as suggested * use getContainingFunctionDeclaration
This commit is contained in:
committed by
GitHub
parent
c03b7f525c
commit
bb5eb025a8
@@ -1330,6 +1330,10 @@ namespace ts {
|
||||
return findAncestor(node.parent, isFunctionLike);
|
||||
}
|
||||
|
||||
export function getContainingFunctionDeclaration(node: Node): FunctionLikeDeclaration | undefined {
|
||||
return findAncestor(node.parent, isFunctionLikeDeclaration);
|
||||
}
|
||||
|
||||
export function getContainingClass(node: Node): ClassLikeDeclaration | undefined {
|
||||
return findAncestor(node.parent, isClassLike);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user