fix: ts/js LSPs require lockfile #4062
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Trying to fix #4015.
As stated in my last comment here, my root_dir manoeuver was only made to improve support for all projects, not only monorepos. I thought every project using TS / Eslint would have a lock file as you need Eslint to be installed somewhere, but there are global installations as well (different from the LSP installation be careful here!).
In this case, I propose that we fallback to the current directory instead, as it means that the TS / Eslint / Biome / ... version is the same and we can reuse the same instance for all files that we open through this nvim process.
I also leveraged nvim priority list to add the
.gitfor project roots, I removed it in my original PR because it was making false positives with lock files.