Closed mbainter closed 1 year ago
Hey! Yeah that seems a bit odd, I'll remove that doc page entirely instead of reintroducing the :TFLintInit
command. Have you tried initializing tflint manually, for example in a :terminal
or directly via :!tflint --init
?
That also didn't work properly, but it did lead me to figuring out what was going on. The problem isn't the init, the problem is that tflint needs to know where its config file is. Normally I run this as part of pre-commit, and in our pre-commit we specify the path which is the root of the repository -- that's not something tflint can find on its own.
So, for anyone else who might run into this situation - you probably want to setup your own personal tflint configuration in your homedir that you use while writing code, and then deal with any variances you might have from repository to repository in your pre-commit. Otherwise, you'll need to setup something custom in the tflint configuration for mason that figures out which tflint.hcl file to use.
We still should delete that TFLintInit note for the server though, and that can close this issue out.
Problem description
There is no way to initialize tflint when using it with mason so that it downloads its plugins and weirdly, even if you've already initialized tflint in the current path, and the plugin is available in ~/.tflint.d/ it still complains and fails on startup.
But from that same path:
Why do you think this is an issue with mason-lspconfig.nvim?
The documentation for tflint appears to pull from the old nvim-lsp-installer code, indicating that there will be a "TFLintInit" function available when the server is set up.
Indeed, in the nvm-lsp-installer plugin, there was a "post_setup" config for the server that looked like this:
But, as far as I can tell, this is not a part of mason, or mason-lspconfig.
Neovim version (>= 0.7)
NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3
Operating system/version
Linux 6.26 x86_64
I've manually reviewed the Nvim LPS client log (
:LspLog
) to find potential errorsI've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig
Affected language servers
tflint
Steps to reproduce
Actual behavior
TFLint client fails with an error
Expected behavior
TFLint returns results
LspInfo
LspLog
Healthcheck
Screenshots or recordings
No response