From 2f36350dc3b76a9239bc8f9d10e668a4de0f7cf3 Mon Sep 17 00:00:00 2001 From: Sysix <3897725+Sysix@users.noreply.github.com> Date: Thu, 11 Sep 2025 05:11:40 +0000 Subject: [PATCH] fix(editor): add notice for a possible restart when fixing `filename-case` (#13557) closes #12404 VSCode does not send the new filename case, when only renaming the file. So `oxc_language_server` receives the wrong URI and still reports for `filename-case` rule. Other language server had the problems, and everybody fixed it in VSCode. Because other editors are doing this "correct". See the linked issues in my replies: https://github.com/oxc-project/oxc/issues/12404#issuecomment-3094684532 Comment highlight of go: https://github.com/golang/go/issues/61293#issuecomment-1635991907 --- editors/vscode/client/extension.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editors/vscode/client/extension.ts b/editors/vscode/client/extension.ts index a0766fe9ad4f4..cc0e387cba181 100644 --- a/editors/vscode/client/extension.ts +++ b/editors/vscode/client/extension.ts @@ -186,6 +186,15 @@ export async function activate(context: ExtensionContext) { outputChannel, traceOutputChannel: outputChannel, middleware: { + handleDiagnostics: (uri, diagnostics, next) => { + for (const diag of diagnostics) { + // https://github.com/oxc-project/oxc/issues/12404 + if (typeof diag.code === 'object' && diag.code?.value === 'eslint-plugin-unicorn(filename-case)') { + diag.message += '\nYou may need to close the file and restart VSCode after renaming a file by only casing.'; + } + } + next(uri, diagnostics); + }, workspace: { configuration: (params: ConfigurationParams) => { return params.items.map(item => {