-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Neovim plugin instead of example configuration
- Loading branch information
1 parent
a532d87
commit 54044f5
Showing
4 changed files
with
36 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
au BufRead,BufNewFile PklProject,*.pkl,*.pcf set filetype=pkl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
local M = {} | ||
|
||
function M.setup(config) | ||
local lspConfigExists, configs = pcall(require, "lspconfig.configs") | ||
if not lspConfigExists then | ||
print("[pklls-nvim] 'lspconfig' not found") | ||
print("[pklls-nvim] Please install 'neovim/nvim-lspconfig'") | ||
return | ||
end | ||
configs.pklls = { | ||
default_config = { | ||
cmd = { | ||
"pkl-lsp-server", | ||
}, | ||
filetypes = { "pkl" }, | ||
root_dir = require("lspconfig/util").root_pattern(".git", "PklProject", ".pkl"), | ||
settings = {}, | ||
}, | ||
} | ||
local lspConfigExists, lspconfig = pcall(require, "lspconfig") | ||
if not lspConfigExists then | ||
print("[pklls-nvim] 'lspconfig' not found") | ||
print("[pklls-nvim] Please install 'neovim/nvim-lspconfig'") | ||
return | ||
end | ||
lspconfig.pklls.setup(config) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if vim.g.pklls_plugin_version then | ||
return | ||
end | ||
|
||
vim.g.pklls_plugin_version = '0.0.3' |