Skip to content

fix(pack): docker-language-server to dockerls - #1707

Closed
jay-babu wants to merge 3 commits into
AstroNvim:mainfrom
jay-babu:patch-9
Closed

fix(pack): docker-language-server to dockerls#1707
jay-babu wants to merge 3 commits into
AstroNvim:mainfrom
jay-babu:patch-9

Conversation

@jay-babu

@jay-babu jay-babu commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

Edit from @Uzaaft:
No longer relevant after v6

Copilot AI review requested due to automatic review settings December 29, 2025 03:40
@github-actions

Copy link
Copy Markdown

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

1 similar comment
@github-actions

Copy link
Copy Markdown

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

@jay-babu

Copy link
Copy Markdown
Contributor Author
  {
    "williamboman/mason-lspconfig.nvim",
    opts = function(_, opts)
      opts.ensure_installed = opts.ensure_installed or {}
      -- filter out the kotlin_language_server if it is already installed
      opts.ensure_installed = vim.tbl_filter(
        function(server) return server ~= "kotlin_language_server" end,
        opts.ensure_installed
      )
      opts.ensure_installed = vim.tbl_filter(function(server) return server ~= "sqls" end, opts.ensure_installed)
      table.insert(opts.ensure_installed, "tsp_server")
    end,
    config = function(_, opts)
      require("mason-lspconfig").setup(opts)
    end,
  },

I really don't know why but my mason-lspconfig setup function is not running till I manually added the config function. This is likely why no one has seen this error for 7 months as this is when this was committed. As soon as I did it started running again.

This comment was marked as spam.

@jay-babu jay-babu changed the title fix(pack): docker-language-server to docker_language_server fix(pack): docker-language-server to dockerls Dec 29, 2025
@wert2all

Copy link
Copy Markdown
Contributor

I really don't know why but my mason-lspconfig setup function is not running till I manually added the config function. This is likely why no one has seen this error for 7 months as this is when this was committed. As soon as I did it started running again.

Maybe I'm doing wrong, but on a clean install of nvim, I got docker-compose-language-service and dockerfile-language-server LSPs. Steps for reproduce:

  1. Change docker-language-server to dockerls
  2. rm -rf ~/.local/share/nvim && rm -rf ~/.local/state/nvim && rm -rf ~/.cache/nvim
  3. start nvim
  4. docker-compose-language-service and dockerfile-language-server installed.

On my clean config, without you fix, I got docker-language-server only. Maybe docker-language-server installs other pack, which I am using.

@azdanov

azdanov commented Jan 30, 2026

Copy link
Copy Markdown
Member

I think it's my fault here.

Since astronvim v5 uses mason-lspconfig v1, which doesn't have docker-language-server.
v1: https://github.com/mason-org/mason-lspconfig.nvim/blob/1a31f824b9cd5bc6f342fc29e9a53b60d74af245/lua/mason-lspconfig/mappings/server.lua#L48 and https://github.com/mason-org/mason-lspconfig.nvim/blob/1a31f824b9cd5bc6f342fc29e9a53b60d74af245/lua/mason-lspconfig/mappings/filetype.lua#L48

But v2 has https://github.com/mason-org/mason-lspconfig.nvim/blob/3d89e7c92fbd96c5e10e0298fc2b006f21cf9428/lua/mason-lspconfig/filetype_mappings.lua#L50

So, need to probably hotpatch mason-lspconfig to recognize the new docker-language-server lsp to make it work.

There is some confusion here in the thread between docker-language-server, dockerfile-language-server and docker-compose-language-service which are 3 different LSPs. The previous update that I did was to replace the community LSPs (dockerfile and compose) with official https://github.com/docker/docker-language-server.

@azdanov

azdanov commented Jan 30, 2026

Copy link
Copy Markdown
Member

Here's an example of hotpatching (thanks to mehalter for providing this technique):

{
"AstroNvim/astrolsp",
opts = {
mason_lspconfig = {
servers = {
oxlint = {
package = "oxlint",
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
},
},
},
},
},

@Uzaaft Uzaaft changed the title fix(pack): docker-language-server to dockerls fix(pack): add docker language server mapping Jun 12, 2026
@Uzaaft Uzaaft changed the title fix(pack): add docker language server mapping fix(pack): docker-language-server to dockerls Jun 12, 2026
@Uzaaft
Uzaaft force-pushed the patch-9 branch 2 times, most recently from ade907d to a2b2234 Compare June 12, 2026 18:49
@Uzaaft

Uzaaft commented Jun 12, 2026

Copy link
Copy Markdown
Member

Sorry for the force pushes. I was too deep until I realized that this isnt needed for v6.

@Uzaaft Uzaaft closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants