Skip to content

Add tests for Open Referenced File command - #4623

Open
syedataiba12311-coder wants to merge 3 commits into
github:mainfrom
syedataiba12311-coder:test/open-referenced-file-980
Open

syedataiba12311-coder wants to merge 3 commits into
github:mainfrom
syedataiba12311-coder:test/open-referenced-file-980

Conversation

@syedataiba12311-coder

Copy link
Copy Markdown

Summary

Adds focused coverage for the CodeQL: Open Referenced File command.

The test verifies that the command:

Closes #980.

Testing

This PR is opened as a draft for repository CI validation. The change only adds a VS Code test and does not modify production code.

@syedataiba12311-coder
syedataiba12311-coder marked this pull request as ready for review November 29, 2026 16:23
@syedataiba12311-coder
syedataiba12311-coder requested a review from a team as a code owner November 29, 2026 16:23
Copilot AI adaptive review requested due to automatic review settings November 29, 2026 16:23

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.

🟡 Changes recommended

The Windows-specific path contract remains unverified because the test uses only a POSIX fixture, allowing an incorrect use of Uri.path to pass on Linux.

1 open issue
What changed in this PR

Adds focused VS Code integration coverage for the existing CodeQL: Open Referenced File command, verifying .qlref resolution and opening the resolved query without preview mode.

Changes:

  • Adds a test verifying the selected URI's fsPath is passed to resolveQlref.
  • Verifies the resolved .ql file opens with { preview: false }.
  • Adds setup and cleanup for mocked VS Code APIs.
File Description
extensions/​ql-vscode/​test/​vscode-tests/​no-workspace/​language-support/​query-editor.test.ts Adds focused command-level test coverage for resolving and opening a referenced query file.

Review effort: Lite (adaptive)

});

it("resolves a qlref and opens the referenced query", async () => {
const selectedQuery = Uri.file("/tmp/reference.qlref");

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I've updated the test to use a Windows drive-letter URI when running on Windows, while retaining the POSIX fixture on other platforms. The assertion continues to verify selectedQuery.fsPath. The fix is pushed in commit f37dd0c. Could you please review the update?

This branch has not been deployed

No deployments
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.

Add tests for "open referenced file" command

2 participants