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

Warrning: Environment variable configuration is being deprecated #1226

Open
benelan opened this issue Nov 19, 2024 · 0 comments · May be fixed by #1227
Open

Warrning: Environment variable configuration is being deprecated #1226

benelan opened this issue Nov 19, 2024 · 0 comments · May be fixed by #1227

Comments

@benelan
Copy link

benelan commented Nov 19, 2024

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

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 a pull request may close this issue.

1 participant