remy / vscode-nextbasic

VS Code tools for NextBASIC
https://marketplace.visualstudio.com/items?itemName=remysharp.nextbasic
9 stars 2 forks source link

First line of code it's deleted when tokenizing #6

Closed jsanjose closed 4 years ago

jsanjose commented 4 years ago

If I write a program like this and run with "run with cspec" the first line is missing when tokenizing it to BAS:

10 PRINT "HELLO"
20 PRINT "WORLD"
30 GOTO 10

It only prints "WORLD" many times because line 10 is missing in the generated BAS.

remy commented 4 years ago

Hmm, this is weird. I just tried to replicate and it was okay, so there's something going with your setup that my code is getting confused with - that's to say: it's broken for you (and probably others), so let's find out why.

Screenshot 2020-05-26 at 18 29 04

Can you let me know:

jsanjose commented 4 years ago

NextBASIC version 1.3.5 Operating system: Windows 10

Attached a screenshot of the NextBASIC config.

nextbasic-config-jsj

jsanjose commented 4 years ago

Also this is a screenshot showing the problem.

run-test-nextbasic

jsanjose commented 4 years ago

Also if it helps you I'm also sure that it worked right in the previous version.

remy commented 4 years ago

Thanks. One extra question, are you able to connect to the Cspect image and upload the file in /devel/index.bas - it's the NextBASIC file that's generated on the fly and it might have some clues in the file (but make sure you've not saved it inbetween in the native NextBASIC editor).

jsanjose commented 4 years ago

Sure, here you have it attached.

index.zip

remy commented 4 years ago

And to confirm, this happens consistently? i.e. you've got it on any file, it has nothing to do with line 10 or anything (not that I can see how it would be).

There's nothing that jumps out at me, so I'm trying to think how VS Code would be giving the extension only part of the file…

Actually, could you zip up your source .txt file and post that too? Just to rule out any encoding in the source.

jsanjose commented 4 years ago

Sure here it goes...

test.bas.txt.zip

F.Y.I: my vscode version is 1.45.1

image

remy commented 4 years ago

I'm struggling to find where this is happening my code. Another test that might be useful, can you run the NextBASIC: export to binary .bas against your text file and send the resulting .bas file?

jsanjose commented 4 years ago

Here it is the resulting .bas from "export to binary .bas". Amazingly this one works well if I copy it to the virtual SD card of the CSpect.

test.zip

remy commented 4 years ago

This is good, and suggests the problem is in the vscode extension (and not in the underlying txt2bas logic), and it also means it's in the auto-run logic, so I know where to look. The bad news is I can't see anything that stands out, so I'll have to dig deeper and probably fire up the windows machine to see if I can replicate.

remy commented 4 years ago

Am able to replicate on a windows machine (with lunch!)

jsanjose commented 4 years ago

Nice! So seems only a problem in the Windows version of VScode.

remy commented 4 years ago

Found the bug and getting a fix ready.

remy commented 4 years ago

Extension version: 1.3.9 will have the fix - going live now.

jsanjose commented 4 years ago

Working now! Nice!