apache / apache/daffodil-vscode

Support loading and breakpoints of schemas on classpath

Open
#76 5 comments 0 reactions 1 assignee Claimed by @arosien View on GitHub
enhancement
Dominant language
TypeScript
Stars
18
Forks
33
Avg merge
3d 6h
Merged PRs (30d)
7

Description

(This issue is extracted from part of #66.)

Schemas may be included as resources on the classpath, which supports both file-system directories and jar files. The debugger extension, however, doesn't currently know about these resources in order to view them or set breakpoints within them.

One way to supply the classpath schemas to the editor, to view and to let the user set breakpoints there, is to send [`LoadedSource` DAP events](https://microsoft.github.io/debug-adapter-protocol/specification#Events_LoadedSource) from our backend to VS Code when we notice any referenced schema outside of the initial schema. We can do this eagerly (scan the XML, etc.) or lazily (as the schema is processed we notify when a new schema is encountered). The editor then will request the source content, and the backend can send it (since we can access the data of the jar file on the classpath), and the editor will display the (read-only) content. Implementation-wise, we need to re-enable the `supportsLoadedSourcesRequest` initialization parameter that was disabled in #25, decide the schema source discovery strategy, and handle the appropriate events and requests.

Additionally, I suspect the default [`pathFormat` parameter of the `Initialize` request](https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Initialize) needs to change from `path` to `uri`, since the loaded source will have a `jar` URI scheme (because it is loaded from a jar on the classpath).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.