Skip to content

Commit

Permalink
Fix preventing start of all sessions if one session ignores view
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Feb 2, 2024
1 parent 813c7ad commit a236380
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions plugin/core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,9 @@ def on_post_start(cls, window: sublime.Window, initiating_view: sublime.View,
@classmethod
def should_ignore(cls, view: sublime.View) -> bool:
"""
Allows to exclude a view from being handled by the language server, even if it matches the URI scheme(s) and
selector from the configuration. This can be used to, for example, ignore certain file patterns which are listed
in a configuration file (e.g. .gitignore).
Exclude a view from being handled by the language server, even if it matches the URI scheme(s) and selector from
the configuration. This can be used to, for example, ignore certain file patterns which are listed in a
configuration file (e.g. .gitignore).
"""
return False

Expand Down
22 changes: 10 additions & 12 deletions plugin/core/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ def disable_config_async(self, config_name: str) -> None:
self._config_manager.disable_config(config_name)

def register_listener_async(self, listener: AbstractViewListener) -> None:
config = self._needed_config(listener.view)
if config:
plugin = get_plugin(config.name)
if plugin and plugin.should_ignore(listener.view):
debug(listener.view, "ignored by plugin", plugin.__name__)
return
set_diagnostics_count(listener.view, self.total_error_count, self.total_warning_count)
# Update workspace folders in case the user have changed those since window was created.
# There is no currently no notification in ST that would notify about folder changes.
Expand Down Expand Up @@ -183,12 +177,16 @@ def _dequeue_listener_async(self) -> None:
config = self._needed_config(listener.view)
if config:
# debug("found new config for listener", listener)
self._new_listener = listener
self.start_async(config, listener.view)
else:
# debug("no new config found for listener", listener)
self._new_listener = None
self._dequeue_listener_async()
plugin = get_plugin(config.name)
if plugin and plugin.should_ignore(listener.view):
debug(listener.view, "ignored by plugin", plugin.__name__)
else:
self._new_listener = listener
self.start_async(config, listener.view)
return
# debug("no new config found for listener", listener)
self._new_listener = None
self._dequeue_listener_async()

def _publish_sessions_to_listener_async(self, listener: AbstractViewListener) -> None:
inside_workspace = self._workspace.contains(listener.view)
Expand Down

0 comments on commit a236380

Please sign in to comment.