The 0-based line a call's own declarations start on: its member's first line, which holds a method's parameters.
(ref: UnresolvedRef, context: ResolutionContext)
| 335 | |
| 336 | /** The 0-based line a call's own declarations start on: its member's first line, which holds a method's parameters. */ |
| 337 | function scopeStartLine(ref: UnresolvedRef, context: ResolutionContext): number { |
| 338 | const from = context.getNodeById?.(ref.fromNodeId); |
| 339 | if (from && from.filePath === ref.filePath && from.startLine <= ref.line && from.endLine >= ref.line && |
| 340 | (from.kind === 'method' || from.kind === 'function' || from.kind === 'property' || from.kind === 'field')) { |
| 341 | return from.startLine - 1; |
| 342 | } |
| 343 | let start = -1; |
| 344 | for (const n of context.getNodesInFile(ref.filePath)) { |
| 345 | if (n.kind !== 'method' && n.kind !== 'function' && n.kind !== 'property') continue; |
| 346 | if (n.startLine <= ref.line && n.endLine >= ref.line && n.startLine - 1 > start) start = n.startLine - 1; |
| 347 | } |
| 348 | return start < 0 ? ref.line - 1 : start; |
| 349 | } |
| 350 | |
| 351 | const VB_WORD_LINES = new WeakMap<ResolutionContext, Map<string, Map<string, number[]>>>(); |
| 352 |
no test coverage detected