matthiasblaesing commented on code in PR #9249:
URL: https://github.com/apache/netbeans/pull/9249#discussion_r2904720591


##########
rust/rust.grammar/src/org/netbeans/modules/rust/grammar/lsp/UnconfiguredHint.java:
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.rust.grammar.lsp;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.EditorRegistry;
+import org.netbeans.api.options.OptionsDisplayer;
+import org.netbeans.modules.editor.NbEditorUtilities;
+import org.netbeans.modules.rust.options.api.RustAnalyzerOptions;
+
+import org.netbeans.spi.editor.hints.ChangeInfo;
+import org.netbeans.spi.editor.hints.ErrorDescription;
+import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
+import org.netbeans.spi.editor.hints.Fix;
+import org.netbeans.spi.editor.hints.HintsController;
+import org.netbeans.spi.editor.hints.Severity;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.modules.OnStart;
+
+
+@OnStart
+public class UnconfiguredHint implements Runnable {
+
+    private static final Set<String> RUST_MIME_TYPES = new 
HashSet<>(Arrays.asList("text/x-rust"));
+
+    private JTextComponent selectedComponent;
+
+    @Override
+    public void run() {
+        EditorRegistry.addPropertyChangeListener(new PropertyChangeListener() {
+            @Override
+            public void propertyChange(PropertyChangeEvent evt) {
+                updateFocused();
+            }
+        });
+        updateFocused();

Review Comment:
   This is established code (as in: This code was more or less copied from 
cpplite).
   
   Question: Where does the idea come from, that this code has anything to do 
with the hang? There is nothing in the dump that indicates this to me. If it 
would be the synchronized call, we would need to see a call into 
`UnconfiguredHint` in the stacktraces, which is not the case.
   
   For the rewrite of LSP support: A good rewrite might improve the situation, 
but experience shows, that rewrites also bring up new bugs. What we see with 
the rust lsp is that "the other" side is now also multithreaded. The primary 
use-case of LSP support in NetBeans was the typescript lsp and given 
javascripts inherent single threaded nature we are less likely to get into 
deadlock situations.
   
   The crucial point: The problem fixed here (see 
[d549c44](https://github.com/apache/netbeans/pull/9249/commits/d549c44be64ef1464c9d3acb1a862078af584dad))
 that was reproducible, if this is not, I don't see the discussion as 
productive.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to