I haven't revisited my P2 programs for almost a year now, but recently I wanted to do check on the code and after updating the extensions in VSC, I suddenly have lots of syntax errors, mostly on object methods, in a code that compiles ok. I tested in latest version of Spin Tools for comparison and it doesn't show any syntax errors there. I am using the latest version of flexspin as compiler. Did I miss some change I need to do with the new version of the Spin2 extension? Here's a screenshot for reference:
I haven't revisited my P2 programs for almost a year now, ..... Did I miss some change I need to do with the new version of the Spin2 extension?
For those of you reading this. I could not identify the cause but could not recreate the issue with the v2.2.15 as I was working on it before release. I then reviewed all the code, found and fixed 3 more issues I was able to find, and then pushed the new release.
Ok, I worked with @jrullan and found a defect in the handling of files on windows that was causing all of the object references to not be found.
I've just release v2.2.16 to address this issue.
Here's what's new in v2.2.16
v2.2.16
Update P2 Only
BUGFIX: Syntax: add missing bytefit/wordfit recognition in DAT blocks (#6)
BUGFIX: Semantic: repair handling of {Spin2_v??} built-in method name support
BUGFIX: File access issues on Windows (11?) repaired
Cleaned up the code-fold detection... now handling ORG* forms better (#6)
Adjusted report key chords for Windows:
Ctrl+Win+r - Generate Object Hierarchy Report
Ctrl+Win+d - Generate OBject Public Interface Report
Ctrl+Win+c - (When cursor on PUB or PRI line) Insert Doc comment below the PUB or PRI line
If you see any issues with these new features please let us know by filing new issues at our code repo. (or email me directly.)
I've just released version 2.3.0 of our spin2 extension. This is the first cut of a new compiler-independent build system.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new in v2.2.17, v2.2.18, and v2.3.0
v2.2.18
Quick repackage and release to pull cruft out of distribution package (oops!)
v2.2.17
Update P2 Only
BUGFIX: parsing repair detection of alignl/alignw in VAR. Issue(#9)
Update P1 and P2
BUGFIX: FlexSpin support: implement new understanding. #include includes spin code but no longer needs spin/spin2 file extension. Issue(#11)
BUGFIX: FlexSpin support: fix highlighting for #include lines
v2.3.0
This update improves/simplifies the ability to compile and download code for Spin2 projects
NEW Automatic Toolchain discovery (paths for FlexProp, PNut, and pnut_ts are now automatically determined)
NEW Automatic PropPlug discovery
NEW statusBar control for switching between compile with debug() and without
NEW statusBar control for switching between download to FLASH / RAM
NEW statusBar control for selecting amongst available USB-attached PropPlugs
NEW Setting to select preferred compiler for all projects
NEW This setting can be overridden for each specific workspace (project)
NEW Setting to enable all this new spin2 toolchain support (disabled by default)
NEW Replacement User Tasks file is now universal (all supported compilers)
NOTE This release uses loadp2 from the flexspin installation to download code compiled by pnut_ts.
General Repairs
BUGFIX Repair crash when system-settings documents are open at startup
BUGFIX Spin2 Semantic Highlighting: fixed VAR section index coloring
Plan a time when you want to move to this new build support. Leave yourself an hour or two so you can do this setup carefully. Once set up, this will be fun to use!
This is our first release of this new build system. Please be sensitive to things being different. My goal is to make building and downloading much more simple than it previously was. But, since it is the first release, If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming With this finally being released, we can now move to adding highlighting support for Spin2 V45, v46, and v47... language features.
I've just released v2.3.1 followed by v2.3.2 of our spin2 extension. These fix the compiler detection code, in general, and additionally, path chasing on Windows.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new:
v2.3.1 and v2.3.2
Repair parsing of PATH on windows and how expected location paths are created
Present Error if multiple installations are found for a given tool
Reduce search to unique paths (no dupes from PATH values)
Extension logging is enabled for now to help us diagnose new-user installations (it will be turned off once again in a later release)
I'll add a section on "How to verify the compiler search by using the newly exposed log" to our "Build System Notes" shortly...
This is our first release of this new build system. Please be sensitive to things being different. My goal is to make building and downloading much more simple than it previously was. But, since it is the first release, If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming With this finally being released, we can now move to adding highlighting support for Spin2 V45, v46, and v47... language features.
Well, normally, Users of VSCode get automatic updates, but I'm not able to publish this before my trip to Rocklin!
However, I've attached the .vsix file to the Release Page (See: Assets)so you can download it right away if you don't want to wait until next week.
Here's a recap of what's new:
v2.4.0
Spin2 Language support upgrade through Spin2_v51
Add language support for {Spin2_v48}, through {Spin2_v51}
Highlight new STRUCT types
BUGFIX: corrected Syntax coloring of smart-pin constant 'P_REG_UP_DOWN' constant (spelled badly in prior versions)
If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming: I've got a small list of things i want to complete relative to this work... so there should be another point release with more pretty highlighting in the next two weeks or so. Of course, if you find issues between now and then I'll try to get to fixing them, too!
Hi Stephen,
I working with MacOS 15 and installed pnut_ts.
I can use pnut_ts in the terminal and ist works.
I want to start the compiler in VSC, I install the spinExtension Version 2.4.2 and generate task.json from Doku: TASKS-User-macOS.md
When ist i type command/shift/B and compileTopP2 I get the Error: command 'spinExtension.getCompArguments' not found
Where can i define "getCompArguments" and what are the Arguments?
@wummi said:
I want to start the compiler in VSC, I install the spinExtension Version 2.4.2 and generate task.json from Doku: TASKS-User-macOS.md
When ist i type command/shift/B and compileTopP2 I get the Error: command 'spinExtension.getCompArguments' not found
Where can I define "getCompArguments" and what are the Arguments?
OK, great question! I somehow left older values in the tasks.json file content.
The value spinExtension.getCompArguments should be spinExtension.getCompilerArguments.
Make this change, and it should work much better for you.
I'm updating the repository doc's as I'm posting this!
TypeError: Cannot read properties of undefined (reading 'length')
at We.appendLastLine (/home/ada/.vscode-oss/extensions/ironsheepproductionsllc.spin2-2.4.2/server/out/server.js:55:27296)
at Ws._parseText (/home/ada/.vscode-oss/extensions/ironsheepproductionsllc.spin2-2.4.2/server/out/server.js:97:4459)
at Ws.reportDocumentSemanticTokens (/home/ada/.vscode-oss/extensions/ironsheepproductionsllc.spin2-2.4.2/server/out/server.js:97:766)
at Li._parseDocument (/home/ada/.vscode-oss/extensions/ironsheepproductionsllc.spin2-2.4.2/server/out/server.js:106:10601)
at Li.process (/home/ada/.vscode-oss/extensions/ironsheepproductionsllc.spin2-2.4.2/server/out/server.js:106:9457)
at async Mi.handleOpenTextDocument (/home/ada/.vscode-oss/extensions/ironsheepproductionsllc.spin2-2.4.2/server/out/server.js:106:11178)
Ah yes, line twenty-seven thousand, two hundred and ninety-six. That one.
@Wuerfel_21 said:
Just gonna post it here instead of going through the issue templare rigmarole…
Keep letting me know of these. It’s been code weaknesses that’s crashing. Insufficient defenses.
Every time i find a new class of these i wipe them all out.
I get a fix out hopefully tomorrow.
If i can find a means to not crash the server i’ll put it in place. No luck so far.
Thanks Stephen, VSC now find the pnut_ts and compiles my Projects.
But VSC do not find the PropPlugs and can't download the .bin files under MacOS 15.
Is there a build in P2-Loader or need I an external Programm?
Hi Stephen, I found 2 compiler Errors and some syntax highlighting Errors.
In SPIN V49 CON STRUCT declarations are now exported to parent objects.
The highlighter is confused with the exported structs.
References to structs in objects also confused the highlighter.
Here are a short Prog that shows the compiler Errors:
{Spin2_v51}
#define testing 'compile Err: VSC.spin2:2:error:Expected "," or end of line
CON struct sFG1 ( byte A, byte B[3])
VAR sFG1 FG1[8]
PUB start ( ) | i, adr
repeat 8 with i
XYZ(-i) 'compile Err: VSC.spin2:12:error:NumberStack: attempted pop from empty stack
adr := @FG1[i].A 'A is decl.
#ifdef testing
debug(uhex(adr))
#endif
PRI XYZ ( val )
debug(sdec(val))
@wummi said:
Hi Stephen, I found 2 compiler Errors and some syntax highlighting Errors.
In SPIN V49 CON STRUCT declarations are now exported to parent objects.
The highlighter is confused with the exported structs.
References to structs in objects also confused the highlighter.
Here are a short Prog that shows the compiler Errors:
```
Thank you for reporting this! I'll get this fixed and also add this to our regression suite!
@wummi, both highlighter problems are fixed and will appear in the next release, hopefully, later today. (Found control structure problems in the colorizer)
@Wuerfel_21, that's a good example! You were correct in the parser being confused by the directive; it's fixed.
Also, I found an incomplete parser for local variables; it's fixed.
There was also some incomplete case-statement parsing (caused by multiple "..." strings on the same line), which has also been fixed.
These fixes will appear in the next release, hopefully, later today.
Opening the mikogpu.spin2 file from my Tempest 2000 source port reliably crashes the LSP
Ok. Yep, that was a good find. There is only one instance of this type of failure in the entire extension code base. I found and fixed it. Fix will appear in the next release, which I'm wrapping up now.
FWIW, you reported this in the way that best helps me find and fix these rapidly. That is, you provided the source that was causing the crash. When I rebuild the extension in a manner that facilitates debugging, I actually do get an excellent indication of exactly where in the source and which method call in the line of source is causing the failure. This means I can get a precise understanding of the cause and get an accurate fix in place. Thank you for reporting this the way you did!
Good morning Stephen,
I found more highlighter problems.
In your Programm flash_fs.spin2 in Line 308 ins one.
The Pin2 Extension on MacOS 15 don't find any PropPlug, so I can't download the binary's to the P2.
The PropPlugs are ok and SpinTools can find them and download can be done under MacOS 15.
What can I do to fix this, or is an external P2Loader necessary?
More highlighter problems in this code:
{Spin2_v51}
#define testing 'compile Err: VSC.spin2:2:error:Expected "," or end of line
CON struct sFG1 ( byte A, byte B[3])
VAR sFG1 FG1[8]
PUB start ( ) | i, adr
repeat 8 with i
XYZ(-i) 'compile Err: VSC.spin2:12:error:NumberStack: attempted pop from empty stack
adr := @FG1[i].A 'OK now
XYZ(@FG1[i].A) 'more hightligting Errors
FG1[i].A++
++FG1[i].A 'pre inc works
FG1[i].A += 3
FG1[i].A -= 3
FG1[i].B[1]--
--FG1[i].B[1] 'pre dec works
FG1[i].B[1]~
FG1[i].B[1]~~
#ifdef testing
debug(uhex(adr))
#endif
PRI XYZ ( val )
debug(sdec(val))
Comments
Stephen,
Just read your development over the past 18 months.
What you have achieved is nothing short of remarkable.
Congratulations!
Thank you! It's been fun to work on.
Thanks Stephen!!!
2.2.16 fixed my issue in Windows:
Ok, I worked with @jrullan and found a defect in the handling of files on windows that was causing all of the object references to not be found.
I've just release v2.2.16 to address this issue.
Here's what's new in v2.2.16
If you see any issues with these new features please let us know by filing new issues at our code repo. (or email me directly.)
NEWS
I've just released version 2.3.0 of our spin2 extension. This is the first cut of a new compiler-independent build system.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new in v2.2.17, v2.2.18, and v2.3.0
Plan a time when you want to move to this new build support. Leave yourself an hour or two so you can do this setup carefully. Once set up, this will be fun to use!
Help with migration to this new mechanism is found at Migrate to v2.3.0 checklist with additional info found at Build System Notes.
This is our first release of this new build system. Please be sensitive to things being different. My goal is to make building and downloading much more simple than it previously was. But, since it is the first release, If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming With this finally being released, we can now move to adding highlighting support for Spin2 V45, v46, and v47... language features.
NEWS
I've just released v2.3.1 followed by v2.3.2 of our spin2 extension. These fix the compiler detection code, in general, and additionally, path chasing on Windows.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new:
Help with migration to this new mechanism is found at Migrate to v2.3.0 checklist with additional info found at Build System Notes.
I'll add a section on "How to verify the compiler search by using the newly exposed log" to our "Build System Notes" shortly...
This is our first release of this new build system. Please be sensitive to things being different. My goal is to make building and downloading much more simple than it previously was. But, since it is the first release, If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming With this finally being released, we can now move to adding highlighting support for Spin2 V45, v46, and v47... language features.
NEWS
I've just released v2.3.4 of our spin2 extension.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new:
If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming: The new types created with structure support are not yet highlighted. This is up next along with v48, v49, v50, etc. support.
NEWS
I've just released v2.4.0 of our spin2 extension.
Well, normally, Users of VSCode get automatic updates, but I'm not able to publish this before my trip to Rocklin!
However, I've attached the .vsix file to the Release Page (See: Assets)so you can download it right away if you don't want to wait until next week.
Here's a recap of what's new:
If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming: I've got a small list of things i want to complete relative to this work... so there should be another point release with more pretty highlighting in the next two weeks or so. Of course, if you find issues between now and then I'll try to get to fixing them, too!
NEWS
I've just released v2.4.1 of our spin2 extension.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new:
If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming: Enable preprocessor highlight support found in v48. Of course, if you find issues between now and then I'll try to get to fixing them, too!
NEWS
I've just released v2.4.2 of our spin2 extension.
Users of VSCode get automatic updates, so you all have these updates already!
Here's a recap of what's new:
If you see any issues with these new features, please let us know by filing new issues at our code repo. (or email me directly.)
Upcoming: See follow-on work reported in Change Log. Of course, if you find issues between now and then, I'll try to get to fixing them, too!
Hi Stephen,
I working with MacOS 15 and installed pnut_ts.
I can use pnut_ts in the terminal and ist works.
I want to start the compiler in VSC, I install the spinExtension Version 2.4.2 and generate task.json from Doku: TASKS-User-macOS.md
When ist i type command/shift/B and compileTopP2 I get the Error: command 'spinExtension.getCompArguments' not found
Where can i define "getCompArguments" and what are the Arguments?
OK, great question! I somehow left older values in the tasks.json file content.
The value
spinExtension.getCompArguments
should bespinExtension.getCompilerArguments
.Make this change, and it should work much better for you.
I'm updating the repository doc's as I'm posting this!
Just gonna post it here instead of going through the issue templare rigmarole.
Opening the
mikogpu.spin2
file from my Tempest 2000 source port reliably crashes the LSP: https://github.com/Wuerfel21/tempest2k/blob/video-nextgen/src/mikogpu.spin2with this tasteful error message
Ah yes, line twenty-seven thousand, two hundred and ninety-six. That one.
(Maybe errors should be cought on some level to stop the entire server coming down from one malformed file)
Keep letting me know of these. It’s been code weaknesses that’s crashing. Insufficient defenses.
Every time i find a new class of these i wipe them all out.
I get a fix out hopefully tomorrow.
If i can find a means to not crash the server i’ll put it in place. No luck so far.
Thanks Stephen, VSC now find the pnut_ts and compiles my Projects.
But VSC do not find the PropPlugs and can't download the .bin files under MacOS 15.
Is there a build in P2-Loader or need I an external Programm?
I'm also noticing a bunch of inexplicable errors in this one: https://github.com/IRQsome/MisoYume/blob/master/padmap_parser.spin2
I think the parser is confused by the attribute on
parse_rule
Hi Stephen, I found 2 compiler Errors and some syntax highlighting Errors.
In SPIN V49 CON STRUCT declarations are now exported to parent objects.
The highlighter is confused with the exported structs.
References to structs in objects also confused the highlighter.
Here are a short Prog that shows the compiler Errors:
Thank you for reporting this! I'll get this fixed and also add this to our regression suite!
@wummi can you please show me the PUB/PRI signature for XYZ() (I'll test with the same that you are using.)
AUGH! Nevermind. The example you provided has what I was missing below the edge of the visible part of the window. I found it when I scrolled!
@wummi, both highlighter problems are fixed and will appear in the next release, hopefully, later today. (Found control structure problems in the colorizer)
@Wuerfel_21, that's a good example! You were correct in the parser being confused by the directive; it's fixed.
Also, I found an incomplete parser for local variables; it's fixed.
There was also some incomplete case-statement parsing (caused by multiple "..." strings on the same line), which has also been fixed.
These fixes will appear in the next release, hopefully, later today.
Ok. Yep, that was a good find. There is only one instance of this type of failure in the entire extension code base. I found and fixed it. Fix will appear in the next release, which I'm wrapping up now.
FWIW, you reported this in the way that best helps me find and fix these rapidly. That is, you provided the source that was causing the crash. When I rebuild the extension in a manner that facilitates debugging, I actually do get an excellent indication of exactly where in the source and which method call in the line of source is causing the failure. This means I can get a precise understanding of the cause and get an accurate fix in place. Thank you for reporting this the way you did!
Good morning Stephen,
I found more highlighter problems.
In your Programm flash_fs.spin2 in Line 308 ins one.
The Pin2 Extension on MacOS 15 don't find any PropPlug, so I can't download the binary's to the P2.
The PropPlugs are ok and SpinTools can find them and download can be done under MacOS 15.
What can I do to fix this, or is an external P2Loader necessary?
More highlighter problems in this code: