Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put instructions at the top when langserver gets disabled #1619

Merged
merged 6 commits into from
Mar 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions plugin/core/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ def start_async(self, config: ClientConfig, initiating_view: sublime.View) -> No
self._new_session = session
except Exception as e:
message = "".join((
"Failed to start subprocess for {0}. Reason:\n\n",
"{1}\n\n",
"{0} will be disabled for this project. Enable {0} again by running ",
"\"LSP: Enable Language Server In Project\" from the Command Palette."
"Failed to start subprocess for {0}. {0} will be disabled for this window. ",
"Enable {0} again by running \"LSP: Enable Language Server In Project\" from the Command Palette.",
rwols marked this conversation as resolved.
Show resolved Hide resolved
"\n\n",
"{1}"
rchl marked this conversation as resolved.
Show resolved Hide resolved
)).format(config.name, str(e))
exception_log("Unable to start subprocess for {}".format(config.name), e)
if isinstance(e, CalledProcessError):
Expand Down Expand Up @@ -423,13 +423,13 @@ def on_post_exit_async(self, session: Session, exit_code: int, exception: Option
listener.on_session_shutdown_async(session)
if exit_code != 0 or exception:
config = session.config
msg = "{} exited with status code {}".format(config.name, exit_code)
if exception:
msg += " and message:\n\n---\n{}\n---".format(str(exception))
msg += "".join((
"\n\nDo you want to restart {0}?\n\nIf you choose Cancel, {0} will be disabled for this project. ",
msg = "".join((
"{0} exited with status code {1}. ",
"Do you want to restart {0}? If you choose Cancel, {0} will be disabled for this window. ",
"Enable {0} again by running \"LSP: Enable Language Server In Project\" from the Command Palette."
rwols marked this conversation as resolved.
Show resolved Hide resolved
)).format(config.name)
)).format(config.name, exit_code)
if exception:
msg += "\n\n---\n{}\n---".format(str(exception))
rwols marked this conversation as resolved.
Show resolved Hide resolved
if sublime.ok_cancel_dialog(msg, "Restart {}".format(config.name)):
for listener in self._listeners:
self.register_listener_async(listener)
Expand Down