Skip to content

LSP fails on Windows due to path mismatch errors #11045

@pschiel

Description

@pschiel

Description

Steps to reproduce

Use various paths and observe that LSP returns no errors due to backslash mismatches.

Occurs in git bash and/or backslash paths.

- Write JS file with lint errors to "/c/Users/ops/lsp-test.js" containing: "const x = 1\nconst y = 2\nx = 3"
- Write JS file with lint errors to "E:/lsp-test.js" containing: "const x = 1\nconst y = 2\nx = 3"
- Write JS file with lint errors to "C:\\Users\\ops\\lsp-test2.js" containing: "var a;var b;a==b"
- Write JS file with lint errors to "E:\\lsp-test2.js" containing: "var a;var b;a==b"

Root Cause

path mismatches in contains() Checks cause LSP to fail read the file, and silently doesn't return diagnostics.

#6763 solves via path normalization

Plugins

OpenCode version

dev

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

not terminal related

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions