Skip to content

Commit ccbac09

Browse files
committed
fix crash on unexpected VSCode source request
1 parent a0aa183 commit ccbac09

File tree

1 file changed

+13
-6
lines changed
  • apps/debug_adapter/lib/debug_adapter

1 file changed

+13
-6
lines changed

apps/debug_adapter/lib/debug_adapter/server.ex

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -888,12 +888,19 @@ defmodule ElixirLS.DebugAdapter.Server do
888888
path = args["source"]["path"]
889889

890890
content =
891-
if path == "replinput" do
892-
# this is a special path that VSCode uses for debugger console
893-
# return an empty string as we do not need anything there
894-
""
895-
else
896-
File.read!(path)
891+
cond do
892+
path == "replinput" ->
893+
# this is a special path that VSCode uses for debugger console
894+
# return an empty string as we do not need anything there
895+
""
896+
897+
String.starts_with?(path, "vs.editor.ICodeEditor:") ->
898+
# some undocumented VSCode behavior related to Monaco editor
899+
# vs.editor.ICodeEditor:1%3Abreakpointinput
900+
""
901+
902+
true ->
903+
File.read!(path)
897904
end
898905

899906
{%{"content" => content}, state}

0 commit comments

Comments
 (0)