Skip to content

Commit 7b9395d

Browse files
Merge pull request #357 from gjsjohnmurray/fix-355
fix #355 fix some commands that were broken for isfs files
2 parents daccde7 + 2afb5c2 commit 7b9395d

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

src/commands/subclass.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function subclass(): Promise<void> {
1010
return;
1111
}
1212
const className = file.name.split(".").slice(0, -1).join(".");
13-
const api = new AtelierAPI();
13+
const api = new AtelierAPI(file.uri);
1414
if (!api.active) {
1515
return;
1616
}
@@ -27,9 +27,14 @@ export async function subclass(): Promise<void> {
2727
if (!list.length) {
2828
return;
2929
}
30-
vscode.window.showQuickPick(list.map((el) => el.Name)).then((item) => {
31-
open(item);
32-
});
30+
vscode.window
31+
.showQuickPick(
32+
list.map((el) => el.Name),
33+
{ placeHolder: "Pick a subclass" }
34+
)
35+
.then((item) => {
36+
open(item);
37+
});
3338
})
3439
.catch((err) => console.error(err));
3540
}

src/commands/superclass.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { currentFile } from "../utils";
55
import { ClassDefinition } from "../utils/classDefinition";
66

77
export async function superclass(): Promise<void> {
8-
if (!config("conn").active) {
8+
const file = currentFile();
9+
if (file.uri.scheme === "file" && !config("conn").active) {
910
return;
1011
}
11-
const file = currentFile();
1212
if (!file || !file.name.toLowerCase().endsWith(".cls")) {
1313
return;
1414
}
@@ -26,7 +26,7 @@ export async function superclass(): Promise<void> {
2626
if (!list.length) {
2727
return;
2828
}
29-
vscode.window.showQuickPick(list).then((item) => {
29+
vscode.window.showQuickPick(list, { placeHolder: "Pick a superclass" }).then((item) => {
3030
open(item);
3131
});
3232
})

src/commands/viewOthers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function viewOthers(): Promise<void> {
99
if (!file) {
1010
return;
1111
}
12-
if (!config("conn").active) {
12+
if (file.uri.scheme === "file" && !config("conn").active) {
1313
return;
1414
}
1515

src/utils/classDefinition.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class ClassDefinition {
4444
return Promise.resolve(methods);
4545
}
4646
const filterScope = (method) => scope === "any" || method.scope === scope;
47-
const api = new AtelierAPI();
47+
const api = new AtelierAPI(this.uri);
4848
const getMethods = (content) => {
4949
const extend = [];
5050
content.forEach((el) => {
@@ -64,7 +64,7 @@ export class ClassDefinition {
6464
if (properties.length) {
6565
return Promise.resolve(properties);
6666
}
67-
const api = new AtelierAPI();
67+
const api = new AtelierAPI(this.uri);
6868
const getProperties = (content) => {
6969
const extend = [];
7070
content.forEach((el) => {
@@ -84,7 +84,7 @@ export class ClassDefinition {
8484
if (parameters.length) {
8585
return Promise.resolve(parameters);
8686
}
87-
const api = new AtelierAPI();
87+
const api = new AtelierAPI(this.uri);
8888
const getParameters = (content) => {
8989
const extend = [];
9090
content.forEach((el) => {
@@ -104,7 +104,7 @@ export class ClassDefinition {
104104
if (superList) {
105105
return Promise.resolve(superList);
106106
}
107-
const api = new AtelierAPI();
107+
const api = new AtelierAPI(this.uri);
108108
const sql = `SELECT PrimarySuper FROM %Dictionary.CompiledClass
109109
WHERE Name %inlist (SELECT $LISTFROMSTRING(Super, ',') FROM %Dictionary.CompiledClass WHERE Name = ?)`;
110110
return api
@@ -128,7 +128,7 @@ export class ClassDefinition {
128128
if (includeCode) {
129129
return Promise.resolve(includeCode);
130130
}
131-
const api = new AtelierAPI();
131+
const api = new AtelierAPI(this.uri);
132132
const sql = `SELECT LIST(IncludeCode) List FROM %Dictionary.CompiledClass WHERE Name %INLIST (
133133
SELECT $LISTFROMSTRING(PrimarySuper, '~') FROM %Dictionary.CompiledClass WHERE Name = ?)`;
134134
const defaultIncludes = ["%occInclude", "%occErrors"];

0 commit comments

Comments
 (0)