Skip to content

feat(completion): handle symlinked directories in file completion - #339

Merged
sudo-tee merged 2 commits into
mainfrom
feat/symlinks-support
Mar 23, 2026
Merged

feat(completion): handle symlinked directories in file completion#339
sudo-tee merged 2 commits into
mainfrom
feat/symlinks-support

Conversation

@sudo-tee

Copy link
Copy Markdown
Owner

This should resolve #336

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for mentioning/adding files located under symlinked directories within the current working directory (fix for #336), primarily by changing how “inside cwd” is determined so that logical (non-resolved) paths can be accepted.

Changes:

  • Update util.is_path_in_cwd to allow relative paths that stay logically within cwd without resolving symlinks.
  • Adjust file completion to build an absolute path without explicitly resolving symlinks.
  • Add unit tests for util.is_path_in_cwd.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
lua/opencode/util.lua Adds a “logical path” check path for relative paths to support symlinked directories.
lua/opencode/ui/completion/files.lua Changes how completion items compute full_path used when adding a file to context.
tests/unit/util_spec.lua Adds new test cases for util.is_path_in_cwd.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/opencode/util.lua Outdated
Comment thread lua/opencode/ui/completion/files.lua
Comment thread tests/unit/util_spec.lua
@sudo-tee
sudo-tee merged commit 281e026 into main Mar 23, 2026
10 checks passed
disrupted pushed a commit to disrupted/opencode-native.nvim that referenced this pull request Jul 23, 2026
…do-tee#339)

* feat(completion): handle symlinked directories in file completion

* feat(util): support symlinked directories in is_path_in_cwd


This should resolve sudo-tee#336
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symbolic link files within cwd cannot be added to context

2 participants