Skip to content

Commit b60ee54

Browse files
author
Keshav Iyer
committed
Fix leading / issue that prevents custom Studio documents from being saved on the server
1 parent a11a8b0 commit b60ee54

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/utils/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ export function currentFile(document?: vscode.TextDocument): CurrentFile {
100100
}
101101
} else {
102102
name = fileName;
103+
// Need to strip leading / for custom Studio documents which should not be treated as files.
104+
// e.g. For a custom Studio document Test.ZPM, the variable name would be /Test.ZPM which is
105+
// not the document name. The document name is Test.ZPM so requests made to the Atelier APIs
106+
// using the name with the leading / would fail to find the document.
107+
if (name.charAt(0) === "/") {
108+
name = name.substr(1);
109+
}
103110
}
104111
if (!name) {
105112
return null;

0 commit comments

Comments
 (0)