Skip to content

Commit

Permalink
Add AWK language server support
Browse files Browse the repository at this point in the history
  • Loading branch information
Hi-Angel committed Jul 6, 2023
1 parent 05c88ea commit 8bf7629
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
* Remove custom variable ~lsp-inlay-hint-enum-format~ since LSP Specification 3.17 only has ~type~ and
~parameter~ hint kinds.
* Add [[https://semgrep.dev][Semgrep]] support
* Add AWK language server support.
** Release 8.0.0
* Add ~lsp-clients-angular-node-get-prefix-command~ to get the Angular server from another location which is still has ~/lib/node_modules~ in it.
* Set ~lsp-clients-angular-language-server-command~ after the first connection to speed up subsequent connections.
Expand Down
49 changes: 49 additions & 0 deletions clients/lsp-awk.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
;;; lsp-awk.el --- AWK client -*- lexical-binding: t; -*-

;; Copyright (C) 2023 emacs-lsp maintainers

;; Author: Konstantin Kharlamov <[email protected]>
;; Keywords: languages lsp awk

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:
;;
;; LSP client for AWK language.
;;

;;; Code:

(require 'lsp-mode)

(defgroup lsp-awk nil
"LSP support for AWK."
:group 'lsp-mode
:link '(url-link "https://github.com/Beaglefoot/awk-language-server"))

(defcustom lsp-awk-executable '("awk-language-server")
"Command to run the AWK language server."
:group 'lsp-awk
:risky t
:type 'list)

(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection lsp-awk-executable)
:activation-fn (lsp-activate-on "awk")
:priority -1
:server-id 'awkls))

(provide 'lsp-awk)
;;; lsp-awk.el ends here
9 changes: 9 additions & 0 deletions docs/lsp-clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
"lsp-install-server": "astro-ls",
"debugger": "Not available"
},
{
"name": "awk",
"full-name": "AWK",
"server-name": "awk-language-server",
"server-url": "https://github.com/Beaglefoot/awk-language-server",
"installation": "npm i -g awk-language-server",
"lsp-install-server": "awkls",
"debugger": "Not available"
},
{
"name": "bash",
"full-name": "Bash",
Expand Down
3 changes: 2 additions & 1 deletion lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ As defined by the Language Server Protocol 3.16."
:package-version '(lsp-mode . "6.1"))

(defcustom lsp-client-packages
'( ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-astro lsp-bash
'( ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-awk lsp-astro lsp-bash
lsp-beancount lsp-clangd lsp-clojure lsp-cmake lsp-credo lsp-crystal lsp-csharp lsp-css
lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile lsp-elm lsp-elixir lsp-emmet
lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-go lsp-gleam
Expand Down Expand Up @@ -786,6 +786,7 @@ Changes take effect only when a new session is started."
("^go\\.mod\\'" . "go.mod")
("^settings.json$" . "jsonc")
(ada-mode . "ada")
(awk-mode . "awk")
(nxml-mode . "xml")
(sql-mode . "sql")
(vimrc-mode . "vim")
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ nav:
- Angular: page/lsp-angular.md
- Ansible: page/lsp-ansible.md
- Astro: page/lsp-astro.md
- AWK: page/lsp-awk.md
- Bash: page/lsp-bash.md
- Beancount: page/lsp-beancount.md
- Camel: page/lsp-camel.md
Expand Down

0 comments on commit 8bf7629

Please sign in to comment.