@@ -298,42 +298,6 @@ config_data! {
298
298
files_watcher: FilesWatcherDef = "\" client\" " ,
299
299
300
300
301
- /// Whether to show `Debug` action. Only applies when
302
- /// `#rust-analyzer.hover.actions.enable#` is set.
303
- hover_actions_debug_enable: bool = "true" ,
304
- /// Whether to show HoverActions in Rust files.
305
- hover_actions_enable: bool = "true" ,
306
- /// Whether to show `Go to Type Definition` action. Only applies when
307
- /// `#rust-analyzer.hover.actions.enable#` is set.
308
- hover_actions_gotoTypeDef_enable: bool = "true" ,
309
- /// Whether to show `Implementations` action. Only applies when
310
- /// `#rust-analyzer.hover.actions.enable#` is set.
311
- hover_actions_implementations_enable: bool = "true" ,
312
- /// Whether to show `References` action. Only applies when
313
- /// `#rust-analyzer.hover.actions.enable#` is set.
314
- hover_actions_references_enable: bool = "false" ,
315
- /// Whether to show `Run` action. Only applies when
316
- /// `#rust-analyzer.hover.actions.enable#` is set.
317
- hover_actions_run_enable: bool = "true" ,
318
-
319
- /// Whether to show documentation on hover.
320
- hover_documentation_enable: bool = "true" ,
321
- /// Whether to show keyword hover popups. Only applies when
322
- /// `#rust-analyzer.hover.documentation.enable#` is set.
323
- hover_documentation_keywords_enable: bool = "true" ,
324
- /// Use markdown syntax for links on hover.
325
- hover_links_enable: bool = "true" ,
326
- /// How to render the align information in a memory layout hover.
327
- hover_memoryLayout_alignment: Option <MemoryLayoutHoverRenderKindDef > = "\" hexadecimal\" " ,
328
- /// Whether to show memory layout data on hover.
329
- hover_memoryLayout_enable: bool = "true" ,
330
- /// How to render the niche information in a memory layout hover.
331
- hover_memoryLayout_niches: Option <bool > = "false" ,
332
- /// How to render the offset information in a memory layout hover.
333
- hover_memoryLayout_offset: Option <MemoryLayoutHoverRenderKindDef > = "\" hexadecimal\" " ,
334
- /// How to render the size information in a memory layout hover.
335
- hover_memoryLayout_size: Option <MemoryLayoutHoverRenderKindDef > = "\" both\" " ,
336
-
337
301
/// Enables the experimental support for interpreting tests.
338
302
interpret_tests: bool = "false" ,
339
303
@@ -507,6 +471,42 @@ config_data! {
507
471
/// Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords.
508
472
highlightRelated_yieldPoints_enable: bool = "true" ,
509
473
474
+ /// Whether to show `Debug` action. Only applies when
475
+ /// `#rust-analyzer.hover.actions.enable#` is set.
476
+ hover_actions_debug_enable: bool = "true" ,
477
+ /// Whether to show HoverActions in Rust files.
478
+ hover_actions_enable: bool = "true" ,
479
+ /// Whether to show `Go to Type Definition` action. Only applies when
480
+ /// `#rust-analyzer.hover.actions.enable#` is set.
481
+ hover_actions_gotoTypeDef_enable: bool = "true" ,
482
+ /// Whether to show `Implementations` action. Only applies when
483
+ /// `#rust-analyzer.hover.actions.enable#` is set.
484
+ hover_actions_implementations_enable: bool = "true" ,
485
+ /// Whether to show `References` action. Only applies when
486
+ /// `#rust-analyzer.hover.actions.enable#` is set.
487
+ hover_actions_references_enable: bool = "false" ,
488
+ /// Whether to show `Run` action. Only applies when
489
+ /// `#rust-analyzer.hover.actions.enable#` is set.
490
+ hover_actions_run_enable: bool = "true" ,
491
+
492
+ /// Whether to show documentation on hover.
493
+ hover_documentation_enable: bool = "true" ,
494
+ /// Whether to show keyword hover popups. Only applies when
495
+ /// `#rust-analyzer.hover.documentation.enable#` is set.
496
+ hover_documentation_keywords_enable: bool = "true" ,
497
+ /// Use markdown syntax for links on hover.
498
+ hover_links_enable: bool = "true" ,
499
+ /// How to render the align information in a memory layout hover.
500
+ hover_memoryLayout_alignment: Option <MemoryLayoutHoverRenderKindDef > = "\" hexadecimal\" " ,
501
+ /// Whether to show memory layout data on hover.
502
+ hover_memoryLayout_enable: bool = "true" ,
503
+ /// How to render the niche information in a memory layout hover.
504
+ hover_memoryLayout_niches: Option <bool > = "false" ,
505
+ /// How to render the offset information in a memory layout hover.
506
+ hover_memoryLayout_offset: Option <MemoryLayoutHoverRenderKindDef > = "\" hexadecimal\" " ,
507
+ /// How to render the size information in a memory layout hover.
508
+ hover_memoryLayout_size: Option <MemoryLayoutHoverRenderKindDef > = "\" both\" " ,
509
+
510
510
/// Whether to show inlay type hints for binding modes.
511
511
inlayHints_bindingModeHints_enable: bool = "false" ,
512
512
/// Whether to show inlay type hints for method chains.
@@ -743,6 +743,55 @@ impl<'a> LocalConfigView<'a> {
743
743
}
744
744
}
745
745
746
+ pub fn hover_actions ( & self ) -> HoverActionsConfig {
747
+ let enable = self . experimental ( "hoverActions" ) && self . local . hover_actions_enable ;
748
+ HoverActionsConfig {
749
+ implementations : enable && self . local . hover_actions_implementations_enable ,
750
+ references : enable && self . local . hover_actions_references_enable ,
751
+ run : enable && self . local . hover_actions_run_enable ,
752
+ debug : enable && self . local . hover_actions_debug_enable ,
753
+ goto_type_def : enable && self . local . hover_actions_gotoTypeDef_enable ,
754
+ }
755
+ }
756
+
757
+ pub fn hover ( & self ) -> HoverConfig {
758
+ let mem_kind = |kind| match kind {
759
+ MemoryLayoutHoverRenderKindDef :: Both => MemoryLayoutHoverRenderKind :: Both ,
760
+ MemoryLayoutHoverRenderKindDef :: Decimal => MemoryLayoutHoverRenderKind :: Decimal ,
761
+ MemoryLayoutHoverRenderKindDef :: Hexadecimal => MemoryLayoutHoverRenderKind :: Hexadecimal ,
762
+ } ;
763
+ HoverConfig {
764
+ links_in_hover : self . local . hover_links_enable ,
765
+ memory_layout : self . local . hover_memoryLayout_enable . then_some (
766
+ MemoryLayoutHoverConfig {
767
+ size : self . local . hover_memoryLayout_size . map ( mem_kind) ,
768
+ offset : self . local . hover_memoryLayout_offset . map ( mem_kind) ,
769
+ alignment : self . local . hover_memoryLayout_alignment . map ( mem_kind) ,
770
+ niches : self . local . hover_memoryLayout_niches . unwrap_or_default ( ) ,
771
+ } ,
772
+ ) ,
773
+ documentation : self . local . hover_documentation_enable ,
774
+ format : {
775
+ let is_markdown = try_or_def ! ( self
776
+ . caps
777
+ . text_document
778
+ . as_ref( ) ?
779
+ . hover
780
+ . as_ref( ) ?
781
+ . content_format
782
+ . as_ref( ) ?
783
+ . as_slice( ) )
784
+ . contains ( & MarkupKind :: Markdown ) ;
785
+ if is_markdown {
786
+ HoverDocFormat :: Markdown
787
+ } else {
788
+ HoverDocFormat :: PlainText
789
+ }
790
+ } ,
791
+ keywords : self . local . hover_documentation_keywords_enable ,
792
+ }
793
+ }
794
+
746
795
pub fn inlay_hints ( & self ) -> InlayHintsConfig {
747
796
let client_capability_fields = self
748
797
. caps
@@ -1742,19 +1791,6 @@ impl Config {
1742
1791
}
1743
1792
}
1744
1793
1745
- pub fn hover_actions ( & self ) -> HoverActionsConfig {
1746
- let enable =
1747
- self . experimental ( "hoverActions" ) && self . root_config . global . 0 . hover_actions_enable ;
1748
- HoverActionsConfig {
1749
- implementations : enable
1750
- && self . root_config . global . 0 . hover_actions_implementations_enable ,
1751
- references : enable && self . root_config . global . 0 . hover_actions_references_enable ,
1752
- run : enable && self . root_config . global . 0 . hover_actions_run_enable ,
1753
- debug : enable && self . root_config . global . 0 . hover_actions_debug_enable ,
1754
- goto_type_def : enable && self . root_config . global . 0 . hover_actions_gotoTypeDef_enable ,
1755
- }
1756
- }
1757
-
1758
1794
pub fn highlighting_non_standard_tokens ( & self ) -> bool {
1759
1795
self . root_config . global . 0 . semanticHighlighting_nonStandardTokens
1760
1796
}
@@ -1788,44 +1824,6 @@ impl Config {
1788
1824
}
1789
1825
}
1790
1826
1791
- pub fn hover ( & self ) -> HoverConfig {
1792
- let mem_kind = |kind| match kind {
1793
- MemoryLayoutHoverRenderKindDef :: Both => MemoryLayoutHoverRenderKind :: Both ,
1794
- MemoryLayoutHoverRenderKindDef :: Decimal => MemoryLayoutHoverRenderKind :: Decimal ,
1795
- MemoryLayoutHoverRenderKindDef :: Hexadecimal => MemoryLayoutHoverRenderKind :: Hexadecimal ,
1796
- } ;
1797
- HoverConfig {
1798
- links_in_hover : self . root_config . global . 0 . hover_links_enable ,
1799
- memory_layout : self . root_config . global . 0 . hover_memoryLayout_enable . then_some (
1800
- MemoryLayoutHoverConfig {
1801
- size : self . root_config . global . 0 . hover_memoryLayout_size . map ( mem_kind) ,
1802
- offset : self . root_config . global . 0 . hover_memoryLayout_offset . map ( mem_kind) ,
1803
- alignment : self . root_config . global . 0 . hover_memoryLayout_alignment . map ( mem_kind) ,
1804
- niches : self . root_config . global . 0 . hover_memoryLayout_niches . unwrap_or_default ( ) ,
1805
- } ,
1806
- ) ,
1807
- documentation : self . root_config . global . 0 . hover_documentation_enable ,
1808
- format : {
1809
- let is_markdown = try_or_def ! ( self
1810
- . caps
1811
- . text_document
1812
- . as_ref( ) ?
1813
- . hover
1814
- . as_ref( ) ?
1815
- . content_format
1816
- . as_ref( ) ?
1817
- . as_slice( ) )
1818
- . contains ( & MarkupKind :: Markdown ) ;
1819
- if is_markdown {
1820
- HoverDocFormat :: Markdown
1821
- } else {
1822
- HoverDocFormat :: PlainText
1823
- }
1824
- } ,
1825
- keywords : self . root_config . global . 0 . hover_documentation_keywords_enable ,
1826
- }
1827
- }
1828
-
1829
1827
pub fn workspace_symbol ( & self ) -> WorkspaceSymbolConfig {
1830
1828
WorkspaceSymbolConfig {
1831
1829
search_scope : match self . root_config . global . 0 . workspace_symbol_search_scope {
0 commit comments