sdedic commented on code in PR #6183:
URL: https://github.com/apache/netbeans/pull/6183#discussion_r1263389312
##########
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java:
##########
@@ -1185,4 +1192,77 @@ private static void hackNoReuseOfOutputsForAntProjects()
{
}
}
}
+
+ public static class LSPServerTelemetryFactory extends CustomIndexerFactory
{
+
+ private static LSPServerTelemetryFactory INSTANCE;
+ private final CustomIndexer noOp = new CustomIndexer() {
+ @Override
+ protected void index(Iterable<? extends Indexable> files, Context
context) {
+ }
+ };
+ private WeakHashMap<LanguageClient, Future<Void>> clients = new
WeakHashMap<>();
+
+ @MimeRegistration(mimeType="", service=CustomIndexerFactory.class)
+ public static LSPServerTelemetryFactory getDefault() {
+ if (INSTANCE == null) {
+ INSTANCE = new LSPServerTelemetryFactory();
+ }
+ return INSTANCE;
+ }
+
+ private LSPServerTelemetryFactory() {
+ }
+
+ public synchronized void connect(LanguageClient client, Future<Void>
future) {
+ clients.put(client, future);
+ }
+
+ @Override
+ public synchronized boolean scanStarted(Context context) {
+ for (Map.Entry<LanguageClient, Future<Void>> entry :
clients.entrySet()) {
+ if (!entry.getValue().isDone()) {
+ entry.getKey().telemetryEvent("nbls.scanStarted");
+ }
Review Comment:
Consider removing the entry in case `entry.getValue().isDone() == true`.
--
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