{"id":13682913,"url":"https://github.com/elm-tooling/elm-language-server","last_synced_at":"2025-05-14T21:09:04.009Z","repository":{"id":35023700,"uuid":"140211459","full_name":"elm-tooling/elm-language-server","owner":"elm-tooling","description":"Language server implementation for Elm","archived":false,"fork":false,"pushed_at":"2025-04-08T01:15:58.000Z","size":7010,"stargazers_count":423,"open_issues_count":68,"forks_count":68,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-10T12:46:33.420Z","etag":null,"topics":["coc","elm","elm-lang","hacktoberfest","kak-lsp","language-server","language-server-protocol","lsp","lsp-mode"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@elm-tooling/elm-language-server","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elm-tooling.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["razzeee","jmbockhorst"],"patreon":null,"open_collective":"elm-tooling","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-07-09T00:04:37.000Z","updated_at":"2025-04-06T05:21:15.000Z","dependencies_parsed_at":"2023-01-15T12:14:28.193Z","dependency_job_id":"fdf8d076-ac33-4572-bb6f-b264bef91e61","html_url":"https://github.com/elm-tooling/elm-language-server","commit_stats":{"total_commits":1482,"total_committers":39,"mean_commits":38.0,"dds":0.5269905533063428,"last_synced_commit":"21d7dc6e1711372466ce121dd0be1e55cd392583"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-tooling%2Felm-language-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-tooling%2Felm-language-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-tooling%2Felm-language-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-tooling%2Felm-language-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elm-tooling","download_url":"https://codeload.github.com/elm-tooling/elm-language-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248753380,"owners_count":21156265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coc","elm","elm-lang","hacktoberfest","kak-lsp","language-server","language-server-protocol","lsp","lsp-mode"],"created_at":"2024-08-02T13:01:55.388Z","updated_at":"2025-04-13T17:37:11.013Z","avatar_url":"https://github.com/elm-tooling.png","language":"TypeScript","funding_links":["https://github.com/sponsors/razzeee","https://github.com/sponsors/jmbockhorst","https://opencollective.com/elm-tooling"],"categories":["TypeScript","Languages","Editor plugins"],"sub_categories":["Sublime Text"],"readme":"# elm-language-server\n\n![Matrix](https://img.shields.io/matrix/elm-language-server:matrix.org?label=Matrix%20chat\u0026logo=Matrix)\n[![Build Status](https://github.com/elm-tooling/elm-language-server/workflows/Lint%20and%20test/badge.svg)](https://github.com/elm-tooling/elm-language-server/actions)\n[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/elm-tooling/elm-language-server)\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/elm-language-server.svg)](https://repology.org/project/elm-language-server/versions)\n\nThis is the language server implementation for the Elm programming language.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Installation](#installation)\n  - [Alternative: Compile and install from source](#alternative-compile-and-install-from-source)\n  - [Alternative: Install with Nix](#alternative-install-with-nix)\n- [Requirements](#requirements)\n- [Configuration](#configuration)\n  - [Linting](#linting)\n- [Features](#features)\n- [Server Settings](#server-settings)\n- [Editor Support](#editor-support)\n  - [VSCode](#vscode)\n  - [Vim](#vim)\n    - [coc.nvim](#cocnvim)\n    - [ALE](#ale)\n    - [LanguageClient](#languageclient)\n  - [Kakoune](#kakoune)\n    - [kak-lsp](#kak-lsp)\n  - [Emacs](#emacs)\n    - [Emacs Doom](#emacs-doom)\n  - [Sublime](#sublime)\n- [Awesome libraries this is based on](#awesome-libraries-this-is-based-on)\n- [Contributing](#contributing)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\nNote for VSCode users: The [plugin](https://github.com/elm-tooling/elm-language-client-vscode) contains the language-server. No installation necessary.\n\nThe server can be installed via `npm` (or from source).\n\n```sh\nnpm install -g @elm-tooling/elm-language-server\n```\n\nThen, you should be able to run the language server with the following command:\n\n```sh\nelm-language-server\n```\n\nYou might need to use this, if your using powershell:\n\n```powershell\nelm-language-server.cmd\n```\n\nFollow the instructions below to integrate the language server into your editor.\n\n### Alternative: Compile and install from source\n\nFirst, clone this repo and compile it. `npm link` will add `elm-language-server` to the `PATH`.\n\n```sh\ngit clone git@github.com:elm-tooling/elm-language-server.git\ncd elm-language-server\nnpm install\nnpm run compile\nnpm link\n```\n\n### Alternative: Install with [Nix](https://nixos.org)\n\n`elm-languager-server` and its [dependencies](https://github.com/elm-tooling/elm-language-server#requirements) are available in [`nixpkgs`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/elm/default.nix).\n\n```sh\nnix-env -i -A nixpkgs.elmPackages.elm-language-server\n```\n\n## Requirements\n\nYou will need to install `elm` and `elm-test` to get all diagnostics and `elm-format` for formatting. Alternatively you can also just install these to your local npm `package.json`.\n\n```sh\nnpm install -g elm elm-test elm-format\n```\n\nIf you want to use `elm-review`:\n\n```sh\nnpm install -g elm-review\n```\n\nOr use local versions from your `node_modules` directory, if you want to do that you need to set the paths, via the settings (e.g. set `elmPath` to `./node_modules/.bin/elm`).\n\n## Configuration\n\nWe used to have a file called `elm-tooling.json` where you could specifiy `\"entrypoints\"`. That’s not needed anymore – the language server finds the entrypoints automatically.\n\nIf all you had in `elm-tooling.json` was `\"entrypoints\"`, you can safely remove that file.\n\nCurrently, no configuration at all is needed.\n\n### Linting\n\nThe Elm Language Server has built-in support for linting. Check out the [documentation](docs/linting.md) for configuring the linter. \n\n## Features\n\nSupports Elm 0.19 and up\n\n| Feature          | Description                                                                                                                                          |\n| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |\n| diagnostics      | Provided via `elm`, `elm-test` and our own type inference and linter                                                                                 |\n| formatting       | Provided via `elm-format` and post-processed to only return a diff of changes. This way it should not be as intrusive as running `elm-format` normal |\n| codeLenses       | Currently only shows if a type alias, custom type or function is exposed from that module                                                            |\n| completions      | Show completions for the current file and snippets                                                                                                   |\n| definitions      | Enables you to jump to the definition of a type alias, module, custom type or function                                                               |\n| documentSymbols  | Identifies all symbols in a document.                                                                                                                |\n| folding          | Let's you fold the code on certain Elm constructs                                                                                                    |\n| hover            | Shows type annotations and documentation for a type alias, module, custom type or function                                                           |\n| linkedEditing    | Enables auto renaming a function name when the type annotation name is edited, or vice versa                                                         |\n| references       | Lists all references to a type alias, module, custom type or function                                                                                |\n| rename           | Enables you to rename a type alias, module, custom type or function                                                                                  |\n| workspaceSymbols | Identifies all symbols in the current workspace                                                                                                      |\n| selectionRange   | Enables navigation by selectionRange (extend selection for e.g.)                                                                                     |\n\n## Server Settings\n\nThis server contributes the following settings:\n\n- `elmLS.trace.server`: Enable/disable trace logging of client and server communication\n- `elmLS.elmPath`: The path to your `elm` executable. Should be empty by default, in that case it will assume the name and try to first get it from a local npm installation or a global one. If you set it manually it will not try to load from the npm folder.\n- `elmLS.elmReviewPath`: The path to your `elm-review` executable. Should be empty by default, in that case it will assume the name and try to first get it from a local npm installation or a global one. If you set it manually it will not try to load from the npm folder.\n- `elmLS.elmReviewDiagnostics`: Configure linting diagnostics from elm-review. Possible values: `off`, `warning`, `error`.\n- `elmLS.elmFormatPath`: The path to your `elm-format` executable. Should be empty by default, in that case it will assume the name and try to first get it from a local npm installation or a global one. If you set it manually it will not try to load from the npm folder.\n- `elmLS.elmTestPath`: The path to your `elm-test` executable. Should be empty by default, in that case it will assume the name and try to first get it from a local npm installation or a global one. If you set it manually it will not try to load from the npm folder.\n- `elmLS.disableElmLSDiagnostics`: Enable/Disable linting diagnostics from the language server.\n- `elmLS.skipInstallPackageConfirmation`: Skip confirmation for the Install Package code action.\n- `elmLS.onlyUpdateDiagnosticsOnSave`: Only update compiler diagnostics on save, not on document change.\n\nSettings may need a restart to be applied.\n\n## Editor Support\n\n| Editor                                                                                  |    Diagnostics     |     Formatting     |    Code Lenses     |    Completions     |    Definitions     |  Document Symbols  |      Folding       |       Hover        |   Linked Editing   |     References     |       Rename       | Workspace Symbols  |\n| --------------------------------------------------------------------------------------- | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |\n| [VSCode](https://github.com/elm-tooling/elm-language-server#vscode)                     | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| [VIM CoC](https://github.com/elm-tooling/elm-language-server#cocnvim)                   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |        :x:         | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| [VIM LanguageClient](https://github.com/elm-tooling/elm-language-server#languageClient) | :heavy_check_mark: | :heavy_check_mark: |  :grey_question:   | :heavy_check_mark: |  :grey_question:   |  :grey_question:   |  :grey_question:   |  :grey_question:   |        :x:         |  :grey_question:   |  :grey_question:   |  :grey_question:   |\n| [VIM ALE](https://github.com/elm-tooling/elm-language-server#ale)                       | :heavy_check_mark: |        :x:         |        :x:         |  :grey_question:   | :heavy_check_mark: |        :x:         |        :x:         | :heavy_check_mark: |        :x:         | :heavy_check_mark: |        :x:         | :heavy_check_mark: |\n| [Kakoune](https://github.com/elm-tooling/elm-language-server#kak-lsp)                   | :heavy_check_mark: | :heavy_check_mark: |  :grey_question:   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |  :grey_question:   | :heavy_check_mark: |        :x:         | :heavy_check_mark: | :heavy_check_mark: |  :grey_question:   |\n| [Emacs](https://github.com/elm-tooling/elm-language-server#emacs)                       | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |  :grey_question:   | :heavy_check_mark: |        :x:         | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| [Sublime](https://github.com/elm-tooling/elm-language-server#sublime)                   | :heavy_check_mark: | :heavy_check_mark: |        :x:         | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |        :x:         | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n### VSCode\n\nJust install the [`elm-tooling/elm-language-client-vscode`](https://github.com/elm-tooling/elm-language-client-vscode) plugin from the [VSCode MarketPlace](https://marketplace.visualstudio.com/items?itemName=Elmtooling.elm-ls-vscode)\n\nTo enable linked editing in VSCode, use the setting `\"editor.linkedEditing\": true`.\n\n### Vim\n\nThere are [general setup instructions and FAQ for Vim](https://github.com/elm-tooling/elm-vim).\n\nIt's recommended to install [syntax highlighting](https://github.com/andys8/vim-elm-syntax), which also adds the required [detection of elm as `filetype`](https://github.com/andys8/vim-elm-syntax/blob/d614325a037982489574012e4db04d7f8f134c17/ftdetect/elm.vim#L3). An example vim configuration can be found in [elm-vim/vim-config-example](https://github.com/elm-tooling/elm-vim/tree/main/vim-config-example).\n\n#### coc.nvim\n\nTo enable support with [coc.nvim](https://github.com/neoclide/coc.nvim), run `:CocConfig` and add the language server config below.\n\nIf needed, you can set the paths to `elm`, `elm-test`, `elm-review` and `elm-format` with the `elmPath`, `elmTestPath`, `elmReviewPath` and `elmFormatPath` variables.\n\n```jsonc\n{\n  \"languageserver\": {\n    \"elmLS\": {\n      \"command\": \"elm-language-server\",\n      \"filetypes\": [\"elm\"],\n      \"rootPatterns\": [\"elm.json\"]\n    }\n  },\n  // If you use neovim you can enable codelenses with this\n  \"codeLens.enable\": true\n}\n```\n\nMuch of this is covered in the [Example vim configuration](https://github.com/neoclide/coc.nvim#example-vim-configuration) section in Coc's readme.\n\n| Feature           | How to use it                                                                                                                                                            |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| Diagnostics       | `:CocList diagnostics`\u003cbr /\u003eConfigure refresh with `\"diagnostic.refreshAfterSave\": false`                                                                                |\n| Formatting        | `:call CocAction('format')`                                                                                                                                              |\n| CodeLenses        | Requires Neovim. Add `\"coc.preferences.codeLens.enable\": true` to your `coc-settings.json` through `:CocConfig`                                                          |\n| Completions       | On by default, see [Completion with sources](https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources) for customizations                                       |\n| Definitions       | Provided as `\u003cPlug\u003e` mapping so that you can set it yourself, e.g. \u003cbr /\u003e `nmap \u003csilent\u003e gd \u003cPlug\u003e(coc-definition)` \u003cbr/\u003e `nmap \u003csilent\u003e gy \u003cPlug\u003e(coc-type-definition)` |\n| DocumentSymbols   | `:CocList outline`                                                                                                                                                       |\n| Folding           | You must `set foldmethod=manual` in your `vimrc`, one set Coc will handle folding with the usual commands, `zc`, `zo`, etc                                               |\n| Hover             | `:call CocAction('doHover')`                                                                                                                                             |\n| References        | Provided as a `\u003cPlug\u003e` mapping, e.g. `nmap \u003csilent\u003e gr \u003cPlug\u003e(coc-references)`                                                                                           |\n| Rename            | Provided as a `\u003cPlug\u003e` mapping, e.g. `nmap \u003cleader\u003ern \u003cPlug\u003e(coc-rename)`                                                                                                |\n| Workspace Symbols | `:CocList symbols`                                                                                                                                                       |\n\n#### ALE\n\n[ALE](https://github.com/dense-analysis/ale) contains the `elm_ls` linter.\n\n```\nlet g:ale_linters = { 'elm': ['elm_ls'] }\n```\n\nIf needed, you can set the paths to `elm`, `elm-test`, `elm-review` and `elm-format`. The configuration can be [found here](https://github.com/dense-analysis/ale/blob/master/doc/ale-elm.txt)\n\n```\nlet g:ale_elm_ls_use_global = 1\nlet g:ale_elm_ls_executable = \"/path/to/elm-language-server\"\nlet g:ale_elm_ls_elm_path = \"/path/to/elm\"\nlet g:ale_elm_ls_elm_format_path = \"/path/to/elm-format\"\nlet g:ale_elm_ls_elm_test_path = \"/path/to/elm-test\"\n```\n\n| Feature           | How to use it                                                                                                                                                            |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| Diagnostics       | `:ALENext`/`:ALEPrevious`\u003cbr /\u003eConfigure refresh with `let g:ale_lint_on_text_changed = 0`\u003cbr /\u003e`let g:ale_lint_on_insert_leave = 1` \u003cbr /\u003e `let g:ale_lint_on_save = 1` |\n| Formatting        | ALE doesn't currently support this through the language server integration, but `elm-format` is a supported ALE Fixer                                                    |\n| CodeLenses        | Not currently supported                                                                                                                                                  |\n| Completions       | On by default, see `:h ale-completion` for more info                                                                                                                     |\n| Definitions       | `:ALEGoToDefinition`, `:ALEGoToTypeDefinition`, see `:h ale-go-to-definition` and `:h ale-go-to-type-definition`                                                         |\n| DocumentSymbols   | Only workspace symbols are currently supported                                                                                                                           |\n| Folding           | Not currently supported                                                                                                                                                  |\n| Hover             | `:ALEHover`                                                                                                                                                              |\n| References        | `:ALEFindReferences`                                                                                                                                                     |\n| Rename            | Not currently supported                                                                                                                                                  |\n| Workspace Symbols | `:ALESymbolSearch \u003cquery\u003e`                                                                                                                                               |\n\n#### LanguageClient\n\nTo use this language server with [LanguageClient](https://github.com/autozimu/LanguageClient-neovim)\nadd the following configuration to your neovim/vim.\n\n```viml\nlet g:LanguageClient_serverCommands = {\n  \\ 'elm': ['elm-language-server'],\n  \\ }\n\nlet g:LanguageClient_rootMarkers = {\n  \\ 'elm': ['elm.json'],\n  \\ }\n```\n\n### Kakoune\n\n#### kak-lsp\n\nFirst install [kak-lsp](https://github.com/ul/kak-lsp), and enable it in the kakrc. One way would be to add these lines to your .config/kak/kakrc file:\n\n```sh\neval %sh{kak-lsp --kakoune -s $kak_session}\nlsp-enable\n```\n\nThen, assuming installation of `elm-language-server`, `elm-format`, and `elm-test`, add this section to your `.config/kak-lsp/kak-lsp.toml` file:\n\n```toml\n[language.elm]\nfiletypes = [\"elm\"]\nroots = [\"elm.json\"]\ncommand = \"elm-language-server\"\n```\n\n### Emacs\n\nThe language client is included in [lsp-mode](https://github.com/emacs-lsp/lsp-mode), specifically [here](https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-elm.el). See specifically [this section](https://github.com/emacs-lsp/lsp-mode#use-package) for a minimal use-package configuration for lsp-mode.\n\n#### Emacs Doom\n\n- Uncomment `lsp` and `elm` in your configuration file `.doom.d/init.el` and add the `+lsp` feature flag to the elm layer:\n\n```elisp\nlsp\n(elm +lsp)\n```\n\n- Optional configuration for [lsp-mode](https://github.com/emacs-lsp/lsp-mode) and [lsp-ui-mode](https://github.com/emacs-lsp/lsp-ui). Add this to your `.doom.d/config.el`.\n\n```elisp\n(after! lsp-ui\n  (setq lsp-ui-doc-max-width 100)\n  (setq lsp-ui-doc-max-height 30)\n  (setq lsp-ui-sideline-show-code-actions nil)\n  (setq lsp-ui-doc-enable nil)\n  (setq lsp-ui-doc-show-with-cursor nil)\n  (setq lsp-ui-doc-show-with-mouse nil)\n  (setq lsp-lens-enable nil)\n  (setq lsp-enable-symbol-highlighting nil)\n  )\n```\n\nYou can also enable or disable more features: https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off\n\n- Run `~/.emacs.d/bin/doom sync`\n\n| Feature         | How to use it                                                |\n| --------------- | ------------------------------------------------------------ |\n| Diagnostics     | On by default                                                |\n| Formatting      | On save                                                      |\n| CodeLenses      | `lsp-lens-mode`, `lsp-show-lens`                             |\n| Completions     | On by default                                                |\n| Definitions     | `lsp-find-definition`, `lsp-ui-peek-find-definitions`        |\n| DocumentSymbols | `lsp-ui-imenu`                                               |\n| Folding         | `+fold/open`, `+fold/close`                                  |\n| Hover           | `lsp-ui-sideline-mode`, `lsp-ui-doc-mode`, `lsp-ui-show-doc` |\n| References      | `lsp-ui-peek-find-references`, `lsp-find-references`         |\n| Rename          | `lsp-rename`                                                 |\n| SelectionRange  | `lsp-extend-selection`                                       |\n\n### Sublime\n\n1. Install [Elm Syntax Highlighting](https://packagecontrol.io/packages/Elm%20Syntax%20Highlighting), [LSP](https://packagecontrol.io/packages/LSP) and [LSP-elm](https://packagecontrol.io/packages/LSP-elm) from Package Control.\n1. Restart Sublime.\n\nYou should now be able to use the integrations from Sublime. You might want to read about [the features offered](https://lsp.readthedocs.io/en/latest/features/)\n\n## Awesome libraries this is based on\n\n- [elm-format](https://github.com/avh4/elm-format)\n- [elm-test](https://github.com/rtfeldman/node-test-runner)\n- [tree-sitter-elm](https://github.com/Razzeee/tree-sitter-elm)\n- [elm-review](https://github.com/jfmengels/elm-review)\n\n## Contributing\n\nPlease do :)\nAs the best thing about a language server is that multiple clients will improve that way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felm-tooling%2Felm-language-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felm-tooling%2Felm-language-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felm-tooling%2Felm-language-server/lists"}