Skip to content

Commit 82af8a5

Browse files
Merge pull request #509 from gjsjohnmurray/fix-508
fix #508 create clickable urls in BPL and DTL documents opened from server
2 parents 191691d + 63ce8fa commit 82af8a5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/providers/FileSystemPovider/FileSystemProvider.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,21 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
330330
return api
331331
.getDoc(fileName)
332332
.then((data) => data.result)
333+
.then((result) => {
334+
const fileSplit = fileName.split(".");
335+
const fileType = fileSplit[fileSplit.length - 1];
336+
if (!csp && ["bpl", "dtl"].includes(fileType)) {
337+
const partialUri = Array.isArray(result.content) ? result.content[0] : String(result.content).split("\n")[0];
338+
const strippedUri = partialUri.split("&STUDIO=")[0];
339+
const { https, host, port, pathPrefix } = api.config;
340+
result.content = [
341+
`${https ? "https" : "http"}://${host}:${port}${pathPrefix}${strippedUri}`,
342+
"Use the link above to launch the external editor in your web browser.",
343+
"Do not edit this document here. It cannot be saved to the server.",
344+
];
345+
}
346+
return result;
347+
})
333348
.then(
334349
({ ts, content }) =>
335350
new File(

0 commit comments

Comments
 (0)