Shop OBEX P1 Docs P2 Docs Learn Events
Visual Studio Code supports P1 development on Windows, Mac, Linux (yes, RPi) — Parallax Forums

Visual Studio Code supports P1 development on Windows, Mac, Linux (yes, RPi)

Stephen MoracoStephen Moraco Posts: 316
edited 2023-02-15 21:40 in Propeller 1

NEWS

Version v1.8.6 is the current release version but as of earlier version v1.7.0, this extension fully supports P1 as well as P2 spin/pasm development.

Features:

  • Full support for both P1 (spin/pasm) and P2 (spin2/pasm2) languages
  • Syntax and Semantic Highlighting for both Spin and Pasm
  • Syntax and Semantic Highlighting for both Spin2 and Pasm2 including all Streamer and Smart-pin Symbols as well as all debug() statements with parameter validation for all display types
  • Custom tabbing Tab-stop support per section à la Parallax Propeller Tool
  • Tab Sets You can choose between Propeller Tool, IronSheep, and User1 (adjust in settings to make your favorite set)
  • File navigation from Outline View
  • Edit Mode support à la Parallax Propeller Tool [Insert, Overtype and Align]
  • Works with your favorite VSCode themes
  • Offers companion Theme (Two themes: Syntax+Semantic, and Syntax only - mostly used during semantic highlighting development)

Known Issues:

We haven't yet learned how to control the ending position of the edit cursor. So in many cases when using selection not an insert point the cursor may end up not being where you might expect it to be after pressing TAB or Shift+TAB. We are looking into how to solve this. Even tho' this problem exists the formatting ability this new service provides is well worth this minor headache. We will keep looking for a means to get this under control.

Possible Conflicts with other VSCode Extensions

Note1: This extension now replaces the Spin by Entomy vscode extension. While either can be used, our version provides more comprehensive Syntax highlighting (as the former has not been maintained) and this extension adds full Semantic Highlighting, Outlining, and Tab support with InsertModes. The older Spin extension can now be uninstalled with no loss of functionality.

Note2: I'll be submitting pull requests to the Overtype extension maintainer to add code for avoiding interference with our .spin/.spin2 InsertMode feature but in the meantime please ensure that the Overtype by Adma Maras and/or Overtype by DrMerfy extensions are disabled or uninstalled as they can interfere with our extensions' behavior.

What are we doing?

The tabbing support is disabled at the first installation.
In order to use it you must enable it, and restart VSCode. Then it will be present when editing any, spin, .pasm, .spin2, or .pasm2 files.

Please let us know of any behavior you are not sure is correct or behavior that just doesn't feel right. Your feedback based on what you are experiencing will help us ensure this is working the way we all would like it to.

Tab Implementation intent: Implementation Tabbing Notes

New Insert Mode operation: Insert Modes for Spin and Spin2

When you find things (or wish for new behaviors) let me know here: Repo Issues Page

About this extension

You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), and type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

What's next? on the horizon: (1) Finishing certification of this Spin VSCode extension for our P1 against all of the P1 Obex, and (2) fixing things seen in a couple of Spin2 code sets that are not being highlighted correctly.

Enjoy!

Stephen

