From 7f1702d917da8b73e7d8e17a42d991e92eb1643e Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Sun, 19 May 2024 00:09:35 +0200 Subject: [PATCH] Add gdscript --- lua/lazy-configure.lua | 4 +++- lua/lsp.lua | 24 ++++++++++++++++++++++++ lua/treesitter-configure.lua | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lua/lazy-configure.lua b/lua/lazy-configure.lua index 148f864..dd3c6ef 100644 --- a/lua/lazy-configure.lua +++ b/lua/lazy-configure.lua @@ -27,6 +27,9 @@ require('lazy').setup({ }, }, + -- DAP: Debug Adapter Protocol + 'mfussenegger/nvim-dap', + { -- Autocompletion 'hrsh7th/nvim-cmp', @@ -299,5 +302,4 @@ require('lazy').setup({ ft = { "markdown", "pandoc" }, build = function() vim.fn["mkdp#util#install"]() end, } - }, {}) diff --git a/lua/lsp.lua b/lua/lsp.lua index 714bcf4..0b12b2a 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -165,6 +165,7 @@ servers = { }, } }, + gdscript = {}, } for server_name, server_settings in pairs(servers) do @@ -174,3 +175,26 @@ for server_name, server_settings in pairs(servers) do settings = server_settings, } end + +local setup_godot_dap = function() + local dap = require("dap") + + dap.adapters.godot = { + type = "server", + host = "127.0.0.1", + port = 6006, + } + + dap.configurations.gdscript = { + { + launch_game_instance = false, + launch_scene = false, + name = "Launch scene", + project = "${workspaceFolder}", + request = "launch", + type = "godot", + }, + } +end + +setup_godot_dap() diff --git a/lua/treesitter-configure.lua b/lua/treesitter-configure.lua index 1112b96..5fddd0e 100644 --- a/lua/treesitter-configure.lua +++ b/lua/treesitter-configure.lua @@ -3,7 +3,7 @@ vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'norg', 'norg_meta' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'norg', 'norg_meta', 'gdscript' }, ignore_install = {'latex', 'tex', 'markdown'}, disable = {'latex', 'tex', 'markdown'},