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

Spams Debug Console of extension host while developing other extension #59

Closed
justarandomgeek opened this issue Jun 10, 2020 · 6 comments

Comments

@justarandomgeek
Copy link

I'm working on my own extension (a debug adapter) and any time i open a Visualizer pane, i get this spamed in the debug console:
image

This makes is pretty hard to find my entries in the debug console. Any chance you could clean this up?

@hediet
Copy link
Owner

hediet commented Jun 10, 2020

Yes, thanks for the report!
I try to fix it within the next week.

It should be this line.

I'm very curious how you use this debug visualizer for factorio!

@justarandomgeek
Copy link
Author

The mapgen noise system has some huge tables representing the noise functions to run (which the game later compiles to a more runnable form which it uses to actually generate the world), and some other mod makers asked for better display of them, so I'm formatting it as a nice readable tree!

@hediet
Copy link
Owner

hediet commented Jun 10, 2020

That's nice ;) Can you post a screenshot? Besides this issue, did you experience other issues with this extension?

@justarandomgeek
Copy link
Author

justarandomgeek commented Jun 10, 2020

There's a screenshot in #58 ;)

But here's one with the blinding lights on:
image

The biggest problem I had was the very minimal diagnostic when my trees weren't the right shape, since I don't have enough type data (yet) in Lua to attempt to validate them there. In particular, I had omitted children instead of using the empty array and got a pretty opaque error about something failing on undefined. Also, I looked at the AST trees, but duplicating the source seems kinda weird - a version with links to move the selection in a normal editor would be far more useful! (not that Lua gives me enough info to make ranges properly anyway, but still...)

@hediet
Copy link
Owner

hediet commented Aug 22, 2020

Console Spamming is fixed in v2.0.0. Sorry for the delay.

The biggest problem I had was the very minimal diagnostic when my trees weren't the right shape

the new playground helps you to get the data right - the editor has autocompletion & json schema validation.
All data is now properly validated. However, validation errors are not displayed yet.

Also, I looked at the AST trees, but duplicating the source seems kinda weird - a version with links to move the selection in a normal editor would be far more useful!

I don't fully understand you there. Which source is going to be duplicated? You mean like it is, but opening the source in VS Code rather the inline view? What is your usecase?

@hediet hediet closed this as completed Aug 22, 2020
@justarandomgeek
Copy link
Author

I don't fully understand you there. Which source is going to be duplicated? You mean like it is, but opening the source in VS Code rather the inline view? What is your usecase?

The trees i'm rendering are Factorio's mapgen Noise Expressions, which have "source" links back to the .lua file in which they were defined, which is probably already open in a normal editor, so showing it again under the tree isn't particularly helpful. What would probably be more useful is to move the selection in the editor in the other panel to that location in the file.

I did a similar thing in my profiler to jump to source from a my profiler charts:

vscode.window.showTextDocument(fileuri,{
	selection: new vscode.Range(line,0,line,0),
	viewColumn: vscode.ViewColumn.One
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants