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(pack): add Pkl language support #749

Merged
merged 3 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions lua/astrocommunity/pack/pkl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Pkl Language Pack

This plugin pack does the following:

- Adds `pkl` Treesitter parser: <https://github.com/apple/tree-sitter-pkl>
- Adds `pkl` language plugin: <https://github.com/apple/pkl-neovim>
35 changes: 35 additions & 0 deletions lua/astrocommunity/pack/pkl/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
return {
"https://github.com/apple/pkl-neovim",
mehalter marked this conversation as resolved.
Show resolved Hide resolved
dependencies = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()

parser_config.pkl = {
install_info = {
url = "https://github.com/apple/tree-sitter-pkl",
files = { "src/parser.c", "src/scanner.c" },
branch = "main",
},
filetype = "pkl",
used_by = { "pcf" },
}

opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, "pkl")
end,
},
},
ft = "pkl",
init = function()
vim.filetype.add {
extension = {
pkl = "pkl",
pcf = "pkl",
},
filename = {
PklProject = "pkl",
},
}
end,
}
Loading