From 8cc4adf424ef5044c568ae208556adb5971b0b48 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Wed, 13 Dec 2023 02:06:04 +0000 Subject: [PATCH] improve REPL --- .../src/lib/CodeMirror.svelte | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sites/svelte-5-preview/src/lib/CodeMirror.svelte b/sites/svelte-5-preview/src/lib/CodeMirror.svelte index ebeeef29dd..b2b9169889 100644 --- a/sites/svelte-5-preview/src/lib/CodeMirror.svelte +++ b/sites/svelte-5-preview/src/lib/CodeMirror.svelte @@ -205,17 +205,23 @@ return { from: word.from - 1, options: [ - { label: '$state', type: 'keyword', boost: 10 }, - { label: '$props', type: 'keyword', boost: 9 }, - { label: '$derived', type: 'keyword', boost: 8 }, - snip('$effect(() => {\n\t${}\n});', { label: '$effect', type: 'keyword', boost: 7 }), + { label: '$state', type: 'keyword', boost: 9 }, + { label: '$props', type: 'keyword', boost: 8 }, + { label: '$derived', type: 'keyword', boost: 7 }, + snip('$effect(() => {\n\t${}\n});', { label: '$effect', type: 'keyword', boost: 6 }), snip('$effect.pre(() => {\n\t${}\n});', { label: '$effect.pre', type: 'keyword', - boost: 6 + boost: 5 }), - { label: '$effect.active', type: 'keyword', boost: 5 }, - { label: '$inspect', type: 'keyword', boost: 4 } + { label: '$state.readonly', type: 'keyword', boost: 4 }, + snip('$effect.root(() => {\n\t${}\n});', { + label: '$effect.root', + type: 'keyword', + boost: 3 + }), + { label: '$effect.active', type: 'keyword', boost: 2 }, + { label: '$inspect', type: 'keyword', boost: 1 } ] }; }