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

Added support to Sublime Text with .lua files #55

Closed
wants to merge 3 commits into from

Conversation

valba8
Copy link

@valba8 valba8 commented Feb 29, 2024

This version allows to use pico8-ls with sublime text to edit .lua files. The only problem with the original code was some console prints, unexpected by the sublime LSP plugin.

@valba8 valba8 mentioned this pull request Feb 29, 2024
{
"pico8-lua": {
"enabled": true,
"command": ["pico8-ls","--stdio"],
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of making a new executable file like above, wouldn't it be simpler to have this command point to the right place?

Does Sublime Text not have any way to install a plugin? are all language servers this janky to install?

Copy link
Author

Choose a reason for hiding this comment

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

Hi,

in sublime text there is a plugin called LSP that manages the lsp servers. In the docs appears:

A subprocess is always started. There is no support for connecting to a remote language server.

You can use tcp instead stdio to communicate with the server, but I don't know if that would be a better solution.

Copy link
Owner

Choose a reason for hiding this comment

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

I'm sure you didn't mean to just completely delete this file ...

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, this was a mistake, I reverted the commit.

@@ -15,6 +15,7 @@
"author": "JanPaul Bergeson",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.12",
Copy link
Owner

Choose a reason for hiding this comment

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

?

Copy link
Author

@valba8 valba8 Mar 8, 2024

Choose a reason for hiding this comment

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

The problem is that if you try to compile the ts scripts with npm run compile, you get a lot of errors related with the tests:

src/parser/test/formatter.test.ts:633:5 - error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.

633     it('preserves comments after statements', () => {

this is why I added the dependency, so I could compile and continue with the process. Maybe there is some alternative to compile without the tests? but I think that it would be required to touch the package.json anyway.

@japhib
Copy link
Owner

japhib commented Mar 1, 2024

Thanks for the contribution! I've looked through the changes and made a few comments that I'd like to see addressed before merging this.

@japhib
Copy link
Owner

japhib commented Jul 12, 2024

Closing this as it's been a long time since the last update. It can still serve as a good starting point for anyone else who might want to add better docs for Sublime support. See my comments on this PR as to what still needs to be done/discussed. Also, i'm happy to re-open if the original author wants to continue working on this branch.

@japhib japhib closed this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants