
    G@d                     n    d Z ddlmZmZ ddlmZmZ ddlmZ ddl	m
Z
mZ ddlmZ  G d de
          Zd	S )
zOutline Explorer Plugin.    )QtSlot)on_plugin_availableon_plugin_teardown_)SpyderDockablePluginPlugins)OutlineExplorerWidgetc                      e Zd ZdZdZej        ej        gZg Z	dZ
eZedefd            ZdefdZd Zd Z eej                  d	             Z eej                  d
             Z eej                  d             Z eej                  d             Z ee          d             Zd Z eee          d             Zd Zd Z d Z!dS )OutlineExploreroutline_explorerFreturnc                       t          d          S )zReturn widget title.zOutline Explorerr        Elib/python3.11/site-packages/spyder/plugins/outlineexplorer/plugin.pyget_namezOutlineExplorer.get_name   s     #$$$r   c                      t          d          S )z6Return the description of the outline explorer widget.z/Explore a file's functions, classes and methodsr   selfs    r   get_descriptionzOutlineExplorer.get_description$   s    BCCCr   c                 ,    |                      d          S )z!Return the outline explorer icon.r   )create_iconr   s    r   get_iconzOutlineExplorer.get_icon(   s     2333r   c                     | j         r$| j         j                            | j                   | j                            | j                   d S N)mainrestore_scrollbar_positionconnect_restore_scrollbar_positionsig_mainwindow_state_changed_on_mainwindow_state_changedr   s    r   on_initializezOutlineExplorer.on_initialize,   sZ    9 	2I08802 2 2)11-	/ 	/ 	/ 	/ 	/r   )pluginc                     |                      t          j                  }|j                            | j                   |j                            | j                   d S r   )
get_pluginr
   Completions"sig_language_completions_availabler    start_symbol_servicessig_stop_completionsstop_symbol_servicesr   completionss     r   on_completions_availablez(OutlineExplorer.on_completions_available3   sb    oog&9::6>>&	( 	( 	((00%	' 	' 	' 	' 	'r   c                     |                      t          j                  }|j                            | j                   d S r   )r'   r
   Editorsig_open_files_finishedr    update_all_editorsr   editors     r   on_editor_availablez#OutlineExplorer.on_editor_available<   s@    00&..#	% 	% 	% 	% 	%r   c                     |                      t          j                  }|j                            | j                   |j                            | j                   d S r   )r'   r
   r(   r)   
disconnectr*   r+   r,   r-   s     r   on_completions_teardownz'OutlineExplorer.on_completions_teardownC   sb    oog&9::6AA&	( 	( 	((33%	' 	' 	' 	' 	'r   c                     |                      t          j                  }|j                            | j                   d S r   )r'   r
   r1   r2   r8   r3   r4   s     r   on_editor_teardownz"OutlineExplorer.on_editor_teardownL   s@    00&11#	% 	% 	% 	% 	%r   c                     |t           j        k    r)|                                                     d           dS |                                                     d           dS )z;Actions to take when the main window has changed its state.FTN)r   WindowMinimized
get_widgetchange_tree_visibility)r   window_states     r   r#   z,OutlineExplorer._on_mainwindow_state_changedU   s\     2--- OO44U;;;;;OO44T:::::r   c                     |                      dd          }|                                 }||j                            |           dS dS )z9Restoring scrollbar position after main window is visiblescrollbar_positionN)get_confr>   
treewidgetset_scrollbar_position)r   scrollbar_posexplorers      r   r!   z+OutlineExplorer._restore_scrollbar_position_   sP    &:DAA??$$$66}EEEEE %$r   c                     |                                  }|                    dd          }|r|                    |           dS dS )z!Enable LSP symbols functionality.documentSymbolProviderFN)r>   getr*   )r   capabilitieslanguagerG   symbol_providers        r   r*   z%OutlineExplorer.start_symbol_servicesh   sU     ??$$&**+CUKK 	5**844444	5 	5r   c                 X    |                                  }|                    |           dS )z"Disable LSP symbols functionality.N)r>   r,   )r   rL   rG   s      r   r,   z$OutlineExplorer.stop_symbol_servicesp   s+    ??$$%%h/////r   c                 V    |                                  }|                                 dS )z1Update all editors with an associated LSP server.N)r>   r3   )r   rG   s     r   r3   z"OutlineExplorer.update_all_editorsu   s)    ??$$##%%%%%r   c                 N    |                                                                  S )z'List of languages with symbols support.)r>   get_supported_languagesr   s    r   rQ   z'OutlineExplorer.get_supported_languagesz   s      88:::r   N)"__name__
__module____qualname__NAMECONF_SECTIONr
   r(   r1   REQUIRESOPTIONAL	CONF_FILEr   WIDGET_CLASSstaticmethodstrr   r   r   r$   r   r/   r6   r   r9   r;   r   objectr#   r!   dictr*   r,   r3   rQ   r   r   r   r   r      s       D%L#W^4HHI(L %c % % % \%D D D D D4 4 4/ / /  3444' ' 54' ///% % 0/% w2333' ' 43' w~...% % /.% 
T&\\; ; \;F F F 
T$__5 5 _50 0 0
& & &
; ; ; ; ;r   r   N)__doc__qtpy.QtCorer   r   )spyder.api.plugin_registration.decoratorsr   r   spyder.api.translationsr   spyder.api.pluginsr	   r
   *spyder.plugins.outlineexplorer.main_widgetr   r   r   r   r   <module>re      s      !              - - - - - - - - % % % % % % < < < < < < < < L L L L L Lh; h; h; h; h;* h; h; h; h; h;r   