You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by sh...@apache.org on 2023/07/25 19:02:57 UTC
[daffodil-vscode] branch main updated: Un-normalize (capitalize) the drive letter from showOpenDialog if we are on Windows
This is an automated email from the ASF dual-hosted git repository.
shanedell pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git
The following commit(s) were added to refs/heads/main by this push:
new 7f6bc5e Un-normalize (capitalize) the drive letter from showOpenDialog if we are on Windows
7f6bc5e is described below
commit 7f6bc5ea7016a01b3eae8af14dce1435c697e970
Author: Michael Hoke <mi...@nteligen.com>
AuthorDate: Mon Apr 17 10:51:43 2023 -0400
Un-normalize (capitalize) the drive letter from showOpenDialog if we are on Windows
---
src/adapter/activateDaffodilDebug.ts | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/adapter/activateDaffodilDebug.ts b/src/adapter/activateDaffodilDebug.ts
index 900a552..b1814f6 100644
--- a/src/adapter/activateDaffodilDebug.ts
+++ b/src/adapter/activateDaffodilDebug.ts
@@ -52,7 +52,19 @@ async function getFile(fileRequested, label, title) {
})
.then((fileUri) => {
if (fileUri && fileUri[0]) {
- return fileUri[0].fsPath
+ let path = fileUri[0].fsPath
+
+ if (
+ process.platform === 'win32' &&
+ path.length > 2 &&
+ path.charCodeAt(0) > 97 &&
+ path.charCodeAt(0) <= 122 &&
+ path.charAt(1) === ':'
+ ) {
+ path = path.charAt(0).toUpperCase() + path.slice(1)
+ }
+
+ return path
}
return ''