Skip to content

Commit 512cb26

Browse files
style: autofix
1 parent ffb5bbe commit 512cb26

8 files changed

Lines changed: 25 additions & 24 deletions

File tree

extension/oj.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { Platform } from 'un-oj'
2-
import type { OJ } from '../shared/events'
3-
import AtCoder from 'un-oj/platforms/atcoder'
4-
import Codeforces from 'un-oj/platforms/codeforces'
5-
import Hydro from 'un-oj/platforms/hydro'
6-
import LeetCode from 'un-oj/platforms/leetcode'
7-
import Luogu from 'un-oj/platforms/luogu'
8-
import Lyrio from 'un-oj/platforms/lyrio'
9-
import MXOJ from 'un-oj/platforms/mxoj'
1+
import type { Platform } from 'un-oj';
2+
import type { OJ } from '../shared/events';
3+
import AtCoder from 'un-oj/platforms/atcoder';
4+
import Codeforces from 'un-oj/platforms/codeforces';
5+
import Hydro from 'un-oj/platforms/hydro';
6+
import LeetCode from 'un-oj/platforms/leetcode';
7+
import Luogu from 'un-oj/platforms/luogu';
8+
import Lyrio from 'un-oj/platforms/lyrio';
9+
import MXOJ from 'un-oj/platforms/mxoj';
1010

1111
export const OJ_INSTANCE: Record<OJ, Platform<any>> = {
1212
AtCoder: new AtCoder(),

extension/webview.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import * as vscode from 'vscode';
33
import { version } from '../package.json';
44
import { EventMarker } from '../shared/events';
55
import { getAutoSave, getConfiguredDefaultTask, getConfiguredTasks, getDefaultTask, isConfigured } from './config';
6+
import { OJ_INSTANCE } from './oj';
67
import { Runner } from './runner';
78
import { logger } from './utils';
8-
import { OJ_INSTANCE } from './oj';
99

1010
class PanelProvider implements vscode.WebviewViewProvider, vscode.Disposable {
1111
static readonly VIEW_TYPE = 'oi-runner-2.panel';
@@ -172,7 +172,7 @@ class PanelProvider implements vscode.WebviewViewProvider, vscode.Disposable {
172172
});
173173
});
174174
break;
175-
175+
176176
case 'file:open-url':
177177
vscode.env.openExternal(vscode.Uri.parse(message.url));
178178
break;
@@ -183,10 +183,10 @@ class PanelProvider implements vscode.WebviewViewProvider, vscode.Disposable {
183183
this.postEvent({
184184
type: 'oj:samples-fetched',
185185
samples: res.samples,
186-
})
186+
});
187187
} catch (e) {
188188
logger.error('Failed to fetch samples:', e);
189-
this.postEvent({ type: 'oj:samples-fetched' })
189+
this.postEvent({ type: 'oj:samples-fetched' });
190190
const res = await vscode.window.showErrorMessage('Failed to fetch samples', 'Copy Details');
191191
if (res === 'Copy Details')
192192
vscode.env.clipboard.writeText(e instanceof Error && e.stack || String(e));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"publisher": "typed-sigterm",
33
"name": "oi-runner-2",
44
"displayName": "%extension.displayName%",
5+
"type": "module",
56
"version": "2.0.1",
67
"private": true,
7-
"type": "module",
88
"packageManager": "pnpm@10.9.0",
99
"description": "%extension.description%",
1010
"license": "MIT",

shared/events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ProblemIOSample } from "un-oj";
1+
import type { ProblemIOSample } from 'un-oj';
22

33
export const EventMarker = '__oiRunner2';
44

@@ -101,4 +101,4 @@ export type EventMessage = { // extension -> webview
101101
} | { // extension -> webview
102102
type: 'oj:samples-fetched'
103103
samples?: ProblemIOSample[]
104-
}
104+
};

src/components/ImportCases.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<script lang="ts">
22
import type { ProblemIOSample } from 'un-oj';
3+
import type { OJ } from '../../shared/events';
34
import { IconCloudAltDownloadFilled, IconLoadingLoop, IconQuestionCircle } from '@iconify-prerendered/vue-line-md';
45
import { ref, watch } from 'vue';
6+
import { postEvent, waitEvent } from '../utils';
57
import OJSelector from './OJSelector.vue';
68
import { Button } from './ui/button';
79
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from './ui/dialog';
810
import { Input } from './ui/input';
911
import { Label } from './ui/label';
1012
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
11-
import { postEvent, waitEvent } from '../utils';
12-
import type { OJ } from '../../shared/events';
1313
1414
export interface ImportedCase {
1515
input: string
@@ -58,11 +58,11 @@ async function handleImport() {
5858
}
5959
}
6060
61-
const reportIssue = () => postEvent({ type: 'file:open-url', url: 'https://github.com/un-oj/core' })
61+
const reportIssue = () => postEvent({ type: 'file:open-url', url: 'https://github.com/un-oj/core' });
6262
</script>
6363

6464
<template>
65-
<Dialog modal v-model:open="selecting">
65+
<Dialog v-model:open="selecting" modal>
6666
<DialogTrigger as-child>
6767
<li
6868
v-bind="$attrs"

src/components/OJSelector.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
2-
import { OJNames, type OJ } from '../../shared/events';
2+
import type { OJ } from '../../shared/events';
3+
import { OJNames } from '../../shared/events';
34
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
45
</script>
56

src/components/Runner.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<script lang="ts" setup>
2+
import type { ProblemIOSample } from 'un-oj';
23
import type { RunStep, TaskAttributes } from '../../shared/events';
34
import type { RunnerCase, RunnerState } from '../utils';
45
import { IconDiffSingle } from '@iconify-prerendered/vue-codicon';
6+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
57
import { nanoid } from 'nanoid';
68
import { computed, ref, toRaw, useTemplateRef, watch } from 'vue';
79
import { logger, postEvent } from '../utils';
810
import IOPanel from './IOPanel.vue';
911
import RunnerHint from './RunnerHint.vue';
1012
import Sidebar from './Sidebar.vue';
1113
import Toolbar from './Toolbar.vue';
12-
import type { ProblemIOSample } from 'un-oj';
13-
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
1414
1515
const { state } = defineProps<{
1616
state: RunnerState

src/components/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
2+
import type { ProblemIOSample } from 'un-oj';
23
import type { RunnerState } from '../utils';
34
import { IconConfirm, IconMinus, IconPlus, IconTrash } from '@iconify-prerendered/vue-line-md';
45
import { ref } from 'vue';
56
import ImportCases from './ImportCases.vue';
6-
import type { ProblemIOSample } from 'un-oj';
77
88
const { state } = defineProps<{
99
state: RunnerState

0 commit comments

Comments
 (0)