From 902912b0b82c59c6af5700c51eefb48df32423c7 Mon Sep 17 00:00:00 2001
From: CronyAkatsuki <crony@cronyakatsuki.xyz>
Date: Thu, 11 Jan 2024 19:53:56 +0100
Subject: [PATCH] Add godot support.

---
 after/ftplugin/gdscript.lua | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 after/ftplugin/gdscript.lua

diff --git a/after/ftplugin/gdscript.lua b/after/ftplugin/gdscript.lua
new file mode 100644
index 0000000..c69f5c3
--- /dev/null
+++ b/after/ftplugin/gdscript.lua
@@ -0,0 +1,12 @@
+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)
+		vim.api.nvim_command('echo serverstart("' .. pipe .. '")')
+	end,
+})