Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable default_setup during reload #62

Merged
merged 1 commit into from
Apr 19, 2023

Commits on Apr 19, 2023

  1. fix: don't memoize default_setup

    The `mason-null-ls.automatic_setup` function has no return value and so can't be
    memoized effectively -- it exists strictly for its side-effects. This change is
    necessary to make mason-null-ls cooperate during a reload of configuration.
    
    Previously the below code would work on initial executtion but noop
    subsequently, resulting in no null-ls diagnostics. Now it behaves as expected.
    
    ```lua
    require("null-ls.config").reset()
    require("null-ls").setup({ on_attach = M.on_attach_null_ls })
    require("mason-null-ls").setup({
      handlers = { require("mason-null-ls").default_setup },
    })
    ```
    
    Without this change I have to work around, using an un-memoized copy-paste of
    the automatic-setup function as my handler.
    bukzor committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    2b22830 View commit details
    Browse the repository at this point in the history