VSCode support for the Propeller languages: Spin2 and Pasm2 for the Parallax Inc. Propeller 2 P2 or P2X8C4M64P along with Spin and Pasm support for the Propeller 1 P1 or P8X32A.
The P2 and P1 communities thrive in the P2 Forums and the P1 Forums
The P2 Forum Thread containing discussion of this VSCode support
The P1 Forum Thread containing discussion of this VSCode support
This new release adds runtime detection of compilers and support for switching compilers for a given project.
Step-by-step, one-time, migration of your environment to v2.3.0 is covered in our Migrate Checklist page. Please visit this page to adjust your setup for this new version.
- Full language server based support for both P1 (spin/pasm) and P2 (spin2/pasm2) languages
- Parse detected errors are reported for each document when referenced/opened. If "Error Lens" extension is installed these errors are shown on the offending line of code.
- Show Hovers and Signature Help features for constants and methods within external objects now shows information from the external file in which they are defined
- Spin Code Folding support
- P2 Support:
- P2: 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
- P2: Show Hovers Feature Hovers show information about the symbol/object that's below the mouse cursor. In our case this is for both user written code and for Spin2 built-ins.
- P2: Signature Help Feature As you are typing a method name show signature help for both user written methods and for Spin2 built-in methods.
- P1 Support:
- P1: Syntax and Semantic Highlighting for both Spin and Pasm
- P1: Show Hovers Feature Hovers show information about the symbol/object that's below the mouse cursor. In our case this is for both user written code and for Spin built-ins.
- P1: Signature Help Feature As you are typing a method name show signature help for both user written methods and for Spin built-in methods.
- Object Public interface Documentation generation via keystroke [Ctrl+Alt+d] - Ctrl+Alt+( d )ocument.
- Document opens on right side of editor - Object Hierarchy Report generation via keystroke [Ctrl+Alt+r] - Ctrl+Alt+( r )eport.
- Report opens on right side of editor - Doc-Comment Generation for PUB and PRI methods via keystroke [Ctrl+Alt+c] - Ctrl+Alt+( c )omment.
- Comment is inserted immediately below the PUB or PRI line. - Editor Screen Coloring support per section à la Parallax Propeller Tool
- Custom tabbing Tab-stop support per section à la Parallax Propeller Tool
- Tab Sets You can choose between
Propeller Tool
,IronSheep
, andUser1
(adjust in settings to make your favorite set) - File navigation from Outline View
- File navigation from Object Hierarchy View
- Edit Mode support à la Parallax Propeller Tool [Insert, Overtype and Align]
- Provides rich companion themes for use with non-color backgrounds or with colored backgrounds as well as Syntax only theme (mostly used during semantic highlighting development.
- P1 Compile only, P2 Compile/Download Support built-in:
- Auto detection of installed compilers; supports FlexSpin, pnut_ts (and PNut when on Windows)
- Status Bar control for enable/disable of debug() compilation.
- Status Bar control of download to RAM or FLASH.
- Status Bar control over which PropPlug to use.
We are working on the next updates:
- Add ability to use external loaders/terminal for P1 & P2
- Improve Hover support (more doc details such as pasm code help)
These are not yet definate but I'm:
- Looking into customizable Spin code formatter with features like format on save.
- Spin2/Pasm2 code formatter/beautifier - allows us to have standard formatting for code we share! (source code could be formatted on each file save)
- Snippets for Spin2/Pasm2 (common code sequences which can be added easily to file being edited (e.g., smart pin setup code for given mode/use)
- Possible Extension Package for P2 (would include all P2 specific extensions)
In VSCode search for the "spin2" extension and install it. It's that easy! After installation you will be notified to download and install a new version as new versions are released.
Note: This extension fully 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, Document generation, etc. The older Spin extension can now be uninstalled with no loss of functionality.
There are additional companion documents in this Repository:
- Configuring User Tasks - Windows which advises on how to automate your P2 Development when using VScode on Windows
- Configuring User Tasks - MacOS which advises on how to automate your P2 Development when using VScode on macOS
- Configuring User Tasks - RPI which advises on how to automate your P2 Development when using VScode on Raspberry Pi
- Configure VSCode for background coloring by Spin Block how to set up coloring and some additional notes
- VSCode Extensions we find useful in our own P2 development
- Visual Examples - Tabbing a visual explaination of how our Tabbing feature works (For those of us, like me, who understand more easily when we see pictures.)
- Engineering Notes - Tabbing more detailed description of how our Tabbing feature works
- Spin2 Extension Details: Settings and Keyboard Mapping
- Additional details of new compiler support ToolChain REF
Also, here are a couple of really useful VSCode sources:
- VSCode can do that? Fun website showing specific things VSCode can do - review whats possible that may help you in your use of VSCode.
- YouTube Channel: Code 2020 - A large list of short videos presenting all manner of useful VSCode tips.
Please go look at each of these once so you can know what's here when you need them!
We know the three extension so far which might interfere with our Spin2 extension. Here's what we've seem:
- If I haven't already, I'll be submitting pull requests to the Overtype extension maintainers 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.
- 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.
This repository contains a single subproject which is the vscode extension:
- SPIN2/SPIN and PASM2/PASM syntax Highlighting and code navigation spin2 - Builds
If you like my work and/or this has helped you in some way then feel free to help me out for a couple of ☕'s or 🍕 slices or support my work by contributing at Patreon!
Ray [Cluso99] in our Propeller 2 Forums which started this effort for us.
Patrick (GitHub Entomy) for a spin1 extension which helped me get further along with this one.
Jay B. Harlow for contributing the initial elastic tabs feature.
George (GitHub DrMerfy) for the latest VSCode-Overtype extension which provided the foundation to which we could add the Align mode.
Licensed under the MIT License.
Follow these links for more information: