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

feat: Pkl language server #3440

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lua/lspconfig/configs/pkl_lsp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local util = require 'lspconfig.util'

return {
default_config = {
cmd = { 'java', '-jar', 'path/to/pkl-lsp.jar' },
Copy link
Member

Choose a reason for hiding this comment

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

what is path/to/...

Copy link
Author

Choose a reason for hiding this comment

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

The path depends on the user, the path here is just a placeholder.

Updated to match how similarly-configured LSPs are set up.

Copy link
Member

Choose a reason for hiding this comment

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

what's the point of this config if it requires the user to manually configure the path?

Copy link
Author

Choose a reason for hiding this comment

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

I looked at a couple other java-based LSPs for inspiration (nextflow_ls, groovyls if you're curious).

I'm happy to remove cmd from default_config, especially since the doc covers it. Let me know what you think fits best :)

filetypes = { 'pkl' },
root_dir = util.root_pattern('.git'),
single_file_support = true,
},
docs = {
description = [[
https://github.com/apple/pkl-lsp.git

Retrieve or build the `pkl-lsp` jar from the Git repo. You can then configure `pkl-lsp` like so:

```lua
require('lspconfig').pkl_lsp.setup{
cmd = { 'java', '-jar', 'path/to/pkl-lsp.jar' },
}
```
]],
},
}
Loading