~damien/jedit-lsp

6b9bf013294fb77a9f82e4a9d69a785ef64aae08 — Damien Radtke 4 months ago f21036a
Ensure disabled property is cleared on each start
1 files changed, 5 insertions(+), 8 deletions(-)

M lsp/Server.java
M lsp/Server.java => lsp/Server.java +5 -8
@@ 142,13 142,9 @@ public class Server {
		if (starting || isRunning()) {
			return;
		}
		if (jEdit.getBooleanProperty(isDisabledProp)) {
			if (force) {
				jEdit.unsetProperty(isDisabledProp);
			} else {
				Log.log(Log.DEBUG, this, "Not starting server because it was explicitly stopped; run the 'Start server' action to start it again");
				return;
			}
		if (jEdit.getBooleanProperty(isDisabledProp) && !force) {
			Log.log(Log.DEBUG, this, "Not starting server because it was explicitly stopped; run the 'Start server' action to start it again");
			return;
		}
		start(buffer);
	}


@@ 158,6 154,7 @@ public class Server {
			return;
		}
		starting = true;
		jEdit.unsetProperty(isDisabledProp);
		errorlist.ErrorSource.registerErrorSource(this.client.getErrorSource());
		ThreadUtilities.runInBackground(new Task("Starting language server: " + this.getName(), () -> {
			Utils.showTemporaryMessage("Starting " + process.getName() + "...");


@@ 186,12 183,12 @@ public class Server {
	 */
	public void stop() {
		synchronized(this) {
			jEdit.setTemporaryProperty(this.isDisabledProp, "true");
			if (this.process != null) {
				this.process.stop();
				log(Log.NOTICE, "Stopped server: " + this.process.getName());
				Utils.showTemporaryMessage("Stopped " + process.getName());
			}
			jEdit.setTemporaryProperty(this.isDisabledProp, "true");
			this.client.unpaintDiagnostics();
			this.client.getErrorSource().clear();
			errorlist.ErrorSource.unregisterErrorSource(this.client.getErrorSource());