All Projects → mattn → Efm Langserver

mattn / Efm Langserver

General purpose Language Server

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Efm Langserver

stardog-language-servers
Language Servers for Stardog Languages
Stars: ✭ 19 (-94.75%)
Mutual labels:  language-server
toy-language-server
Example language server (LSP) implementation for a toy language
Stars: ✭ 54 (-85.08%)
Mutual labels:  language-server
Vscode Yaml
YAML support for VS Code with built-in kubernetes syntax support
Stars: ✭ 293 (-19.06%)
Mutual labels:  language-server
asls
A front-end independent language server for AssemblyScript
Stars: ✭ 42 (-88.4%)
Mutual labels:  language-server
els-component-extraction-addon
Component extraction addon
Stars: ✭ 11 (-96.96%)
Mutual labels:  language-server
gluon language-server
Language server providing completion for gluon
Stars: ✭ 40 (-88.95%)
Mutual labels:  language-server
vscode-tenkawa-php
Visual Studio Code extension integrating Tenkawa PHP language server.
Stars: ✭ 28 (-92.27%)
Mutual labels:  language-server
Vscode Haskell
VS Code extension for Haskell, powered by haskell-language-server
Stars: ✭ 311 (-14.09%)
Mutual labels:  language-server
vscode-autohotkey2-lsp
Autohotkey2 Language Support using vscode-lsp.
Stars: ✭ 24 (-93.37%)
Mutual labels:  language-server
Vscode Solargraph
A Visual Studio Code extension for Solargraph.
Stars: ✭ 292 (-19.34%)
Mutual labels:  language-server
ltex-ls
LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others
Stars: ✭ 182 (-49.72%)
Mutual labels:  language-server
benten
A language server for Common Workflow Language
Stars: ✭ 50 (-86.19%)
Mutual labels:  language-server
satysfi-language-server
The SATySFi Language Server
Stars: ✭ 26 (-92.82%)
Mutual labels:  language-server
hcl-lang
Schema and decoder to be used as building blocks for an HCL2-based language server.
Stars: ✭ 44 (-87.85%)
Mutual labels:  language-server
Clangd
clangd language server
Stars: ✭ 293 (-19.06%)
Mutual labels:  language-server
jsonnet-language-server
A Language Server Protocol (LSP) server for Jsonnet (https://jsonnet.org)
Stars: ✭ 55 (-84.81%)
Mutual labels:  language-server
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-91.44%)
Mutual labels:  language-server
Erlang ls
The Erlang Language Server
Stars: ✭ 363 (+0.28%)
Mutual labels:  language-server
Elm Language Server
Language server implementation for Elm
Stars: ✭ 298 (-17.68%)
Mutual labels:  language-server
Ide Php
PHP language support for Atom-IDE
Stars: ✭ 269 (-25.69%)
Mutual labels:  language-server

efm-langserver

Actions Status

General purpose Language Server that can use specified error message format generated from specified command. This is useful for editing code with linter.

efm

Usage

Usage of efm-langserver:
  -c string
        path to config.yaml
  -d    dump configuration
  -logfile string
        logfile
  -loglevel int
        loglevel (default 1)
  -q    Run quieter
  -v    Print the version

Configuration

Configuration can be done with either a config.yaml file, or through a DidChangeConfiguration notification from the client. DidChangeConfiguration can be called any time and will overwrite only provided properties.

DidChangeConfiguration only supports V2 configuration and cannot set LogFile.

InitializeParams

Because the configuration can be updated on the fly, capabilities might change throughout the lifetime of the server. To enable support for capabilities that will be available later, set them in the InitializeParams

Example

{
    "initializationOptions": {
        "documentFormatting": true,
        "hover": true,
        "documentSymbol": true,
        "codeAction": true,
        "completion": true
    }
}

Example for config.yaml

Location of config.yaml is:

  • UNIX: $HOME/.config/efm-langserver/config.yaml
  • Windows: %APPDATA%\efm-langserver\config.yaml

