From 1e949e8f335f207d9cfcfcc90190d8ccb2eba06c Mon Sep 17 00:00:00 2001 From: Pradeep Ramola Date: Mon, 20 Jul 2026 05:51:26 -0400 Subject: [PATCH] Show ESLint output after manual restart --- README.md | 1 + client/src/extension.ts | 9 +++++++++ package.json | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 674257b9..0bcf1ebe 100644 --- a/README.md +++ b/README.md @@ -371,6 +371,7 @@ This extension contributes the following variables to the [settings](https://cod - `eslint.enable`: enable/disable ESLint for the workspace folder. Is enabled by default. - `eslint.debug`: enables ESLint's debug mode (same as --debug command line option). Please see the ESLint output channel for the debug output. This options is very helpful to track down configuration and installation problems with ESLint since it provides verbose information about how ESLint is validating a file. +- `eslint.showOutputOnRestart`: shows the ESLint output channel after manually restarting the ESLint server. Disabled by default. - `eslint.lintTask.enable`: whether the extension contributes a lint task to lint a whole workspace folder. - `eslint.lintTask.options`: Command line options applied when running the task for linting the whole workspace (https://eslint.org/docs/user-guide/command-line-interface). An example to point to a custom `.eslintrc.json` file and a custom `.eslintignore` is: diff --git a/client/src/extension.ts b/client/src/extension.ts index 1255e681..9807ea4c 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -65,6 +65,13 @@ let client: LanguageClient; let acknowledgePerformanceStatus: () => void; const taskProvider: TaskProvider = new TaskProvider(); const validator: Validator = new Validator(); + +function showOutputOnRestart(): void { + if (Workspace.getConfiguration('eslint').get('showOutputOnRestart', false)) { + client.outputChannel.show(); + } +} + export function activate(context: ExtensionContext) { @@ -148,6 +155,7 @@ function realActivate(context: ExtensionContext): void { [client, acknowledgePerformanceStatus] = ESLintClient.create(context, validator); return client.start().then(() => { client.info('ESLint server restarted.'); + showOutputOnRestart(); }).catch((error) => { client.error(`Starting the server failed.`, error, 'force'); const message = typeof error === 'string' ? error : typeof error.message === 'string' ? error.message : undefined; @@ -158,6 +166,7 @@ function realActivate(context: ExtensionContext): void { } else { return client.restart().then(() => { client.info('ESLint server restarted.'); + showOutputOnRestart(); }).catch((error) => client.error(`Restarting client failed`, error, 'force')); } }), diff --git a/package.json b/package.json index c01925a9..4b87d69e 100644 --- a/package.json +++ b/package.json @@ -423,6 +423,12 @@ "default": false, "markdownDescription": "Enables ESLint debug mode (same as `--debug` on the command line)" }, + "eslint.showOutputOnRestart": { + "scope": "window", + "type": "boolean", + "default": false, + "markdownDescription": "Shows the ESLint output channel after manually restarting the ESLint server." + }, "eslint.codeAction.disableRuleComment": { "scope": "resource", "type": "object",