Comments

  • Stephen MoracoStephen Moraco Posts: 316
    edited 2023-02-15 21:56

    I use this environment for all of my P2 work. It's way too useful as an editing/IDE so we activated the P1 support nearly as robustly as the P2 support. (I say nearly as the are many more P1 files in the P1 Obex so I've many more files to verify, yet.)

    While the following is set up for P2 development using Flexspin, this is an excellent pattern for running your own favorite native compilers.

    VSCode Build/download/flash UPDATEs:
    With this change we have:

    • Moved to a central user-tasks definition for all P2 tasks
    • Merged FlexProp and PNut task lists into one
    • Included Program Flash tasks
    • Adjusted terminal window use: Compile and Download/Flash now share the same terminal window
    • Recorded Path to FlexSpin as Environment Variable(Windows only) so tasks can find the flash support binary
    • Moved the tasks: Compile tasks are in Tasks: run build task while download/flash are in Tasks: run test task

    The new Spin2 VSCode Extension TASKS-User.md page describes the full setup steps for Windows, macOS, and RaspiOS (Linux variants)

    You may know that I run VSCode from my macOS desktop and use it to remote into my Raspberry Pi's. In this environment, this change really helped as these new user tasks and key bindings are automatically copied to the remote machine every time I connect keeping them up-to-date from my central copy. Very nice!

    While I don't remote into my windows machine I do use the VSCode Settings Sync extension on all my machines with VSCode installed. With this enabled when I move to my Windows Laptop it too has now received my central copy of the user tasks and key bindings.

    Here's a summary of the build environments I run with and have tested:

    • P2 hardware USB attached to Mac, FlexProp installed, VSCode to edit, compile, and download/flash
    • P2 hardware USB attached to Raspberry Pi (or other Linux), FlexProp installed, VSCode to edit compile, and download/flash
    • P2 hardware USB attached to Raspberry Pi (or other Linux), FlexProp installed, remote into RPi via SSH with VSCode, compile and download/flash
    • P2 hardware USB attached to Windows Machine, FlexProp and PNut installed, VSCode to edit compile, and download/flash

    We'll shortly be making updates to the quickbytes page to reflect this change in setup.

    @dgately thanks for suggesting that we could be doing things in a more central fashion. That prompted me to get this tested and documented. @VBBSim thanks for testing out the flash mechanisms.

    Future changes I'm contemplating: (1) adding a setting to our extension allowing one to change a PNut debug-enabled setting which would be used when building with PNut, and (2) moving to a Task Provider built into our extension which would recognize the tools installed and the OS and then provide only the tasks appropriate for the OS with the tools installed.

    Enjoy!

    -Stephen

  • NEWS

    I've just released v1.9.0 of our spin2 extension, which fully supports both P1 and P2.

    I haven't been announcing each of the past updates. Here is the latest:

    v1.9.0
    Minor Semantic updates for P1 and P2 along with new Documentation feature

    • Add documentation generation via keystroke [Ctrl+Alt+d], doc opens on the right side
    • Fix highlight of object constant references in case statement selectors P1 and P2 (#17)
    • Flag "else if" in spin code as illegal / won't compile - P1 and P2 (#18)

    What are we doing?

    In this update, (1) I reorganized the titles of commands provided by this extension to that you can filter on "spin2" to see the full list of all the commands:

    ... and (2) I've added a new generate Object Interface Document command [Ctrl+Alt+d] (Control+Alt+(d)ocument) which opens the generated file to the right of the spin2 or spin file that you are editing:

    If you see any issues with these new features please let us know by filing new issues at our code repo.

    Possible Conflicts with other VSCode Extensions

    Note: This extension replaces the Spin by Entomy vscode extension. While either can be used, our version provides more comprehensive Syntax highlighting (as the former has not been maintained) and this extension adds full Semantic Highlighting, Outlining, and Tab support with InsertModes. The older Spin extension can now be uninstalled with no loss of functionality.

    About this extension

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), and type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    There are also two new platform-specific tasks installation pages:

    For any others refer to the all platform User tasks

    What's next? on the horizon (yes, I'm still working on these...): (1) Finishing certification of this Spin VSCode extension for our P1 against all of the P1 Obex, and (2) fixing things seen in a couple of Spin2 code sets that are not being highlighted correctly. However, the very next item I'm working on is rewriting the semantic highlighting to use a Language Server Process behind the scenes which will allow us to awaken many more features we need.

    Enjoy!

    Stephen

  • NEWS

    I've just released v1.9.8 of our spin2 extension, which fully supports both P1 and P2.

    I haven't been announcing each of the past updates. Here is the latest:

    v1.9.7/1.9.8
    Add Signature Help P1 & P2, Awaken Hover support and Documentation Generation features for P1!
    This release brings our P1 support into feature parity with the P2 feature set and also includes minor fixes for the P2 side of things.

    • P1: When typing user and built-in method calls Signature Help will describe parameters needed, with meaning, as they are typed
    • P1: Now supports hovering over User variables, constants, methods, pasm labels, and objects to display pop-up information about the item including comments within the code for the item
    • P1: Now supports hover for Built-in Spin methods, variables, and constants to display pop-up documentation about the built-in item
    • P1: Adds new Doc-Comment Generation for PUB and PRI methods via keystroke [Ctrl+Alt+c] - Ctrl+Alt+( c )moment.
      -- Comment is inserted immediately below the PUB or PRI line.

    • P1: Adds new Object Public interface documentation generation via keystroke [Ctrl+Alt+d] - Ctrl+Alt+( d )ocument. Doc opens on the right side of the editor window

    • P1 and P2: when user methods don't have parameter documentation the signature help now works and it reminds us how to generate the missing documentation.
    • P2 Hover information is now shown for debug display window names.
    • P2 Improve hover pop-up content for SEND(), RECV() method pointers

    What are we doing?

    This is the next of a number of releases. This release introduces the "Signature Help" support for P1 and P2.

    Here's an introduction video (12:30) demonstrating the new Hover features and the PUB/PRI doc generation:

    Here's an introduction video (6:20) demonstrating the new Signature Help features along with updates to the PUB/PRI doc generation:

    If you see any issues with these new features please let us know by filing new issues at our code repo.

    Possible Conflicts with other VSCode Extensions

    Note: This extension replaces the Spin by Entomy vscode extension. While either can be used, our version provides more comprehensive Syntax highlighting (as the former has not been maintained) and this extension adds full Semantic Highlighting, Outlining, and Tab support with InsertModes. The older Spin extension can now be uninstalled with no loss of functionality.

    The Extension Document This v0.8.2 currently also occasionally intercepts the Ctrl+Alt+D keystroke which we use to generate documentation and our extension then doesn't get the request. I've filed an issue with that extensions' maintainer so maybe this will be fixed in the future. Meanwhile, you can either disable the Document This extension, or when you see the warning pop up from the document this extension you can usually just click in your editor window again and then press Ctrl+Alt+d again and it will work after one or more tries.

    About this extension

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), and type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    There are also two new platform-specific tasks installation pages:

    For any others refer to the all platform User tasks

    What's next? on the horizon (yes, I'm still working on these...): (1) Finishing certification of this Spin VSCode extension for our P1 against all of the P1 Obex, and (2) fixing things seen in a couple of Spin2 code sets that are not being highlighted correctly. However, the very next items I'm working on are a number of small releases (this being the first) followed by adding a new Spin/Spin2 Language Server Process behind the scenes which will allow us to awaken many more features we need.

    Enjoy!

    Stephen

  • NEWS

    After many months of thinking this couldn't be done in VSCode, I found an extension that demonstrated how it could be. So after a bit of work... ;-)

    I've just released v1.9.12 of our spin2 extension, which fully supports both P1 and P2.

    v1.9.12
    **Feature Updates (P1 and P2) **

    • P1 & P2: Adds editor background coloring per section à la Parallax Propeller Tool (disabled by default, enable in settings, requires the use of the new background color-supporting themes)
    • Adds two new color themes which are better suited to colorized backgrounds
    • Adds new Light theme for non-colored background use which compliments the Dark theme already present

    What are we doing?

    This is the next of a number of releases. This release introduces the "Spin/Spin2 Code Block Coloring" support for P1 and P2.

    For help with enabling this new feature see Spin2/Pasm2 Editor Background Coloring for VSCode

    If you see any issues with these new features please let us know by filing new issues at our code repo.

    Possible Conflicts with other VSCode Extensions

    Note: This extension replaces the Spin by Entomy vscode extension. While either can be used, our version provides more comprehensive Syntax highlighting (as the former has not been maintained) and this extension adds full Semantic Highlighting, Outlining, and Tab support with InsertModes. The older Spin extension can now be uninstalled with no loss of functionality.

    The Extension Document This v0.8.2 currently also occasionally intercepts the Ctrl+Alt+D keystroke which we use to generate documentation and our extension then doesn't get the request. I've filed an issue with that extensions' maintainer so maybe this will be fixed in the future. Meanwhile, you can either disable the "Document This" extension or when you see the warning pop up from the document this extension you can usually just click in your editor window again and then press Ctrl+Alt+d again and it will work after one or more tries.

    About this extension

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), and type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    There are also three platform-specific tasks installation pages:

    What's next? on the horizon (yes, I'm still working on these...): (1) Finishing certification of this Spin VSCode extension for our P1 against all of the P1 Obex, and (2) fixing things seen in a couple of Spin2 code sets that are not being highlighted correctly. However, the very next items I'm working on are a number of small releases (this being one of a couple) followed by adding a new Spin/Spin2 Language Server Process behind the scenes which will allow us to awaken many more features we need.

    Enjoy!

    Stephen

  • NEWS

    It's time to quickly evaluate the feature parity version of the new Language-Server-based VSCode Extension for P1 and P2 so I can get it released for all of us to use.

    I'm looking for a few volunteers who would want to evaluate the new extension against their code. The key here is that the code must compile with PNut or Propeller Tool. For this effort, I'm NOT looking into FlexSpin compatibility with this initial testing.

    My immediate focus is to ensure that there are no regressions relative to the way the current v1.9.16 Spin2 extension is working.
    I believe the parser is more robust as I've been reviewing all my regression test code, and it's looking quite good.

    Here's my ask:

    • You email me indicating interest and that you have time early this week to do this.
    • I'll reply with a .zip of the new extension and a link to a page with instructions (Today, Mon. or Tue.)
    • You follow the instructions to get your VSCode running the new Spin2 extension instead of the old one. (You can quickly revert this if you find a reason to.)
    • You visit many of your source files to see if they are not parsing correctly.
    • For each one that isn't, you send an email to me indicating what's not working, and I get it fixed before the live release

    Sound like you want to help? You can email me volunteering at stephen@ironsheep.biz

  • NEWS

    Finally, After more than a month of work...

    I've just released v2.1.0 of our spin2 extension. This is the first Language-server-based version of the extension.

    v2.1.0
    **Feature Updates for both P1 and P2 **

    • Files included by the current file are parsed, and references to the included objects are validated
    • Documentation from the included object files is shown for Hover Text and Signature help
    • Live parsing on file change, allowing changes in one editor window to affect another editor window (e.g., You have a top-level spin file open and an object spin file open in 2nd window. Changes in the object file can immediately affect the top-level file.)
    • Display of errors found during parse are listed for each file parsed (and with Error Lens, errors show on affected line)
    • When a file is parsed, and errors are found, the file entry in the left panel file browser turns light red to highlight that the file contains errors
    • Many improvements in parsing / highlighting for both P1 and P2
    • Our new parse error reporting makes it easier to port P1 code to our P2. Simply copy the P1 file and adjust the suffix to .spin2. At this point, all non-supported P1 code is highlighted, and errors are shown describing the issues found.

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

    This represents a whole lot of change. Please be sensitive to things being different. My goal in this extension is to do our best to parse the language implemented by PNut and Propeller Tool. If any warnings are not correct relative to what these two tools do, please let me know, and I'll work to quickly get the issue fixed!

    Possible Conflicts with other VSCode Extensions

    Note: This extension replaces the Spin by Entomy vscode extension. While either can be used, our version provides more comprehensive Syntax highlighting (as the former has not been maintained) and this extension adds full Semantic Highlighting, Outlining, and Tab support with InsertModes. The older Spin extension can now be uninstalled with no loss of functionality.

    The Extension Document This v0.8.2 currently also occasionally intercepts the Ctrl+Alt+D keystroke, which we use to generate documentation and our extension then doesn't get the request. I've filed an issue with that extensions' maintainer so maybe this will be fixed in the future. Meanwhile, you can either disable the "Document This" extension or when you see the warning pop up from the Document This extension, you can usually just click in your editor window again and then press Ctrl+Alt+d again and it will work after one or more tries.

    About this extension

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode from within the VSCode Extensions panel, search for Spin2, install it, and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and, for some reason, it did not update for you automatically, in VSCode, go to your extensions view (SHIFT+CMD+X), and type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    There are also three platform-specific tasks installation pages:

    What's next? Taking a short break, this was a lot of focused work... but then starting to add the features now enabled by our being Langauge Server based!

    Enjoy!

    Stephen

Sign In or Register to comment.