Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

denols

URL: https://deno.land/

plugins.lsp.servers.denols.enable

Whether to enable https://github.com/denoland/deno Deno’s built-in language server To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages in your init.lua. Example:

vim.g.markdown_fenced_languages = {
  "ts=typescript"
}

Some care must be taken here to correctly infer whether a file is part of a Deno program, or a TS program that expects to run in Node or Web Browsers. This supports having a Deno module that is a part of a mostly-not-Deno monorepo. We do this by finding the nearest package manager lock file, and the nearest deno.json or deno.jsonc. Note that this means that without a deno.json, deno.jsonc, or deno.lock file, this LSP client will not attach. Example:

project-root
+-- node_modules/...
+-- package-lock.json
+-- package.json
+-- packages
    +-- deno-module
    |   +-- deno.json
    |   +-- package.json <-- It's normal for Deno projects to have package.json files!
    |   +-- src
    |       +-- index.ts <-- this is a Deno file
    +-- node-module
        +-- package.json
        +-- src
            +-- index.ts <-- a non-Deno file (ie, should use ts_ls or tsgo)

From the file being edited, we walk up to find the nearest package manager lockfile. This is PROJECT ROOT. From the file being edited, find the nearest deno.json or deno.jsonc. This is DENO ROOT. From the file being edited, find the nearest deno.lock. This is DENO LOCK ROOT If DENO LOCK ROOT is found, and PROJECT ROOT is missing or shorter, then this is a deno file, and we attach. If DENO ROOT is found, and it’s longer than or equal to PROJECT ROOT, then this is a Deno file, and we attach. Otherwise, we abort, because this is a non-Deno TS file…

Type: boolean

Default:

false

Example:

true

Declared by:

plugins.lsp.servers.denols.package

The denols package to use.

Alternatively, denols should be installed on your $PATH.

Type: null or package

Default:

pkgs.deno

Declared by:

plugins.lsp.servers.denols.packageFallback

When enabled, the language server package will be added to the end of the PATH (suffix) instead of the beginning (prefix).

This can be useful if you want local versions of the language server (e.g. from a devshell) to override the Nixvim version.

Type: boolean

Default:

false

Declared by:

plugins.lsp.servers.denols.autostart

Controls if the FileType autocommand that launches a language server is created. If false, allows for deferring language servers until manually launched with :LspStart (|lspconfig-commands|).

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.lsp.servers.denols.cmd

A list where each entry corresponds to the blankspace delimited part of the command that launches the server.

The first entry is the binary used to run the language server. Additional entries are passed as arguments.

Type: null or (list of string)

Default: null when package is null, otherwise null

Declared by:

plugins.lsp.servers.denols.extraOptions

Extra options for the denols language server.

Type: attribute set of anything

Default:

{ }

Declared by:

plugins.lsp.servers.denols.filetypes

Set of filetypes for which to attempt to resolve {root_dir}. May be empty, or server may specify a default value.

Type: null or (list of string)

Default:

null

Declared by:

plugins.lsp.servers.denols.rootMarkers

A list of files that mark the root of the project/workspace.

Vim’s LSP will try to share the same language server instance for all buffers matching filetypes within the same project.

A new server instance is only spawned when opening a buffer with a different project root.

See :h lsp-config and :h vim.fs.root().

Type: null or (list of (string or raw lua code)) or raw lua code

Default: null

Plugin default: null

Declared by:

plugins.lsp.servers.denols.settings

The settings for this LSP.

Type: open submodule of attribute set of lua value

Default:

{ }

Example:

{
  callback = lib.nixvim.mkRaw ''
  function()
    print('nixvim')
  end
'';
  foo_bar = 42;
  hostname = "localhost:8080";
}

Declared by: