@@ -670,6 +670,7 @@ impl GlobalState {
670670 }
671671
672672 use crate :: handlers:: request as handlers;
673+ use lsp_types:: request as lsp_request;
673674
674675 dispatcher
675676 // Request handlers that must run on the main thread
@@ -682,30 +683,30 @@ impl GlobalState {
682683 // are run on the main thread to reduce latency:
683684 . on_sync :: < lsp_ext:: JoinLines > ( handlers:: handle_join_lines)
684685 . on_sync :: < lsp_ext:: OnEnter > ( handlers:: handle_on_enter)
685- . on_sync :: < lsp_types :: request :: SelectionRangeRequest > ( handlers:: handle_selection_range)
686+ . on_sync :: < lsp_request :: SelectionRangeRequest > ( handlers:: handle_selection_range)
686687 . on_sync :: < lsp_ext:: MatchingBrace > ( handlers:: handle_matching_brace)
687688 . on_sync :: < lsp_ext:: OnTypeFormatting > ( handlers:: handle_on_type_formatting)
688689 // Formatting should be done immediately as the editor might wait on it, but we can't
689690 // put it on the main thread as we do not want the main thread to block on rustfmt.
690691 // So we have an extra thread just for formatting requests to make sure it gets handled
691692 // as fast as possible.
692- . on_fmt_thread :: < lsp_types :: request :: Formatting > ( handlers:: handle_formatting)
693- . on_fmt_thread :: < lsp_types :: request :: RangeFormatting > ( handlers:: handle_range_formatting)
693+ . on_fmt_thread :: < lsp_request :: Formatting > ( handlers:: handle_formatting)
694+ . on_fmt_thread :: < lsp_request :: RangeFormatting > ( handlers:: handle_range_formatting)
694695 // We can’t run latency-sensitive request handlers which do semantic
695696 // analysis on the main thread because that would block other
696697 // requests. Instead, we run these request handlers on higher priority
697698 // threads in the threadpool.
698- . on_latency_sensitive :: < lsp_types :: request :: Completion > ( handlers:: handle_completion)
699- . on_latency_sensitive :: < lsp_types :: request :: ResolveCompletionItem > (
699+ . on_latency_sensitive :: < lsp_request :: Completion > ( handlers:: handle_completion)
700+ . on_latency_sensitive :: < lsp_request :: ResolveCompletionItem > (
700701 handlers:: handle_completion_resolve,
701702 )
702- . on_latency_sensitive :: < lsp_types :: request :: SemanticTokensFullRequest > (
703+ . on_latency_sensitive :: < lsp_request :: SemanticTokensFullRequest > (
703704 handlers:: handle_semantic_tokens_full,
704705 )
705- . on_latency_sensitive :: < lsp_types :: request :: SemanticTokensFullDeltaRequest > (
706+ . on_latency_sensitive :: < lsp_request :: SemanticTokensFullDeltaRequest > (
706707 handlers:: handle_semantic_tokens_full_delta,
707708 )
708- . on_latency_sensitive :: < lsp_types :: request :: SemanticTokensRangeRequest > (
709+ . on_latency_sensitive :: < lsp_request :: SemanticTokensRangeRequest > (
709710 handlers:: handle_semantic_tokens_range,
710711 )
711712 // All other request handlers
@@ -729,29 +730,25 @@ impl GlobalState {
729730 . on :: < lsp_ext:: OpenCargoToml > ( handlers:: handle_open_cargo_toml)
730731 . on :: < lsp_ext:: MoveItem > ( handlers:: handle_move_item)
731732 . on :: < lsp_ext:: WorkspaceSymbol > ( handlers:: handle_workspace_symbol)
732- . on :: < lsp_types:: request:: DocumentSymbolRequest > ( handlers:: handle_document_symbol)
733- . on :: < lsp_types:: request:: GotoDefinition > ( handlers:: handle_goto_definition)
734- . on :: < lsp_types:: request:: GotoDeclaration > ( handlers:: handle_goto_declaration)
735- . on :: < lsp_types:: request:: GotoImplementation > ( handlers:: handle_goto_implementation)
736- . on :: < lsp_types:: request:: GotoTypeDefinition > ( handlers:: handle_goto_type_definition)
737- . on_no_retry :: < lsp_types:: request:: InlayHintRequest > ( handlers:: handle_inlay_hints)
738- . on :: < lsp_types:: request:: InlayHintResolveRequest > ( handlers:: handle_inlay_hints_resolve)
739- . on :: < lsp_types:: request:: CodeLensRequest > ( handlers:: handle_code_lens)
740- . on :: < lsp_types:: request:: CodeLensResolve > ( handlers:: handle_code_lens_resolve)
741- . on :: < lsp_types:: request:: FoldingRangeRequest > ( handlers:: handle_folding_range)
742- . on :: < lsp_types:: request:: SignatureHelpRequest > ( handlers:: handle_signature_help)
743- . on :: < lsp_types:: request:: PrepareRenameRequest > ( handlers:: handle_prepare_rename)
744- . on :: < lsp_types:: request:: Rename > ( handlers:: handle_rename)
745- . on :: < lsp_types:: request:: References > ( handlers:: handle_references)
746- . on :: < lsp_types:: request:: DocumentHighlightRequest > ( handlers:: handle_document_highlight)
747- . on :: < lsp_types:: request:: CallHierarchyPrepare > ( handlers:: handle_call_hierarchy_prepare)
748- . on :: < lsp_types:: request:: CallHierarchyIncomingCalls > (
749- handlers:: handle_call_hierarchy_incoming,
750- )
751- . on :: < lsp_types:: request:: CallHierarchyOutgoingCalls > (
752- handlers:: handle_call_hierarchy_outgoing,
753- )
754- . on :: < lsp_types:: request:: WillRenameFiles > ( handlers:: handle_will_rename_files)
733+ . on :: < lsp_request:: DocumentSymbolRequest > ( handlers:: handle_document_symbol)
734+ . on :: < lsp_request:: GotoDefinition > ( handlers:: handle_goto_definition)
735+ . on :: < lsp_request:: GotoDeclaration > ( handlers:: handle_goto_declaration)
736+ . on :: < lsp_request:: GotoImplementation > ( handlers:: handle_goto_implementation)
737+ . on :: < lsp_request:: GotoTypeDefinition > ( handlers:: handle_goto_type_definition)
738+ . on_no_retry :: < lsp_request:: InlayHintRequest > ( handlers:: handle_inlay_hints)
739+ . on :: < lsp_request:: InlayHintResolveRequest > ( handlers:: handle_inlay_hints_resolve)
740+ . on :: < lsp_request:: CodeLensRequest > ( handlers:: handle_code_lens)
741+ . on :: < lsp_request:: CodeLensResolve > ( handlers:: handle_code_lens_resolve)
742+ . on :: < lsp_request:: FoldingRangeRequest > ( handlers:: handle_folding_range)
743+ . on :: < lsp_request:: SignatureHelpRequest > ( handlers:: handle_signature_help)
744+ . on :: < lsp_request:: PrepareRenameRequest > ( handlers:: handle_prepare_rename)
745+ . on :: < lsp_request:: Rename > ( handlers:: handle_rename)
746+ . on :: < lsp_request:: References > ( handlers:: handle_references)
747+ . on :: < lsp_request:: DocumentHighlightRequest > ( handlers:: handle_document_highlight)
748+ . on :: < lsp_request:: CallHierarchyPrepare > ( handlers:: handle_call_hierarchy_prepare)
749+ . on :: < lsp_request:: CallHierarchyIncomingCalls > ( handlers:: handle_call_hierarchy_incoming)
750+ . on :: < lsp_request:: CallHierarchyOutgoingCalls > ( handlers:: handle_call_hierarchy_outgoing)
751+ . on :: < lsp_request:: WillRenameFiles > ( handlers:: handle_will_rename_files)
755752 . on :: < lsp_ext:: Ssr > ( handlers:: handle_ssr)
756753 . on :: < lsp_ext:: ViewRecursiveMemoryLayout > ( handlers:: handle_view_recursive_memory_layout)
757754 . finish ( ) ;
0 commit comments