Skip to content

Warrning: Environment variable configuration is being deprecated #1226

Closed
@benelan

Description

@benelan

Code editor

nvim

Platform

Linux (Ubuntu)

Version

5.4.2

What steps will reproduce the bug?

I don't have any of the environment variables, but opening a shell script logs the following warning to ~/.local/state/nvim/lsp.log when the LSP server attaches to a buffer.

[WARN][2024-11-18 21:19:33] ...lsp/handlers.lua:625	"05:19:33.609 WARNING ⛔️ Environment variable configuration is being deprecated, please use workspace configuration. The following environment variables were used: shfmt"

How often does it reproduce? Is there a required condition?

It reproduces when the LSP server attaches to a buffer for the first time in the session. Closing neovim and reopening the file will add another warning to the log file.

What is the expected behavior?

I expect that the code correctly determines whether any of the config environment variables are being used.

What do you see instead?

This might be the place the warning is talking about, because the shfmt key is an object.

const environmentVariablesUsed = Object.entries(rawConfig)
.map(([key, value]) => (typeof value !== 'undefined' ? key : null))
.filter((key): key is string => key !== null)
.filter((key) => key !== 'logLevel') // logLevel is a special case that we ignore

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions