Skip to content

Commit

Permalink
Merge pull request #169 from sys-bio/minorfix
Browse files Browse the repository at this point in the history
Warning message change
  • Loading branch information
konankisa authored Jul 14, 2023
2 parents ac8e4cd + b01fe12 commit ee87548
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
25 changes: 12 additions & 13 deletions vscode-antimony/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ let activeEditor = vscode.window.activeTextEditor;
// RoundTripping SBML to Antimony
let roundTripping: boolean | null = null;

// Check if the current file is .txt
async function checkFileExtension() {
const doc = vscode.window.activeTextEditor.document;
const uri = doc.uri.toString();
const fileExtension = path.extname(uri);
if (fileExtension === '.txt') {
vscode.window.showInformationMessage('Please save the file as .ant to use VSCode-Antimony, otherwise ignore');
return;
}
}

// Activate extension
export async function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
Expand All @@ -55,9 +44,19 @@ export async function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('antimony.deleteVirtualEnv', (...args: any[]) => venvErrorFix()));

await createVirtualEnv(context);

// Check if the current file is .txt
const doc = vscode.window.activeTextEditor.document;
const uri = doc.uri.toString();
const fileExtension = path.extname(uri);
if (fileExtension !== '.ant' && fileExtension !== '.xml') {
if (fileExtension === '.txt') {
vscode.window.showInformationMessage('Please save the file as .ant to use VSCode-Antimony, otherwise ignore');
}
return;
}

await checkFileExtension();
await createVirtualEnv(context);

roundTripping = vscode.workspace.getConfiguration('vscode-antimony').get('openSBMLAsAntimony');

Expand Down
2 changes: 1 addition & 1 deletion vscode-antimony/src/modelBrowse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function modelSearchInput(context: ExtensionContext, initialEntity:
var tempPath
vscode.commands.executeCommand('antimony.sbmlStrToAntStr', xmlData).then(async (result: any) => {
if (result["error"]) {
window.showWarningMessage(`Could not convert SBML to Antimony, displaying default content.`);
window.showWarningMessage(`Could not convert to Antimony, displaying default content.`);
var tempFile = xmlName
result = xmlData
} else {
Expand Down

0 comments on commit ee87548

Please sign in to comment.