pull/9670/head
Dominic Gannaway 3 years ago
parent 22b5289a42
commit f2162c0c26

@ -299,29 +299,42 @@ export const javascript_visitors_runes = {
return b.call('$.effect_active'); return b.call('$.effect_active');
} }
if (rune === '$log') { if (rune === '$log') {
if (state.options.dev) {
const args = /** @type {import('estree').Expression[]} */ ( const args = /** @type {import('estree').Expression[]} */ (
node.arguments.map((arg) => visit(arg)) node.arguments.map((arg) => visit(arg))
); );
return b.call('$.log', b.thunk(b.array(args))); return b.call('$.log', b.thunk(b.array(args)));
} }
return b.unary('void', b.literal(0));
}
if (rune === '$log.trace') { if (rune === '$log.trace') {
if (state.options.dev) {
const args = /** @type {import('estree').Expression[]} */ ( const args = /** @type {import('estree').Expression[]} */ (
node.arguments.map((arg) => visit(arg)) node.arguments.map((arg) => visit(arg))
); );
return b.call('$.log_trace', b.thunk(b.array(args))); return b.call('$.log_trace', b.thunk(b.array(args)));
} }
return b.unary('void', b.literal(0));
}
if (rune === '$log.break') { if (rune === '$log.break') {
if (state.options.dev) {
const args = /** @type {import('estree').Expression[]} */ ( const args = /** @type {import('estree').Expression[]} */ (
node.arguments.map((arg) => visit(arg)) node.arguments.map((arg) => visit(arg))
); );
return b.call('$.log_break', b.thunk(b.array(args))); return b.call('$.log_break', b.thunk(b.array(args)));
} }
return b.unary('void', b.literal(0));
}
if (rune === '$log.table') { if (rune === '$log.table') {
if (state.options.dev) {
const args = /** @type {import('estree').Expression[]} */ ( const args = /** @type {import('estree').Expression[]} */ (
node.arguments.map((arg) => visit(arg)) node.arguments.map((arg) => visit(arg))
); );
return b.call('$.log_table', b.thunk(b.array(args))); return b.call('$.log_table', b.thunk(b.array(args)));
} }
return b.unary('void', b.literal(0));
}
next(); next();
} }

@ -205,15 +205,20 @@
return { return {
from: word.from - 1, from: word.from - 1,
options: [ options: [
{ label: '$state', type: 'keyword', boost: 5 }, { label: '$state', type: 'keyword', boost: 10 },
{ label: '$props', type: 'keyword', boost: 4 }, { label: '$props', type: 'keyword', boost: 9 },
{ label: '$derived', type: 'keyword', boost: 3 }, { label: '$derived', type: 'keyword', boost: 8 },
snip('$effect(() => {\n\t${}\n});', { label: '$effect', type: 'keyword', boost: 2 }), snip('$effect(() => {\n\t${}\n});', { label: '$effect', type: 'keyword', boost: 7 }),
snip('$effect.pre(() => {\n\t${}\n});', { snip('$effect.pre(() => {\n\t${}\n});', {
label: '$effect.pre', label: '$effect.pre',
type: 'keyword', type: 'keyword',
boost: 1 boost: 6
}) });
{ label: '$effect.active', type: 'keyword', boost: 5 },
{ label: '$log', type: 'keyword', boost: 4 },
{ label: '$log.break', type: 'keyword', boost: 3 },
{ label: '$log.trace', type: 'keyword', boost: 2 },
{ label: '$log.table', type: 'keyword', boost: 1 },
] ]
}; };
} }

Loading…
Cancel
Save