@@ -30,18 +30,31 @@ pub struct ContextSubHost<'a> {
30
30
// Specific framework options, for example, whether the context is inside `<script setup>` in Vue files.
31
31
#[ expect( dead_code) ]
32
32
pub ( super ) framework_options : FrameworkOptions ,
33
+ /// The source text offset of the sub host
34
+ #[ expect( dead_code) ]
35
+ pub ( super ) source_text_offset : u32 ,
33
36
}
34
37
35
38
impl < ' a > ContextSubHost < ' a > {
36
- pub fn new ( semantic : Rc < Semantic < ' a > > , module_record : Arc < ModuleRecord > ) -> Self {
37
- Self :: new_with_framework_options ( semantic, module_record, FrameworkOptions :: Default )
39
+ pub fn new (
40
+ semantic : Rc < Semantic < ' a > > ,
41
+ module_record : Arc < ModuleRecord > ,
42
+ source_text_offset : u32 ,
43
+ ) -> Self {
44
+ Self :: new_with_framework_options (
45
+ semantic,
46
+ module_record,
47
+ source_text_offset,
48
+ FrameworkOptions :: Default ,
49
+ )
38
50
}
39
51
40
52
/// # Panics
41
53
/// If `semantic.cfg()` is `None`.
42
54
pub fn new_with_framework_options (
43
55
semantic : Rc < Semantic < ' a > > ,
44
56
module_record : Arc < ModuleRecord > ,
57
+ source_text_offset : u32 ,
45
58
frameworks_options : FrameworkOptions ,
46
59
) -> Self {
47
60
// We should always check for `semantic.cfg()` being `Some` since we depend on it and it is
@@ -57,6 +70,7 @@ impl<'a> ContextSubHost<'a> {
57
70
Self {
58
71
semantic,
59
72
module_record,
73
+ source_text_offset,
60
74
disable_directives : Rc :: new ( disable_directives) ,
61
75
framework_options : frameworks_options,
62
76
}
0 commit comments