open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

Nodejs windows: bug in multiline dicts?

Open gagebt opened this issue 1 year ago • 3 comments

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

image

Open Interpreter version

0.1.15

Python version

3.11.6

Operating System name and version

windows 11

Additional context

No response

gagebt avatar Dec 19 '23 19:12 gagebt

current workaround: "beware that multiline dicts are interpreted erroneously in this coding environment."

gagebt avatar Dec 19 '23 19:12 gagebt

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.)

KillianLucas avatar Jan 05 '24 04:01 KillianLucas

Seems to be working for me in 0.1.8 image

aj47 avatar Jan 05 '24 05:01 aj47