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

[Feature] add support for Sublime Text via LSP #200

Open
trench8891 opened this issue Dec 11, 2022 · 2 comments
Open

[Feature] add support for Sublime Text via LSP #200

trench8891 opened this issue Dec 11, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@trench8891
Copy link

Is your feature request related to a problem? Please describe.
As an avid user of Sublime Text it is my editor of choice when writing KOS scripts, so it would be nice to be able to use it with the language server as well.

Describe the solution you'd like
A provided example of how to configure the Sublime Text Language Server Protocol (LSP) package to use the language server.

Describe alternatives you've considered
I've tried implementing it myself (and will continue to do so), but I have no previous experience with language servers and am mostly groping in the dark.

Additional context
Ultimately my intention is to have a tool that I can use to quickly identify problems with KOS scripts without having to try to run them in-game. This language server seems to be the closest starting point but I'm not familiar enough yet with language servers to close the gap. I figure a good first step will be to be able to use it at all with an editor.

@trench8891 trench8891 added the enhancement New feature or request label Dec 11, 2022
@trench8891
Copy link
Author

I was able to get it working with the following LSP.sublime-settings contents:

{
  "clients": {
    "kos": {
      "enabled": true,
      "command": [
        "kls",
        "--stdio"
      ],
      "selector": "source.kos",
      "env": {
        "PATH": "/Users/<username>/.nvm/versions/node/v12.18.2/bin"
      }
    }
  }
}

The selector part works thanks to the kOS syntax highlighting for Sublime Text 3, and without using that some other homespun file scoping would be required.

Also the subprocess needs to have a PATH (or Path for Windows, probably) environment variable to include the node (and coincidentally kls) executables.

Also although I've got sublime making use of the server, I'm getting a lot of unexpected errors. My guess is although I've got a ksconfig.json file in my project, it's not placed in a way that the server finds and uses it, so I need to do some experimenting with that.

@trench8891
Copy link
Author

Unfortunately no amount of experimentation on my part has yielded any result that looks like the server is actually finding/reading/respecting the ksconfig.json file, despite the fact that it looks like it certainly should. My best guess is that it's somehow similar to #167, even though the observed behavior there is somewhat different than in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants