From c5f87ba81950ee30551af5a982f3849405715ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 5 Aug 2023 21:08:04 +0200 Subject: [PATCH] CPPLITE: Ensure STDERR of language server is discarded and not ignored The language server ccls and clangd both output debugging information to STDERR. This works while the output buffer of the language server is not yet filled and fails when the buffer is full. Closes: #6297 --- cpplite/cpplite.editor/nbproject/project.properties | 3 ++- .../modules/cpplite/editor/lsp/LanguageServerImpl.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cpplite/cpplite.editor/nbproject/project.properties b/cpplite/cpplite.editor/nbproject/project.properties index 5137752915a4..88e39a3d0ffa 100644 --- a/cpplite/cpplite.editor/nbproject/project.properties +++ b/cpplite/cpplite.editor/nbproject/project.properties @@ -15,5 +15,6 @@ # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.source=11 +javac.target=11 javac.compilerargs=-Xlint -Xlint:-serial diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/lsp/LanguageServerImpl.java b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/lsp/LanguageServerImpl.java index 06f4dc518954..5cb27cefbf68 100644 --- a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/lsp/LanguageServerImpl.java +++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/lsp/LanguageServerImpl.java @@ -124,6 +124,8 @@ public void stateChanged(ChangeEvent e) { ProcessBuilder builder = new ProcessBuilder(command); if (LOG.isLoggable(Level.FINEST)) { builder.redirectError(Redirect.INHERIT); + } else { + builder.redirectError(Redirect.DISCARD); } Process process = builder.start(); InputStream in = process.getInputStream();