aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorTom <ttofel@gmail.com>2024-12-23 00:45:56 +0100
committerGitHub <noreply@github.com>2024-12-22 15:45:56 -0800
commit73ce1e3bf66b47a444378e7fdc68d03d854328ef (patch)
tree190e3b80fb3a68a4eb3120f0c37e46124f97bcb0 /lua
parentrefactor: deprecate util.path.iterate_parents (diff)
downloadnvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.tar
nvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.tar.gz
nvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.tar.bz2
nvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.tar.lz
nvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.tar.xz
nvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.tar.zst
nvim-lspconfig-73ce1e3bf66b47a444378e7fdc68d03d854328ef.zip
feat: autohotkey_lsp #3408
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/configs/autohotkey_lsp.lua56
1 files changed, 56 insertions, 0 deletions
diff --git a/lua/lspconfig/configs/autohotkey_lsp.lua b/lua/lspconfig/configs/autohotkey_lsp.lua
new file mode 100644
index 00000000..839af2fc
--- /dev/null
+++ b/lua/lspconfig/configs/autohotkey_lsp.lua
@@ -0,0 +1,56 @@
+-- NOTE: AutoHotkey is used only on windows
+local function get_autohotkey_path()
+ local path = vim.fn.exepath('autohotkey.exe')
+ return #path > 0 and path or ''
+end
+
+return {
+ default_config = {
+ cmd = { 'autohotkey_lsp', '--stdio' },
+ filetypes = { 'autohotkey' },
+ root_dir = function(fname)
+ return vim.fs.dirname(vim.fs.find('package.json', { path = fname, upward = true })[1])
+ end,
+ single_file_support = true,
+ autostart = true,
+ flags = { debounce_text_changes = 500 },
+ --capabilities = capabilities,
+ --on_attach = custom_attach,
+ init_options = {
+ locale = 'en-us',
+ InterpreterPath = get_autohotkey_path(),
+ AutoLibInclude = 'All',
+ CommentTags = '^;;\\s*(?<tag>.+)',
+ CompleteFunctionParens = false,
+ SymbolFoldinFromOpenBrace = false,
+ Diagnostics = {
+ ClassStaticMemberCheck = true,
+ ParamsCheck = true,
+ },
+ ActionWhenV1IsDetected = 'Continue',
+ FormatOptions = {
+ array_style = 'expand',
+ break_chained_methods = false,
+ ignore_comment = false,
+ indent_string = '\t',
+ max_preserve_newlines = 2,
+ brace_style = 'One True Brace',
+ object_style = 'none',
+ preserve_newlines = true,
+ space_after_double_colon = true,
+ space_before_conditional = true,
+ space_in_empty_paren = false,
+ space_in_other = true,
+ space_in_paren = false,
+ wrap_line_length = 0,
+ },
+ },
+ },
+ docs = {
+ description = [[
+https://github.com/thqby/vscode-autohotkey2-lsp
+
+AutoHotkey v2.0 LSP implementation
+ ]],
+ },
+}