The VSCode extension is written in TypeScript with C# being used for the language server and debug proxy.
Uses the Papyrus Debug Adapter xSE plugin for live debugging.
Also uses this fork of Pyro for PPJ builds.
Do you have questions or need help? Please come visit the....
Papyrus Language Tools Discord
Even if you don't plan to contribute code, it would be good to hear how you are using the extension and get your feedback.
First, you will need Windows with the following installed on your system:
- VSCode Download and install
- Node.js Download and install
- Git for Windows Download and install
- One of the following:
- Minimum: .NET Core 2.1 SDK Download and install
- Recommended: Microsoft Visual Studio 2019 Download and install
Also, building from the shell will be much easier if you use a Powershell (powershell.exe) console because the main build script is written in PS, but if you have Visual Studio installed you should be able to build from the solution file.
First, Fork the joelday/papyrus-lang
repo on github. Then clone it:
git clone https://github.com/<yourusername>/papyrus-lang.git
cd papyrus-lang
Create a branch for your new development:
git checkout -b mynewfeature
Set your upstream remote to help you pull changes from main when needed:
git remote add upstream https://github.com/joelday/papyrus-lang.git
Make sure your script execution policy allows running unsigned scripts as long as they're already on disk and not executed from the internet:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Get-ExecutionPolicy -List
Run the build script with default targets:
.\build.ps1
In the same directory, run this to update the bundled third-party packages (which are provided by separate repos):
.\build.ps1 -Script build.cake -Target update-debug-plugin
.\build.ps1 -Script build.cake -Target update-pyro-cli
Run VSCode to open the papyrus-lang directory as a folder. If this is still your current directory then just run:
code .
Hit Ctrl-Shift-D to open the Debug panel. At the top select Launch (Build Extension Only).
Hit F5 to build and launch the extension with debugging. After a little while you will see another VSCode window open. This is the Extension Development Host version of VSCode running the extension that was just built. Any changes you made to the code would be reflected in the debug/test install of the extension running in this window.
It is not required that you squash your commits before submitting a pull request, so just commit and push your changes to your fork, then submit the pull request for your branch. Please merge from upstream/master
to your branch before submitting the pull request though to make sure your changes will merge.
git merge upstream/master
This is a brief set of links to more info on modules and patterns used in the code.
- decoration-ioc is why
InstantiationService
is used to instantiate services and command handlers based on the Service Locator design pattern. It makes it easy to add references to services in the constructor of a class. For example just put@IExtensionConfigProvider infoProvider: IExtensionConfigProvider
in the argument list of a constructor and it will magically get called with a reference. - For a simple example of how to add a command, see
src\papyrus-lang-vscode\src\features\commands\ViewAssemblyCommand.ts
- rxjs is used in many places for the reactive Observer/Observable asynchronous pattern.
- async/await is used frequently. If possible try to use async functions and
await
on them because this allows other things to happen while a function is blocked on IO etc. - deepmerge is used in some places.
- Otherwise most of the code is similar to other vscode extensions.
- See the Project Wiki
- The Typescript Programming Language Documentation
- VSCode Extension Anatomy
- VSCode Extension Samples are useful for learning specific APIs
- Learn RxJS (Reactive eXtensions for Javascript)
- JavaScript Promises
- The Pro Git book
- The Contributing wiki page