Skip to content

Commit 484a7a0

Browse files
committed
Don't overpackage routines of the format foo.bar.1.int
Return it as foo/bar.1.int rather than foo/bar/1.int By doing this we align with how it displays in Explorer
1 parent a33396c commit 484a7a0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/providers/FileSystemPovider/FileSearchProvider.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
1919
const type = folderQuery.type || "all";
2020
const category =
2121
folderQuery.csp === "" || folderQuery.csp === "1" ? "CSP" : type === "cls" ? "CLS" : type === "rtn" ? "RTN" : "*";
22-
const generated = folderQuery.generated && folderQuery.generated === "1";
22+
const generated = folderQuery.generated === "1";
2323
const api = new AtelierAPI(options.folder);
2424
let filter = query.pattern;
2525
if (category !== "CSP") {
@@ -49,8 +49,16 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
4949
if (file.name.startsWith("%") && api.ns !== "%SYS") {
5050
return null;
5151
}
52+
// Convert dotted name to slashed one, treating the likes of ABC.1.int or DEF.T1.int in the same way
53+
// as the Studio dialog does.
5254
const nameParts = file.name.split(".");
53-
file.name = nameParts.slice(0, -2).join("/") + "/" + nameParts.slice(-2).join(".");
55+
const dotParts = nameParts
56+
.slice(-2)
57+
.join(".")
58+
.match(/^[A-Z]?\d*[.](mac|int|inc)$/)
59+
? 3
60+
: 2;
61+
file.name = nameParts.slice(0, -dotParts).join("/") + "/" + nameParts.slice(-dotParts).join(".");
5462
}
5563
if (!options.maxResults || ++counter <= options.maxResults) {
5664
return options.folder.with({ path: `/${file.name}` });

0 commit comments

Comments
 (0)