microsoft / vscode-mock-debug

Starter sample for developing debug adapters for VSCode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot start debugging sampleWorkspace/readme.md on Linux due to filename case-sensitivity problem

wataash opened this issue · comments

In [Extension Development Host] started by "Extension + Server", "Debug readme.md" fails to run with the following error in the DEBUG CONSOLE:

rejected promise not handled within 1 second: EntryNotFound (FileSystemError): Unable to read file '/home/wsh/qjs/vscode-mock-debug/sampleworkspace/readme.md' (Error: Unable to resolve nonexistent file '/home/wsh/qjs/vscode-mock-debug/sampleworkspace/readme.md')
/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:112
stack trace: EntryNotFound (FileSystemError): Unable to read file '/home/wsh/qjs/vscode-mock-debug/sampleworkspace/readme.md' (Error: Unable to resolve nonexistent file '/home/wsh/qjs/vscode-mock-debug/sampleworkspace/readme.md')
    at Function._handleError (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:93:83879)
    at Object.readFile (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:93:82793)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.readFile (/home/wsh/qjs/vscode-mock-debug/src/activateMockDebug.ts:194:10)
    at MockRuntime.loadSource (/home/wsh/qjs/vscode-mock-debug/src/mockRuntime.ts:473:28)
    at MockRuntime.verifyBreakpoints (/home/wsh/qjs/vscode-mock-debug/src/mockRuntime.ts:646:4)
    at MockRuntime.setBreakPoint (/home/wsh/qjs/vscode-mock-debug/src/mockRuntime.ts:347:3)
    at /home/wsh/qjs/vscode-mock-debug/src/mockDebug.ts:268:35
    at async Promise.all (index 0)
    at _MockDebugSession.setBreakPointsRequest (/home/wsh/qjs/vscode-mock-debug/src/mockDebug.ts:273:29)

Note that this prints sampleworkspace/ instead of sampleWorkspace/.
When sampleWorkspace/ is renamed to sampleworkspace with the following patch, "Debug readme.md" starts successfully.

diff --git a/.vscode/launch.json b/.vscode/launch.json
index 377ddb3..393239e 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -7,7 +7,7 @@
 			"request": "launch",
 			"args": [
 				"--extensionDevelopmentPath=${workspaceFolder}",
-				"${workspaceFolder}/sampleWorkspace"
+				"${workspaceFolder}/sampleworkspace"
 			],
 			"outFiles": [
 				"${workspaceFolder}/dist/**/*.js"
@@ -22,7 +22,7 @@
 			"args": [
 				"--extensionDevelopmentPath=${workspaceFolder}",
 				"--extensionDevelopmentKind=web",
-				"${workspaceFolder}/sampleWorkspace"
+				"${workspaceFolder}/sampleworkspace"
 			],
 			"outFiles": [
 				"${workspaceFolder}/dist/**/*.js"
diff --git a/sampleWorkspace/.vscode/launch.json b/sampleworkspace/.vscode/launch.json
similarity index 100%
rename from sampleWorkspace/.vscode/launch.json
rename to sampleworkspace/.vscode/launch.json
diff --git a/sampleWorkspace/readme.md b/sampleworkspace/readme.md
similarity index 100%
rename from sampleWorkspace/readme.md
rename to sampleworkspace/readme.md

Environments:

$ code --version
1.64.2
f80445acd5a3dadef24aa209168452a3d97cc326
x64

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"

$ uname -a  # kernel is built by myself (not an Ubuntu official kernel)
Linux wsh64 5.13.19+ #1 SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

this has been fixed.