Skip to content

Commit 01e2c86

Browse files
malkav30a501341RVR06
authored
Enable preview functionality regardless of the filename used for .dsl files (#32)
Co-authored-by: a501341 <[email protected]> Co-authored-by: Romain Vasseur <[email protected]>
1 parent 7e2ee18 commit 01e2c86

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.2.2 - October 2025
4+
5+
### Bugs fixed
6+
7+
* Fix #9: broken `preview` when workspace file name is not the default one, `workspace.dsl`.
8+
39
## 1.2.1 - September 2025
410

511
### Bugs fixed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# C4 DSL Visual Studio Code Extension
22

3-
![](https://img.shields.io/badge/last_updated-september_2025-0c7cba)
4-
![](https://img.shields.io/badge/vsix-v1.2.1-ef8d22)
3+
![](https://img.shields.io/badge/last_updated-october_2025-0c7cba)
4+
![](https://img.shields.io/badge/vsix-v1.2.2-ef8d22)
55

66
![](https://img.shields.io/badge/publisher-archicionado-fcc438)
77
![](https://img.shields.io/badge/chat-on_github_issue-19967d)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"license": "SEE LICENSE IN LICENSE.txt",
1313
"publisher": "archicionado",
14-
"version": "1.2.1",
14+
"version": "1.2.2",
1515
"homepage": "https://rvr06.github.io/cornifer/",
1616
"repository": {
1717
"type": "git",

src/previewProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ export function setupPreviewProvider(context: ExtensionContext) {
3030
let tag = workspace.getConfiguration('cornifer').structurizrLiteTag;
3131
let ws = path.dirname(activeEditor.document.uri.fsPath);
3232
let workspaceName = ws.split(path.sep).pop();
33+
let fileName = path.basename(activeEditor.document.uri.fsPath, '.dsl');
3334

3435
let containerName = createRandomString();
3536

3637
portfinder.getPort(function (_: any, port: any) {
3738
console.log(`Starting ${workspaceName} Structurizr Preview...`);
3839

39-
cp.exec(`docker run -p 127.0.0.1:${port}:8080 --name ${containerName} -v "${ws}:/usr/local/structurizr" structurizr/lite:${tag}`,
40+
cp.exec(`docker run -p 127.0.0.1:${port}:8080 --name ${containerName} -v "${ws}:/usr/local/structurizr" -e STRUCTURIZR_WORKSPACE_FILENAME="${fileName}" structurizr/lite:${tag}`,
4041
function (_, stdout, __) {
4142
console.log(stdout);
4243
});

0 commit comments

Comments
 (0)