scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.07k stars 325 forks source link

Unverified breakpoints as a result of naming convention #3747

Closed mdelomba closed 10 months ago

mdelomba commented 2 years ago

Describe the bug

As a result of us not strictly enforcing naming conventions we have projects with different naming conventions as shown below: LibraryProject subprojecta subProjectB SubProjectC

When debugging I've noticed that the only code that has verified breakpoints are the projects with all lowercase naming. The other projects will show as "Unverified Breakpoint". After renaming projects to being all lowercase, the issue seems to be resolved and I can now break into that code.

Steps to reproduce would be:

  1. Create project with anything but all lowercase naming
  2. Run application
  3. Attach to debug
  4. Place a breakpoint
  5. Breakpoint should appear with "Unverified Breakpoint"
  6. Rename project to be all lowerase (I also Refresh, Compile, Import build)
  7. Run Steps 2- 4
  8. Breakpoint show now be verified and users can break into code.

Expected behavior

Although projects should have some form of naming convention that all engineers abide by, all lowercase naming should not be a requirement in order to debug into code.

Operating system

Windows

Editor/Extension

VS Code

Version of Metals

v0.11.1

Extra context or search terms

No response

tgodzik commented 2 years ago

Thanks for reporting! I finally managed to try and reproduce it, but I was unable to do so on my windows machine. What version of Windows are you using exactly? Does this happen on all possible projects? Does it fail also on the newest 0.11.2 version of Metals?

