[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode adef2a5 118/192: Be more resilient to server cra
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode adef2a5 118/192: Be more resilient to server crashes |
Date: |
Sun, 29 Aug 2021 11:02:02 -0400 (EDT) |
branch: elpa/dart-mode
commit adef2a5b672d503ae3e92b30bb80095879b030d0
Author: Natalie Weizenbaum <nex342@gmail.com>
Commit: Natalie Weizenbaum <nex342@gmail.com>
Be more resilient to server crashes
Automatically restart the server when interacting with it after it
crashes.
---
dart-mode.el | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 041ffa7..d32f3bd 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -2,7 +2,7 @@
;; Author: Natalie Weizenbaum
;; URL: https://github.com/nex3/dart-mode
-;; Version: 1.0.1
+;; Version: 1.0.2
;; Package-Requires: ((emacs "24.5") (cl-lib "0.5") (dash "2.10.0") (flycheck
"0.23") (s "1.11"))
;; Keywords: language
@@ -791,11 +791,14 @@ directory or the current file directory to the analysis
roots."
(add-to-list 'flycheck-checkers 'dart-analysis-server))
(defun dart-start-analysis-server ()
- "Start the Dart analysis server."
+ "Start the Dart analysis server.
+
+Initializes analysis server support for all `dart-mode' buffers."
(when dart--analysis-server
- (kill-process
- (dart--analysis-server-process dart--analysis-server))
+ (-let [process (dart--analysis-server-process dart--analysis-server)]
+ (when (process-live-p process) (kill-process process)))
(kill-buffer (dart--analysis-server-buffer dart--analysis-server)))
+
(let* ((process-connection-type nil)
(dart-process
(start-process "dart-analysis-server"
@@ -805,7 +808,13 @@ directory or the current file directory to the analysis
roots."
"--no-error-notification")))
(set-process-query-on-exit-flag dart-process nil)
(setq dart--analysis-server
- (dart--analysis-server-create dart-process))))
+ (dart--analysis-server-create dart-process)))
+
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (eq major-mode 'dart-mode)
+ (dart--start-analysis-server-for-current-buffer)
+ (when (buffer-modified-p buffer) (dart-add-analysis-overlay))))))
(defun dart--analysis-server-create (process)
"Create a Dart analysis server from PROCESS."
@@ -918,6 +927,14 @@ The constructed request will call METHOD with optional
PARAMS."
(or callback #'dart--analysis-server-on-error-callback))
dart--analysis-server-callbacks)
+ (cond
+ ((not dart--analysis-server)
+ (message "Starting Dart analysis server.")
+ (dart-start-analysis-server))
+ ((not (process-live-p (dart--analysis-server-process
dart--analysis-server)))
+ (message "Dart analysis server crashed, restarting.")
+ (dart-start-analysis-server)))
+
(dart-info (concat "Sent: " request))
(process-send-string (dart--analysis-server-process dart--analysis-server)
(concat request "\n"))))
- [nongnu] elpa/dart-mode 6bc08f7 136/192: Adds failing test against dart dev, (continued)
- [nongnu] elpa/dart-mode 6bc08f7 136/192: Adds failing test against dart dev, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9c9a63e 130/192: Fix dart-format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1f27d03 119/192: Properly set up font-lock variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6397b3d 115/192: Clean up the way the SDK is configured, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e9cd33d 109/192: Use proper private name convention, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a087c75 099/192: Add a result counter in search results, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 847707d 129/192: Require final newline, like dartfmt, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 570e58c 116/192: Refactor formatter support, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d4da484 126/192: Removes nil c-syntactic-context (#56), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 7c28c58 131/192: Add Travis-CI and Cask, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode adef2a5 118/192: Be more resilient to server crashes,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 61f334c 149/192: Improves indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 47dc5a0 146/192: Fixes flycheck in Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6e1c42f 156/192: Fontify string interpolation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d78c5c7 142/192: Bump version to 1.0.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1031016 141/192: Edit README to melpa rather than marmalade, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d3d3d7e 188/192: Add indentation tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e94acb5 168/192: Fontify SCREAMING_CAPS words of length greater than two as constant, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c51e750 163/192: Stop testing 24.3 on travis, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 735868e 154/192: Copy/paste multiline string syntax-propertize from python.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9ad52e8 158/192: Search for sdk from flutter if no dart on path, ELPA Syncer, 2021/08/29