Skip to content

Commit 2f36350

Browse files
committed
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: #12404 (comment) Comment highlight of go: golang/go#61293 (comment)
1 parent 75a673e commit 2f36350

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

editors/vscode/client/extension.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ export async function activate(context: ExtensionContext) {
186186
outputChannel,
187187
traceOutputChannel: outputChannel,
188188
middleware: {
189+
handleDiagnostics: (uri, diagnostics, next) => {
190+
for (const diag of diagnostics) {
191+
// https://github.com/oxc-project/oxc/issues/12404
192+
if (typeof diag.code === 'object' && diag.code?.value === 'eslint-plugin-unicorn(filename-case)') {
193+
diag.message += '\nYou may need to close the file and restart VSCode after renaming a file by only casing.';
194+
}
195+
}
196+
next(uri, diagnostics);
197+
},
189198
workspace: {
190199
configuration: (params: ConfigurationParams) => {
191200
return params.items.map(item => {

0 commit comments

Comments
 (0)