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

inline values #16067

Closed
wants to merge 2 commits into from
Closed

inline values #16067

wants to merge 2 commits into from

Conversation

isidorn
Copy link
Contributor

@isidorn isidorn commented Nov 25, 2016

To address #13424

Chrome dev tools does this feature nicely, a picture for reference
screen shot 2016-11-25 at 16 24 13

@isidorn isidorn added the debug Debug viewlet, configurations, breakpoints, adapter issues label Nov 25, 2016
@isidorn isidorn added this to the November 2016 milestone Nov 25, 2016
@isidorn isidorn self-assigned this Nov 25, 2016
@mention-bot
Copy link

@isidorn, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jrieken, @alexandrudima and @bpasero to be potential reviewers.

@isidorn isidorn changed the title inline values first baby steps inline values Nov 25, 2016
@isidorn
Copy link
Contributor Author

isidorn commented Nov 25, 2016

I have added an empty method in the right place with documentation on how this should behave
Some docs on developing vscode can be found here

@nojvek give it a try and let me know how it goes. I plan to continue on this on Monday unless you take it over. You should be able to fork my branch and continue your work on top of that.

@nojvek
Copy link
Contributor

nojvek commented Nov 25, 2016

I'll take a stab. For this version, the scope ranges are not coming from the debugger API's right? The idea is to go through stack frames until global. Do a regex search for variable names and show decorators after line?

@isidorn
Copy link
Contributor Author

isidorn commented Nov 25, 2016

For the first version just ignore the scope ranges - since they are only supported by the node2 debug adapter, and it would be cool to have this feature for all 20+ adapters that exist. Once we have that we can improve it for adapters that support scope ranges.

No, the idea is to just go through the focused stack frame and go inside all the non expenisve scopes fo that stack frame. No regex search, just a regular compar of does a variable name match a word - similar how debugHover does it.

@nojvek
Copy link
Contributor

nojvek commented Nov 25, 2016 via email

@isidorn
Copy link
Contributor Author

isidorn commented Nov 25, 2016

Instead of mathcing against scope.name, you would match against something like scope.getChildern().then(children=> children.forEach(variable => match variable.name))

Also not sure about doing regex across whole text content of editor. I would prefer if you instead go through all the words in the text document since editor already parses the words nicely, and then word by word you can try to find across all variable names

@nojvek
Copy link
Contributor

nojvek commented Nov 25, 2016 via email

@isidorn
Copy link
Contributor Author

isidorn commented Nov 25, 2016

For gray highlihgts we are using a json parser and look for keys. Not useful for this scenario.

@nojvek
Copy link
Contributor

nojvek commented Nov 27, 2016

I have a prototype working.

image

Have some issues though.

  1. How do I get list of words in a line. I couldn't find an exposed api. I am currently calling editor.getLines() and doing a single regexp match for each line which is composed from variables in scope. e.g const namesRegex = new RegExp(`\\b(${Object.keys(nameValueMap).join('|')})\\b`,'g')

  2. How do I call registerDecorator as an exposed api. Currently I'm hacking it so I can get the decorators working. There must be a nicer way other than this.editor['_registerDecorationType'](...)

@isidorn
Copy link
Contributor Author

isidorn commented Nov 28, 2016

@nojvek awesome! Let's continue the discussion in #16129

@isidorn
Copy link
Contributor Author

isidorn commented Nov 30, 2016

Closing this ass all the interesting work is done in #16129

@isidorn isidorn closed this Nov 30, 2016
@isidorn isidorn deleted the isidorn/inlineValues branch July 3, 2017 12:19
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants