@@ -20,8 +20,8 @@ use crate::linter::{
2020 isolated_lint_handler:: { IsolatedLintHandler , IsolatedLintHandlerOptions } ,
2121 tsgo_linter:: TsgoLinter ,
2222} ;
23- use crate :: options:: { Run , UnusedDisableDirectives } ;
24- use crate :: { ConcurrentHashMap , OXC_CONFIG_FILE , Options } ;
23+ use crate :: options:: { LintOptions as LSPLintOptions , Run , UnusedDisableDirectives } ;
24+ use crate :: { ConcurrentHashMap , OXC_CONFIG_FILE } ;
2525
2626use super :: config_walker:: ConfigWalker ;
2727
@@ -80,7 +80,7 @@ impl ServerLinterDiagnostics {
8080}
8181
8282impl ServerLinter {
83- pub fn new ( root_uri : & Uri , options : & Options ) -> Self {
83+ pub fn new ( root_uri : & Uri , options : & LSPLintOptions ) -> Self {
8484 let root_path = root_uri. to_file_path ( ) . unwrap ( ) ;
8585 let mut nested_ignore_patterns = Vec :: new ( ) ;
8686 let ( nested_configs, mut extended_paths) =
@@ -186,7 +186,7 @@ impl ServerLinter {
186186 /// and insert them inside the nested configuration
187187 fn create_nested_configs (
188188 root_path : & Path ,
189- options : & Options ,
189+ options : & LSPLintOptions ,
190190 nested_ignore_patterns : & mut Vec < ( Vec < String > , PathBuf ) > ,
191191 ) -> ( ConcurrentHashMap < PathBuf , Config > , Vec < PathBuf > ) {
192192 let mut extended_paths = Vec :: new ( ) ;
@@ -394,9 +394,8 @@ mod test {
394394 use std:: path:: { Path , PathBuf } ;
395395
396396 use crate :: {
397- Options ,
398397 linter:: server_linter:: { ServerLinter , normalize_path} ,
399- options:: Run ,
398+ options:: { LintOptions , Run } ,
400399 tester:: { Tester , get_file_path} ,
401400 } ;
402401 use rustc_hash:: FxHashMap ;
@@ -417,7 +416,7 @@ mod test {
417416 let mut nested_ignore_patterns = Vec :: new ( ) ;
418417 let ( configs, _) = ServerLinter :: create_nested_configs (
419418 Path :: new ( "/root/" ) ,
420- & Options { flags, ..Options :: default ( ) } ,
419+ & LintOptions { flags, ..LintOptions :: default ( ) } ,
421420 & mut nested_ignore_patterns,
422421 ) ;
423422
@@ -429,7 +428,7 @@ mod test {
429428 let mut nested_ignore_patterns = Vec :: new ( ) ;
430429 let ( configs, _) = ServerLinter :: create_nested_configs (
431430 & get_file_path ( "fixtures/linter/init_nested_configs" ) ,
432- & Options :: default ( ) ,
431+ & LintOptions :: default ( ) ,
433432 & mut nested_ignore_patterns,
434433 ) ;
435434 let configs = configs. pin ( ) ;
@@ -448,7 +447,7 @@ mod test {
448447 fn test_lint_on_run_on_type_on_type ( ) {
449448 Tester :: new (
450449 "fixtures/linter/lint_on_run/on_type" ,
451- Some ( Options { type_aware : true , run : Run :: OnType , ..Default :: default ( ) } ) ,
450+ Some ( LintOptions { type_aware : true , run : Run :: OnType , ..Default :: default ( ) } ) ,
452451 )
453452 . test_and_snapshot_single_file_with_run_type ( "on-type.ts" , Run :: OnType ) ;
454453 }
@@ -458,7 +457,7 @@ mod test {
458457 fn test_lint_on_run_on_type_on_save ( ) {
459458 Tester :: new (
460459 "fixtures/linter/lint_on_run/on_save" ,
461- Some ( Options { type_aware : true , run : Run :: OnType , ..Default :: default ( ) } ) ,
460+ Some ( LintOptions { type_aware : true , run : Run :: OnType , ..Default :: default ( ) } ) ,
462461 )
463462 . test_and_snapshot_single_file_with_run_type ( "on-save.ts" , Run :: OnSave ) ;
464463 }
@@ -468,7 +467,7 @@ mod test {
468467 fn test_lint_on_run_on_save_on_type ( ) {
469468 Tester :: new (
470469 "fixtures/linter/lint_on_run/on_save" ,
471- Some ( Options { type_aware : true , run : Run :: OnSave , ..Default :: default ( ) } ) ,
470+ Some ( LintOptions { type_aware : true , run : Run :: OnSave , ..Default :: default ( ) } ) ,
472471 )
473472 . test_and_snapshot_single_file_with_run_type ( "on-type.ts" , Run :: OnType ) ;
474473 }
@@ -478,7 +477,7 @@ mod test {
478477 fn test_lint_on_run_on_save_on_save ( ) {
479478 Tester :: new (
480479 "fixtures/linter/lint_on_run/on_type" ,
481- Some ( Options { type_aware : true , run : Run :: OnSave , ..Default :: default ( ) } ) ,
480+ Some ( LintOptions { type_aware : true , run : Run :: OnSave , ..Default :: default ( ) } ) ,
482481 )
483482 . test_and_snapshot_single_file_with_run_type ( "on-save.ts" , Run :: OnSave ) ;
484483 }
@@ -553,12 +552,12 @@ mod test {
553552 fn test_multiple_suggestions ( ) {
554553 Tester :: new (
555554 "fixtures/linter/multiple_suggestions" ,
556- Some ( Options {
555+ Some ( LintOptions {
557556 flags : FxHashMap :: from_iter ( [ (
558557 "fix_kind" . to_string ( ) ,
559558 "safe_fix_or_suggestion" . to_string ( ) ,
560559 ) ] ) ,
561- ..Options :: default ( )
560+ ..Default :: default ( )
562561 } ) ,
563562 )
564563 . test_and_snapshot_single_file ( "forward_ref.ts" ) ;
@@ -569,7 +568,7 @@ mod test {
569568 use crate :: options:: UnusedDisableDirectives ;
570569 Tester :: new (
571570 "fixtures/linter/unused_disabled_directives" ,
572- Some ( Options {
571+ Some ( LintOptions {
573572 unused_disable_directives : UnusedDisableDirectives :: Deny ,
574573 ..Default :: default ( )
575574 } ) ,
@@ -588,7 +587,7 @@ mod test {
588587 fn test_ts_alias ( ) {
589588 Tester :: new (
590589 "fixtures/linter/ts_path_alias" ,
591- Some ( Options {
590+ Some ( LintOptions {
592591 ts_config_path : Some ( "./deep/tsconfig.json" . to_string ( ) ) ,
593592 ..Default :: default ( )
594593 } ) ,
@@ -601,7 +600,7 @@ mod test {
601600 fn test_tsgo_lint ( ) {
602601 let tester = Tester :: new (
603602 "fixtures/linter/tsgolint" ,
604- Some ( Options { type_aware : true , run : Run :: OnSave , ..Default :: default ( ) } ) ,
603+ Some ( LintOptions { type_aware : true , run : Run :: OnSave , ..Default :: default ( ) } ) ,
605604 ) ;
606605 tester. test_and_snapshot_single_file ( "no-floating-promises/index.ts" ) ;
607606 }
0 commit comments