You could create DAP trace files to see what exactly is being sent (more details here: https://scalameta.org/metals/docs/contributors/getting-started#json-rpc-trace) and send us those files.

mdelomba commented 2 years ago

Thanks for the reply , we are currently using Windows 10. I'll be getting a JSON file to you here shortly. The files need to be vetted before we can give them to you but the person to do that is out today.

The issue I'm seeing is when we initialize our subproject: lazy val subProjectA = (project in file("subprojecta")). settings( name := "SubProjectA")

The area file("subprojecta") appears to need to match our folder name (case sensitive) which in this case would be subProjectA. We would also see this issue with file("subProjectA") and the folder was subprojecta.

This has me curious if this is actually an issue with Metals or SBT. We didn't seem to have this issue with IntelliJ but see it with VSCode.

tgodzik commented 2 years ago

Oh, that might be related. I haven't checked it with the project names. I will take a look next week when I will have access to a Windows machine.

mdelomba commented 2 years ago

I've created a reproduction of our project structure in: https://github.com/YeOldePorkchop/NamingConventionIssue

Attached are the dap-server.trace.json text as well as the dap-client.trace.json text.

dap-client.trace.json:

[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 1,
  "command": "initialize",
  "arguments": {
    "clientID": "vscode",
    "clientName": "Visual Studio Code",
    "adapterID": "scala",
    "pathFormat": "path",
    "linesStartAt1": true,
    "columnsStartAt1": true,
    "supportsVariableType": true,
    "supportsVariablePaging": true,
    "supportsRunInTerminalRequest": true,
    "locale": "en-us",
    "supportsProgressReporting": true,
    "supportsInvalidatedEvent": true,
    "supportsMemoryReferences": true
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 1,
  "request_seq": 1,
  "command": "initialize",
  "success": true,
  "body": {
    "supportsConfigurationDoneRequest": true,
    "supportsHitConditionalBreakpoints": true,
    "supportsConditionalBreakpoints": true,
    "supportsEvaluateForHovers": true,
    "supportsCompletionsRequest": true,
    "supportsRestartFrame": true,
    "supportsSetVariable": true,
    "supportsRestartRequest": false,
    "supportTerminateDebuggee": true,
    "supportsDelayedStackTraceLoading": false,
    "supportsLogPoints": true,
    "supportsExceptionInfoRequest": true,
    "exceptionBreakpointFilters": [
      {
        "label": "Uncaught Exceptions",
        "filter": "uncaught"
      },
      {
        "label": "Caught Exceptions",
        "filter": "caught"
      }
    ]
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 2,
  "command": "launch",
  "arguments": {
    "type": "scala",
    "name": "main.Main",
    "noDebug": false,
    "request": "launch",
    "debugServer": 54689,
    "__sessionId": "f064c0ca-0f70-4ec7-b702-c7716c768e70"
  }
}
[Trace][03:01:52 PM] Sent notification:
{
  "type": "event",
  "seq": 2,
  "event": "initialized",
  "body": {
    "type": "initialized"
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 2,
  "request_seq": 2,
  "command": "launch",
  "success": true
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 3,
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "SomeClassA.scala",
      "path": "c:\\Users\\micha\\Desktop\\libraryProject\\subprojecta\\src\\main\\scala\\SomeClassA.scala"
    },
    "lines": [
      5
    ],
    "breakpoints": [
      {
        "line": 5
      }
    ],
    "sourceModified": false
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 4,
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "SomeClassB.scala",
      "path": "c:\\Users\\micha\\Desktop\\libraryProject\\subprojectb\\src\\main\\scala\\SomeClassB.scala"
    },
    "lines": [
      5
    ],
    "breakpoints": [
      {
        "line": 5
      }
    ],
    "sourceModified": false
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 5,
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "SomeClassC.scala",
      "path": "c:\\Users\\micha\\Desktop\\libraryProject\\subprojectc\\src\\main\\scala\\SomeClassC.scala"
    },
    "lines": [
      5
    ],
    "breakpoints": [
      {
        "line": 5
      }
    ],
    "sourceModified": false
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 3,
  "request_seq": 3,
  "command": "setBreakpoints",
  "success": true,
  "body": {
    "breakpoints": [
      {
        "id": 1,
        "verified": true,
        "message": "",
        "source": {
          "name": "SomeClassA.scala",
          "path": "c:\\Users\\micha\\Desktop\\libraryProject\\subprojecta\\src\\main\\scala\\SomeClassA.scala"
        },
        "line": 5
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 4,
  "request_seq": 4,
  "command": "setBreakpoints",
  "success": true,
  "body": {
    "breakpoints": [
      {
        "id": 2,
        "verified": false,
        "message": "",
        "source": {
          "name": "SomeClassB.scala",
          "path": "c:\\Users\\micha\\Desktop\\libraryProject\\subprojectb\\src\\main\\scala\\SomeClassB.scala"
        },
        "line": 5
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 5,
  "request_seq": 5,
  "command": "setBreakpoints",
  "success": true,
  "body": {
    "breakpoints": [
      {
        "id": 3,
        "verified": false,
        "message": "",
        "source": {
          "name": "SomeClassC.scala",
          "path": "c:\\Users\\micha\\Desktop\\libraryProject\\subprojectc\\src\\main\\scala\\SomeClassC.scala"
        },
        "line": 5
      }
    ]
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 6,
  "command": "setExceptionBreakpoints",
  "arguments": {
    "filters": []
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 6,
  "request_seq": 6,
  "command": "setExceptionBreakpoints",
  "success": true
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 7,
  "command": "configurationDone"
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 7,
  "request_seq": 7,
  "command": "configurationDone",
  "success": true
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 8,
  "command": "threads"
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 8,
  "request_seq": 8,
  "command": "threads",
  "success": true,
  "body": {
    "threads": [
      {
        "id": 28,
        "name": "Thread [Attach Listener]"
      },
      {
        "id": 29,
        "name": "Thread [Signal Dispatcher]"
      },
      {
        "id": 30,
        "name": "Thread [Finalizer]"
      },
      {
        "id": 31,
        "name": "Thread [Reference Handler]"
      },
      {
        "id": 1,
        "name": "Thread [main]"
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent notification:
{
  "type": "event",
  "seq": 10,
  "event": "thread",
  "body": {
    "reason": "started",
    "threadId": 1,
    "type": "thread"
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 9,
  "command": "threads"
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 9,
  "request_seq": 9,
  "command": "threads",
  "success": true,
  "body": {
    "threads": [
      {
        "id": 28,
        "name": "Thread [Attach Listener]"
      },
      {
        "id": 29,
        "name": "Thread [Signal Dispatcher]"
      },
      {
        "id": 30,
        "name": "Thread [Finalizer]"
      },
      {
        "id": 31,
        "name": "Thread [Reference Handler]"
      },
      {
        "id": 1,
        "name": "Thread [main]"
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent notification:
{
  "type": "event",
  "seq": 12,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from Main\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:52 PM] Sent notification:
{
  "type": "event",
  "seq": 13,
  "event": "breakpoint",
  "body": {
    "reason": "new",
    "breakpoint": {
      "id": 1,
      "verified": true,
      "line": 5,
      "message": ""
    },
    "type": "breakpoint"
  }
}
[Trace][03:01:52 PM] Sent notification:
{
  "type": "event",
  "seq": 14,
  "event": "stopped",
  "body": {
    "threadId": 1,
    "reason": "breakpoint",
    "allThreadsStopped": false,
    "type": "stopped"
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 10,
  "command": "threads"
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 10,
  "request_seq": 10,
  "command": "threads",
  "success": true,
  "body": {
    "threads": [
      {
        "id": 28,
        "name": "Thread [Attach Listener]"
      },
      {
        "id": 29,
        "name": "Thread [Signal Dispatcher]"
      },
      {
        "id": 30,
        "name": "Thread [Finalizer]"
      },
      {
        "id": 31,
        "name": "Thread [Reference Handler]"
      },
      {
        "id": 1,
        "name": "Thread [main]"
      }
    ]
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 11,
  "command": "stackTrace",
  "arguments": {
    "threadId": 1,
    "startFrame": 0,
    "levels": 20
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 11,
  "request_seq": 11,
  "command": "stackTrace",
  "success": true,
  "body": {
    "stackFrames": [
      {
        "id": 1,
        "name": "SomeClassA$.outputSomething()",
        "source": {
          "name": "SomeClassA.scala",
          "path": "C:\\Users\\micha\\Desktop\\libraryProject\\subprojecta\\src\\main\\scala\\SomeClassA.scala",
          "sourceReference": 0
        },
        "line": 5,
        "column": 1
      },
      {
        "id": 2,
        "name": "Main$.main(String[])",
        "source": {
          "name": "Main.scala",
          "path": "C:\\Users\\micha\\Desktop\\libraryProject\\src\\main\\scala\\Main.scala",
          "sourceReference": 0
        },
        "line": 10,
        "column": 1
      },
      {
        "id": 3,
        "name": "Main.main(String[])",
        "line": -1,
        "column": 1
      }
    ],
    "totalFrames": 3
  }
}
[Trace][03:01:52 PM] Received request:
{
  "type": "request",
  "seq": 12,
  "command": "scopes",
  "arguments": {
    "frameId": 1
  }
}
[Trace][03:01:52 PM] Sent response:
{
  "type": "response",
  "seq": 12,
  "request_seq": 12,
  "command": "scopes",
  "success": true,
  "body": {
    "scopes": [
      {
        "name": "Local",
        "variablesReference": 4,
        "expensive": false
      }
    ]
  }
}
[Trace][03:01:53 PM] Received request:
{
  "type": "request",
  "seq": 13,
  "command": "variables",
  "arguments": {
    "variablesReference": 4
  }
}
[Trace][03:01:53 PM] Sent response:
{
  "type": "response",
  "seq": 13,
  "request_seq": 13,
  "command": "variables",
  "success": true,
  "body": {
    "variables": [
      {
        "name": "this",
        "value": "SomeClassA$@419",
        "type": "SomeClassA$",
        "variablesReference": 5,
        "namedVariables": 0,
        "indexedVariables": 0
      }
    ]
  }
}
[Trace][03:01:53 PM] Received request:
{
  "type": "request",
  "seq": 14,
  "command": "continue",
  "arguments": {
    "threadId": 1
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 19,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from SomeClassA\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:53 PM] Sent response:
{
  "type": "response",
  "seq": 14,
  "request_seq": 14,
  "command": "continue",
  "success": true,
  "body": {
    "allThreadsContinued": false
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 21,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from SomeClassB\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 22,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from SomeClassC\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 23,
  "event": "thread",
  "body": {
    "reason": "exited",
    "threadId": 1,
    "type": "thread"
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 24,
  "event": "thread",
  "body": {
    "reason": "started",
    "threadId": 425,
    "type": "thread"
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 25,
  "event": "thread",
  "body": {
    "reason": "exited",
    "threadId": 425,
    "type": "thread"
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 26,
  "event": "exited",
  "body": {
    "exitCode": 0,
    "type": "exited"
  }
}
[Trace][03:01:53 PM] Sent notification:
{
  "type": "event",
  "seq": 27,
  "event": "terminated",
  "body": {
    "restart": false,
    "type": "terminated"
  }
}
[Trace][03:01:53 PM] Received request:
{
  "type": "request",
  "seq": 15,
  "command": "disconnect",
  "arguments": {
    "restart": false,
    "terminateDebuggee": false
  }
}
[Trace][03:01:53 PM] Sent response:
{
  "type": "response",
  "seq": 15,
  "request_seq": 15,
  "command": "disconnect",
  "success": true
}

dap-server.trace.json:

[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 1,
  "command": "initialize",
  "arguments": {
    "clientID": "vscode",
    "clientName": "Visual Studio Code",
    "adapterID": "scala",
    "pathFormat": "path",
    "linesStartAt1": true,
    "columnsStartAt1": true,
    "supportsVariableType": true,
    "supportsVariablePaging": true,
    "supportsRunInTerminalRequest": true,
    "locale": "en-us",
    "supportsProgressReporting": true,
    "supportsInvalidatedEvent": true,
    "supportsMemoryReferences": true
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 1,
  "request_seq": 1,
  "command": "initialize",
  "success": true,
  "body": {
    "supportsConfigurationDoneRequest": true,
    "supportsHitConditionalBreakpoints": true,
    "supportsConditionalBreakpoints": true,
    "supportsEvaluateForHovers": true,
    "supportsCompletionsRequest": true,
    "supportsRestartFrame": true,
    "supportsSetVariable": true,
    "supportsRestartRequest": false,
    "supportTerminateDebuggee": true,
    "supportsDelayedStackTraceLoading": false,
    "supportsLogPoints": true,
    "supportsExceptionInfoRequest": true,
    "exceptionBreakpointFilters": [
      {
        "label": "Uncaught Exceptions",
        "filter": "uncaught"
      },
      {
        "label": "Caught Exceptions",
        "filter": "caught"
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 2,
  "command": "launch",
  "arguments": {
    "type": "scala",
    "name": "main.Main",
    "noDebug": false,
    "request": "launch",
    "debugServer": 54689,
    "__sessionId": "f064c0ca-0f70-4ec7-b702-c7716c768e70"
  }
}
[Trace][03:01:52 PM] Received notification:
{
  "type": "event",
  "seq": 2,
  "event": "initialized",
  "body": {
    "type": "initialized"
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 3,
  "request_seq": 2,
  "command": "launch",
  "success": true
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 3,
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "SomeClassA.scala",
      "path": "file:///C:/Users/micha/Desktop/libraryProject/subprojecta/src/main/scala/SomeClassA.scala"
    },
    "breakpoints": [
      {
        "line": 5
      }
    ],
    "lines": [
      5
    ],
    "sourceModified": false
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 4,
  "request_seq": 3,
  "command": "setBreakpoints",
  "success": true,
  "body": {
    "breakpoints": [
      {
        "id": 1,
        "verified": true,
        "line": 5,
        "message": ""
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 4,
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "SomeClassB.scala",
      "path": "file:///C:/Users/micha/Desktop/libraryProject/subProjectB/src/main/scala/SomeClassB.scala"
    },
    "breakpoints": [
      {
        "line": 5
      }
    ],
    "lines": [
      5
    ],
    "sourceModified": false
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 5,
  "request_seq": 4,
  "command": "setBreakpoints",
  "success": true,
  "body": {
    "breakpoints": [
      {
        "id": 2,
        "verified": false,
        "line": 5,
        "message": ""
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 5,
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "SomeClassC.scala",
      "path": "file:///C:/Users/micha/Desktop/libraryProject/SubProjectC/src/main/scala/SomeClassC.scala"
    },
    "breakpoints": [
      {
        "line": 5
      }
    ],
    "lines": [
      5
    ],
    "sourceModified": false
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 6,
  "request_seq": 5,
  "command": "setBreakpoints",
  "success": true,
  "body": {
    "breakpoints": [
      {
        "id": 3,
        "verified": false,
        "line": 5,
        "message": ""
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 6,
  "command": "setExceptionBreakpoints",
  "arguments": {
    "filters": []
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 7,
  "request_seq": 6,
  "command": "setExceptionBreakpoints",
  "success": true
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 7,
  "command": "configurationDone"
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 8,
  "request_seq": 7,
  "command": "configurationDone",
  "success": true
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 8,
  "command": "threads"
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 9,
  "request_seq": 8,
  "command": "threads",
  "success": true,
  "body": {
    "threads": [
      {
        "id": 28,
        "name": "Thread [Attach Listener]"
      },
      {
        "id": 29,
        "name": "Thread [Signal Dispatcher]"
      },
      {
        "id": 30,
        "name": "Thread [Finalizer]"
      },
      {
        "id": 31,
        "name": "Thread [Reference Handler]"
      },
      {
        "id": 1,
        "name": "Thread [main]"
      }
    ]
  }
}
[Trace][03:01:52 PM] Received notification:
{
  "type": "event",
  "seq": 10,
  "event": "thread",
  "body": {
    "reason": "started",
    "threadId": 1,
    "type": "thread"
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 9,
  "command": "threads"
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 11,
  "request_seq": 9,
  "command": "threads",
  "success": true,
  "body": {
    "threads": [
      {
        "id": 28,
        "name": "Thread [Attach Listener]"
      },
      {
        "id": 29,
        "name": "Thread [Signal Dispatcher]"
      },
      {
        "id": 30,
        "name": "Thread [Finalizer]"
      },
      {
        "id": 31,
        "name": "Thread [Reference Handler]"
      },
      {
        "id": 1,
        "name": "Thread [main]"
      }
    ]
  }
}
[Trace][03:01:52 PM] Received notification:
{
  "type": "event",
  "seq": 12,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from Main\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:52 PM] Received notification:
{
  "type": "event",
  "seq": 13,
  "event": "breakpoint",
  "body": {
    "reason": "new",
    "breakpoint": {
      "id": 1,
      "verified": true,
      "line": 5,
      "message": ""
    },
    "type": "breakpoint"
  }
}
[Trace][03:01:52 PM] Received notification:
{
  "type": "event",
  "seq": 14,
  "event": "stopped",
  "body": {
    "threadId": 1,
    "reason": "breakpoint",
    "allThreadsStopped": false,
    "type": "stopped"
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 10,
  "command": "threads"
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 15,
  "request_seq": 10,
  "command": "threads",
  "success": true,
  "body": {
    "threads": [
      {
        "id": 28,
        "name": "Thread [Attach Listener]"
      },
      {
        "id": 29,
        "name": "Thread [Signal Dispatcher]"
      },
      {
        "id": 30,
        "name": "Thread [Finalizer]"
      },
      {
        "id": 31,
        "name": "Thread [Reference Handler]"
      },
      {
        "id": 1,
        "name": "Thread [main]"
      }
    ]
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 11,
  "command": "stackTrace",
  "arguments": {
    "threadId": 1,
    "startFrame": 0,
    "levels": 20
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 16,
  "request_seq": 11,
  "command": "stackTrace",
  "success": true,
  "body": {
    "stackFrames": [
      {
        "id": 1,
        "source": {
          "name": "SomeClassA.scala",
          "path": "C:\\Users\\micha\\Desktop\\libraryProject\\subprojecta\\src\\main\\scala\\SomeClassA.scala",
          "sourceReference": 0
        },
        "line": 5,
        "column": 1,
        "name": "SomeClassA$.outputSomething()"
      },
      {
        "id": 2,
        "source": {
          "name": "Main.scala",
          "path": "C:\\Users\\micha\\Desktop\\libraryProject\\src\\main\\scala\\Main.scala",
          "sourceReference": 0
        },
        "line": 10,
        "column": 1,
        "name": "Main$.main(String[])"
      },
      {
        "id": 3,
        "line": -1,
        "column": 1,
        "name": "Main.main(String[])"
      }
    ],
    "totalFrames": 3
  }
}
[Trace][03:01:52 PM] Sent request:
{
  "type": "request",
  "seq": 12,
  "command": "scopes",
  "arguments": {
    "frameId": 1
  }
}
[Trace][03:01:52 PM] Received response:
{
  "type": "response",
  "seq": 17,
  "request_seq": 12,
  "command": "scopes",
  "success": true,
  "body": {
    "scopes": [
      {
        "name": "Local",
        "variablesReference": 4,
        "expensive": false
      }
    ]
  }
}
[Trace][03:01:53 PM] Sent request:
{
  "type": "request",
  "seq": 13,
  "command": "variables",
  "arguments": {
    "variablesReference": 4
  }
}
[Trace][03:01:53 PM] Received response:
{
  "type": "response",
  "seq": 18,
  "request_seq": 13,
  "command": "variables",
  "success": true,
  "body": {
    "variables": [
      {
        "name": "this",
        "value": "SomeClassA$@419",
        "type": "SomeClassA$",
        "variablesReference": 5,
        "namedVariables": 0,
        "indexedVariables": 0
      }
    ]
  }
}
[Trace][03:01:53 PM] Sent request:
{
  "type": "request",
  "seq": 14,
  "command": "continue",
  "arguments": {
    "threadId": 1
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 19,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from SomeClassA\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:53 PM] Received response:
{
  "type": "response",
  "seq": 20,
  "request_seq": 14,
  "command": "continue",
  "success": true,
  "body": {
    "allThreadsContinued": false
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 21,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from SomeClassB\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 22,
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Output from SomeClassC\r\n",
    "variablesReference": 0,
    "line": 0,
    "column": 0,
    "type": "output"
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 23,
  "event": "thread",
  "body": {
    "reason": "exited",
    "threadId": 1,
    "type": "thread"
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 24,
  "event": "thread",
  "body": {
    "reason": "started",
    "threadId": 425,
    "type": "thread"
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 25,
  "event": "thread",
  "body": {
    "reason": "exited",
    "threadId": 425,
    "type": "thread"
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 26,
  "event": "exited",
  "body": {
    "exitCode": 0,
    "type": "exited"
  }
}
[Trace][03:01:53 PM] Received notification:
{
  "type": "event",
  "seq": 27,
  "event": "terminated",
  "body": {
    "restart": false,
    "type": "terminated"
  }
}
[Trace][03:01:53 PM] Sent request:
{
  "type": "request",
  "seq": 15,
  "command": "disconnect",
  "arguments": {
    "restart": false,
    "terminateDebuggee": false
  }
}
[Trace][03:01:53 PM] Received response:
{
  "type": "response",
  "seq": 28,
  "request_seq": 15,
  "command": "disconnect",
  "success": true
}
tgodzik commented 2 years ago

I think I know what might be going on.

The area file("subprojecta") appears to need to match our folder name (case sensitive) which in this case would be subProjectA. We would also see this issue with file("subProjectA") and the folder was subprojecta.

Normally, directory names need to match exactly, but on Windows subProjectA is the same as subprojecta, while Metals will try to match exactly. This seems to be an issue in https://github.com/scalacenter/scala-debug-adapter/blob/b3d0140ef132d6de0674880e4f818347ffde1a19/core/src/main/scala/ch/epfl/scala/debugadapter/internal/SourceEntryLookUp.scala

@adpi2 any ideas on how to solve this one? Should we just change all the paths we get to lower case?

adpi2 commented 10 months ago

Fixed in scalacenter/scaladebugadapter#615