Skip to content

Commit

Permalink
fix: get filename rather than Uri (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
scnwwu authored Sep 27, 2024
1 parent c4bf7e4 commit 298c918
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ async function runCode(selected?: boolean, uri?: Uri) {
session.onExecutionLogFn = onExecutionLogFn;
session.onSessionLogFn = appendSessionLogFn;

const fileName = basename(codeDoc.getUri(), extname(codeDoc.getUri()));
const fileName = basename(
codeDoc.getFileName(),
extname(codeDoc.getFileName()),
);
setFileName(fileName);

await session.setup();
Expand Down Expand Up @@ -228,7 +231,10 @@ async function _runTask(
);
session.onSessionLogFn = appendSessionLogFn;

const fileName = basename(codeDoc.getUri(), extname(codeDoc.getUri()));
const fileName = basename(
codeDoc.getFileName(),
extname(codeDoc.getFileName()),
);
setFileName(fileName);

messageEmitter.fire(`${l10n.t("Connecting to SAS session...")}\r\n`);
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/utils/SASCodeDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export class SASCodeDocument {
return this.parameters.uri;
}

public getFileName(): string {
return this.parameters.fileName;
}

public wrappedCodeLineAt(lineNumber: number) {
return this.getWrappedCode().split("\n")[lineNumber];
}
Expand Down

0 comments on commit 298c918

Please sign in to comment.