Skip to content

JS TS Language Server

theimpostor edited this page Oct 11, 2021 · 2 revisions

JavaScript/TypeScript Language Server

This serves as a guide on how to setup a JS/TS language server for LanguageClient-neovim.

Requirements

Installation

Install using npm:

npm i typescript-language-server -g

Client Configuration

let g:LanguageClient_serverCommands = {
    " other server commands...
    \ 'javascript': ['typescript-language-server', '--stdio'],
    \ 'typescript': ['typescript-language-server', '--stdio'],
    \ 'javascript.jsx': ['typescript-language-server', '--stdio'],
    \ 'typescript.tsx': ['typescript-language-server', '--stdio'],
    \ }

Language Server Configuration

You can configure preferences. E.g. place the following in <workspace root>/.vim/settings.json:

{
    "typescript-language-server": {
        "preferences": {
            "disableSuggestions": true
        }
    }
}

References