Skip to content

Commit 3be1083

Browse files
authored
Fix mapping of client-side DFI file to its document name (#1711)
1 parent b5a29ec commit 3be1083

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ export function getServerDocName(uri: vscode.Uri): string {
170170
return uri.path.slice(cspIdx);
171171
} else if (uri.path.toLowerCase().endsWith(".dfi")) {
172172
// Determine the file path relative to the workspace folder path
173-
const wsPath = wsFolder.uri.path + wsFolder.uri.path.endsWith("/") ? "" : "/";
173+
const wsPath = `${wsFolder.uri.path}${!wsFolder.uri.path.endsWith("/") ? "/" : ""}`;
174174
const relativeFilePath = uri.path.startsWith(wsPath) ? uri.path.slice(wsPath.length) : "";
175-
if (relativeFilePath == "") return;
175+
if (relativeFilePath == "") return; // uri isn't in the workspace folder. Should never happen.
176176
// Check for matching export settings first. If no match, use base name.
177177
const config = vscode.workspace.getConfiguration("objectscript.export", uri);
178178
const folder: string = config.get("folder");

0 commit comments

Comments
 (0)