Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support updating debugAdapter provided sourceReference documents #41362

Closed
gregg-miskelly opened this issue Jan 9, 2018 · 13 comments
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan
Milestone

Comments

@gregg-miskelly
Copy link
Member

  • VSCode Version: 1.20.0-insider
    Commit 8697a5e
  • OS Version: Windows 10

I would like to be able to use the sourceReference feature of the debug protocol to return source files to VS Code. But I have ran into one issue - I can't seem to get VS Code to re-query for new content if my virtual document changes.

The debug protocol appears to support this by issuing a "loadedSource" event with a reason of "changed". But when I tied to do this it didn't work. Here is the event I sent:

<- (E) {"event":"loadedSource","body":{"reason":"changed","source":{"path":"Source file extracted from PDB File. Original Path: C:\\proj\\DebuggeeTest\\EmbeddedSourceTest\\SmallFile.cs","name":"SmallFile.cs","sourceReference":1,"sources":[],"checksums":[{"algorithm":"SHA1","checksum":"47755c1e39034a3ca708d4659bc36eea3e3880d4"}]}},"seq":44,"type":"event"}

I couldn't find any code in VS Code to actually consume the "loadedSource" event, so I am assuming this method will not currently work.

Is there anything else I can do, or do I need a new VS Code feature for this?

@vscodebot vscodebot bot added the insiders label Jan 9, 2018
@vscodebot vscodebot bot added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jan 9, 2018
@isidorn
Copy link
Contributor

isidorn commented Jan 10, 2018

@gregg-miskelly you are correct this is currently not implemented in VSCode.
We accept PRs that fix this. I would do this in such a way that the Process adds a listener on the Session and updates it sources map. Code pointer

@weinand fyi

@isidorn isidorn added feature-request Request for new features or functionality and removed insiders labels Jan 10, 2018
@isidorn isidorn removed their assignment Jan 10, 2018
@isidorn isidorn added this to the Backlog milestone Jan 10, 2018
@remss
Copy link

remss commented Sep 17, 2018

I seems that the "removed" reason for "loadedSource" event is not implemented yet too (vscode 1.27). Can you confirm ?

@weinand
Copy link
Contributor

weinand commented Sep 17, 2018

„removed“ is implemented in current Insiders (1.28 )

@weinand weinand self-assigned this Sep 17, 2018
@remss
Copy link

remss commented Sep 19, 2018

@weinand Great news!

Until now I believed that the protocol defines only features implemented in the last VScode but if this is not the case how can we know if a feature is available in VSCode?

@weinand
Copy link
Contributor

weinand commented Sep 19, 2018

The debug adapter protocol is independent from VS Code and contains quite a few features that are not implemented in VS Code but exist in VS or VS for Mac.

In the VS Code release notes we always try to clearly state whether a new DAP feature is implemented in VS Code or not.

@weinand weinand modified the milestones: Backlog, On Deck Sep 19, 2018
@remss
Copy link

remss commented Sep 19, 2018

I understand but it is difficult to review all release notes to find if a feature of the DAP is implemented or not.
For now the only way I see is to test the feature and see if it does something. But when it doesn't I'm not sure if the feature is not implemented or if I misuse the DAP.
Maybe some labels like "VSCode-only" or "VS-only" in the DAP documentation could help developers what is available for the IDE they target ?

@weinand
Copy link
Contributor

weinand commented Sep 19, 2018

In general we do not know which clients implements what. So clients should provide that information themselves.

Please file a feature request at https://github.com/Microsoft/debug-adapter-protocol/issues

@remss
Copy link

remss commented Sep 19, 2018

@weinand weinand modified the milestones: On Deck, October 2018 Oct 22, 2018
@weinand
Copy link
Contributor

weinand commented Oct 29, 2018

The loaded scripts view now supports "related resources" per script.
But a "loadedSource" event with reason "changed" is not yet supported.

Moved to November.

@weinand
Copy link
Contributor

weinand commented Nov 26, 2018

The changed event from the first comment is this:

{
	"event": "loadedSource",
	"body": {
		"reason": "changed",
		"source": {
			"path": "Source file extracted from PDB File. Original Path: C:\\proj\\DebuggeeTest\\EmbeddedSourceTest\\SmallFile.cs",
			"name": "SmallFile.cs",
			"sourceReference": 1,
			"sources": [
			],
			"checksums": [
				{
					"algorithm": "SHA1",
					"checksum": "47755c1e39034a3ca708d4659bc36eea3e3880d4"
				}
			]
		}
	},
	"seq": 44,
	"type": "event"
}

@weinand
Copy link
Contributor

weinand commented Nov 27, 2018

A "changed" event now properly triggers an updates of the "script" node in the LoadedScripts view.

Please note that a "changed" event does not yet trigger a refetch of the document content, but this feature will come soon...

@weinand
Copy link
Contributor

weinand commented Nov 28, 2018

@gregg-miskelly I've added the feature that a "changed" event now triggers a reload of the source content.

@gregg-miskelly
Copy link
Member Author

Thanks!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

4 participants