@@ -28,7 +28,6 @@ pub struct ContextSubHost<'a> {
2828 /// `eslint-disable` or `eslint-disable-next-line`.
2929 pub ( super ) disable_directives : Rc < DisableDirectives < ' a > > ,
3030 // Specific framework options, for example, whether the context is inside `<script setup>` in Vue files.
31- #[ expect( dead_code) ]
3231 pub ( super ) framework_options : FrameworkOptions ,
3332 /// The source text offset of the sub host
3433 pub ( super ) source_text_offset : u32 ,
@@ -74,7 +73,25 @@ impl<'a> ContextSubHost<'a> {
7473 framework_options : frameworks_options,
7574 }
7675 }
76+
77+ /// Shared reference to the [`Semantic`] analysis
78+ #[ inline]
79+ pub fn semantic ( & self ) -> & Rc < Semantic < ' a > > {
80+ & self . semantic
81+ }
82+
83+ /// Shared reference to the [`ModuleRecord`]
84+ #[ inline]
85+ pub fn module_record ( & self ) -> & ModuleRecord {
86+ & self . module_record
87+ }
88+
89+ /// Shared reference to the [`DisableDirectives`]
90+ pub fn disable_directives ( & self ) -> & Rc < DisableDirectives < ' a > > {
91+ & self . disable_directives
92+ }
7793}
94+
7895/// Stores shared information about a file being linted.
7996///
8097/// When linting a file, there are a number of shared resources that are
@@ -361,6 +378,19 @@ impl<'a> ContextHost<'a> {
361378 pub fn frameworks ( & self ) -> FrameworkFlags {
362379 self . frameworks
363380 }
381+
382+ pub fn frameworks_options ( & self ) -> FrameworkOptions {
383+ self . current_sub_host ( ) . framework_options
384+ }
385+
386+ pub fn other_file_hosts ( & self ) -> Vec < & ContextSubHost < ' a > > {
387+ self . sub_hosts
388+ . iter ( )
389+ . enumerate ( )
390+ . filter ( |( index, _) | * index != * self . current_sub_host_index . borrow ( ) )
391+ . map ( |( _, sub_host) | sub_host)
392+ . collect ( )
393+ }
364394}
365395
366396impl < ' a > From < ContextHost < ' a > > for Vec < Message < ' a > > {
0 commit comments