Lsp Layer

class LspLayer #

  • supers: Layer

methods #


LspLayer.packages #


function LspLayer.packages() ->  (PackageSlug|Package)[]

LspLayer.preload #


function LspLayer.preload() ->  nil

LspLayer.load #


function LspLayer.load() ->  nil

LspLayer.use_server #


function LspLayer.use_server(
  lang: string,
  install: boolean,
  srv: string,
  settings: table?
) ->  nil

@param lang - The name of the language (used by Mason)

@param install - True if the server should be installed via Mason

@param srv - The name of the server executable (if any)

@param settings - Any optional settings for the language server

Enables an LSP server at startup

LspLayer.on_attach #


function LspLayer.on_attach(fn: function) ->  nil

@param fn - The callback function

Adds an on_attach function which gets called when LSPs get enabled on buffers

LspLayer.on_attach_one_time #


function LspLayer.on_attach_one_time(fn: function) ->  nil

@param fn - The callback function

Adds a one-time on_attach function which gets called the first time a LS is enabled on each buffer

LspLayer.get_callbacks #


function LspLayer.get_callbacks() -> callbacks function[]

@return callbacks - A list of callbacks

Returns the list of on_attach callbacks

LspLayer.get_callbacks_one_time #


function LspLayer.get_callbacks_one_time() -> callbacks function[]

@return callbacks - A list of callbacks

Returns the list of one-time on_attach callbacks

LspLayer.on_capabilities #


function LspLayer.on_capabilities(fn: function) ->  nil

@param fn - The hook

Sets the capabilities table

LspLayer.get_capabilities #


function LspLayer.get_capabilities() -> capabilities function

@return capabilities - The capabilities handler

Returns the current capabilities handler

fields #


LspLayer.servers #


LspLayer.servers: table

LspLayer.callbacks #


LspLayer.callbacks: table

LspLayer.one_time_callbacks #


LspLayer.one_time_callbacks: table

LspLayer.buffers #


LspLayer.buffers: table

The set of IDs of buffers that have had an LSP attached to them at least once. Closed buffers can also be in it.

LspLayer.capabilities #


LspLayer.capabilities : nil

LspLayer.use_nullls #


LspLayer.use_nullls: false

LspLayer.default_config #


LspLayer.default_config: {
    install: boolean = true,
    progress: table,
    mason: { registries = ("github:mason-org/mason-registry","github:visimp/mason-registry"), ... },
    mason_tool_installer: table,
    nullls: table,
    binds: { any, any, fun() -> nil, any, fun() -> nil, any, any, any, ... },
}