Skip to content
Snippets Groups Projects
Commit bc12d636 authored by Stekelenburg, A.V. (Alexander, Student )'s avatar Stekelenburg, A.V. (Alexander, Student )
Browse files

Fix file saving paths

parent 1aa258bd
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,7 @@ export namespace DotViewer {
public saveSvg() {
if (this.lastSvgString) {
const defaultUri = vscode.workspace.workspaceFolders
? vscode.Uri.parse(`{vscode.workspace.workspaceFolders[0].uri.fsPath}/analysis/${this.fileUri.path.split("/").pop()?.slice(0, -1 * '.modest'.length)}.svg`)
? vscode.Uri.joinPath(vscode.workspace.workspaceFolders[0].uri, `/analysis/${this.fileUri.path.split("/").pop()?.slice(0, -1 * '.modest'.length)}.svg`)
: undefined;
vscode.window.showSaveDialog({ defaultUri: defaultUri }).then(f => {
if (f) {
......
......@@ -328,7 +328,7 @@ function loadResults(provider: AnalysisResultsProvider) {
function exportResults(prov: AnalysisResultsProvider) {
if (prov.getJsonObject()) {
const defaultUri = vscode.workspace.workspaceFolders
? vscode.Uri.parse(`${vscode.workspace.workspaceFolders[0].uri.fsPath}/analysis/${prov.getModestFile()}-results.json`)
? vscode.Uri.joinPath(vscode.workspace.workspaceFolders[0].uri, `/analysis/${prov.getModestFile()}-results.json`)
: undefined;
vscode.window.showSaveDialog({ defaultUri: defaultUri }).then(f => {
if (f) {
......@@ -624,7 +624,7 @@ function plotValue(res: Result, context: ExtensionContext) {
function saveImage(res: Result, url: Buffer) {
const defaultUri = vscode.workspace.workspaceFolders
? vscode.Uri.parse(`${vscode.workspace.workspaceFolders[0].uri.fsPath}/analysis/${res.getParentName()}-${res.getLabel()}.png`)
? vscode.Uri.joinPath(vscode.workspace.workspaceFolders[0].uri, `/analysis/${res.getParentName()}-${res.getLabel()}.png`)
: undefined;
vscode.window.showSaveDialog({ defaultUri: defaultUri }).then(f => {
if (f) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment