Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Open the command palette (`⌘ + ⇧ + p`) and simply call the `Start Protein Vi

Right-click on the file or selection of files in the file editor and select `Launch Protein Viewer from File(s)`

You can also open a file in the editor from the integrated terminal (for example on a remote server) and then run `Launch Protein Viewer from File(s)` from the command palette to load the active file.

**✅ Supported Formats**

* `.pdb`
Expand Down
15 changes: 12 additions & 3 deletions out/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion out/extension.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,21 @@ export async function activate(context: vscode.ExtensionContext) {
});
});

const activateFromFiles = vscode.commands.registerCommand("protein-viewer.activateFromFiles", (file_uri: vscode.Uri, selectedFiles: vscode.Uri[]) => {
console.log(file_uri);
console.log(selectedFiles);
ProteinViewerPanel.renderFromFiles(context.extensionUri, selectedFiles);
const activateFromFiles = vscode.commands.registerCommand("protein-viewer.activateFromFiles", (file_uri: vscode.Uri | undefined, selectedFiles: vscode.Uri[] | undefined) => {
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);
});

const activateFromFolder = vscode.commands.registerCommand("protein-viewer.activateFromFolder", (folder_uri: vscode.Uri) => {
Expand Down