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

First loadedSource event raised by Debug Adapter adds nothing to the Loaded Scripts panel #59281

Closed
gjsjohnmurray opened this issue Sep 25, 2018 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@gjsjohnmurray
Copy link
Contributor

Version: 1.28.0-insider (user setup)
Commit: 79f79a2
Date: 2018-09-24T05:19:32.981Z
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Steps to Reproduce:

  1. Code a Debug Adapter capable of raising loadedSource events, e.g. via evaluateRequest's handling of the 'repl' context. Mine was derived from the mock-debug sample.
  2. The first loadedSource event you raise with reason='new' produces no visible entry in the Loaded Scripts panel.
  3. The second loadedSource event (different Source) results in two entries appearing.
  4. Thereafter, each loadedSource event correctly adds its Source to the panel.
@isidorn
Copy link
Contributor

isidorn commented Sep 25, 2018

@gjsjohnmurray are you sure you are sending your first loadedSource event after the initalisation has been done and you have responsed properly to the initialize request?
Also not to refresh the tree too much there is 300 ms timeout. You still do not see the tree updating after this time?

@isidorn isidorn added the info-needed Issue requires more information from poster label Sep 25, 2018
@gjsjohnmurray
Copy link
Contributor Author

@isidorn yes, pretty sure I'm not making those mistakes.

To replicate it in the vscode-mock-debug sample I did the following:

  1. Added this to initializeRequest
    response.body.supportsLoadedSourcesRequest = true;

  2. Modified evaluateRequest to support REPL strings such as 'ls 1' and 'ls 2'
    if (args.context === 'repl') {
    // 'evaluate' supports adding fake entries to Loaded Scripts panel via the 'repl':

     	const matches = /ls +([0-9]+)/.exec(args.expression);
     	if (matches && matches.length === 2) {
     		const src = new Source(`YJM${matches[1]}.txt`, `debug:YJM${matches[1]}.txt`);
     		this.sendEvent(new LoadedSourceEvent('new', src));
     		reply = `entry added to Loaded Scripts panel`;
     	}
     }
    
  3. Ran the amended vscode-mock-debug in the VSCode debugger as usual. When debugging of the readme.md file was underway, entered the following commands into the input field of the Debug Output panel:

ls 1

Debug Output echoed the command, followed by:
entry added to Loaded Scripts panel

But nothing appeared in the Loaded Scripts panel.

image

ls 2

Again, this echoed, followed by:
entry added to Loaded Scripts panel

At this point both entries appeared:
image

@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues and removed info-needed Issue requires more information from poster labels Sep 25, 2018
@isidorn isidorn assigned weinand and unassigned isidorn Sep 25, 2018
@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Sep 25, 2018
@weinand weinand added this to the October 2018 milestone Sep 25, 2018
@roblourens roblourens added the verified Verification succeeded label Nov 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants