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

VS Code Addon manager #76

Merged
merged 46 commits into from
Feb 17, 2023
Merged

VS Code Addon manager #76

merged 46 commits into from
Feb 17, 2023

Conversation

carsakiller
Copy link
Collaborator

Adds an addon manager to VS Code that allows users to install addons from LLS-Addons.

Requires Git to be installed.

Also, crash a little nicer on startup if Git is not installed

@carsakiller add wiki entry for new setting
@carsakiller
Copy link
Collaborator Author

GIF showing usage:
addonManager

@carsakiller carsakiller marked this pull request as ready for review February 17, 2023 03:55
@carsakiller carsakiller requested a review from sumneko February 17, 2023 03:55
@carsakiller
Copy link
Collaborator Author

carsakiller commented Feb 17, 2023

Okay, I think the addon manager is good to go! I think there are just some smaller tasks to make sure everyone knows what is going on. Not sure if you want to wait for these to be done before releasing, up to you. I have written a little announcement post for when the addon manager goes live. It just briefly explains what it is and sort of how it works. This leaves a few things to address:

  • Remove built-in libraries?

    • Announce removal of built-in libraries
    • Update wiki to deprecate built-in libraries (I have it nearly complete)
  • Add wiki page that explains “Addons”

    • Explain addon manager
    • Explain LLS-Addons
    • Explain LuaCATS organization
  • Document new setting

@sumneko sumneko merged commit 5699d31 into LuaLS:master Feb 17, 2023
@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

Unfortunately, I can't get it work

@carsakiller
Copy link
Collaborator Author

🥴 yikes. I built, packaged it, and tested it on a completely fresh VM and things worked smoothly. Does it work at all? Highly possible I screwed up the setting for enabling it (by default)😆.

If you can provide the log file, I can check it out in the morning ☕
image

@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

image

It is a empty page and no output

sumneko added a commit that referenced this pull request Feb 17, 2023
@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

I found I didn't update the submodule webvue.
However I don't know how to compile it.

@carsakiller
Copy link
Collaborator Author

Ah, are you not using the packaged vsix?

@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

Ah, are you not using the packaged vsix?

No, I'm using installExtensionFromLocation

Could you please provide a simple way to compile?
The client just need npm install && tsc before.

@carsakiller
Copy link
Collaborator Author

Hm, that should work then. The actions should have compiled the TS and built webvue.

You will want to run tsc in client/. Then cd to client/webvue and run npm run build. Then you'll have to repackage vscode-lua.

Alternatively you can run it in debug mode but it doesn't look accurate (especially the colours):

  1. tsc --watch in client/
  2. npm run dev in client/webvue
  3. F5 to open extension debug host

@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

OK, it works!

@carsakiller
Copy link
Collaborator Author

Nice! But why wasn't it built before 🤔

@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

Because I runed tsc instead of npm run build before...

@carsakiller
Copy link
Collaborator Author

But you installed the vsix that you downloaded from the GH action, right? It should be compiled and built already then

@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

But you installed the vsix that you downloaded from the GH action, right? It should be compiled and built already then

No, I always use the project it self.
Command installExtensionFromLocation can install vscode-lua from your local directory.

@carsakiller
Copy link
Collaborator Author

Ahhh, okay. I was confused because I thought you were using "Install from VSIX" to install the GH action artifact 🥴. A bit more detail can be found in the webvue repo. Glad it is working then!

@sumneko
Copy link
Collaborator

sumneko commented Feb 17, 2023

Maybe we need a script to compile client, including update submodules, install npm, tsc and run build.

@carsakiller
Copy link
Collaborator Author

We could use npm so we could say npm run all or something and it can run git submodule update && npm i && tsc && npm run build

@carsakiller carsakiller deleted the addon-manager branch February 17, 2023 16:03
carsakiller added a commit that referenced this pull request Feb 17, 2023
Edited VS Code build task to use new client build script
@carsakiller
Copy link
Collaborator Author

carsakiller commented Feb 19, 2023

@sumneko, what will be the new version number that has the addon manager and removes the built-in libraries? I am writing an announcement for the removal of the built-in libraries, but need to know which version it will be included in.

I can open a PR that deletes the built-ins if you would like. (I suppose the logic for ${3rd} can go as well, though, so maybe I will leave that to you)

@carsakiller
Copy link
Collaborator Author

carsakiller commented Feb 19, 2023

Also, I have somehow managed to activate discussions in vscode-lua, despite not having permission to disable it....

I think we should keep discussions to just lua-language-server actually, maybe it would be good to have addon manager issues not clutter up the client-independent language server. Now that everything is in the organization, we can super easily transfer issues and discussions, so we can organize them way better. Now issues can be in the same repo that the issue originates from. Issues for the addon manager can also live in vscode-lua

@carsakiller
Copy link
Collaborator Author

Hey @sumneko!

Here is what I have for the announcement for the removal of the built-in libraries (to be posted ASAP):

Announcement

Hello 👋

With the VS Code addon manager releasing very soon, we have decided to remove the built-in libraries that ship with the language server in the same release.

This means the ${3rd} shortcut for workspace.library will no longer work.

Note
Older versions of the server that still contain the built-in libraries will continue to function as-is.

Why?

The addon manager for VS Code is releasing at the same time as this change, meaning everyone using the VS Code extension will still be able to install definition files super easily.

Removing the built-in libraries helps prevent duplicates for those using VS Code and can help cut down on bloat for everyone. It is unlikely that everyone is interested in all the built-in libraries, so many of them end up not being used.

What is the New Method?

Libraries are now addons. The name “libraries” is a little misleading, as they are actually just definitions (and maybe a plugin).

Those using VS Code can use the addon manager to install addons that contain all the definition files that were included in the language server, and more!

Those using other clients can still download all the libraries that were included in the server from the LuaCATS organization. They can then be dropped into a folder and linked to with workspace.userThirdParty for functionality similar to how the built-ins have previously worked, or manually linked using workspace.library.

Contribute

Collaboration on definition files is now better than ever.

Do you have definition files for a library? Now is the time to contribute them! If you would like it to show up in the addon manager, you can add it to LLS-Addons.

Do you have definition files that you can no longer maintain? If you transfer ownership to me (@carsakiller), I can transfer the project to LuaCATS, where the community can work together to keep the definitions up-to-date.


And for the addon manager (to be posted at release of VS Code extension):

Announcement

New in version X.XX of the VS Code extension is the addon manager! 🎉

It can be opened using Ctrl + P to open the command palette and searching for the Open Addon Manager command.

Summary

The addon manager allows you to enable, disable, and uninstall addons for the language server. This means you can now easily install definitions for libraries and automatically apply settings to better emulate an environment.

Warning
While each addon added to LLS-Addons will be reviewed, it is possible for an addon to modify any VS Code setting using its config.json. This offers great freedom but is also potentially abusable. Pressing the GitHub button will open the addon, allowing you to review it yourself if you'd like to double-check 🕵️‍♂️

Addon manager usage example

Contributing Addons

The addon manager pulls from the LLS-Addons repository and currently contains many of the definitions from the language server. If you would like to contribute an addon, head over to the LLS-Addons README to learn more. They are very similar to the environment emulations that have been in use for a while, but add a little more configuration and are missing plugin support.

WebVue UI

The addon manager is a webview (basically an iframe) that allows us to display a custom webpage within VS Code. You can check out the code for the webview UI in the vscode-lua-webvue repository. It uses Vue.js and some VS Code components and styling to try to make it feel as at-home as possible.

Feedback

The addon manager has been a while in the making, so I'm excited to finally merge it in. If you have any feedback, please leave it in the VS Code extension repository ❤️.

I also have some wiki changes ready to go that deprecate the built-in libraries and explain addons (which replace the “environment emulations”)

If you know the version that these changes will take place in, I can add it to the announcements.

@sumneko
Copy link
Collaborator

sumneko commented Feb 26, 2023

I can't guarantee the release cycle of the version, so I think it can be declared that it is removed in a medium version update after half a year.

@carsakiller
Copy link
Collaborator Author

Okay, makes sense. Do you know which version the addon manager would be released in?

@sumneko
Copy link
Collaborator

sumneko commented Feb 26, 2023

It is not a break change for user, so I can publish a small version for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon manager Related to the addon manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants