@@ -34,7 +34,7 @@ use crate::{
3434 config:: RustfmtConfig ,
3535 diagnostics:: DiagnosticTask ,
3636 from_json, from_proto,
37- req :: { self , InlayHint , InlayHintsParams } ,
37+ lsp_ext :: { self , InlayHint , InlayHintsParams } ,
3838 to_proto,
3939 world:: WorldSnapshot ,
4040 LspError , Result ,
@@ -52,7 +52,10 @@ pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> {
5252 Ok ( buf)
5353}
5454
55- pub fn handle_syntax_tree ( world : WorldSnapshot , params : req:: SyntaxTreeParams ) -> Result < String > {
55+ pub fn handle_syntax_tree (
56+ world : WorldSnapshot ,
57+ params : lsp_ext:: SyntaxTreeParams ,
58+ ) -> Result < String > {
5659 let _p = profile ( "handle_syntax_tree" ) ;
5760 let id = from_proto:: file_id ( & world, & params. text_document . uri ) ?;
5861 let line_index = world. analysis ( ) . file_line_index ( id) ?;
@@ -63,8 +66,8 @@ pub fn handle_syntax_tree(world: WorldSnapshot, params: req::SyntaxTreeParams) -
6366
6467pub fn handle_expand_macro (
6568 world : WorldSnapshot ,
66- params : req :: ExpandMacroParams ,
67- ) -> Result < Option < req :: ExpandedMacro > > {
69+ params : lsp_ext :: ExpandMacroParams ,
70+ ) -> Result < Option < lsp_ext :: ExpandedMacro > > {
6871 let _p = profile ( "handle_expand_macro" ) ;
6972 let file_id = from_proto:: file_id ( & world, & params. text_document . uri ) ?;
7073 let line_index = world. analysis ( ) . file_line_index ( file_id) ?;
@@ -74,7 +77,7 @@ pub fn handle_expand_macro(
7477 None => Ok ( None ) ,
7578 Some ( offset) => {
7679 let res = world. analysis ( ) . expand_macro ( FilePosition { file_id, offset } ) ?;
77- Ok ( res. map ( |it| req :: ExpandedMacro { name : it. name , expansion : it. expansion } ) )
80+ Ok ( res. map ( |it| lsp_ext :: ExpandedMacro { name : it. name , expansion : it. expansion } ) )
7881 }
7982 }
8083}
@@ -124,7 +127,7 @@ pub fn handle_selection_range(
124127
125128pub fn handle_find_matching_brace (
126129 world : WorldSnapshot ,
127- params : req :: FindMatchingBraceParams ,
130+ params : lsp_ext :: FindMatchingBraceParams ,
128131) -> Result < Vec < Position > > {
129132 let _p = profile ( "handle_find_matching_brace" ) ;
130133 let file_id = from_proto:: file_id ( & world, & params. text_document . uri ) ?;
@@ -146,8 +149,8 @@ pub fn handle_find_matching_brace(
146149
147150pub fn handle_join_lines (
148151 world : WorldSnapshot ,
149- params : req :: JoinLinesParams ,
150- ) -> Result < req :: SourceChange > {
152+ params : lsp_ext :: JoinLinesParams ,
153+ ) -> Result < lsp_ext :: SourceChange > {
151154 let _p = profile ( "handle_join_lines" ) ;
152155 let frange = from_proto:: file_range ( & world, params. text_document , params. range ) ?;
153156 let source_change = world. analysis ( ) . join_lines ( frange) ?;
@@ -157,7 +160,7 @@ pub fn handle_join_lines(
157160pub fn handle_on_enter (
158161 world : WorldSnapshot ,
159162 params : lsp_types:: TextDocumentPositionParams ,
160- ) -> Result < Option < req :: SourceChange > > {
163+ ) -> Result < Option < lsp_ext :: SourceChange > > {
161164 let _p = profile ( "handle_on_enter" ) ;
162165 let position = from_proto:: file_position ( & world, params) ?;
163166 match world. analysis ( ) . on_enter ( position) ? {
@@ -388,8 +391,8 @@ pub fn handle_parent_module(
388391
389392pub fn handle_runnables (
390393 world : WorldSnapshot ,
391- params : req :: RunnablesParams ,
392- ) -> Result < Vec < req :: Runnable > > {
394+ params : lsp_ext :: RunnablesParams ,
395+ ) -> Result < Vec < lsp_ext :: Runnable > > {
393396 let _p = profile ( "handle_runnables" ) ;
394397 let file_id = from_proto:: file_id ( & world, & params. text_document . uri ) ?;
395398 let line_index = world. analysis ( ) . file_line_index ( file_id) ?;
@@ -419,7 +422,7 @@ pub fn handle_runnables(
419422 match cargo_spec {
420423 Some ( spec) => {
421424 for & cmd in [ "check" , "test" ] . iter ( ) {
422- res. push ( req :: Runnable {
425+ res. push ( lsp_ext :: Runnable {
423426 range : Default :: default ( ) ,
424427 label : format ! ( "cargo {} -p {}" , cmd, spec. package) ,
425428 bin : "cargo" . to_string ( ) ,
@@ -431,7 +434,7 @@ pub fn handle_runnables(
431434 }
432435 }
433436 None => {
434- res. push ( req :: Runnable {
437+ res. push ( lsp_ext :: Runnable {
435438 range : Default :: default ( ) ,
436439 label : "cargo check --workspace" . to_string ( ) ,
437440 bin : "cargo" . to_string ( ) ,
@@ -972,7 +975,10 @@ pub fn handle_document_highlight(
972975 Ok ( Some ( res) )
973976}
974977
975- pub fn handle_ssr ( world : WorldSnapshot , params : req:: SsrParams ) -> Result < req:: SourceChange > {
978+ pub fn handle_ssr (
979+ world : WorldSnapshot ,
980+ params : lsp_ext:: SsrParams ,
981+ ) -> Result < lsp_ext:: SourceChange > {
976982 let _p = profile ( "handle_ssr" ) ;
977983 let source_change =
978984 world. analysis ( ) . structural_search_replace ( & params. query , params. parse_only ) ??;
@@ -1003,7 +1009,7 @@ fn to_lsp_runnable(
10031009 world : & WorldSnapshot ,
10041010 file_id : FileId ,
10051011 runnable : Runnable ,
1006- ) -> Result < req :: Runnable > {
1012+ ) -> Result < lsp_ext :: Runnable > {
10071013 let spec = CargoTargetSpec :: for_file ( world, file_id) ?;
10081014 let ( args, extra_args) = CargoTargetSpec :: runnable_args ( spec, & runnable. kind ) ?;
10091015 let line_index = world. analysis ( ) . file_line_index ( file_id) ?;
@@ -1014,7 +1020,7 @@ fn to_lsp_runnable(
10141020 RunnableKind :: DocTest { test_id, .. } => format ! ( "doctest {}" , test_id) ,
10151021 RunnableKind :: Bin => "run binary" . to_string ( ) ,
10161022 } ;
1017- Ok ( req :: Runnable {
1023+ Ok ( lsp_ext :: Runnable {
10181024 range : to_proto:: range ( & line_index, runnable. range ) ,
10191025 label,
10201026 bin : "cargo" . to_string ( ) ,
0 commit comments