Skip to content

Commit 9f4375a

Browse files
committed
go to routine
1 parent 3cfc8f1 commit 9f4375a

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
- Explorer view, option to show/hide generated items
1010
- Explorer view will be shown only when any folder open
1111
- When used docker-compose to run instance, it's now possible to get connected to a random port from service.
12+
- When used docker-compose it's now very easy to connect to terminal
13+
- Go to routine
1214

1315
## [0.7.12]
1416

src/providers/ObjectScriptDefinitionProvider.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,21 @@ export class ObjectScriptDefinitionProvider implements vscode.DefinitionProvider
169169
pos += part.length;
170170
}
171171

172+
const asLabelRoutineCall = /(\^%?\b[a-zA-Z][a-zA-Z0-9]+(?:\.[a-zA-Z][a-zA-Z0-9]+)*\b)/;
173+
parts = lineText.split(asLabelRoutineCall);
174+
pos = 0;
175+
for (const part of parts) {
176+
if (part.match(asLabelRoutineCall)) {
177+
const [, routine] = part.match(/\^(%?\b\w+\b)/);
178+
const start = pos + part.indexOf(routine) - 1;
179+
const length = routine.length + 1;
180+
return this.getFullRoutineName(routine).then(routineName => [
181+
this.makeRoutineDefinition(workspaceFolderName, position, start, length, routineName),
182+
]);
183+
}
184+
pos += part.length;
185+
}
186+
172187
return [];
173188
}
174189

@@ -222,6 +237,15 @@ export class ObjectScriptDefinitionProvider implements vscode.DefinitionProvider
222237
return name;
223238
}
224239

240+
public getFullRoutineName(name: string): Promise<string> {
241+
const api = new AtelierAPI();
242+
return api
243+
.actionIndex([`${name}.int`, `${name}.mac`])
244+
.then(data => data.result.content)
245+
.then(files => files.filter(el => !el.gen && el.status === "" && el.db !== ""))
246+
.then(files => files.pop().name);
247+
}
248+
225249
/**
226250
* returns package name for current class
227251
* @param document

0 commit comments

Comments
 (0)