@@ -34,6 +34,7 @@ struct Args {
3434 workspaces : Vec < PathBuf > ,
3535 compile_info : Option < PathBuf > ,
3636 suppress_imports : Option < bool > ,
37+ zero_indexed : Option < bool > ,
3738 linting_enabled : Option < bool > ,
3839 lint_cfg_path : Option < PathBuf > ,
3940 test : bool ,
@@ -78,6 +79,11 @@ fn parse_args() -> Args {
7879 . action ( ArgAction :: Set )
7980 . value_parser ( clap:: value_parser!( bool ) )
8081 . required ( false ) )
82+ . arg ( Arg :: new ( "zero-indexed" ) . short ( 'z' ) . long ( "zero-indexed" )
83+ . help ( "Diagnostics reported by the server will be zero-indexed (defaults to false)" )
84+ . action ( ArgAction :: Set )
85+ . value_parser ( clap:: value_parser!( bool ) )
86+ . required ( false ) )
8187 . arg ( Arg :: new ( "linting-enabled" ) . short ( 'l' ) . long ( "linting-enabled" )
8288 . help ( "Turns linting on/off (defaults to true)" )
8389 . action ( ArgAction :: Set )
@@ -106,6 +112,8 @@ fn parse_args() -> Args {
106112 . cloned ( ) ,
107113 suppress_imports : args. get_one :: < bool > ( "suppress-imports" )
108114 . cloned ( ) ,
115+ zero_indexed : args. get_one :: < bool > ( "zero-indexed" )
116+ . cloned ( ) ,
109117 linting_enabled : args. get_one :: < bool > ( "linting-enabled" )
110118 . cloned ( ) ,
111119 lint_cfg_path : args. get_one :: < PathBuf > ( "lint-cfg-path" )
@@ -126,6 +134,7 @@ fn main_inner() -> Result<(), i32> {
126134 let first_workspace = workspace_rest. next ( ) ;
127135
128136 let linting_enabled = arg. linting_enabled . unwrap_or ( true ) ;
137+ let zero_indexed = arg. zero_indexed . unwrap_or ( false ) ;
129138
130139 let root = match first_workspace {
131140 Some ( w) => w,
@@ -167,7 +176,7 @@ fn main_inner() -> Result<(), i32> {
167176 } ) ?;
168177
169178 if !arg. quiet {
170- dlsclient. output_errors ( ) ;
179+ dlsclient. output_errors ( zero_indexed ) ;
171180 }
172181 if arg. test && !dlsclient. no_errors ( ) {
173182 exit_code = Err ( 1 ) ;
0 commit comments