@@ -30,18 +30,31 @@ pub struct ContextSubHost<'a> {
3030 // Specific framework options, for example, whether the context is inside `<script setup>` in Vue files.
3131 #[ expect( dead_code) ]
3232 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 ,
3336}
3437
3538impl < ' 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+ )
3850 }
3951
4052 /// # Panics
4153 /// If `semantic.cfg()` is `None`.
4254 pub fn new_with_framework_options (
4355 semantic : Rc < Semantic < ' a > > ,
4456 module_record : Arc < ModuleRecord > ,
57+ source_text_offset : u32 ,
4558 frameworks_options : FrameworkOptions ,
4659 ) -> Self {
4760 // 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> {
5770 Self {
5871 semantic,
5972 module_record,
73+ source_text_offset,
6074 disable_directives : Rc :: new ( disable_directives) ,
6175 framework_options : frameworks_options,
6276 }
0 commit comments