#18560 · @superherointj · opened Mar 21, 2026 at 10:02 PM UTC · last updated Mar 21, 2026 at 10:02 PM UTC
fix(lsp): resolve extension matching for Dockerfile files
Score breakdown
Impact
Clarity
Urgency
Ease Of Review
Guidelines
Readiness
Size
Trust
Traction
Summary
This PR fixes LSP extension matching for Dockerfiles, specifically addressing case sensitivity and files without extensions. It introduces a new matchesExtension function with comprehensive unit tests and manual verification.
Description
Issue for this PR
Closes #18558
Type of change
- [x] Bug fix
What does this PR do?
Fixes LSP extension matching for files named exactly Dockerfile (without a file extension) and adds case-insensitive extension matching.
The old code used case-sensitive Array.includes() which failed for:
Dockerfile(no extension, basename fallback didn't match due to case)file.Dockerfile(case mismatch with.dockerfileextension)
The new matchesExtension function handles:
- Case-insensitive extension matching (
.Dockerfilematches.dockerfile) - Files without extensions matching basenames (
DockerfilematchesDockerfileextension)
How did you verify your code works?
- Added 8 unit tests covering various edge cases
- All tests pass
- Manually tested with actual Dockerfile files:
Dockerfile- LSP spawns and initializes correctlyfile.dockerfile- continues to worksomething.Dockerfile- case-insensitive matching works
Checklist
- [x] I have tested my changes locally
- [x] I have not included unrelated changes in this PR
Linked Issues
#18558 fix(lsp): resolve extension matching for Dockerfile files
View issueComments
No comments.
Changed Files
packages/opencode/src/lsp/index.ts
+22−4packages/opencode/test/lsp/matches-extension.test.ts
+53−0