drccrd commented on code in PR #4007:
URL: 
https://github.com/apache/incubator-kie-tools/pull/4007#discussion_r4008545317


##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/CustomOperators.java:
##########
@@ -0,0 +1,141 @@
+/*
+ * 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.drools.completion;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.drools.drl.parser.impl.Operator;
+
+/**
+ * The project's custom DRL operators, read from where the engine reads them:
+ * the {@code drools.evaluator.<id>} keys of {@code 
META-INF/kie.properties.conf}
+ * and {@code META-INF/kie.default.properties.conf} on its classpath
+ * ({@code org.kie.internal.utils.ChainedProperties}). The engine instantiates
+ * each configured class, whose static initializer registers the operator; only
+ * the keys are read here, so no project code runs in the server.
+ *
+ * <p>Each id is registered in the parser's {@link Operator} cache, which the
+ * DRL10 grammar consults through {@code isPluggableEvaluator} before accepting
+ * {@code ##id} — so a custom operator parses in the editor as it does in the
+ * engine. Operators registered from Java rather than configured, and ids a
+ * definition registers beyond its property key, are not seen.
+ */
+public final class CustomOperators {
+
+    private static final Logger logger = 
Logger.getLogger(CustomOperators.class.getName());
+
+    static final String PROPERTY_PREFIX = "drools.evaluator.";
+
+    static final String[] CONF_FILES = {

Review Comment:
   this was previously missing and was a gap between the runtime compiler and 
the IDE, so so now syntax highlighting is possible too, and potentially other 
features in the future



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

Reply via email to