File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2123,8 +2123,14 @@ export function getCompletionEntriesFromSymbols(
2123
2123
}
2124
2124
// Filter out variables from their own initializers
2125
2125
// `const a = /* no 'a' here */`
2126
- if ( tryCast ( variableOrParameterDeclaration , isVariableDeclaration ) && symbol . valueDeclaration === variableOrParameterDeclaration ) {
2127
- return false ;
2126
+ if ( variableOrParameterDeclaration && tryCast ( variableOrParameterDeclaration , isVariableDeclaration ) ) {
2127
+ if ( symbol . valueDeclaration === variableOrParameterDeclaration ) {
2128
+ return false ;
2129
+ }
2130
+ // const { a } = /* no 'a' here */;
2131
+ if ( isBindingPattern ( variableOrParameterDeclaration . name ) && variableOrParameterDeclaration . name . elements . some ( e => e === symbol . valueDeclaration ) ) {
2132
+ return false ;
2133
+ }
2128
2134
}
2129
2135
2130
2136
// Filter out parameters from their own initializers
You can’t perform that action at this time.
0 commit comments