mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 01:53:08 +02:00
added lines and lines to errors
This commit is contained in:
parent
2a8e93e4be
commit
93bd4dc8fe
3 changed files with 22 additions and 1 deletions
|
@ -58,6 +58,21 @@ watch(() => props.lang, (to) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.codeBlockRoot :deep(.shiki) > code {
|
||||||
|
counter-reset: step;
|
||||||
|
counter-increment: step 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.codeBlockRoot :deep(.shiki) > code > .line::before {
|
||||||
|
content: counter(step);
|
||||||
|
counter-increment: step;
|
||||||
|
width: 1rem;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: right;
|
||||||
|
color: rgba(115,138,148,.4)
|
||||||
|
}
|
||||||
|
|
||||||
.codeBlockRoot :deep(.shiki) {
|
.codeBlockRoot :deep(.shiki) {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
margin: .5em 0;
|
margin: .5em 0;
|
||||||
|
|
|
@ -204,6 +204,8 @@ watch(v, newValue => {
|
||||||
min-width: calc(100% - 24px);
|
min-width: calc(100% - 24px);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
// the +2.5 rem is because of the line numbers
|
||||||
|
padding-left: calc(12px + 2.5rem);
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
|
font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
|
||||||
|
|
|
@ -64,8 +64,12 @@ export async function parsePluginMeta(code: string): Promise<AiScriptPluginMeta>
|
||||||
try {
|
try {
|
||||||
ast = parser.parse(code);
|
ast = parser.parse(code);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
if (err instanceof Error) {
|
||||||
|
throw new Error(`Aiscript syntax error\n${(err as Error).message}`);
|
||||||
|
} else {
|
||||||
throw new Error('Aiscript syntax error');
|
throw new Error('Aiscript syntax error');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const meta = Interpreter.collectMetadata(ast);
|
const meta = Interpreter.collectMetadata(ast);
|
||||||
if (meta == null) {
|
if (meta == null) {
|
||||||
|
|
Loading…
Reference in a new issue