rojo-rbx / vscode-rojo

Visual Studio Code plugin for Rojo
https://marketplace.visualstudio.com/items?itemName=evaera.vscode-rojo
Mozilla Public License 2.0
35 stars 23 forks source link

Add ability to choose project file to serve #41

Closed JohnnyMorganz closed 3 years ago

JohnnyMorganz commented 3 years ago

This PR implements the ability to choose the project file to use to serve a Rojo project.

When the user runs the one off command, they will be prompted if they would like to set this as the default project file to use when serving Rojo. This can either be set on the workspace, or set globally.

The Status icon on the bottom bar is also updated to also show the project file being used to serve, to let the user know what is being served. It will be formatted as Rojo vXXX [filename.project.json]

A one off command for building is also implemented: Rojo: Build place/model file using project file...

Closes #33

I did not add in the preconfigured priority check list as I felt the above commands would cover it, however I am happy to also add that in if you feel it is useful.

One thing: should the configuration project file path for serving and building be separated? Currently they are both linked to the same path, however it may be more useful to separate it (e.g. default.project.json for serving, build.project.json for building). Also happy to do this if people agree

evaera commented 3 years ago

Thank you for the PR! I changed how it works slightly. Instead of adding separate commands to pick a specific file, we just assume the user wants to pick every time, and we add a new command that reuses the last picked file (this is the command that the Start Rojo button uses.)

Also added a few improvements for handling workspaces with multiple root folders. Previously, the user had to jump through two quick pick menus, now it collapses down into one and displays the workspace in the status bar.

Additionally, there is now a "Choose a different project file" button on the serve success message to allow users who clicked the button an easy way to pick a different file.

I decided to force the user to pick a project file, even if there is only one to pick from, to signal to the user that it's possible to pick a different file if they create one.