Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.1.1
=====
- Fix Outline for function, procedure and method with multiline syntax

1.1
=====
- Code completion and Outline pane
Expand Down
6 changes: 4 additions & 2 deletions src/parser/processDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ export function getAllMethods(sourceCode: SourceCode): ABLMethod[] {
// 3 = aditional details (returns xxx...)
// 4 = code block (incomplete)

const regexStart = new RegExp(/\b(proc|procedure|func|function){1}[\s\t\n]+([\w\d\-]+)(.*?)(?:[\.\:][^\w\d\-\+])/gim);
const regexStart = new RegExp(/\b(proc|procedure|func|function|method|constructor){1}[\s\t\n]+([\w\d\-]+)((?:.|\n)*?)(?:[\.\:][^\w\d\-\+])/gim);
// 1 = function | procedure
// 2 = name
// 3 = aditional details (returns xxx...)
const regexEnd = new RegExp(/\b(?:end[\s\t]+(proc|procedure|func|function)){1}\b/gim);
const regexEnd = new RegExp(/\b(?:end[\s\t]+(proc|procedure|func|function|method|constructor)){1}\b/gim);
//
const text = sourceCode.sourceWithoutStrings;
let resStart = regexStart.exec(text);
Expand All @@ -108,6 +108,8 @@ export function getAllMethods(sourceCode: SourceCode): ABLMethod[] {
const m = new ABLMethod();
try {
m.name = resStart[2];
if(resStart[1].toLowerCase() == 'method' || resStart[1].toLowerCase() == 'constructor')
m.name = resStart[3];
m.lineAt = sourceCode.document.positionAt(resStart.index).line;
m.lineEnd = sourceCode.document.positionAt(regexEnd.lastIndex).line;
m.params = [];
Expand Down