Today I have been setting up neovim on windows 11 (not WSL). I can't get the lsp servers to work. The issue is that nvim isn't loading the projects root tsconfig.json or eslintrc.json file for any file in a subdirectory of the project. I open nvim in the project directory. VSCode lints and parses all files in subdirectories correctly, so the tsconfig and eslintrc files are fine.
Here is a minimal config that fails:
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
use 'neovim/nvim-lspconfig'
end)
require'lspconfig'.eslint.setup{}
For every file inside a subdirectory of the project I see this error - error message path will change depending on file path. E.g the file c:\dev\project\src\subdir\file.ts will come with this error:
Parsing error: Cannot read file 'c:\dev\project\src\subdir\tsconfig.json'
In addition to any errors that I shouldn't be seeing based on eslint config. A file created inside the project root directory gets correctly parsed. It looks like the lsp servers are trying to locate config files in the same directory as the file I have open instead of the project directory.
Here is the structure of the project is and it's located at C:/dev/project
src/
├─ testfile2.ts -- this one fails to parse according to configs
tsconfig.json
.eslintrc.json
testfile.ts -- this one parses correctly
This is my :LspInfo screen
Language client log: C:\Users\Mark\AppData\Local\nvim-data\lsp.log
Detected filetype: typescript
1 client(s) attached to this buffer:
Client: eslint (id: 1, bufnr: [4])
filetypes: javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx, vue, svelte, astro
autostart: true
root directory: C:/dev/chat-room/ui
cmd: cmd.exe /C vscode-eslint-language-server --stdio
Configured servers list: eslint
Thanks in advance!!
Edit I am fairly certain the issue is related to Windows. The exact same minimal config works without issues on WSL2. Sadly, I need to use Windows for my workflow.