File tree Expand file tree Collapse file tree 4 files changed +9
-36
lines changed
sites/svelte-5-preview/src/lib Expand file tree Collapse file tree 4 files changed +9
-36
lines changed Original file line number Diff line number Diff line change 12
12
import Message from ' ./Message.svelte' ;
13
13
import { svelteTheme } from ' ./theme.js' ;
14
14
15
- /** @type {import('./types').StartOrEnd | null} */
16
- export let errorLoc = null ;
17
-
18
15
/** @type {import('@codemirror/lint').LintSource | undefined} */
19
16
export let diagnostics = undefined ;
20
17
171
168
172
169
let marked = false ;
173
170
174
- /** @type {number | null} */
175
- let error_line = null ;
176
-
177
171
let updating_externally = false ;
178
172
179
173
/** @type {import('@codemirror/state').Extension[]} */
180
174
let extensions = [];
181
175
182
176
let cursor_pos = 0 ;
183
177
184
- $: {
185
- if ($cmInstance .view ) {
186
- fulfil_module_editor_ready ();
187
- }
178
+ $: if ($cmInstance .view ) {
179
+ fulfil_module_editor_ready ();
188
180
}
189
181
190
182
$: if ($cmInstance .view && w && h) resize ();
191
183
192
- $: {
193
- if (marked) {
194
- unmarkText ();
195
- marked = false ;
196
- }
197
-
198
- if (errorLoc) {
199
- markText ({ from: errorLoc .character , to: errorLoc .character + 1 , className: ' error-loc' });
200
-
201
- error_line = errorLoc .line ;
202
- } else {
203
- error_line = null ;
204
- }
184
+ $: if (marked) {
185
+ unmarkText ();
186
+ marked = false ;
205
187
}
206
188
207
189
const watcher = EditorView .updateListener .of ((viewUpdate ) => {
Original file line number Diff line number Diff line change 3
3
import { get_full_filename } from ' $lib/utils.js' ;
4
4
import CodeMirror from ' ../CodeMirror.svelte' ;
5
5
6
- /** @type {import('$lib/types').StartOrEnd | null} */
7
- export let errorLoc = null ;
8
-
9
6
/** @type {boolean} */
10
7
export let autocomplete;
11
8
58
55
< div class = " editor notranslate" translate= " no" >
59
56
< CodeMirror
60
57
bind: this = {$module_editor}
61
- {errorLoc}
62
58
{autocomplete}
63
59
diagnostics= {$selected && $bundle ? diagnostics : () => []}
64
60
on: change= {handle_change}
Original file line number Diff line number Diff line change 10
10
/** @type {string | null} */
11
11
export let status;
12
12
13
- /** @type {import('$lib/types').StartOrEnd | null} */
14
- export let sourceErrorLoc = null ;
15
-
16
13
/** @type {import('$lib/types').MessageDetails | null} */
17
14
export let runtimeError = null ;
18
15
97
94
<!-- js output -->
98
95
<div class ="tab-content" class:visible ={selected ?.type !== ' md' && view === ' js' }>
99
96
{#if embedded }
100
- <CodeMirror bind:this ={js_editor } errorLoc ={ sourceErrorLoc } readonly />
97
+ <CodeMirror bind:this ={js_editor } readonly />
101
98
{:else }
102
99
<PaneWithPanel pos =" 50%" panel =" Compiler options" >
103
100
<div slot =" main" >
104
- <CodeMirror bind:this ={js_editor } errorLoc ={ sourceErrorLoc } readonly />
101
+ <CodeMirror bind:this ={js_editor } readonly />
105
102
</div >
106
103
107
104
<div slot =" panel-body" >
113
110
114
111
<!-- css output -->
115
112
<div class ="tab-content" class:visible ={selected ?.type !== ' md' && view === ' css' }>
116
- <CodeMirror bind:this ={css_editor } errorLoc ={ sourceErrorLoc } readonly />
113
+ <CodeMirror bind:this ={css_editor } readonly />
117
114
</div >
118
115
119
116
<!-- ast output -->
Original file line number Diff line number Diff line change 260
260
261
261
$: $toggleable = mobile && orientation === ' columns' ;
262
262
263
- /** @type {import('./types').StartOrEnd} */
264
- let sourceErrorLoc;
265
263
let width = 0 ;
266
264
let show_output = false ;
267
265
321
319
>
322
320
< section slot= " a" >
323
321
< ComponentSelector show_modified= {showModified} on: add on: remove / >
324
- < ModuleEditor errorLoc = {sourceErrorLoc} {autocomplete} / >
322
+ < ModuleEditor {autocomplete} / >
325
323
< / section>
326
324
327
325
< section slot= " b" style= " height: 100%;" >
You can’t perform that action at this time.
0 commit comments