belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.41k stars 98 forks source link

CSharpier not formatting on save #1340

Closed jairo-blanco-stenn closed 2 months ago

jairo-blanco-stenn commented 2 months ago

Environments

Log Output java.lang.NullPointerException: Cannot invoke "String.split(String)" because "output" is null at com.intellij.csharpier.CSharpierProcessProvider.findCSharpierVersionInToolOutput(CSharpierProcessProvider.java:172) at com.intellij.csharpier.CSharpierProcessProvider.lambda$getCSharpierVersion$1(CSharpierProcessProvider.java:139) at com.intellij.csharpier.FunctionRunner.runUntilNonNull(FunctionRunner.java:9) at com.intellij.csharpier.CSharpierProcessProvider.getCSharpierVersion(CSharpierProcessProvider.java:135) at com.intellij.csharpier.CSharpierProcessProvider.findAndWarmProcess(CSharpierProcessProvider.java:92) at com.intellij.csharpier.CSharpierProcessProvider.documentChanged(CSharpierProcessProvider.java:72) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:119) at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:84) at jdk.proxy2/jdk.proxy2.$Proxy92.documentChanged(Unknown Source) at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$1(DocumentImpl.java:923) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:269) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277) at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:62) at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277) at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:268) at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:920) at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:824) at com.intellij.openapi.editor.impl.DocumentImpl.deleteString(DocumentImpl.java:577) at com.intellij.openapi.editor.actions.DeleteAction.deleteCharAtCaret(DeleteAction.java:96) at com.intellij.openapi.editor.actions.DeleteAction$Handler.executeWriteAction(DeleteAction.java:32) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:42) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$4(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:890) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:56) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:214) at com.intellij.database.run.SqlNotebookDeleteHandler.doExecute(SqlNotebookDeleteHandler.java:30) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:214) at com.jetbrains.rider.languages.fileTypes.csharp.assists.CSharpDeleteHandler.executeWriteAction(CSharpDeleteHandler.kt:15) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:42) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$4(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:890) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:56) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$2(EditorActionHandler.java:204) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:95) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$3(EditorActionHandler.java:203) at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$3(CaretModelImpl.java:303) at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:412) at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:312) at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:289) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:201) at com.intellij.openapi.editor.actions.DeleteSelectionHandler.executeWriteAction(DeleteSelectionHandler.java:33) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:42) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$4(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:890) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:56) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:211) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:95) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:210) at com.jetbrains.rdclient.actions.base.FrontendEditorActionHandler.executeOnFrontend(FrontendEditorActionHandler.kt:62) at com.jetbrains.rider.editorActions.FrontendTypingEditorActionHandler.access$executeOnFrontend(FrontendTypingEditorActionHandler.kt:24) at com.jetbrains.rider.editorActions.FrontendTypingEditorActionHandler$doExecute$1.invoke(FrontendTypingEditorActionHandler.kt:67) at com.jetbrains.rider.editorActions.FrontendTypingEditorActionHandler$doExecute$1.invoke(FrontendTypingEditorActionHandler.kt:65) at com.jetbrains.rider.editorActions.TypingSessions.executeTypedAction(TypingSessions.kt:321) at com.jetbrains.rider.editorActions.FrontendTypingEditorActionHandler.doExecute(FrontendTypingEditorActionHandler.kt:65) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:211) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:95) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:210) at com.intellij.openapi.editor.actions.DeleteInColumnModeHandler.executeWriteAction(DeleteInColumnModeHandler.java:35) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:42) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$4(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:318) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:890) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:56) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:211) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:95) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:210) at com.intellij.execution.impl.ConsoleViewImpl$ConsoleActionHandler.doExecute(ConsoleViewImpl.java:1209) at com.intellij.openapi.editor.actionSystem.DynamicEditorActionHandler.doExecute(DynamicEditorActionHandler.java:63) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:211) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:95) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:210) at com.intellij.openapi.editor.actionSystem.EditorAction.executeHandler(EditorAction.java:120) at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:107) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:226) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178) at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:106) at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:83) at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:342) at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$actionProcessor$1.performAction(IdeKeyEventDispatcher.kt:496) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4$lambda$3(IdeKeyEventDispatcher.kt:845) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4(IdeKeyEventDispatcher.kt:845) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1172) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.kt:359) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:843) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:572) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:509) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:448) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:441) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:303) at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:620) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$15(IdeEventQueue.kt:582) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:582) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351) at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035) at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910) at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55) at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23) at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035) at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Steps to reproduce Get latest version of rider and csharpier and apply format on save. Expected behavior It should apply format Actual behavior Throws an exception and does not apply any format.

I realize today but this seems to be happening since last Rider update. It was working perfectly days ago.

jairo-blanco-stenn commented 2 months ago

Seems to be working with plugin version 1.8.2 feel free to close it!