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


##########
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 code was more or less copied from cpplite).
   
   I expect ccplite having very low usage given that the project import on NB 
version migration doesn't even work atm. And users asking on the discussions 
how to set projects up with no answers.
   
   > Question: Where does the idea come from, that this code has anything to do 
with the hang? 
   
   I looked through the diff focusing on concurrency red flags. Calling from 
EDT into a synchonized block is one. It being a startup/init issue while some 
prop change listeners are under high load during startup is another.
   
   > if this is not, I don't see the discussion as productive.
   
   could still be a problem. But if its not appreciated I'll stop I have other 
things to do anyway ;)



-- 
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