Repository: neovim/neovim
File: runtime/lua/vim/lsp/client.lua (Lua)

Code before:
  validate_config(config)

  client_index = client_index + 1
  local id = client_index
  local name = get_name(id, config)

  --- @class vim.lsp.Client
  local self = {
    id = id,
    config = config,
    handlers = config.handlers or {},
    offset_encoding = validate_encoding(config.offset_encoding),
    name = name,
    _log_prefix = string.format('LSP[%s]', name),
    requests = {},
    attached_buffers = {},
    server_capabilities = {},
    registrations = {},
    commands = config.commands or {},
    settings = config.settings or {},
    flags = config.flags or {},
    get_language_id = config.get_language_id or default_get_language_id,
    capabilities = config.capabilities,
    workspace_folders = lsp._get_workspace_folders(config.workspace_folders or config.root_dir),
    root_dir = config.root_dir,
    is_stopping = false,
    _before_init_cb = config.before_init,
    _on_init_cbs = vim._ensure_list(config.on_init),
    _on_exit_cbs = vim._ensure_list(config.on_exit),
    _on_attach_cbs = vim._ensure_list(config.on_attach),
    _on_error_cb = config.on_error,
    _trace = get_trace(config.trace),

    --- Contains $/progress report messages.
    --- They have the format {token: integer|string, value: any}
    --- For "work done progress", value will be one of:
    --- - lsp.WorkDoneProgressBegin,
    --- - lsp.WorkDoneProgressReport (extended with title from Begin)
    --- - lsp.WorkDoneProgressEnd    (extended with title from Begin)
    progress = vim.ringbuf(50) --[[@as vim.lsp.Client.Progress]],

    --- @deprecated use client.progress instead
    messages = { name = name, messages = {}, progress = {}, status = {} },
  }

  self.capabilities =
    vim.tbl_deep_extend('force', lsp.protocol.make_client_capabilities(), self.capabilities or {})

  --- @class lsp.DynamicCapabilities
  --- @nodoc
  self.dynamic_capabilities = {

Review comment (suggestion):
`is_stopped()` is already a public method, don't need another public field. Ideally we wouldn't need this field at all, but I'm assuming there is no other way.
```suggestion
    _is_stopping = false,
```

Code after:
  validate_config(config)

  client_index = client_index + 1
  local id = client_index
  local name = get_name(id, config)

  --- @class vim.lsp.Client
  local self = {
    id = id,
    config = config,
    handlers = config.handlers or {},
    offset_encoding = validate_encoding(config.offset_encoding),
    name = name,
    _log_prefix = string.format('LSP[%s]', name),
    requests = {},
    attached_buffers = {},
    server_capabilities = {},
    registrations = {},
    commands = config.commands or {},
    settings = config.settings or {},
    flags = config.flags or {},
    get_language_id = config.get_language_id or default_get_language_id,
    capabilities = config.capabilities,
    workspace_folders = lsp._get_workspace_folders(config.workspace_folders or config.root_dir),
    root_dir = config.root_dir,
    _is_stopping = false,
    _before_init_cb = config.before_init,
    _on_init_cbs = vim._ensure_list(config.on_init),
    _on_exit_cbs = vim._ensure_list(config.on_exit),
    _on_attach_cbs = vim._ensure_list(config.on_attach),
    _on_error_cb = config.on_error,
    _trace = get_trace(config.trace),

    --- Contains $/progress report messages.
    --- They have the format {token: integer|string, value: any}
    --- For "work done progress", value will be one of:
    --- - lsp.WorkDoneProgressBegin,
    --- - lsp.WorkDoneProgressReport (extended with title from Begin)
    --- - lsp.WorkDoneProgressEnd    (extended with title from Begin)
    progress = vim.ringbuf(50) --[[@as vim.lsp.Client.Progress]],

    --- @deprecated use client.progress instead
    messages = { name = name, messages = {}, progress = {}, status = {} },
  }

  self.capabilities =
    vim.tbl_deep_extend('force', lsp.protocol.make_client_capabilities(), self.capabilities or {})

  --- @class lsp.DynamicCapabilities
  --- @nodoc
  self.dynamic_capabilities = {