(node *ast.Node, userPrefs lsutil.CodeLensUserPreferences)
| 177 | } |
| 178 | |
| 179 | func isValidReferenceLensNode(node *ast.Node, userPrefs lsutil.CodeLensUserPreferences) bool { |
| 180 | switch node.Kind { |
| 181 | case ast.KindFunctionDeclaration: |
| 182 | if userPrefs.ReferencesCodeLensShowOnAllFunctions.IsTrue() { |
| 183 | return true |
| 184 | } |
| 185 | fallthrough |
| 186 | |
| 187 | case ast.KindVariableDeclaration: |
| 188 | return ast.GetCombinedModifierFlags(node)&ast.ModifierFlagsExport != 0 |
| 189 | |
| 190 | case ast.KindClassDeclaration, ast.KindInterfaceDeclaration, ast.KindTypeAliasDeclaration, ast.KindEnumDeclaration, ast.KindEnumMember: |
| 191 | return true |
| 192 | |
| 193 | case ast.KindMethodDeclaration, ast.KindMethodSignature, ast.KindConstructor, |
| 194 | ast.KindGetAccessor, ast.KindSetAccessor, |
| 195 | ast.KindPropertyDeclaration, ast.KindPropertySignature: |
| 196 | // Don't show if child and parent have same start |
| 197 | // For https://github.com/microsoft/vscode/issues/90396 |
| 198 | // !!! |
| 199 | |
| 200 | switch node.Parent.Kind { |
| 201 | case ast.KindClassDeclaration, ast.KindInterfaceDeclaration, ast.KindTypeLiteral: |
| 202 | return true |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | return false |
| 207 | } |
no test coverage detected