Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin dev ux improvements #992

Merged
merged 7 commits into from
Nov 10, 2024

Conversation

boatbomber
Copy link
Member

@boatbomber boatbomber commented Nov 9, 2024

It's pretty annoying to work on the plugin because the Luau LSP doesn't support nested project files (ie: plugin/...json) & the handy scripts for common actions are not uniform and undocumented. Also, the unit tests are flaky (at least on my machine) cuz it doesn't use WaitForChild on ReplicatedStorage descendants.

@boatbomber boatbomber added size: small type: tech debt Internal work that needs to happen skip changelog PRs that may skip the changelog enforcement check labels Nov 9, 2024
@boatbomber boatbomber requested a review from Dekkonot November 9, 2024 02:09
@boatbomber boatbomber self-assigned this Nov 9, 2024
@Dekkonot
Copy link
Member

Dekkonot commented Nov 9, 2024

considered naming the root-level project file more descriptively, like plugin.project.json, but Luau LSP only supports one project name that it searches for- if I set it to plugin.project.json, then every other project I work on will stop having LSP support

You can set a setting for only the local workspace in VSCode, assuming you use that. If you don't, then idk.

@boatbomber
Copy link
Member Author

boatbomber commented Nov 9, 2024

Oh yeah I could add a .vscode folder to the repo so everyone using vscode gets LSP support, totally forgot I could do that lol

Copy link
Member

@kennethloeffler kennethloeffler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're at it, could you do some stuff for me? 😅

I use Emacs with eglot-luau, and for project-specific configuration I need a file called .dir-locals.el. To match your VS Code settings here, I'd need a .dir-locals.el under the project root containing the following:

((nil . ((eglot-luau-rojo-project-path . "plugin.project.json")
         (eglot-luau-rojo-sourcemap-enabled . 't))))

Since I and my Emacs represent the vast minority of those that will ever interact with this project, I don't necessarily want this file tracked in source control, and would be totally fine with just adding .dir-locals.el to .gitignore; but, I'm not necessarily against it either...

@boatbomber
Copy link
Member Author

While you're at it, could you do some stuff for me? 😅

I use Emacs with eglot-luau, and for project-specific configuration I need a file called .dir-locals.el.

Added :)

@kennethloeffler
Copy link
Member

kennethloeffler commented Nov 10, 2024

It may be cumbersome to have to maintain two project files: one at plugin/default.project.json and plugin.project.json in the project root. It has me wondering if there's a way to cajole VS Code into starting the language server with a specific subdirectory as the CWD (Emacs can do this 🕶️)!

If not, then I'm okay with it for now, and if it requires additional support from the Luau Language Server, then we should see to contribute improvements there. We might also consider removing plugin/default.project.json and relying on the project at the project root instead, but we'll have to make sure that we change anything that relies on plugin/default.project.json.

I read the diff incorrectly, lol - we still only have one project file. The bit about cajoling VS Code to start the language server in a specific subdir still stands though

Copy link
Member

@kennethloeffler kennethloeffler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we just need to change the "Build Plugin" step in our GA release workflow to use the new project file, and this should be good to go:

- name: Build Plugin
run: rojo build plugin --output Rojo.rbxm

@kennethloeffler
Copy link
Member

So, somewhat annoyingly, we also have to modify the build script to have a plugin subfolder for the plugin project snapshot, otherwise rojo plugin install is broken.

@boatbomber boatbomber merged commit b7d3394 into rojo-rbx:master Nov 10, 2024
6 checks passed
@boatbomber boatbomber deleted the plugin-dev-ux-improvements branch November 10, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: small skip changelog PRs that may skip the changelog enforcement check type: tech debt Internal work that needs to happen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants