chage gdscript setup and make hidden file searchable with telescope

This commit is contained in:
Marco 2024-06-11 10:55:54 +02:00
parent 367987d932
commit 900b2d0b24
4 changed files with 27 additions and 19 deletions

View File

@ -0,0 +1,23 @@
local port = os.getenv('GDScript_Port') or 6005
local cmd = vim.lsp.rpc.connect('127.0.0.1', port)
local pipe = '/tmp/godot.pipe'
vim.lsp.start({
name = 'Godot',
cmd = cmd,
root_dir = vim.fs.dirname(vim.fs.find({ 'project.godot', '.git' }, { upward = true })[1]),
on_attach = function(client, bufnr)
print("gdscipt.lua on_attach")
vim.api.nvim_command('echo serverstart("' .. pipe .. '")')
end
})
vim.api.nvim_create_autocmd('BufWritePost',
{
pattern = '*.gd',
callback = function()
local file = vim.api.nvim_buf_get_name(0)
local job = vim.fn.jobstart({ "gdformat", file })
vim.fn.jobwait({ job })
end,
})

View File

@ -1,12 +0,0 @@
require("lspconfig").gdscript.setup {}
vim.api.nvim_create_autocmd('BufWritePost',
{
pattern = '*.gd',
callback = function()
local file = vim.api.nvim_buf_get_name(0)
local job = vim.fn.jobstart({ "gdformat", file })
vim.fn.jobwait({ job })
vim.cmd(":e")
end,
})

View File

@ -1,7 +1 @@
--Enable (broadcasting) snippet capability for completion require 'lspconfig'.html.setup {}
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require 'lspconfig'.html.setup {
capabilities = capabilities,
}

View File

@ -8,6 +8,9 @@ vim.keymap.set('n', '<leader>fs', builtin.lsp_dynamic_workspace_symbols);
require("telescope").setup({ require("telescope").setup({
pickers = {
find_files = { hidden = true }
},
extensions = { extensions = {
["ui-select"] = { ["ui-select"] = {
require("telescope.themes").get_dropdown { require("telescope.themes").get_dropdown {