Skip to content

Handle documents outside workspace#69

Merged
gediminasz merged 2 commits into
masterfrom
document-outside-workspace
Jan 2, 2026
Merged

Handle documents outside workspace#69
gediminasz merged 2 commits into
masterfrom
document-outside-workspace

Conversation

@gediminasz

Copy link
Copy Markdown
Owner

Part of #68

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

This PR implements support for handling documents outside the workspace in the ctags-companion extension, specifically for the provideDocumentSymbols functionality. This addresses issue #68.

Key changes:

  • Updated provideDocumentSymbols to use absolute file paths instead of relative paths and removed the workspace-specific working directory requirement
  • Modified definitionToSymbolInformation to handle cases where no workspace scope is available
  • Enhanced the VS Code mock to properly simulate getWorkspaceFolder behavior for documents outside the workspace

Reviewed changes

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

File Description
src/readtags.test.js Added parameterized test cases to verify document symbols work for both documents inside and outside the workspace
src/readtags.js Removed workspace-specific path handling and TODO/FIXME comments, now uses absolute paths and no longer requires a working directory
src/helpers.js Updated definitionToSymbolInformation to accept undefined scope, changed default parameters from null to undefined, and added logic to handle paths when scope is not available
src/mocks/vscode.js Updated getWorkspaceFolder mock to return undefined for URIs outside the workspace scope

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

Comment thread src/readtags.test.js Outdated
Comment thread src/helpers.js
Comment thread src/readtags.test.js Outdated
@gediminasz gediminasz merged commit 8c1ec0c into master Jan 2, 2026
1 check passed
@gediminasz gediminasz deleted the document-outside-workspace branch January 2, 2026 12:20
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.

2 participants