remy / vscode-nextbasic

VS Code tools for NextBASIC

Home Page:https://marketplace.visualstudio.com/items?itemName=remysharp.nextbasic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with 'Format Document' and Import.

castingflame opened this issue · comments

Issues
As well as the left shunting in the listing for leading dot and semicolon commands , one of the issues seems to be that the extension isn't processing the semicolon correctly understanding that it is a comment but part of a command. In the very first comment line, this is apparent as the "for" was converted to a " FOR " BASIC token. Other spaces were also removed in the comment.
Example
Please find screenshots of the pre and post 'Format Document' applied (manually). I believe the Extension does this Format Document on each export anyway. Demo test case code is also provided to load into VS.
PaulLand NecxtBASIC.zip

10 ; Thanks Remy for your extesion. In step then cat to return to play in and out! <<BASIC TOKENS
11 ; In step the cat to return to play in and out!
12 ; Cat for play
14 ; Thanks Remy for your extesion!

After 'Format Document' becomes

10;ThanksRemy FOR yourextesion. IN STEP THEN CAT TO RETURN TO PLAY IN AND OUT ! << BASICTOKENS
11; IN STEP the CAT TO RETURN TO PLAY IN AND OUT !
12; CAT FOR PLAY
14;ThanksRemy FOR yourextesion!

The source paulland.bas.txt is exactly what I need 👍 - I'm able to replicate and I'll get on to fixing this.

That's fixed and going live now with 1.5.3.

Thanks again.

I have installed version 1.5.3 . Closed open files then VS. Opened VS opened file.

  1. I still have the same issue with;

10 .CD "C:\PML\EMPTY"
changing to
10 .CD "C:\PML\EMPTY" in CSpect (deleting space)

2).
10 ; Thanks Remy for your extesion. In step then cat to return to play in and out! <<BASIC TOKENS
11 ; In step the cat to return to play in and out!
12 ; Cat for play
14 ; Thanks Remy for your extesion!

Then Format Document is still ...

10;ThanksRemy FOR yourextesion. IN STEP THEN CAT TO RETURN TO PLAY IN AND OUT ! << BASICTOKENS
11; IN STEP the CAT TO RETURN TO PLAY IN AND OUT !
12; CAT FOR PLAY
14;ThanksRemy FOR yourextesion!

I Updated to the Extension and it is reporting 1.5.3 so I am confused!
EDIT: I have just tried uninstalling NextBASIC, restarting VS, installing 1.5.3 but it is still the same.

This is strange. How are you triggering the format document (though I've tried save, format document from the palette and hitting return)?

Also, when you bring up the command palette, can you run the "NextBASIC: txt2bas version" - you'll get an info notification in the bottom right of the screen - can you post here what it reads?

To bring up the command pallet Right click on the code window then select Format Document.

If I don't do that and just run it to CSpect, it looks fixed apart from the semi colons and leading dots have still shunted to the left.

https://i.postimg.cc/NjWd1px6/screenshot-54.png[/img][/url]

EDIT:>>>>> Current txt2bas version: v1.14.3

Sod, I think I dropped the ball on this. I'll try to sort this out shortly. I assume it's still a problem?

I just looked again and the problem has disappeared. Under closer inspection I think it was down to having Comment with REM and not ; in the settings. :)

Okay, I'll give that a try too - I think my own defaults are to use ; - so I'll repeat the test with REM. I'll leave this open for a short bit longer just so I can sign it off myself.