Skip to content

Commit

Permalink
Add basic support for futhark mode (#4556)
Browse files Browse the repository at this point in the history
* Add basic support for futhark mode

* Remove duplicate adding to lsp-language-id-configuration

* Add futhark addition to changelog

* Add futhark to list of client-packages

* Add futhark to docs list

* Add documentation group for futhark

* Add server installation docs for futhark

* N/A → Not available
  • Loading branch information
SKyletoft authored Sep 23, 2024
1 parent 710f2a2 commit 9222365
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Add ~lsp-flush-delayed-changes-before-next-message~ customization point to enforce throttling document change notifications.
* Fix bug in ~rust-analyzer.check.features~ configuration via ~lsp-rust-checkonsave-features~ Emacs setting: we were defaulting to ~[]~, but ~rust-analyzer~ defaults to inheriting the value from ~rust-analyzer.cargo.features~. The bug resulted in code hidden behind features not getting type checked when those features were enabled by setting ~rust-analyzer.cargo.features~ via the ~lsp-rust-features~ Emacs setting.
* Change ~ruff-lsp~ to ~ruff~ for python lsp client. All ~ruff-lsp~ customizable variable change to ~ruff~. Lsp server command now is ~["ruff" "server"]~ instead of ~["ruff-lsp"]~.
* Add futhark support

** 9.0.0
* Add language server config for QML (Qt Modeling Language) using qmlls.
Expand Down
42 changes: 42 additions & 0 deletions clients/lsp-futhark.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
;;; lsp-futhark.el --- lsp-mode futhark integration -*- lexical-binding: t; -*-

;; Copyright (C) 2024 lsp-mode maintainers

;; Keywords: languages

;; 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:

;; Client for the futhark language server.

;;; Code:

(require 'lsp-mode)

(defgroup lsp-futhark nil
"LSP support for Futhark, using futhark lsp"
:group 'lsp-mode
:link '(url-link "https://github.com/diku-dk/futhark/tree/master/src/Futhark/LSP")
:package-version `(lsp-mode . "9.0.1"))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("futhark" "lsp"))
:activation-fn (lsp-activate-on "futhark")
:server-id 'futhark))

(lsp-consistency-check lsp-futhark)

(provide 'lsp-futhark)
;;; lsp-futhark.el ends here
8 changes: 8 additions & 0 deletions docs/lsp-clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@
"installation": "pip install fortls",
"debugger": "Yes"
},
{
"name": "futhark",
"full-name": "Futhark",
"server-name": "futhark-lsp",
"server-url": "https://github.com/diku-dk/futhark"
"installation": "A part of the compiler since 0.21.9",
"debugger": "Not available"
},
{
"name": "gdscript",
"full-name": "GDScript",
Expand Down
5 changes: 3 additions & 2 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ As defined by the Language Server Protocol 3.16."
lsp-autotools lsp-awk lsp-bash lsp-beancount lsp-bufls lsp-clangd
lsp-clojure lsp-cmake lsp-cobol lsp-credo lsp-crystal lsp-csharp lsp-css
lsp-cucumber lsp-cypher lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile
lsp-earthly lsp-elixir lsp-elm lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp
lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly
lsp-earthly lsp-elixir lsp-elm lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-futhark
lsp-fsharp lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly
lsp-graphql lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java
lsp-javascript lsp-jq lsp-json lsp-kotlin lsp-latex lsp-lisp lsp-ltex
lsp-lua lsp-magik lsp-markdown lsp-marksman lsp-mdx lsp-meson lsp-metals lsp-mint
Expand Down Expand Up @@ -893,6 +893,7 @@ Changes take effect only when a new session is started."
(reason-mode . "reason")
(caml-mode . "ocaml")
(tuareg-mode . "ocaml")
(futhark-mode . "futhark")
(swift-mode . "swift")
(elixir-mode . "elixir")
(elixir-ts-mode . "elixir")
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ nav:
- ESLint: page/lsp-eslint.md
- F#: page/lsp-fsharp.md
- Fortran: page/lsp-fortran.md
- Futhark: page/lsp-futhark.md
- GDScript: page/lsp-gdscript.md
- Gleam: page/lsp-gleam.md
- GLSL: page/lsp-glsl.md
Expand Down

0 comments on commit 9222365

Please sign in to comment.