Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 1x 1x 1x 1x 7278x 7278x 7278x 7278x 7278x 32x 32x 32x 31x 31x 32x 32x 32x 32x 32x 32x 32x 31x 31x 32x 31x 31x 32x 32x 32x 32x 32x 7278x 7278x 2449x 2501x 2501x 1x 1x 1x 1x 2501x 2501x 2449x 7278x 7278x 278x 278x 7278x 7278x 14x 14x 7278x | import {IMSAGReferences} from "./_imsag_references"; import {AbstractToken} from "./abap/1_lexer/tokens/abstract_token"; import {IObject} from "./objects/_iobject"; export class MSAGReferences implements IMSAGReferences { private readonly nameNumberIndex: { [messageClass: string]: { [number: string]: {filename: string, token: AbstractToken}[] } } = {}; private readonly filenameIndex: { [filename: string]: {token: AbstractToken, messageClass: string, number: string}[] } = {}; public addUsing(filename: string, token: AbstractToken, messageClass: string, number: string): void { if (number.length !== 3) { return; } if (this.filenameIndex[filename] === undefined) { this.filenameIndex[filename] = []; } this.filenameIndex[filename].push({ token: token, messageClass: messageClass, number: number, }); if (this.nameNumberIndex[messageClass] === undefined) { this.nameNumberIndex[messageClass] = {}; } if (this.nameNumberIndex[messageClass][number] === undefined) { this.nameNumberIndex[messageClass][number] = []; } this.nameNumberIndex[messageClass][number].push({ filename: filename, token: token, }); } public clear(obj: IObject): void { for (const file of obj.getFiles()) { const filename = file.getFilename(); for (const fIndex of this.filenameIndex[filename] || []) { // this should be okay for performance, each message should be referenced less than 10 times typically this.nameNumberIndex[fIndex.messageClass][fIndex.number] = this.nameNumberIndex[fIndex.messageClass][fIndex.number].filter(i => i.filename !== filename); } delete this.filenameIndex[filename]; } } public listByFilename(filename: string): { token: AbstractToken; messageClass: string; number: string; }[] { return this.filenameIndex[filename] || []; } public listByMessage(messageClass: string, number: string): { filename: string; token: AbstractToken; }[] { return this.nameNumberIndex[messageClass]?.[number] || []; } } |