You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tkobayas (via GitHub)" <gi...@apache.org> on 2026/08/18 09:25:04 UTC
[PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
tkobayas opened a new pull request, #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718
(no comment)
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3859705365
##########
packages/drools-lsp/drools-lsp-server/src/main/java/org/drools/lsp/server/DroolsLspDocumentService.java:
##########
@@ -237,7 +238,14 @@ public void didChange(DidChangeTextDocumentParams params) {
public String getRuleName(CompletionParams completionParams) {
String text = sourcesMap.get(completionParams.getTextDocument().getUri());
- return DRLParserHelper.getFirstRuleName(text);
+ DRL10Parser parser = DRL10ParserHelper.createDrlParser(text);
Review Comment:
Thanks, deleted.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer merged PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "Rikkola (via GitHub)" <gi...@apache.org>.
Rikkola commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3860699822
##########
packages/drools-and-kogito/env/index.js:
##########
@@ -28,7 +28,7 @@ module.exports = composeEnv([rootEnv], {
description: "Git repository URL for Drools",
},
DROOLS_AND_KOGITO__droolsRepoGitRef: {
- default: "578d0c51c655c94c4cf03419d16b0996bf96eb8b",
+ default: "08c76b5c9655ad900fcf5e564d8d3e274ad248ff",
Review Comment:
So the code referencing incubator-kie codes is tied to a commit in incubator-kie?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3859698879
##########
packages/drools-lsp/drools-completion/src/test/java/org/drools/completion/DRLParserSmokeTest.java:
##########
@@ -1,90 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.drl.parser.antlr4;
-
-import org.drools.drl.parser.antlr4.DRL10Parser.BooleanAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.CompilationUnitContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ConstraintContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ExpressionAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ImportStandardDefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LabelContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsPatternContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsUnarySingleContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.PackagedefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.RuledefContext;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * This class is a quick test to check if the antlr4 parser is working.
- * The real tests are done in the Drools project.
- */
-class SmokeTest {
Review Comment:
Brought this back.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "drccrd (via GitHub)" <gi...@apache.org>.
drccrd commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3850500746
##########
packages/drools-lsp/drools-parser/pom.xml:
##########
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-lsp</artifactId>
- <version>${revision}</version>
- </parent>
-
- <artifactId>drools-parser</artifactId>
-
- <name>Drools :: Parser</name>
Review Comment:
This pom had fewer dependencies than `drools-drl-parser`, so switching brings `drools-core` - which adds substantially to the extension - particularly `drools-core` and `antlr-runtime` (other than drl-ast)
if this is intentional then it changes what is possible in the vscode extension, but will also flag it in vscode's extension size warning
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#issuecomment-5420707117
@drccrd Thank you for the review! Fixed and replied to each comment.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3818966063
##########
packages/drools-lsp/drools-completion/pom.xml:
##########
@@ -35,9 +35,8 @@
<dependencies>
<dependency>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-parser</artifactId>
- <version>${project.version}</version>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-drl-parser</artifactId>
</dependency>
Review Comment:
false-positive. `org.drools:drools-drl-parser` version is managed by `drools-bom`
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "drccrd (via GitHub)" <gi...@apache.org>.
drccrd commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3850500746
##########
packages/drools-lsp/drools-parser/pom.xml:
##########
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-lsp</artifactId>
- <version>${revision}</version>
- </parent>
-
- <artifactId>drools-parser</artifactId>
-
- <name>Drools :: Parser</name>
Review Comment:
This pom had fewer dependencies than `drools-drl-parser`, so switching brings `drools-core` - which adds substantially to the extension - particularly `drools-core` and `antlr-runtime` (other than drl-ast)
if this is intentional then it changes what is possible in the vscode extension, but will also flag it in vscode's extension size warning I think
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "drccrd (via GitHub)" <gi...@apache.org>.
drccrd commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3850666328
##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/DRLDiagnosticHelper.java:
##########
Review Comment:
and .rat-excludes:116-118 (dead)
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3818980877
##########
packages/drools-lsp/drools-lsp-server/src/main/java/org/drools/lsp/server/DroolsLspDocumentService.java:
##########
@@ -178,7 +179,14 @@ public void didChange(DidChangeTextDocumentParams params) {
public String getRuleName(CompletionParams completionParams) {
String text = sourcesMap.get(completionParams.getTextDocument().getUri());
- return DRLParserHelper.getFirstRuleName(text);
+ DRL10Parser parser = DRL10ParserHelper.createDrlParser(text);
+ DRL10Parser.CompilationUnitContext compilationUnitContext = parser.compilationUnit();
+ return compilationUnitContext.drlStatementdef()
+ .stream()
+ .filter(def -> def.ruledef() != null)
+ .map(def -> def.ruledef().name.getText())
+ .findFirst()
+ .orElse("");
Review Comment:
Used in only one place, so not extracting. YAGNI.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3859698879
##########
packages/drools-lsp/drools-completion/src/test/java/org/drools/completion/DRLParserSmokeTest.java:
##########
@@ -1,90 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.drl.parser.antlr4;
-
-import org.drools.drl.parser.antlr4.DRL10Parser.BooleanAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.CompilationUnitContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ConstraintContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ExpressionAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ImportStandardDefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LabelContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsPatternContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsUnarySingleContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.PackagedefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.RuledefContext;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * This class is a quick test to check if the antlr4 parser is working.
- * The real tests are done in the Drools project.
- */
-class SmokeTest {
Review Comment:
Thanks. Brought this back.
##########
packages/drools-lsp/drools-completion/src/test/java/org/drools/completion/DRLParserSmokeTest.java:
##########
@@ -1,90 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.drl.parser.antlr4;
-
-import org.drools.drl.parser.antlr4.DRL10Parser.BooleanAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.CompilationUnitContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ConstraintContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ExpressionAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ImportStandardDefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LabelContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsPatternContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsUnarySingleContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.PackagedefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.RuledefContext;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * This class is a quick test to check if the antlr4 parser is working.
- * The real tests are done in the Drools project.
- */
-class SmokeTest {
Review Comment:
Agreed. Brought this back.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3863976303
##########
packages/drools-and-kogito/env/index.js:
##########
@@ -28,7 +28,7 @@ module.exports = composeEnv([rootEnv], {
description: "Git repository URL for Drools",
},
DROOLS_AND_KOGITO__droolsRepoGitRef: {
- default: "578d0c51c655c94c4cf03419d16b0996bf96eb8b",
+ default: "08c76b5c9655ad900fcf5e564d8d3e274ad248ff",
Review Comment:
@Rikkola Correct
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "drccrd (via GitHub)" <gi...@apache.org>.
drccrd commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3850644595
##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/DRLDiagnosticHelper.java:
##########
Review Comment:
minor, but this could be updated to `drools-drl-parser` now
##########
packages/drools-lsp/drools-parser/src/test/java/org/drools/drl/parser/antlr4/SmokeTest.java:
##########
@@ -1,90 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.drl.parser.antlr4;
-
-import org.drools.drl.parser.antlr4.DRL10Parser.BooleanAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.CompilationUnitContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ConstraintContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ExpressionAttributeContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.ImportStandardDefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LabelContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsPatternContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.LhsUnarySingleContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.PackagedefContext;
-import org.drools.drl.parser.antlr4.DRL10Parser.RuledefContext;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * This class is a quick test to check if the antlr4 parser is working.
- * The real tests are done in the Drools project.
- */
-class SmokeTest {
Review Comment:
might be worth keeping the smoke test in this repo to flag any drift?
##########
packages/drools-lsp/drools-parser/pom.xml:
##########
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-lsp</artifactId>
- <version>${revision}</version>
- </parent>
-
- <artifactId>drools-parser</artifactId>
-
- <name>Drools :: Parser</name>
-
- <dependencies>
- <!-- External dependencies -->
- <dependency>
- <groupId>org.antlr</groupId>
Review Comment:
[maven-base/pom.xml.template:129](vscode-webview://1rjdckcc5ev6l89tugdg3d6v0s94ch7a7q2huubpa8m63irnhkg1/packages/maven-base/pom.xml.template#L129) + :256-257 — version.org.antlr4.plugin and the antlr4-maven-plugin pluginManagement entry existed solely for the deleted module. Nothing under packages/ generates ANTLR sources any more. (they were added in https://github.com/apache/incubator-kie-tools/pull/3665 )
##########
packages/drools-lsp/drools-lsp-server/src/main/java/org/drools/lsp/server/DroolsLspDocumentService.java:
##########
@@ -237,7 +238,14 @@ public void didChange(DidChangeTextDocumentParams params) {
public String getRuleName(CompletionParams completionParams) {
String text = sourcesMap.get(completionParams.getTextDocument().getUri());
- return DRLParserHelper.getFirstRuleName(text);
+ DRL10Parser parser = DRL10ParserHelper.createDrlParser(text);
Review Comment:
this is the only reason for importing the DRL10Parser into this package (is otherwise only in drools-completion), but it seems the function has no callers - delete?
##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/DRLDiagnosticHelper.java:
##########
Review Comment:
JavaSourceTypeParser.java:39 has the module name in a comment too
##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/DRLDiagnosticHelper.java:
##########
Review Comment:
and .rat-excludes:116-118
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3859696313
##########
packages/drools-lsp/drools-parser/pom.xml:
##########
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-lsp</artifactId>
- <version>${revision}</version>
- </parent>
-
- <artifactId>drools-parser</artifactId>
-
- <name>Drools :: Parser</name>
Review Comment:
Thank you for pointing this out. With this PR, the .vsix went from 5.41 to 8.47 MB (+3 MB). Then I excluded `drools-core` and some transitive dependencies (`antlr-runtime` is required though). Now the .vsix is 6.73 MB (+1.3 MB). I hope it's acceptable (btw, if there is a good reason, we may include `drools-core` etc., I think).
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3859704112
##########
packages/drools-lsp/drools-parser/pom.xml:
##########
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-lsp</artifactId>
- <version>${revision}</version>
- </parent>
-
- <artifactId>drools-parser</artifactId>
-
- <name>Drools :: Parser</name>
-
- <dependencies>
- <!-- External dependencies -->
- <dependency>
- <groupId>org.antlr</groupId>
Review Comment:
Thanks, removed.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3840060215
##########
packages/drools-and-kogito/env/index.js:
##########
@@ -28,7 +28,7 @@ module.exports = composeEnv([rootEnv], {
description: "Git repository URL for Drools",
},
DROOLS_AND_KOGITO__droolsRepoGitRef: {
- default: "578d0c51c655c94c4cf03419d16b0996bf96eb8b",
+ default: "08c76b5c9655ad900fcf5e564d8d3e274ad248ff",
Review Comment:
Updated to pick the latest drools commit.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3859700224
##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/DRLDiagnosticHelper.java:
##########
Review Comment:
Thanks, fixed.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-tools#3715] drools-lsp to consume drools-drl-parser [incubator-kie-tools]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3718:
URL: https://github.com/apache/incubator-kie-tools/pull/3718#discussion_r3811743159
##########
packages/drools-lsp/drools-lsp-server/src/main/java/org/drools/lsp/server/DroolsLspDocumentService.java:
##########
@@ -178,7 +179,14 @@ public void didChange(DidChangeTextDocumentParams params) {
public String getRuleName(CompletionParams completionParams) {
String text = sourcesMap.get(completionParams.getTextDocument().getUri());
- return DRLParserHelper.getFirstRuleName(text);
+ DRL10Parser parser = DRL10ParserHelper.createDrlParser(text);
+ DRL10Parser.CompilationUnitContext compilationUnitContext = parser.compilationUnit();
+ return compilationUnitContext.drlStatementdef()
+ .stream()
+ .filter(def -> def.ruledef() != null)
+ .map(def -> def.ruledef().name.getText())
+ .findFirst()
+ .orElse("");
Review Comment:
The first-rule-name extraction logic was previously centralized in `DRLParserHelper.getFirstRuleName(...)`, but is now inlined here. To avoid duplication (and make future parser migrations easier), consider reintroducing a small local utility method/class in this repo (or using an equivalent upstream helper if available) and call it from here.
##########
packages/drools-lsp/drools-completion/pom.xml:
##########
@@ -35,9 +35,8 @@
<dependencies>
<dependency>
- <groupId>org.kie.tools</groupId>
- <artifactId>drools-parser</artifactId>
- <version>${project.version}</version>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-drl-parser</artifactId>
</dependency>
Review Comment:
This dependency no longer declares a `<version>`. Maven builds will fail unless `org.drools:drools-drl-parser` is provided via `<dependencyManagement>` (e.g., a BOM imported by the parent). If it isn’t managed, add an explicit version property (ideally centralized in the parent) to make the build deterministic.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org