Duroktar / Wolf

Wolf is a VsCode extension that enables live inspection of Python code in the editor.
Other
128 stars 7 forks source link

nameError does not display correctly #14

Closed Almenon closed 6 years ago

Almenon commented 6 years ago
x = 1
y = 2
z

console.ts:123 [Extension Host] WOOF: [{"source": "z", "lineno": 3, "error": true, "value": "NameError: name 'z' is not defined\n"}]

WOOF: [{"source": "z", "lineno": 3, "error": true, "value": "NameError: name 'z' is not defined\n"}, {"source": "z", "lineno": 3, "value": "None"}, {"source": "z", "lineno": 3, "value": "None"}, {"source": "", "lineno": 112, "error": true, "value": "TimeoutError: 'Wolf timed out after [10 seconds] exceeded!'\n"}] (at PythonTracer.tryParsePythonData (C:\Users\almenon.vscode\extensions\traBpUkciP.wolf-0.2.5\out\src\tracer.js:46:25)) t.log @ console.ts:123 t._logExtensionHostMessage @ extensionHost.ts:394 (anonymous) @ extensionHost.ts:211 emitTwo @ events.js:106 emit @ events.js:194 process.nextTick @ internal/child_process.js:766 _combinedTickCallback @ internal/process/next_tick.js:73 _tickCallback @ internal/process/next_tick.js:104

console.ts:123 [Extension Host] SyntaxError: Unexpected token W in JSON at position 97 at JSON.parse () at PythonTracer.tryParsePythonData (C:\Users\almenon.vscode\extensions\traBpUkciP.wolf-0.2.5\out\src\tracer.js:42:29) at Socket.__dirname.tracePythonScript.python.stdout.on (C:\Users\almenon.vscode\extensions\traBpUkciP.wolf-0.2.5\out\src\tracer.js:30:38) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at Pipe.onread (net.js:560:20) (at PythonTracer.tryParsePythonData (C:\Users\almenon.vscode\extensions\traBpUkciP.wolf-0.2.5\out\src\tracer.js:47:25))

The following also fails:

x
Almenon commented 6 years ago

Almost forgot to mention - win 10, python 3.5

Duroktar commented 6 years ago

Great, I'll check it out tonight. Thanks!

~BTW, Is this on the 0.3.0 branch or on the released extension?~ Nevermind, I can see that it's for the released version (0.2.5).

Almenon commented 6 years ago

the two issues I raised today were on the latest version of the 0.3.0 branch

Almenon commented 6 years ago

but maybe you get the same issue with released, let me check

Duroktar commented 6 years ago

Are you sure? The error code you pasted shows this..

SNIP... ...at Pipe.onread (net.js:560:20) (at PythonTracer.tryParsePythonData > (C:\Users\almenon.vscode\extensions\traBpUkciP.wolf-0.2.5\out\src\tracer.js:47:25))

Almenon commented 6 years ago

errrr..... not sure what happened there lol. I ran it again and looks like I'm using the right version this time:

console.ts:123 [Extension Host] WOOF: [{"lineno": 1, "value": "None", "source": "x"}, {"lineno": 1, "error": true, "value": "NameError: name 'x' is not defined\n", "source": "x"}]

WOOF: [{"lineno": 1, "value": "None", "source": "x"}, {"lineno": 1, "error": true, "value": "NameError: name 'x' is not defined\n", "source": "x"}, {"lineno": 1, "value": "None", "source": "x"}, {"lineno": 1, "value": "None", "source": "x"}, {"lineno": 112, "error": true, "value": "TimeoutError: 'Wolf timed out after [10 seconds] exceeded!'\n", "source": ""}] (at PythonTracer.tryParsePythonData (C:\dev\Wolf\out\src\tracer.js:54:25)) t.log @ console.ts:123 t._logExtensionHostMessage @ extensionHost.ts:394 (anonymous) @ extensionHost.ts:211 emitTwo @ events.js:106 emit @ events.js:194 process.nextTick @ internal/child_process.js:766 _combinedTickCallback @ internal/process/next_tick.js:73 _tickCallback @ internal/process/next_tick.js:104

console.ts:123 [Extension Host] SyntaxError: Unexpected token W in JSON at position 144 at JSON.parse () at PythonTracer.tryParsePythonData (C:\dev\Wolf\out\src\tracer.js:50:29) at Socket.__dirname.tracePythonScriptForDocument.python.stdout.on (C:\dev\Wolf\out\src\tracer.js:38:38) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at Pipe.onread (net.js:560:20) (at PythonTracer.tryParsePythonData (C:\dev\Wolf\out\src\tracer.js:55:25))

I also made sure I'm on the v0.3.0 branch

Duroktar commented 6 years ago

~The snippets you provided seem to work on the 0.2.5 branch for me so yeah, you're on the 0.3.0 for sure.~ (I see you just responded as such while I was typing this).

Okay, cool.. So it seems it's timing out for some reason (or just not exiting properly or something). Good find. I'll patch this up for sure.

Thanks buddy :beers:

Duroktar commented 6 years ago

Fixed in 0.3.0 upcoming release.

Almenon commented 6 years ago

? I'm still getting the same error. Which commit fixed it?

Duroktar commented 6 years ago

I'm not sure which one exactly, I made about 14 commits today. But the most recent master branch (it's not on the extension store yet, just here) will be the latest version.

Duroktar commented 6 years ago
almenonerror1
almenonerror2
Almenon commented 6 years ago

I switched to master and It is still not working - same error.

Duroktar commented 6 years ago

Oh I forgot I have a windows laptop now lol I got one for work, so I can try it out myself on windows 10 (I think that it may be an OS thing). Thanks for checking on it, I'll post back with an update soon..

Duroktar commented 6 years ago

I was able to replicate that exact error and traced it back to the timeout function in our wolf.py file. So I moved the timeout to the extension and that seems to have fixed it for good.

Duroktar commented 6 years ago

Closing. Feel free to re-open should the issue persist.