-
Notifications
You must be signed in to change notification settings - Fork 10
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
sublime text support? #44
Comments
Progress: I found #34 and ran these commands to install this language server: git clone https://github.com/japhib/pico8-ls
cd pico8-ls
npm install
cd server
npm run compile
echo -e '#!/usr/bin/env bash\n'"node $PWD/out/server.js" '"$@"' > ~/bin/pico8-ls # or any other folder in your $PATH
chmod +x ~/bin/pico8-ls I already have sublime's LSP installed, and it works for me with LSP-lua. I edited my LSP settings: (via "Preferences: LSP Settings" in the sublime command palette) {
"clients":
{
"pico8-lua": {
"enabled": true,
"command": ["pico8-ls","--stdio"],
"selector": "source.p8",
},
},
} (the This is where I'm stuck now; I can't figure out how to use the pico8 language server. The right-click context menu only lets me do The LSP log panel shows this, so the server appears to be running, I just can't figure out how to use it:
In LSP-lua, I can right click on a variable and choose |
You probably need to edit the Sublime Text portion of your config to match up with the features actually provided by the language server. Here's where the capabilities are defined on the server side: https://github.com/japhib/pico8-ls/blob/master/server/src/server.ts#L51-L67 In English, the features provided are:
Notably,
I never use Sublime Text myself and have zero experience setting up a plugin for it, so I'm sorry I can't be more help! However, if you're able to get this working, I'd be happy to add setup instructions to the repo. Or if you want to make a Sublime plugin repo, I could split out the current |
Oh, "View usages of symbol" is supported but "Rename" isn't? How strange, I would expect one would imply the other automatically. (But again, I know very little about LSPs and I'm sure it's complicated) Ah sorry, I don't particularly care about "Expand Selection". What I meant to communicate was that pico8-ls seemed to be initialized and running, but my editor didn't seem to be able to use any of its features. This video shows LSP-lua hover working, but pico8-ls hover not working: pico8-ls.mp4
pico8-ls sends that info to Sublime-LSP, right? why would I need to tell sublime that info as well? It seems redundant. (probably I don't understand something fundamental about LSP configuration..?) wait, I'm seeing some errors in the sublime console:
The error repeats itself 5 times. Maybe this has to do with the extra logging you were talking about? Or maybe not, maybe the "$/progress notification" pico8-ls sends is faulty somehow -- here's line 2001 and line 2215 is here (note, the line numbers don't actually match up with my local copy of LSP. I haven't changed anything, I must just be not up-to-date) I tried editing my LSP settings to get rid of --stdio, based on sublime-LSP documentation: "pico8-lua": {
"enabled": true,
"command": ["pico8-ls","--socket=1289"],
"tcp_port": 1289,
"selector": "source.p8",
"settings": {
"Lua.hover.enable": true,
},
}, but the errors remain. (the |
Hi, I was looking at this and the problem is in some prints that are made from the server to the standard output, that make the sublime LSP plugin fail. If those console.log are removed the server works with Sublime. I have made a pull request (#55), if anyone is interested. The modification is to use pico8-ls with .lua files, not with the .p8 format. |
Hi! I'm looking for a pico8 LSP for Sublime Text and I see this the README:
How difficult would it be to get this LSP running in Sublime, either on my own, or as an official feature of this repo? I don't know much about how LSPs work under the hood so I have no idea how big of a feature request this is. Any tips on how I would go about doing this?
The text was updated successfully, but these errors were encountered: