Skip to content

Commit

Permalink
Added basic compilation (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
cohansen authored Sep 26, 2024
1 parent ed2d2b6 commit 304e440
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/sequencing/SequenceEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@
setSequenceAdaptation(undefined);
}
function compile(): void {
if (selectedOutputFormat?.compile) {
selectedOutputFormat.compile(sequenceOutput);
}
}
async function sequenceUpdateListener(viewUpdate: ViewUpdate): Promise<void> {
const sequence = viewUpdate.state.doc.toString();
disableCopyAndExport = sequence === '';
Expand Down Expand Up @@ -452,6 +458,10 @@
{/each}
</Menu>
</div>

{#if selectedOutputFormat?.compile}
<button class="st-button icon-button secondary ellipsis" on:click={compile}>Compile</button>
{/if}
</div>
</svelte:fragment>

Expand Down
1 change: 1 addition & 0 deletions src/types/sequencing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type DictionaryType = {
};

export interface IOutputFormat {
compile?: (output: string) => Promise<void>;
fileExtension: string;
linter?: (
diagnostics: Diagnostic[],
Expand Down

0 comments on commit 304e440

Please sign in to comment.