Below is example for config.yaml for Windows.

version: 2
root-markers:
  - .git/
commands:
  - command: notepad
    arguments:
      - ${INPUT}
    title: メモ帳

tools:
  eruby-erb: &eruby-erb
    lint-command: 'erb -x -T - | ruby -c'
    lint-stdin: true
    lint-offset: 1
    format-command: htmlbeautifier

  vim-vint: &vim-vint
    lint-command: 'vint -'
    lint-stdin: true
    lint-formats:
      - '%f:%l:%c: %m'

  make-checkmake: &make-checkmake
    lint-command: 'checkmake'
    lint-stdin: true

  markdown-markdownlint: &markdown-markdownlint
    lint-command: 'markdownlint -s -c %USERPROFILE%\.markdownlintrc'
    lint-stdin: true
    lint-formats:
      - '%f:%l %m'
      - '%f:%l:%c %m'
      - '%f: %l: %m'

  markdown-pandoc: &markdown-pandoc
    format-command: 'pandoc -f markdown -t gfm -sp --tab-stop=2'

  rst-pandoc: &rst-pandoc
    format-command: 'pandoc -f rst -t rst -s --columns=79'

  rst-lint: &rst-lint
    lint-command: 'rst-lint'
    lint-formats:
      - '%tNFO %f:%l %m'
      - '%tARNING %f:%l %m'
      - '%tRROR %f:%l %m'
      - '%tEVERE %f:%l %m'

  yaml-yamllint: &yaml-yamllint
    lint-command: 'yamllint -f parsable -'
    lint-stdin: true

  python-flake8: &python-flake8
    lint-command: 'flake8 --stdin-display-name ${INPUT} -'
    lint-stdin: true
    lint-formats:
      - '%f:%l:%c: %m'

  python-mypy: &python-mypy
    lint-command: 'mypy --show-column-numbers'
    lint-formats:
      - '%f:%l:%c: %trror: %m'
      - '%f:%l:%c: %tarning: %m'
      - '%f:%l:%c: %tote: %m'

  python-black: &python-black
    format-command: 'black --quiet -'
    format-stdin: true

  python-autopep8: &python-autopep8
    format-command: 'autopep8 -'
    format-stdin: true

  python-yapf: &python-yapf
    format-command: 'yapf --quiet'
    format-stdin: true

  python-isort: &python-isort
    format-command: 'isort --quiet -'
    format-stdin: true

  dockerfile-hadolint: &dockerfile-hadolint
    lint-command: 'hadolint'
    lint-formats:
      - '%f:%l %m'

  sh-shellcheck: &sh-shellcheck
    lint-command: 'shellcheck -f gcc -x'
    lint-source: 'shellcheck'
    lint-formats:
      - '%f:%l:%c: %trror: %m'
      - '%f:%l:%c: %tarning: %m'
      - '%f:%l:%c: %tote: %m'

  sh-shfmt: &sh-shfmt
    format-command: 'shfmt -ci -s -bn'
    format-stdin: true

  javascript-eslint: &javascript-eslint
    lint-command: 'eslint -f unix --stdin'
    lint-ignore-exit-code: true
    lint-stdin: true

  php-phpstan: &php-phpstan
    lint-command: './vendor/bin/phpstan analyze --error-format raw --no-progress'

  php-psalm: &php-psalm
    lint-command: './vendor/bin/psalm --output-format=emacs --no-progress'
    lint-formats:
      - '%f:%l:%c:%trror - %m'
      - '%f:%l:%c:%tarning - %m'

  html-prettier: &html-prettier
    format-command: './node_modules/.bin/prettier ${--tab-width:tabWidth} ${--single-quote:singleQuote} --parser html'

  css-prettier: &css-prettier
    format-command: './node_modules/.bin/prettier ${--tab-width:tabWidth} ${--single-quote:singleQuote} --parser css'

  json-prettier: &json-prettier
    format-command: './node_modules/.bin/prettier ${--tab-width:tabWidth} --parser json'

  json-jq: &json-jq
    lint-command: 'jq .'

  json-fixjson: &json-fixjson
    format-command: 'fixjson'

  csv-csvlint: &csv-csvlint
    lint-command: 'csvlint'

  lua-lua-format: &lua-lua-format
    format-command: 'lua-format -i'
    format-stdin: true

  blade-blade-formatter: &blade-blade-formatter
    format-command: 'blade-formatter --stdin'
    format-stdin: true

  mix_credo: &mix_credo
    lint-command: "mix credo suggest --format=flycheck --read-from-stdin ${INPUT}"
    lint-stdin: true
    lint-ignore-exit-code: true
    lint-formats:
      - '%f:%l:%c: %m'
    root-markers:
      - mix.lock
      - mix.exs

  any-excitetranslate: &any-excitetranslate
    hover-command: 'excitetranslate'
    hover-stdin: true

