import * as vscode from 'vscode' import { Definition } from './Definition' export class EventHandlerDefinition extends Definition { private eventHandlerName: string = '' public validateContext(word: string, document: vscode.TextDocument, position: vscode.Position) { const line = document.lineAt(position) if (line.text.match(/:([a-zA-Z]*)="/)) { this.eventHandlerName = word return true } return false } public getLocation() { const eventHandlerFragments = `(protected|protected async) ${this.eventHandlerName}` return this.basicLocation(eventHandlerFragments, 'ts') } }