williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

[New server]: autohotkey2 #460

Open thqby opened 2 years ago

thqby commented 2 years ago

Server name

ahk2_ls

Server homepage

https://github.com/thqby/vscode-autohotkey2-lsp/tree/server

Languages

autohotkey2

Is this server added in lspconfig?

How is this server distributed?

github-actions[bot] commented 2 years ago

Hello! Cool! Pull requests are always very welcomed to add new servers. If the distribution of the server is simple, the installation will most likely be so as well (existing server installers may be used for reference!). Otherwise, @williamboman will get around to looking into this ASAP!

thqby commented 2 years ago

default config

local nvim_lsp = require 'lspconfig'

return {
  default_config = {
    cmd = { "node", "vscode-autohotkey2-lsp/server/dist/server.js", "--stdio" },
    filetypes = { "ahk", "ahk2", "ah2", "autohotkey" },
    root_dir = function(fname)
                return nvim_lsp.util.find_git_ancestor(fname) or vim.fn.getcwd()
                    end,
    cmd_env = {
      AHK2_LS_CONFIG = '{"locale":"en-us"}',
    },
    settings = {
      AutoHotkey2 = {
        -- the path of the AutoHotkey.exe executable file. This default setting is used as a fallback if no interpreter is selected for the workspace.
        InterpreterPath = 'C:/Program Files/Autohotkey/AutoHotkey.exe',

        -- Provide completion and automatic include from User and Standard library, Local library
        AutoLibInclude = 0,

        -- Add parentheses to function completions
        completeFunctionParens = false
      }
    },
  },
  docs = {
    description = [[
    https://github.com/thqby/vscode-autohotkey2-lsp

    Autohotkey2 Language Support 

    Download and unpack thqby.vscode-autohotkey2-LSP plugin 
    from github, git clone --depth=1 -b server https://github.com/thqby/vscode-autohotkey2-lsp
    from vscode marketplace, https://marketplace.visualstudio.com/items?itemName=thqby.vscode-autohotkey2-lsp
    cmd = {'node', 'extension/server/dist/server.js', '--stdio'}
    ]]
  }
}