Autocomplete and evaluate solutions on the solve page
The editor's completion popup was on but empty for C++, since @codemirror/lang-cpp has no completion source. web/src/completions.js adds one: keywords, the STL, every name in the file (the template's macros show their expansion, typedefs what they alias), members after . and ->, and snippets for the loops and lambdas typed over and over. Python gains the contest standard library and members after ., on top of lang-python's builtins and local names. Nothing knows types, so members are the common ones plus those already used in the file. Evaluate (POST/GET /problems/<name>/evaluate) has Claude judge the editor's code as a strong competitive programmer would before submitting. It runs the saved tests on the runner first, as Submit does, and gives Claude the verdicts and up to three failing cases. The reply is a verdict, correctness, complexity against the constraints, line-anchored issues and a traced counterexample (internal/evaluate). The page shows it in an Evaluation tab of the results panel, marks the issues in the editor beside the lint's for as long as their lines are unchanged, and can load the counterexample as the custom input. It is a background job the page polls, like explanations, but it commits nothing: the code is a draft. explain.Jobs.StartWith keeps a finished job's answer in memory until the next one or a restart. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -60,6 +60,11 @@ export const runCode = (name, body) => request("POST", `/problems/${encodeURICom
|
||||
export const lintCode = (name, body) => request("POST", `/problems/${encodeURIComponent(name)}/lint`, body);
|
||||
// Commits the source as the problem's solution file in that language.
|
||||
export const saveCode = (name, body) => request("PUT", `/problems/${encodeURIComponent(name)}/code`, body);
|
||||
// body: { lang, source, note? }. Starts Claude judging the source (after a
|
||||
// run of the saved tests) and answers 202; the status's result is the
|
||||
// evaluation once it is done. Nothing is committed.
|
||||
export const startEvaluate = (name, body) => request("POST", `/problems/${encodeURIComponent(name)}/evaluate`, body);
|
||||
export const evaluateStatus = (name) => request("GET", `/problems/${encodeURIComponent(name)}/evaluate`);
|
||||
// Imports today's LeetCode daily question (or finds it, if it is already a
|
||||
// problem) and answers { name, created }. It takes a few seconds.
|
||||
export const startDaily = () => request("POST", "/leetcode/daily");
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
/**
|
||||
* The solve page's autocomplete. CodeMirror's basicSetup already shows
|
||||
* completions as you type, but @codemirror/lang-cpp offers none, and
|
||||
* lang-python only keywords, builtins and the names defined in the file.
|
||||
*
|
||||
* Both languages get the library a contest solution reaches for, and
|
||||
* member names after "." (and "->"), which neither language package does.
|
||||
* Members are the common STL (or list/dict/str) ones plus every member
|
||||
* already used in the file: without a type checker, that is as close as a
|
||||
* completion can get to what the object actually has. C++ also gets every
|
||||
* name in the file, so the template's macros and typedefs (F, takeI, ll)
|
||||
* come up with what they expand to, and snippets for the loops and lambdas
|
||||
* that are typed over and over.
|
||||
*
|
||||
* A real language server (clangd) would know types, but would have to run
|
||||
* beside the code runner and hold a session open per editor; this is local
|
||||
* and instant.
|
||||
*/
|
||||
import { completeFromList, ifNotIn, snippetCompletion as snip } from "@codemirror/autocomplete";
|
||||
import { syntaxTree } from "@codemirror/language";
|
||||
import { cppLanguage } from "@codemirror/lang-cpp";
|
||||
import { pythonLanguage } from "@codemirror/lang-python";
|
||||
|
||||
// "a b c" as completions of one type, with a detail (the header).
|
||||
const words = (list, type, detail) => list.trim().split(/\s+/).map((label) => ({ label, type, detail }));
|
||||
|
||||
// ---- C++ ----
|
||||
|
||||
const CPP_KEYWORDS = words(
|
||||
`auto bool break case catch char class const constexpr continue default delete do double else enum explicit
|
||||
extern false float for friend goto if inline int long mutable namespace new noexcept nullptr operator private
|
||||
protected public return short signed sizeof static static_assert static_cast struct switch template this throw
|
||||
true try typedef typename union unsigned using virtual void volatile while`,
|
||||
"keyword",
|
||||
);
|
||||
|
||||
const CPP_LIBRARY = [
|
||||
...words(
|
||||
"vector string array deque list map multimap set multiset unordered_map unordered_set unordered_multimap stack queue priority_queue bitset pair tuple optional function",
|
||||
"type",
|
||||
"std",
|
||||
),
|
||||
...words("int64_t uint64_t int32_t uint32_t size_t __int128", "type"),
|
||||
...words("greater less hash", "class", "<functional>"),
|
||||
...words("cin cout cerr endl", "variable", "<iostream>"),
|
||||
...words("getline to_string stoi stoll stod freopen printf scanf puts", "function", "<string>/<cstdio>"),
|
||||
...words(
|
||||
`sort stable_sort reverse min max swap minmax lower_bound upper_bound equal_range binary_search unique fill
|
||||
find find_if count count_if max_element min_element next_permutation prev_permutation nth_element
|
||||
partial_sort rotate all_of any_of none_of transform copy remove remove_if shuffle`,
|
||||
"function",
|
||||
"<algorithm>",
|
||||
),
|
||||
...words("accumulate iota partial_sum adjacent_difference gcd lcm", "function", "<numeric>"),
|
||||
...words("abs sqrt sqrtl cbrt pow exp log log2 log10 floor ceil round hypot", "function", "<cmath>"),
|
||||
...words("make_pair make_tuple tie get move distance next prev advance begin end", "function", "std"),
|
||||
...words("memset memcpy strlen", "function", "<cstring>"),
|
||||
...words(
|
||||
"__builtin_popcount __builtin_popcountll __builtin_clz __builtin_clzll __builtin_ctz __builtin_ctzll __lg",
|
||||
"function",
|
||||
"builtin",
|
||||
),
|
||||
...words("INT_MAX INT_MIN LLONG_MAX LLONG_MIN UINT_MAX", "constant", "<climits>"),
|
||||
{ label: "numeric_limits", type: "class", detail: "<limits>" },
|
||||
{ label: "mt19937", type: "class", detail: "<random>" },
|
||||
{ label: "chrono", type: "namespace" },
|
||||
{ label: "std", type: "namespace" },
|
||||
];
|
||||
|
||||
// Nothing knows the object's type, so the members used most come first.
|
||||
const COMMON_MEMBERS = new Set(["push_back", "size", "begin", "end", "first", "second", "back", "pop_back", "insert", "count"]);
|
||||
const CPP_MEMBERS = words(
|
||||
`push_back emplace_back pop_back push_front emplace_front pop_front back front size empty clear begin end
|
||||
rbegin rend insert emplace erase find count lower_bound upper_bound resize reserve assign at data swap
|
||||
push pop top first second substr length append c_str compare set reset flip test any none all to_string
|
||||
to_ullong value has_value`,
|
||||
"method",
|
||||
).map((c) => (COMMON_MEMBERS.has(c.label) ? { ...c, boost: 1 } : c));
|
||||
|
||||
// The template's habits, as snippets. Same-named fields are edited
|
||||
// together, so typing the loop variable once fills in all three.
|
||||
const CPP_SNIPPETS = [
|
||||
snip("for (int ${i} = 0; ${i} < ${n}; ${i}++) {\n\t${}\n}", { label: "for", detail: "loop", type: "keyword" }),
|
||||
snip("for (int ${i} = ${n} - 1; ${i} >= 0; ${i}--) {\n\t${}\n}", { label: "forr", detail: "loop down", type: "keyword" }),
|
||||
snip("for (auto &${x} : ${v}) {\n\t${}\n}", { label: "foreach", detail: "range loop", type: "keyword" }),
|
||||
snip("while (${}) {\n\t${}\n}", { label: "while", detail: "loop", type: "keyword" }),
|
||||
snip("if (${}) {\n\t${}\n}", { label: "if", detail: "block", type: "keyword" }),
|
||||
snip("if (${}) {\n\t${}\n} else {\n\t${}\n}", { label: "ifelse", detail: "block", type: "keyword" }),
|
||||
snip("struct ${Name} {\n\t${}\n};", { label: "struct", detail: "definition", type: "keyword" }),
|
||||
snip("auto ${f} = [&](${}) {\n\t${}\n};", { label: "lambda", detail: "[&] lambda", type: "keyword" }),
|
||||
snip("function<void(int)> ${dfs} = [&](int ${u}) {\n\t${}\n};", {
|
||||
label: "dfs",
|
||||
detail: "recursive lambda",
|
||||
type: "keyword",
|
||||
}),
|
||||
snip("sort(${a}.begin(), ${a}.end(), [&](const auto &${x}, const auto &${y}) {\n\treturn ${};\n});", {
|
||||
label: "sortby",
|
||||
detail: "sort with a comparator",
|
||||
type: "keyword",
|
||||
}),
|
||||
];
|
||||
|
||||
// A keyword with a snippet of the same name would hide it behind a plain
|
||||
// word, so the snippet stands in for it.
|
||||
const SNIPPED = new Set(CPP_SNIPPETS.map((c) => c.label));
|
||||
const CPP_FIXED = [...CPP_KEYWORDS.filter((c) => !SNIPPED.has(c.label)), ...CPP_LIBRARY, ...CPP_SNIPPETS];
|
||||
const CPP_FIXED_LABELS = new Set(CPP_FIXED.map((c) => c.label));
|
||||
|
||||
// Comments, strings and #include <...> get no completions.
|
||||
const CPP_SKIP = new Set(["LineComment", "BlockComment", "String", "RawString", "CharLiteral", "SystemLibString"]);
|
||||
const CPP_NAMES = new Set(["Identifier", "TypeIdentifier", "NamespaceIdentifier"]);
|
||||
|
||||
// "#define F(i, L, R) for (...)": a macro, shown with its parameters and
|
||||
// what it expands to.
|
||||
const DEFINE = /^[ \t]*#[ \t]*define[ \t]+([A-Za-z_]\w*)(\([^)]*\))?/dgm;
|
||||
// "typedef long long ll;" and "using vi = vector<int>;"
|
||||
const ALIAS = /\btypedef\s+([^;]+?)\s+([A-Za-z_]\w*)\s*;|\busing\s+([A-Za-z_]\w*)\s*=\s*([^;]+);/g;
|
||||
|
||||
function brief(s) {
|
||||
s = s.replace(/\s+/g, " ").trim();
|
||||
return s.length > 48 ? s.slice(0, 47) + "…" : s;
|
||||
}
|
||||
|
||||
// A macro's body: the rest of its line, and the next while a line ends in
|
||||
// a backslash.
|
||||
function macroBody(text, at) {
|
||||
let body = "";
|
||||
for (;;) {
|
||||
const end = text.indexOf("\n", at);
|
||||
const line = text.slice(at, end < 0 ? text.length : end);
|
||||
if (!line.endsWith("\\") || end < 0) return body + line;
|
||||
body += line.slice(0, -1) + " ";
|
||||
at = end + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// The file's own names, leaving out the word being typed (at skipFrom):
|
||||
// otherwise every half-typed name would complete to itself.
|
||||
function cppFileNames(state, skipFrom) {
|
||||
const text = state.doc.toString();
|
||||
const out = new Map();
|
||||
for (const m of text.matchAll(DEFINE)) {
|
||||
if (m.indices[1][0] === skipFrom) continue;
|
||||
const body = brief(macroBody(text, m.index + m[0].length));
|
||||
// The template defines DBG twice, the #else one empty: keep the one
|
||||
// that says something.
|
||||
if (!body && out.has(m[1])) continue;
|
||||
out.set(m[1], {
|
||||
label: m[1],
|
||||
type: m[2] ? "function" : "constant",
|
||||
detail: m[2] ? m[2].replace(/\s+/g, "") : undefined,
|
||||
info: body || undefined,
|
||||
boost: 2,
|
||||
});
|
||||
}
|
||||
for (const m of text.matchAll(ALIAS)) {
|
||||
const [name, to] = m[2] ? [m[2], m[1]] : [m[3], m[4]];
|
||||
if (!out.has(name)) out.set(name, { label: name, type: "type", detail: brief(to), boost: 2 });
|
||||
}
|
||||
syntaxTree(state).iterate({
|
||||
enter(n) {
|
||||
if (CPP_SKIP.has(n.name)) return false;
|
||||
if (!CPP_NAMES.has(n.name) || n.from === skipFrom) return;
|
||||
const name = text.slice(n.from, n.to);
|
||||
if (name.length < 2 || out.has(name) || CPP_FIXED_LABELS.has(name)) return;
|
||||
out.set(name, { label: name, type: n.name === "TypeIdentifier" ? "type" : "variable", boost: 1 });
|
||||
},
|
||||
});
|
||||
return [...out.values()];
|
||||
}
|
||||
|
||||
// Members already used in the file (x.first, it->second, seg.query).
|
||||
function fileMembers(state, nodeName, skipFrom, known) {
|
||||
const out = [];
|
||||
const seen = new Set(known);
|
||||
syntaxTree(state).iterate({
|
||||
enter(n) {
|
||||
if (n.name !== nodeName || n.from === skipFrom) return;
|
||||
const name = state.sliceDoc(n.from, n.to);
|
||||
if (seen.has(name)) return;
|
||||
seen.add(name);
|
||||
out.push({ label: name, type: "property" });
|
||||
},
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
const CPP_MEMBER_LABELS = CPP_MEMBERS.map((c) => c.label);
|
||||
|
||||
// Whether the word at from follows a member access: "." but not the one in
|
||||
// "1." (a number), and in C++ "->" too.
|
||||
function afterMember(state, from, arrow) {
|
||||
const text = state.sliceDoc(Math.max(0, from - 32), from);
|
||||
if (arrow && text.endsWith("->")) return true;
|
||||
return text.endsWith(".") && !/(^|[^\w])\d+\.$/.test(text);
|
||||
}
|
||||
|
||||
function cppSource(context) {
|
||||
const node = syntaxTree(context.state).resolveInner(context.pos, -1);
|
||||
for (let n = node; n; n = n.parent) if (CPP_SKIP.has(n.name)) return null;
|
||||
const word = context.matchBefore(/[A-Za-z_]\w*/);
|
||||
const from = word ? word.from : context.pos;
|
||||
if (afterMember(context.state, from, true)) {
|
||||
return {
|
||||
from,
|
||||
options: [...CPP_MEMBERS, ...fileMembers(context.state, "FieldIdentifier", from, CPP_MEMBER_LABELS)],
|
||||
validFor: /^\w*$/,
|
||||
};
|
||||
}
|
||||
if (!word && !context.explicit) return null;
|
||||
return { from, options: [...cppFileNames(context.state, from), ...CPP_FIXED], validFor: /^\w*$/ };
|
||||
}
|
||||
|
||||
export const cppCompletions = () => cppLanguage.data.of({ autocomplete: cppSource });
|
||||
|
||||
// ---- Python ----
|
||||
|
||||
// The standard library a contest solution imports from. lang-python
|
||||
// already completes builtins and the file's own names, and has its own
|
||||
// def/for/class snippets.
|
||||
const PY_LIBRARY = [
|
||||
...words("defaultdict Counter deque OrderedDict", "class", "collections"),
|
||||
...words("heappush heappop heapify heappushpop nlargest nsmallest", "function", "heapq"),
|
||||
...words("bisect_left bisect_right insort", "function", "bisect"),
|
||||
...words("lru_cache cache cmp_to_key reduce", "function", "functools"),
|
||||
...words("accumulate permutations combinations combinations_with_replacement product groupby pairwise", "function", "itertools"),
|
||||
...words("gcd lcm isqrt comb perm inf sqrt log2 ceil floor", "function", "math"),
|
||||
...words("setrecursionlimit stdin stdout", "function", "sys"),
|
||||
snip("sys.setrecursionlimit(${10 ** 6})", { label: "recursionlimit", detail: "sys", type: "keyword" }),
|
||||
];
|
||||
|
||||
const PY_MEMBERS = words(
|
||||
`append extend insert pop remove clear sort reverse index count copy keys values items get setdefault update
|
||||
add discard union intersection difference split join strip lstrip rstrip startswith endswith replace find
|
||||
lower upper isdigit appendleft popleft most_common read readline buffer`,
|
||||
"method",
|
||||
);
|
||||
const PY_MEMBER_LABELS = PY_MEMBERS.map((c) => c.label);
|
||||
|
||||
const pyLibrary = completeFromList(PY_LIBRARY);
|
||||
|
||||
function pySource(context) {
|
||||
const word = context.matchBefore(/[A-Za-z_]\w*/);
|
||||
const from = word ? word.from : context.pos;
|
||||
if (afterMember(context.state, from, false)) {
|
||||
return {
|
||||
from,
|
||||
options: [...PY_MEMBERS, ...fileMembers(context.state, "PropertyName", from, PY_MEMBER_LABELS)],
|
||||
validFor: /^\w*$/,
|
||||
};
|
||||
}
|
||||
// lang-python leaves property names alone; everywhere else the library
|
||||
// joins its builtins.
|
||||
return pyLibrary(context);
|
||||
}
|
||||
|
||||
export const pythonCompletions = () =>
|
||||
pythonLanguage.data.of({ autocomplete: ifNotIn(["String", "FormatString", "Comment"], pySource) });
|
||||
@@ -14,6 +14,9 @@
|
||||
* is remote and debounced by the page), and are pushed with setDiagnostics
|
||||
* rather than through a linter() source the editor would schedule itself.
|
||||
* CodeMirror maps them through later edits until the next set arrives.
|
||||
*
|
||||
* Completions come from basicSetup's autocompletion with sources of our own
|
||||
* (completions.js), since lang-cpp has none.
|
||||
*/
|
||||
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
|
||||
import { basicSetup } from "codemirror";
|
||||
@@ -25,6 +28,7 @@ import { lintGutter, setDiagnostics } from "@codemirror/lint";
|
||||
import { cpp } from "@codemirror/lang-cpp";
|
||||
import { python } from "@codemirror/lang-python";
|
||||
import { tags as t } from "@lezer/highlight";
|
||||
import { cppCompletions, pythonCompletions } from "@/completions";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: String, required: true },
|
||||
@@ -37,9 +41,9 @@ const emit = defineEmits(["update:modelValue", "run", "submit", "save"]);
|
||||
|
||||
// The workspace's styles: clang-format's two spaces for C++, PEP 8's four.
|
||||
const LANGS = {
|
||||
cpp: () => [cpp(), indentUnit.of(" ")],
|
||||
c: () => [cpp(), indentUnit.of(" ")],
|
||||
python: () => [python(), indentUnit.of(" ")],
|
||||
cpp: () => [cpp(), cppCompletions(), indentUnit.of(" ")],
|
||||
c: () => [cpp(), cppCompletions(), indentUnit.of(" ")],
|
||||
python: () => [python(), pythonCompletions(), indentUnit.of(" ")],
|
||||
};
|
||||
|
||||
const highlight = HighlightStyle.define([
|
||||
@@ -95,6 +99,14 @@ const theme = EditorView.theme(
|
||||
".cm-diagnostic-info": { borderLeftColor: "var(--color-ink-faint)" },
|
||||
".cm-diagnosticSource": { color: "var(--color-ink-muted)" },
|
||||
".cm-panels": { backgroundColor: "var(--color-paper-tint)", color: "var(--color-ink)" },
|
||||
".cm-tooltip.cm-tooltip-autocomplete > ul": { fontFamily: "var(--font-mono)", fontSize: "0.8rem", maxHeight: "16em" },
|
||||
".cm-tooltip.cm-tooltip-autocomplete > ul > li": { padding: "1px 8px 1px 4px" },
|
||||
".cm-tooltip-autocomplete ul li[aria-selected]": { backgroundColor: "#d7e6fb", color: "var(--color-ink)" },
|
||||
".cm-completionMatchedText": { textDecoration: "none", fontWeight: "600" },
|
||||
".cm-completionDetail": { color: "var(--color-ink-muted)", fontStyle: "normal", marginLeft: "1em" },
|
||||
".cm-completionIcon": { opacity: "0.55" },
|
||||
".cm-tooltip.cm-completionInfo": { fontFamily: "var(--font-mono)", fontSize: "0.8rem", padding: "4px 8px" },
|
||||
".cm-snippetField": { backgroundColor: "rgba(0, 0, 0, 0.05)" },
|
||||
},
|
||||
{ dark: false },
|
||||
);
|
||||
@@ -186,7 +198,16 @@ watch(
|
||||
);
|
||||
watch(() => props.diagnostics, () => view && pushDiagnostics());
|
||||
|
||||
defineExpose({ focus: () => view?.focus() });
|
||||
// Puts the cursor at the start of a line's code and shows it.
|
||||
function goto(line) {
|
||||
if (!view) return;
|
||||
const l = view.state.doc.line(Math.min(Math.max(line, 1), view.state.doc.lines));
|
||||
const at = l.from + (/^\s*/.exec(l.text)?.[0].length || 0);
|
||||
view.dispatch({ selection: { anchor: at }, effects: EditorView.scrollIntoView(at, { y: "center" }) });
|
||||
view.focus();
|
||||
}
|
||||
|
||||
defineExpose({ focus: () => view?.focus(), goto });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
<script setup>
|
||||
/**
|
||||
* The solve page's Evaluation tab: Claude's judgement of the code in the
|
||||
* editor (internal/evaluate), after a run of the saved tests.
|
||||
*
|
||||
* It is about the source it was given, which the editor may have moved on
|
||||
* from: the report says so rather than hiding, since most of it still
|
||||
* applies after a small fix. Its issues are also marked in the editor by
|
||||
* the page, on the lines they were about, for as long as those lines are
|
||||
* unchanged.
|
||||
*/
|
||||
import { computed } from "vue";
|
||||
import CodeBlock from "@/components/CodeBlock.vue";
|
||||
import { markdown } from "@/markdown";
|
||||
import { EVAL_VERDICTS, LANG_LABELS } from "@/format";
|
||||
|
||||
const props = defineProps({
|
||||
// The job: { state: idle | running | done | error, error? }.
|
||||
job: { type: Object, required: true },
|
||||
evaluation: { type: Object, default: null },
|
||||
// The editor's language, and whether its source is still the one judged.
|
||||
lang: { type: String, required: true },
|
||||
stale: { type: Boolean, default: false },
|
||||
// Why Evaluate is off, or "".
|
||||
disabled: { type: String, default: "" },
|
||||
note: { type: String, default: "" },
|
||||
});
|
||||
defineEmits(["evaluate", "goto", "use-input", "update:note"]);
|
||||
|
||||
const md = markdown();
|
||||
const render = (s) => (s ? md.render(s) : "");
|
||||
|
||||
const ev = computed(() => props.evaluation);
|
||||
const verdict = computed(() => EVAL_VERDICTS[ev.value?.verdict] || { label: ev.value?.verdict, tone: "plain" });
|
||||
const otherLang = computed(() => !!ev.value && ev.value.lang !== props.lang);
|
||||
const running = computed(() => props.job.state === "running");
|
||||
const at = computed(() =>
|
||||
ev.value ? new Date(ev.value.at).toLocaleString(undefined, { hour: "2-digit", minute: "2-digit", day: "numeric", month: "short" }) : "",
|
||||
);
|
||||
const counter = computed(() => (ev.value?.counterexample?.input ? ev.value.counterexample : null));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="evaluation">
|
||||
<form class="ask" @submit.prevent="$emit('evaluate')">
|
||||
<input
|
||||
:value="note"
|
||||
type="text"
|
||||
maxlength="4000"
|
||||
placeholder="Anything to check? (optional) e.g. overflow, the n = 1 case"
|
||||
aria-label="What Claude should look at"
|
||||
@input="$emit('update:note', $event.target.value)"
|
||||
/>
|
||||
<button class="btn" type="submit" :disabled="!!disabled || running" :title="disabled">
|
||||
{{ running ? "Evaluating…" : ev ? "Evaluate again" : "Evaluate" }}
|
||||
</button>
|
||||
</form>
|
||||
<p v-if="running" class="working" role="status">
|
||||
Running the saved tests, then Claude reads the code. This takes a minute or two.
|
||||
</p>
|
||||
<p v-else-if="job.state === 'error'" class="error" role="status">Evaluation failed: {{ job.error }}</p>
|
||||
<p v-else-if="!ev" class="muted intro">
|
||||
Claude judges the code in the editor against the statement and the saved tests' verdicts: whether it will be
|
||||
accepted, its complexity, the lines that are wrong, and an input that breaks it. Nothing is committed.
|
||||
</p>
|
||||
|
||||
<template v-if="ev">
|
||||
<p class="facts">
|
||||
<span class="badge verdict" :class="verdict.tone">{{ verdict.label }}</span>
|
||||
<span v-if="ev.tests" class="muted">Tests: {{ ev.tests }}</span>
|
||||
<span class="muted">{{ LANG_LABELS[ev.lang] || ev.lang }} · {{ ev.model }} · {{ at }}</span>
|
||||
</p>
|
||||
<p v-if="otherLang" class="stale">
|
||||
This is about your {{ LANG_LABELS[ev.lang] || ev.lang }} code; its issues are not marked in this editor.
|
||||
</p>
|
||||
<p v-else-if="stale" class="stale">
|
||||
The code has changed since. Issues stay marked on the lines that haven't.
|
||||
</p>
|
||||
|
||||
<div class="prose" v-html="render(ev.summary)"></div>
|
||||
|
||||
<section v-if="ev.issues?.length">
|
||||
<h3>Issues</h3>
|
||||
<ul class="issues">
|
||||
<li v-for="(is, i) in ev.issues" :key="i">
|
||||
<p class="issue-head">
|
||||
<span class="sev" :class="is.severity" :title="is.severity" aria-hidden="true"></span>
|
||||
<button v-if="is.line && !otherLang" type="button" class="line" @click="$emit('goto', is.line)">
|
||||
Line {{ is.line }}
|
||||
</button>
|
||||
<span v-else-if="is.line" class="line plain">Line {{ is.line }}</span>
|
||||
<strong>{{ is.title }}</strong>
|
||||
<span class="visually-hidden">({{ is.severity }})</span>
|
||||
</p>
|
||||
<div class="prose detail" v-html="render(is.detail)"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section v-if="counter">
|
||||
<h3>Counterexample</h3>
|
||||
<div class="io">
|
||||
<div>
|
||||
<p class="filename muted">Input</p>
|
||||
<CodeBlock :content="counter.input" />
|
||||
</div>
|
||||
<div>
|
||||
<p class="filename muted">Expected</p>
|
||||
<CodeBlock :content="counter.expected" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="prose" v-html="render(counter.why)"></div>
|
||||
<button class="btn" type="button" @click="$emit('use-input', counter.input)">Use as custom input</button>
|
||||
</section>
|
||||
|
||||
<section v-if="ev.correctness">
|
||||
<h3>Correctness</h3>
|
||||
<div class="prose" v-html="render(ev.correctness)"></div>
|
||||
</section>
|
||||
<section v-if="ev.complexity">
|
||||
<h3>Complexity</h3>
|
||||
<div class="prose" v-html="render(ev.complexity)"></div>
|
||||
</section>
|
||||
<section v-if="ev.style">
|
||||
<h3>Style</h3>
|
||||
<div class="prose" v-html="render(ev.style)"></div>
|
||||
</section>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.evaluation {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.evaluation > * {
|
||||
min-width: 0;
|
||||
}
|
||||
.ask {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
.ask input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--color-line);
|
||||
border-radius: 4px;
|
||||
font-size: 0.85rem;
|
||||
color: var(--color-ink);
|
||||
background: var(--color-paper);
|
||||
}
|
||||
.intro {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.facts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px 12px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.verdict {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.verdict.ok {
|
||||
color: var(--color-solved);
|
||||
border-color: currentColor;
|
||||
}
|
||||
.verdict.warn {
|
||||
color: var(--color-solving);
|
||||
border-color: currentColor;
|
||||
}
|
||||
.verdict.bad {
|
||||
color: var(--color-ink-danger);
|
||||
border-color: currentColor;
|
||||
}
|
||||
.stale {
|
||||
font-size: 0.85rem;
|
||||
color: var(--color-solving);
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.05rem;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.issues {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
.issue-head {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px 8px;
|
||||
}
|
||||
.detail {
|
||||
margin: 2px 0 0 16px;
|
||||
}
|
||||
.sev {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
flex: none;
|
||||
background: var(--color-ink-faint);
|
||||
}
|
||||
.sev.error {
|
||||
background: var(--color-ink-danger);
|
||||
}
|
||||
.sev.warning {
|
||||
background: var(--color-solving);
|
||||
}
|
||||
.line {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.8rem;
|
||||
padding: 0 6px;
|
||||
border: 1px solid var(--color-line);
|
||||
border-radius: 4px;
|
||||
background: var(--color-paper-tint);
|
||||
color: var(--color-ink-link);
|
||||
cursor: pointer;
|
||||
}
|
||||
.line.plain {
|
||||
color: var(--color-ink-muted);
|
||||
cursor: default;
|
||||
}
|
||||
.io {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.io > div {
|
||||
min-width: 0;
|
||||
}
|
||||
.filename {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.8rem;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
section > .btn {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
}
|
||||
/* The results panel's pulsing dot: the job is still going. */
|
||||
.working {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.working::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-right: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-solving);
|
||||
animation: pulse 1.2s ease-in-out infinite;
|
||||
}
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
opacity: 0.25;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.working::before {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -7,6 +7,9 @@
|
||||
*
|
||||
* After a run the panel opens the tab worth reading first: the compile
|
||||
* error, else the first test that failed, else the first test.
|
||||
*
|
||||
* With evaluationTab set there is also an Evaluation tab, whose content is
|
||||
* the page's (the evaluation slot); the page opens it with show().
|
||||
*/
|
||||
import { computed, ref, watch } from "vue";
|
||||
import CodeBlock from "@/components/CodeBlock.vue";
|
||||
@@ -19,6 +22,8 @@ const props = defineProps({
|
||||
running: { type: String, default: "" },
|
||||
error: { type: String, default: "" },
|
||||
modelValue: { type: String, default: "" },
|
||||
// { label, tone: ok | warn | bad | plain | "" } for the Evaluation tab.
|
||||
evaluationTab: { type: Object, default: null },
|
||||
});
|
||||
defineEmits(["update:modelValue"]);
|
||||
|
||||
@@ -38,6 +43,7 @@ const warnings = computed(() => compile.value?.ok && compile.value.output?.trim(
|
||||
|
||||
const tabs = computed(() => {
|
||||
const out = [{ id: "custom", label: "Custom input" }];
|
||||
if (props.evaluationTab) out.push({ id: "evaluation", ...props.evaluationTab });
|
||||
if (compile.value && !compile.value.ok) out.push({ id: "compile", label: "Compile error", verdict: "bad" });
|
||||
if (warnings.value) out.push({ id: "warnings", label: "Warnings" });
|
||||
results.value.forEach((r, i) => {
|
||||
@@ -77,6 +83,8 @@ const summary = computed(() => {
|
||||
});
|
||||
|
||||
const verdictClass = (v) => (v === "AC" ? "ok" : v === "unchecked" || !v ? "plain" : "bad");
|
||||
|
||||
defineExpose({ show: (id) => (tab.value = id) });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -94,7 +102,12 @@ const verdictClass = (v) => (v === "AC" ? "ok" : v === "unchecked" || !v ? "plai
|
||||
:class="{ on: tab === tb.id }"
|
||||
@click="tab = tb.id"
|
||||
>
|
||||
<span v-if="tb.verdict" class="dot" :class="verdictClass(tb.verdict)" aria-hidden="true"></span>
|
||||
<span
|
||||
v-if="tb.verdict || tb.tone"
|
||||
class="dot"
|
||||
:class="tb.tone || verdictClass(tb.verdict)"
|
||||
aria-hidden="true"
|
||||
></span>
|
||||
{{ tb.label }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -105,9 +118,11 @@ const verdictClass = (v) => (v === "AC" ? "ok" : v === "unchecked" || !v ? "plai
|
||||
</div>
|
||||
|
||||
<div id="run-panel" class="body" role="tabpanel" :aria-labelledby="`tab-${tab}`">
|
||||
<p v-if="error" class="error">{{ error }}</p>
|
||||
<p v-if="error && tab !== 'evaluation'" class="error">{{ error }}</p>
|
||||
|
||||
<label v-if="tab === 'custom'" class="custom">
|
||||
<slot v-if="tab === 'evaluation'" name="evaluation"></slot>
|
||||
|
||||
<label v-else-if="tab === 'custom'" class="custom">
|
||||
<span class="muted">
|
||||
Input for Run ({{ MOD_KEY }}+Enter). Submit ({{ MOD_KEY }}+Shift+Enter) runs the saved tests instead.
|
||||
</span>
|
||||
@@ -219,6 +234,9 @@ const verdictClass = (v) => (v === "AC" ? "ok" : v === "unchecked" || !v ? "plai
|
||||
.dot.bad {
|
||||
background: var(--color-ink-danger);
|
||||
}
|
||||
.dot.warn {
|
||||
background: var(--color-solving);
|
||||
}
|
||||
.summary,
|
||||
.working {
|
||||
font-size: 0.85rem;
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
|
||||
export const STATUS_LABELS = { solving: "Solving", solved: "Solved", skipped: "Skipped" };
|
||||
|
||||
// internal/evaluate's verdicts, with a tone for badges and tab dots.
|
||||
export const EVAL_VERDICTS = {
|
||||
correct: { label: "Looks correct", tone: "ok" },
|
||||
edge_cases: { label: "Misses edge cases", tone: "warn" },
|
||||
too_slow: { label: "Too slow", tone: "bad" },
|
||||
wrong: { label: "Wrong", tone: "bad" },
|
||||
incomplete: { label: "Unfinished", tone: "plain" },
|
||||
};
|
||||
|
||||
export const LANG_LABELS = { cpp: "C++", c: "C", python: "Python", java: "Java", rust: "Rust", go: "Go" };
|
||||
|
||||
// "diamond-collector" -> "Diamond Collector"
|
||||
|
||||
@@ -2,22 +2,25 @@
|
||||
/**
|
||||
* Solve a problem in the browser (admin only): the statement and saved
|
||||
* tests on the left, an editor on the right with Run (the custom input),
|
||||
* Submit (the saved tests) and Save (a commit, like the CLI's).
|
||||
* Submit (the saved tests), Evaluate (Claude's judgement of the code, after
|
||||
* a run of the tests) and Save (a commit, like the CLI's).
|
||||
*
|
||||
* What is typed is kept as a draft in this browser per problem and language
|
||||
* until it is saved or reset, so leaving the page loses nothing and there
|
||||
* is no "unsaved changes" prompt. Runs and lints are plain requests to the
|
||||
* server, which passes them to the code runner: a run answers when it has
|
||||
* finished, which can take up to a minute.
|
||||
* finished, which can take up to a minute. An evaluation takes longer
|
||||
* than nginx waits, so it is a job the page polls, as on the problem page.
|
||||
*/
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { RouterLink } from "vue-router";
|
||||
import CodeBlock from "@/components/CodeBlock.vue";
|
||||
import CodeEditor from "@/components/CodeEditor.vue";
|
||||
import EvaluationReport from "@/components/EvaluationReport.vue";
|
||||
import RunResults from "@/components/RunResults.vue";
|
||||
import { markdown } from "@/markdown";
|
||||
import { getCode, getMe, getProblem, lintCode, runCode, saveCode } from "@/api";
|
||||
import { LANG_LABELS, MOD_KEY, STATUS_LABELS, title } from "@/format";
|
||||
import { evaluateStatus, getCode, getMe, getProblem, lintCode, runCode, saveCode, startEvaluate } from "@/api";
|
||||
import { EVAL_VERDICTS, LANG_LABELS, MOD_KEY, STATUS_LABELS, title } from "@/format";
|
||||
|
||||
const props = defineProps({ name: { type: String, required: true } });
|
||||
|
||||
@@ -44,6 +47,15 @@ const diagnostics = ref([]);
|
||||
const linted = ref(false);
|
||||
const lintError = ref("");
|
||||
|
||||
const editor = ref(null);
|
||||
const results = ref(null);
|
||||
const evalJob = ref({ state: "idle" });
|
||||
const evaluation = ref(null);
|
||||
const evalNote = ref("");
|
||||
const evalDiagnostics = ref([]);
|
||||
// The lint's marks and Claude's together; lintSummary counts the lint's.
|
||||
const editorDiagnostics = computed(() => [...diagnostics.value, ...evalDiagnostics.value]);
|
||||
|
||||
const statementHtml = computed(() => (problem.value?.statement ? md.render(problem.value.statement) : ""));
|
||||
const current = computed(() => info.value?.code[lang.value]);
|
||||
const dirty = computed(() => !!current.value && source.value !== current.value.source);
|
||||
@@ -62,6 +74,7 @@ const codeStatus = computed(() => {
|
||||
async function load() {
|
||||
flushDraft();
|
||||
clearTimeout(lintTimer);
|
||||
stopEvalPolling();
|
||||
const name = props.name;
|
||||
loading.value = true;
|
||||
error.value = "";
|
||||
@@ -73,6 +86,10 @@ async function load() {
|
||||
notice.value = "";
|
||||
diagnostics.value = [];
|
||||
linted.value = false;
|
||||
evalJob.value = { state: "idle" };
|
||||
evaluation.value = null;
|
||||
evalNote.value = "";
|
||||
evalDiagnostics.value = [];
|
||||
try {
|
||||
const [p, me] = await Promise.all([getProblem(name), getMe().catch(() => ({ admin: false }))]);
|
||||
if (name !== props.name) return;
|
||||
@@ -86,6 +103,8 @@ async function load() {
|
||||
if (name !== props.name) return;
|
||||
info.value = c;
|
||||
open(c.code[c.default] ? c.default : c.languages[0]);
|
||||
// The server keeps the last evaluation until it restarts.
|
||||
if (c.claude) checkEvaluate();
|
||||
} catch (e) {
|
||||
if (name !== props.name) return;
|
||||
problem.value = null;
|
||||
@@ -105,6 +124,7 @@ function open(l) {
|
||||
lintError.value = "";
|
||||
notice.value = "";
|
||||
saveError.value = "";
|
||||
anchorIssues();
|
||||
lintSoon();
|
||||
}
|
||||
|
||||
@@ -194,6 +214,8 @@ async function lintNow() {
|
||||
const r = await lintCode(name, { lang: l, source: src });
|
||||
if (seq !== lintSeq || name !== props.name || l !== lang.value || src !== source.value) return;
|
||||
diagnostics.value = r.diagnostics || [];
|
||||
// Re-placed against the same text, so the two sets agree.
|
||||
anchorIssues();
|
||||
linted.value = true;
|
||||
lintError.value = "";
|
||||
} catch (e) {
|
||||
@@ -258,6 +280,114 @@ async function save() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- evaluate ----
|
||||
// Polled every 3 s while it runs, as the problem page's jobs are. A job
|
||||
// that fails leaves the last evaluation on show under its error.
|
||||
let evalPoll = null;
|
||||
|
||||
function stopEvalPolling() {
|
||||
clearTimeout(evalPoll);
|
||||
evalPoll = null;
|
||||
}
|
||||
|
||||
async function checkEvaluate() {
|
||||
stopEvalPolling();
|
||||
const name = props.name;
|
||||
try {
|
||||
const s = await evaluateStatus(name);
|
||||
if (name !== props.name) return;
|
||||
const finished = evalJob.value.state === "running" && s.state !== "running";
|
||||
evalJob.value = s;
|
||||
if (s.result) evaluation.value = s.result;
|
||||
if (s.state === "running") evalPoll = setTimeout(checkEvaluate, 3000);
|
||||
else if (finished) results.value?.show("evaluation");
|
||||
} catch (e) {
|
||||
if (name === props.name) evalJob.value = { state: "error", error: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
const evalDisabled = computed(() => {
|
||||
if (!info.value?.claude) return "Claude isn't configured on this server (CLAUDE_API_KEY)";
|
||||
if (!problem.value?.statement && !problem.value?.url) return "Add the statement or a link on the problem page first";
|
||||
if (!source.value.trim()) return "The editor is empty";
|
||||
return "";
|
||||
});
|
||||
const evaluating = computed(() => evalJob.value.state === "running");
|
||||
const canEvaluate = computed(() => !evalDisabled.value && !evaluating.value);
|
||||
|
||||
async function evaluate() {
|
||||
if (!canEvaluate.value) return;
|
||||
const name = props.name;
|
||||
results.value?.show("evaluation");
|
||||
try {
|
||||
const s = await startEvaluate(name, { lang: lang.value, source: source.value, note: evalNote.value });
|
||||
if (name !== props.name) return;
|
||||
evalJob.value = s;
|
||||
evalPoll = setTimeout(checkEvaluate, 3000);
|
||||
} catch (e) {
|
||||
if (name !== props.name) return;
|
||||
// Started from another tab: follow that one.
|
||||
if (e.status === 409) checkEvaluate();
|
||||
else evalJob.value = { state: "error", error: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
// Whether the editor still holds what was judged. In another language it
|
||||
// is a different file, which the report says instead.
|
||||
const evalStale = computed(() => {
|
||||
const ev = evaluation.value;
|
||||
return !!ev && ev.lang === lang.value && ev.source !== source.value;
|
||||
});
|
||||
|
||||
const evaluationTab = computed(() => {
|
||||
if (!info.value?.claude) return null;
|
||||
if (evaluating.value) return { label: "Evaluation", tone: "plain" };
|
||||
return { label: "Evaluation", tone: EVAL_VERDICTS[evaluation.value?.verdict]?.tone || "" };
|
||||
});
|
||||
|
||||
// Claude's issues as editor marks, on the lines they were about. Once the
|
||||
// code has changed, a line is found again by its text, at the copy nearest
|
||||
// to where it was; a line edited since loses its mark, which is usually
|
||||
// the fix. Called when the evaluation, the language or the lint changes,
|
||||
// and CodeMirror moves the marks through edits in between.
|
||||
function anchorIssues() {
|
||||
const ev = evaluation.value;
|
||||
if (!ev || ev.lang !== lang.value) {
|
||||
evalDiagnostics.value = [];
|
||||
return;
|
||||
}
|
||||
const same = ev.source === source.value;
|
||||
const was = ev.source.split("\n");
|
||||
const now = source.value.split("\n");
|
||||
const out = [];
|
||||
for (const is of ev.issues || []) {
|
||||
const text = was[is.line - 1];
|
||||
if (!is.line || text === undefined) continue;
|
||||
let line = same ? is.line : 0;
|
||||
for (let d = 0; !line && text.trim() && d < now.length; d++) {
|
||||
if (now[is.line - 1 - d] === text) line = is.line - d;
|
||||
else if (now[is.line - 1 + d] === text) line = is.line + d;
|
||||
}
|
||||
if (!line) continue;
|
||||
out.push({
|
||||
line,
|
||||
col: /^\s*/.exec(text)[0].length + 1,
|
||||
endLine: line,
|
||||
endCol: text.length + 1,
|
||||
severity: is.severity,
|
||||
message: is.detail ? `${is.title}\n\n${is.detail}` : is.title,
|
||||
source: "Claude",
|
||||
});
|
||||
}
|
||||
evalDiagnostics.value = out;
|
||||
}
|
||||
watch(evaluation, anchorIssues);
|
||||
|
||||
function useInput(input) {
|
||||
customInput.value = input;
|
||||
results.value?.show("custom");
|
||||
}
|
||||
|
||||
// The editor handles these itself while it has focus (and stops them);
|
||||
// this is for everywhere else on the page, the custom input included.
|
||||
function onKey(e) {
|
||||
@@ -280,6 +410,7 @@ onUnmounted(() => {
|
||||
window.removeEventListener("keydown", onKey);
|
||||
window.removeEventListener("pagehide", flushDraft);
|
||||
clearTimeout(lintTimer);
|
||||
stopEvalPolling();
|
||||
flushDraft();
|
||||
});
|
||||
|
||||
@@ -431,6 +562,15 @@ watch(() => props.name, load, { immediate: true });
|
||||
>
|
||||
{{ running === "tests" ? "Submitting…" : "Submit" }}
|
||||
</button>
|
||||
<button
|
||||
class="btn"
|
||||
type="button"
|
||||
:disabled="!canEvaluate"
|
||||
:title="evalDisabled || 'Run the saved tests and have Claude judge this code'"
|
||||
@click="evaluate"
|
||||
>
|
||||
{{ evaluating ? "Evaluating…" : "Evaluate" }}
|
||||
</button>
|
||||
<button class="btn" type="button" :disabled="!canSave" :title="`Commit to the repo (${MOD_KEY}+S)`" @click="save">
|
||||
{{ saving ? "Saving…" : "Save" }}
|
||||
</button>
|
||||
@@ -455,17 +595,40 @@ watch(() => props.name, load, { immediate: true });
|
||||
</p>
|
||||
|
||||
<CodeEditor
|
||||
ref="editor"
|
||||
v-model="source"
|
||||
class="code"
|
||||
:lang="lang"
|
||||
:diagnostics="diagnostics"
|
||||
:diagnostics="editorDiagnostics"
|
||||
:label="`${LANG_LABELS[lang] || lang} solution`"
|
||||
@run="run('custom')"
|
||||
@submit="run('tests')"
|
||||
@save="save"
|
||||
/>
|
||||
|
||||
<RunResults v-model="customInput" class="out" :result="result" :running="running" :error="runError" />
|
||||
<RunResults
|
||||
ref="results"
|
||||
v-model="customInput"
|
||||
class="out"
|
||||
:result="result"
|
||||
:running="running"
|
||||
:error="runError"
|
||||
:evaluation-tab="evaluationTab"
|
||||
>
|
||||
<template #evaluation>
|
||||
<EvaluationReport
|
||||
v-model:note="evalNote"
|
||||
:job="evalJob"
|
||||
:evaluation="evaluation"
|
||||
:lang="lang"
|
||||
:stale="evalStale"
|
||||
:disabled="evalDisabled"
|
||||
@evaluate="evaluate"
|
||||
@goto="(line) => editor?.goto(line)"
|
||||
@use-input="useInput"
|
||||
/>
|
||||
</template>
|
||||
</RunResults>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user