File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2468,8 +2468,14 @@ export function getCompletionEntriesFromSymbols(
2468
2468
}
2469
2469
// Filter out variables from their own initializers
2470
2470
// `const a = /* no 'a' here */`
2471
- if ( tryCast ( variableOrParameterDeclaration , isVariableDeclaration ) && symbol . valueDeclaration === variableOrParameterDeclaration ) {
2472
- return false ;
2471
+ if ( variableOrParameterDeclaration && tryCast ( variableOrParameterDeclaration , isVariableDeclaration ) ) {
2472
+ if ( symbol . valueDeclaration === variableOrParameterDeclaration ) {
2473
+ return false ;
2474
+ }
2475
+ // const { a } = /* no 'a' here */;
2476
+ if ( isBindingPattern ( variableOrParameterDeclaration . name ) && variableOrParameterDeclaration . name . elements . some ( e => e === symbol . valueDeclaration ) ) {
2477
+ return false ;
2478
+ }
2473
2479
}
2474
2480
2475
2481
// Filter out parameters from their own initializers
You can’t perform that action at this time.
0 commit comments