languages:
  eruby:
    - <<: *eruby-erb

  vim:
    - <<: *vim-vint

  make:
    - <<: *make-checkmake

  markdown:
    - <<: *markdown-markdownlint
    - <<: *markdown-pandoc

  rst:
    - <<: *rst-lint
    - <<: *rst-pandoc

  yaml:
    - <<: *yaml-yamllint

  python:
    - <<: *python-flake8
    - <<: *python-mypy
    # - <<: *python-autopep8
    # - <<: *python-yapf
    - <<: *python-black
    - <<: *python-isort

  dockerfile:
    - <<: *dockerfile-hadolint

  sh:
    - <<: *sh-shellcheck
    - <<: *sh-shfmt

  javascript:
    - <<: *javascript-eslint

  php:
    - <<: *php-phpstan
    - <<: *php-psalm

  html:
    - <<: *html-prettier

  css:
    - <<: *css-prettier

  json:
    - <<: *json-jq
    - <<: *json-fixjson
    # - <<: *json-prettier

  csv:
    - <<: *csv-csvlint

  lua:
    - <<: *lua-lua-format

  blade:
    - <<: *blade-blade-formatter

  elixir:
    - <<: *mix_credo

  _:
    - <<: *any-excitetranslate

If you want to debug output of commands:

version: 2
log-file: /path/to/output.log
log-level: 1

Example for DidChangeConfiguration notification

{
    "settings": {
        "rootMarkers": [".git/"],
        "languages": {
            "lua": {
                "formatCommand": "lua-format -i",
                "formatStdin": true
            }
        }
    }
}

Configuration for vim-lsp

augroup LspEFM
  au!
  autocmd User lsp_setup call lsp#register_server({
      \ 'name': 'efm-langserver',
      \ 'cmd': {server_info->['efm-langserver', '-c=/path/to/your/config.yaml']},
      \ 'allowlist': ['vim', 'eruby', 'markdown', 'yaml'],
      \ })
augroup END

vim-lsp-settings provide installer for efm-langserver.

Configuration for coc.nvim

coc-settings.json

  // languageserver
  "languageserver": {
    "efm": {
      "command": "efm-langserver",
      "args": [],
      // custom config path
      // "args": ["-c", "/path/to/your/config.yaml"],
      "filetypes": ["vim", "eruby", "markdown", "yaml"]
    }
  },

Configuration for elgot

Add to eglot-server-programs with major mode you want.

(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs
    `(markdown-mode . ("efm-langserver"))))

Configuration for neovim buildin LSP with nvim-lspconfig

init.vim

lua << EOF
require "lspconfig".efm.setup {
    init_options = {documentFormatting = true},
    settings = {
        rootMarkers = {".git/"},
        languages = {
            lua = {
                {formatCommand = "lua-format -i", formatStdin = true}
            }
        }
    }
}
EOF

Supported Lint tools

Installation

go get github.com/mattn/efm-langserver

Homebrew

brew install efm-langserver

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].