Skip to content

Enable Launch Protein Viewer from File(s) for terminal-opened/remote files#44

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/open-local-files-terminal
Draft

Enable Launch Protein Viewer from File(s) for terminal-opened/remote files#44
Copilot wants to merge 3 commits into
mainfrom
copilot/open-local-files-terminal

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

Launch Protein Viewer from File(s) previously depended on Explorer context selection, so it could not reliably open files that were opened via integrated terminal workflows (including remote files outside watched workspace paths). This update makes command-palette invocation work against the active editor file when no Explorer selection is present.

  • Command fallback behavior

    • Updated protein-viewer.activateFromFiles to resolve inputs in this order:
      1. selectedFiles (Explorer multi/single selection)
      2. file_uri (single URI invocation)
      3. vscode.window.activeTextEditor.document.uri (command-palette/terminal-opened file flow)
    • Shows a user-facing error when no resolvable file exists, instead of attempting to render with empty input.
  • Documentation

    • Added README guidance for opening files from integrated terminal (including remote sessions) and then invoking Launch Protein Viewer from File(s) from the command palette.
  • Code hygiene in touched path

    • Removed debug logging from the file activation command path.
const filesToOpen = selectedFiles && selectedFiles.length > 0
  ? selectedFiles
  : file_uri
    ? [file_uri]
    : vscode.window.activeTextEditor
      ? [vscode.window.activeTextEditor.document.uri]
      : [];

if (filesToOpen.length === 0) {
  void vscode.window.showErrorMessage("No structure file selected or active.");
  return;
}

ProteinViewerPanel.renderFromFiles(context.extensionUri, filesToOpen);

Copilot AI linked an issue May 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add ability to open remote files using terminal Enable Launch Protein Viewer from File(s) for terminal-opened/remote files May 22, 2026
Copilot AI requested a review from a-r-j May 22, 2026 20:26
Copilot finished work on behalf of a-r-j May 22, 2026 20:26
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.

Open local files using terminal

2 participants