open-interpreter
open-interpreter copied to clipboard
Nodejs windows: bug in multiline dicts?
Describe the bug
Nodejs interpreter seems to have issues with dicts specified on multiple lines. See screenshot.
Reproduce
"nodejs. log a dictionary that is specified on multiple lines"
Expected behavior
Nicely executed code:
const dictionary = { key1: 'value1', key2: 'value2', key3: 'value3' };
console.log(dictionary);
Screenshots
Open Interpreter version
0.1.15
Python version
3.11.6
Operating System name and version
windows 11
Additional context
No response
current workaround: "beware that multiline dicts are interpreted erroneously in this coding environment."
Thank you so much for finding this @gagebt, let me know if anything else in javascript is weird. I'm a python dev so I rarely encounter things like this, very helpful to report them.
As of 0.2.0, which just came out a few minutes ago, we don't add active line console.log() statements between lines of multiline dicts. But the way I detect multiline dicts is a little flawed IMO— I just check if there's a bracket or curly braces anywhere in the code.
If you or anyone can think of a better way to parse for this, we can bring back active line highlighting to javascript for code blocks with those characters.
(also, do you think Javascript should be renamed to Node or maybe NodeJS? It's using Node to run it, but I'm not sure if that's what the 'language' is called.)
Seems to be working for me in 0.1.8