Home

Awesome

<img src="assets/logo.svg" alt="fuzion logo" width="25" /> A language server implementation for Fuzion


<!--ts--> <!--te-->

Requirements

Build

Install

ClientRepository
vscodehttps://github.com/tokiwa-software/vscode-fuzion
vimsee instructions below
emacssee instructions below
eclipse (theia)https://github.com/tokiwa-software/vscode-fuzion

Vim

Vim

  1. Note: fuzion_language_server (from ./bin/) needs to be in $PATH

  2. Example .vimrc:

    :filetype on
    
    call plug#begin('~/.vim/plugged')
    Plug 'neoclide/coc.nvim', {'branch': 'release'}
    call plug#end()
    
  3. in vim

    1. :PlugInstall

    2. :CocConfig

      {
        "languageserver": {
          "fuzion": {
            "command": "fuzion_language_server",
            "args" : ["-stdio"],
            "filetypes": [
              "fz",
              "fuzion"
            ]
          }
        }
      }
      
  4. add filetype-detection file ~/.vim/ftdetect/fz.vim

    au BufRead,BufNewFile *.fz            set filetype=fz
    

Emacs

Emacs

fuzion_language_server (from ./bin/) needs to be in $PATH

For emacs there is two options eglot or lsp-mode.

Eglot

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/"))
;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(inhibit-startup-screen t)
 '(package-selected-packages '(eglot ##)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(define-derived-mode fuzion-mode
  fundamental-mode "Fuzion"
  "Major mode for Fuzion.")

(add-to-list 'auto-mode-alist '("\\.fz\\'" . fuzion-mode))

(require 'eglot)

(add-to-list 'eglot-server-programs
             '(fuzion-mode . ("fuzion_language_server" "-stdio")))

(add-hook 'after-init-hook 'global-company-mode)
(add-hook 'fuzion-mode-hook 'eglot-ensure)

(provide 'init)
;;; init.el ends here

LSP-Mode

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/"))
(package-initialize)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(inhibit-startup-screen t)
 '(package-selected-packages '(lsp-ui company flycheck lsp-mode ##)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(define-derived-mode fuzion-mode
  fundamental-mode "Fuzion"
  "Major mode for Fuzion.")

(add-to-list 'auto-mode-alist '("\\.fz\\'" . fuzion-mode))

(require 'lsp-mode)
(global-flycheck-mode)
(add-to-list 'lsp-language-id-configuration '(fuzion-mode . "fuzion"))

(defgroup lsp-fuzionlsp nil
  "LSP support for Fuzion, using fuzionlsp."
  :group 'lsp-mode
  :link '(url-link ""))

(lsp-register-client
 (make-lsp-client :new-connection (lsp-stdio-connection  (lambda ()
                                                          `(,"fuzion_language_server"
                                                            "-stdio")))
                  :major-modes '(fuzion-mode)
                  :priority -1
                  :server-id 'fuzionls))


(lsp-consistency-check lsp-fuzion)

(add-hook 'fuzion-mode-hook #'lsp)
(add-hook 'after-init-hook 'global-company-mode)

(setq lsp-enable-symbol-highlighting t)

;; (setq  lsp-enable-semantic-highlighting t
;;        lsp-semantic-tokens-enable t
;;        lsp-semantic-tokens-warn-on-missing-face t
;;        lsp-semantic-tokens-apply-modifiers nil
;;        lsp-semantic-tokens-allow-delta-requests nil
;;        lsp-semantic-tokens-allow-ranged-requests nil)

;; (setq lsp-modeline-code-actions-mode t)

;; (setq lsp-modeline-code-actions-segments '(name icon))

;; (setq lsp-log-io t)

(provide 'lsp-fuzion)

(provide 'init)
;;; init.el ends here

Run standalone

Transport socket

Transport stdio

Debug

Test

Profiling

Implementation state

FeatureStatus
diagnostics
completion
hover
signatureHelp
declaration
definition
typeDefinition
implementation
references
documentHighlight
documentSymbol
codeAction
codeLens
documentLink
documentColor
colorPresentation
formatting
rangeFormatting
onTypeFormatting
rename
prepareRename
foldingRange
selectionRange
prepareCallHierarchy
callHierarchy incoming
callHierarchy outgoing
semantic tokens
linkedEditingRange
moniker
inlayHints
inlineValue
type hierarchy
notebook document support