mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 04:21:08 +00:00
Merge a48296c91e into 459a4c3b10
This commit is contained in:
commit
b060be37d0
1 changed files with 72 additions and 0 deletions
72
lua/lazyvim/plugins/extras/lang/luau.lua
Normal file
72
lua/lazyvim/plugins/extras/lang/luau.lua
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
local rojo_project
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "luau",
|
||||
root = {
|
||||
".luaurc",
|
||||
".config.luau",
|
||||
"*.project.json",
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "luau" } },
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
luau_lsp = {},
|
||||
},
|
||||
setup = {
|
||||
luau_lsp = function(_, config)
|
||||
-- luau-lsp.nvim configures it's own lsp so forward the config to it
|
||||
vim.lsp.config("luau-lsp", config)
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
luau = { "stylua" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"lopi-py/luau-lsp.nvim",
|
||||
ft = "luau",
|
||||
init = function()
|
||||
rojo_project = vim.fs.root(0, function(name)
|
||||
return name:match(".+%.project%.json$")
|
||||
end)
|
||||
|
||||
if rojo_project then
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
lua = function(path)
|
||||
return path:match("%.nvim%.lua$") and "lua" or "luau"
|
||||
end,
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
opts = function()
|
||||
return {
|
||||
platform = {
|
||||
type = rojo_project and "roblox" or "standard",
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue