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

Allow expanding values in dap-ui-repl #167

Open
3ynm opened this issue Dec 8, 2019 · 9 comments
Open

Allow expanding values in dap-ui-repl #167

3ynm opened this issue Dec 8, 2019 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@3ynm
Copy link

3ynm commented Dec 8, 2019

As you can see in the following image, REPL just says which class I'm using instead of showing the content... that really does not help that much.

php_repl

I can help myself by using the json_encode() function sometimes, but that's actually just a trick.

@yyoncho
Copy link
Member

yyoncho commented Dec 8, 2019

Can you set dap-print-io to t and include request/response that corresponds to one invocation in the REPL? (it will be available in the *Messages* buffer).

This will help us find out whether the issue is in dap-mode "not printing the correct piece of information" or in the server "not sending printable result".

Also, as a workaround, what happens if you eval the same thing using dap-ui-inspect ? Are you able to see what you are looking for? If this is the case, we will try to include the expandable result in the console (I think this is what vscode does).

@3ynm
Copy link
Author

3ynm commented Dec 9, 2019

Can you set dap-print-io to t and include request/response that corresponds to one invocation in the REPL? (it will be available in the Messages buffer).

Sending: 
{
  "command": "evaluate",
  "arguments": {
    "expression": "$request",
    "frameId": 76
  },
  "type": "request",
  "seq": 22
}
Received:
{
  "body": {
    "variablesReference": 2,
    "result": "Laravel\\Lumen\\Http\\Request"
  },
  "success": true,
  "command": "evaluate",
  "request_seq": 22,
  "type": "response",
  "seq": 27
}

It seems like a problem from the server :(
But I'm not sure, probably we should use other command?

Also, as a workaround, what happens if you eval the same thing using dap-ui-inspect ?

Actually the same
php_repl_2

EDIT: (I was not expanding [-], check #167 (comment))

@yyoncho
Copy link
Member

yyoncho commented Dec 9, 2019

@HACKTIVISTA if the inspect command doesn't help that means we do not have a solution on emacs side.

My guess is that this is a well-known issue on the server-side - it sends all objects after converting them to string. I suggest closing the issue and moving the discussion in the php debug adapter repo.

@3ynm
Copy link
Author

3ynm commented Dec 10, 2019

I'm really not sure about the internals... But it seems like emacs-lsp is only considering a part of what should be requested to the server... Here you can see what I see on VSCode vs emacs:

php_repl_3
php_repl_4

I'm attaching the full log after setting dap-print-io to true and inspecting with dap-ui-inspect.
php_repl.log

It would be great if you could direct me towards deeper inspections on emacs or that well-known issue you refer to.

@yyoncho
Copy link
Member

yyoncho commented Dec 10, 2019

@HACKTIVISTA what happens when you are in the inspect window and press enter with focus on [-] it looks like it is not expanded. Alternatively, you may do M-x tree-mode-expand-level?

@3ynm
Copy link
Author

3ynm commented Dec 10, 2019

What a shame... haha. I tried that on the text instead of the [-]. It shows the info.

php_repl_5

@yyoncho
Copy link
Member

yyoncho commented Dec 10, 2019

Ok. I am closing the issue. The tree control will be rewritten to use treemacs renderer which will make a but easier to distinguish which node is open and which is not.

@yyoncho yyoncho closed this as completed Dec 10, 2019
@3ynm
Copy link
Author

3ynm commented Dec 10, 2019

@yyoncho the issue was not about the inspect tree, but about not printing the whole thing on the REPL.

@yyoncho
Copy link
Member

yyoncho commented Dec 10, 2019

I have investigated that in the past, ATM it is not possible using comint. This would require reimplementing the repl control. I am reopening this for tracking purpose.

@yyoncho yyoncho reopened this Dec 10, 2019
@yyoncho yyoncho added enhancement New feature or request help wanted Extra attention is needed labels Dec 10, 2019
@yyoncho yyoncho changed the title PHP REPL returns class type instead of content Allow expanding values in dap-ui-repl Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants