Skip to content

Commit

Permalink
Fixed "Go to file" for members on iasp
Browse files Browse the repository at this point in the history
Signed-off-by: Seb Julliand <[email protected]>
  • Loading branch information
sebjulliand committed Feb 12, 2025
1 parent b8ec846 commit 31c562c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/commands/open.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import path from "path";
import { commands, Disposable, l10n, QuickInputButton, QuickPickItem, QuickPickItemButtonEvent, QuickPickItemKind, Range, TextDocument, TextDocumentShowOptions, ThemeIcon, Uri, window } from "vscode";
import { DefaultOpenMode, MemberItem, QsysFsOptions, WithPath } from "../typings";
import Instance from "../Instance";
import IBMi from "../api/IBMi";
import { Tools } from "../api/Tools";
import { getUriFromPath, parseFSOptions } from "../filesystems/qsys/QSysFs";
import path from "path";
import { DefaultOpenMode, MemberItem, QsysFsOptions, WithPath } from "../typings";
import { VscodeTools } from "../ui/Tools";
import IBMi from "../api/IBMi";

const CLEAR_RECENT = `$(trash) Clear recently opened`;
const CLEAR_CACHED = `$(trash) Clear cached`;
Expand Down Expand Up @@ -367,10 +367,14 @@ export function registerOpenCommands(instance: Instance): Disposable[] {
window.showInformationMessage(`Cleared cached files.`);
} else {
const selectionSplit = connection!.upperCaseName(selection).split('/')
if (selectionSplit.length === 3 || selection.startsWith(`/`)) {
if ([3,4].includes(selectionSplit.length) || selection.startsWith(`/`)) {

// When selection is QSYS path
if (!selection.startsWith(`/`) && connection) {
if(selectionSplit.length === 4){
//Remove the iASP part
selectionSplit.shift();
}
const library = selectionSplit[0];
const file = selectionSplit[1];
const member = path.parse(selectionSplit[2]);
Expand Down

0 comments on commit 31c562c

Please sign in to comment.