Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qute template validation breaks when using Gradle #1224

Closed
billoneil opened this issue Oct 15, 2023 · 10 comments · Fixed by #1237
Closed

Qute template validation breaks when using Gradle #1224

billoneil opened this issue Oct 15, 2023 · 10 comments · Fixed by #1237
Assignees
Labels
bug Something isn't working qute Qute support
Milestone

Comments

@billoneil
Copy link

There are no issues with the templates and everything works correctly but I am getting errors with the Qute validation.

image image

The templates are located here in the build directly and they do work as expected.

image
@angelozerr
Copy link
Contributor

Could you share your project please.

@billoneil
Copy link
Author

I created a minimal repo here but I'm seeing different behavior there now. https://github.com/billoneil/quarkus-kotlin-qute

I am not getting any highlighting or completion
image

@angelozerr angelozerr added the bug Something isn't working label Oct 16, 2023
@angelozerr
Copy link
Contributor

Thanks @billoneil for sharing your project. I have imported your project and at first you need to wait that your project is indexing to benefit with Qute support. After IJ indexing is finishd, do you have syntax coloration ad completion support for Qute?

I have imported your project and there is indeed a problem. It seems that root path for template is in src/test/resources/templates instead of src/main/resources/templates. I need to investigate why.

@angelozerr
Copy link
Contributor

The current problem is that main,test, and native-test are modules:

image

So we consider that there are 4 Qute projects. You can see that in LSP console:

image

by activating verbose message:

image

[Trace - 12:19:16] Sending response 'qute/template/projects - (4)'. Processing request took 4ms
Result: [
  {
    "uri": "rest-kotlin-quickstart.test",
    "templateBaseDir": "file:/C:/Users/azerr/git/quarkus-kotlin-qute/src/test/src/main/resources/templates/",
    "projectDependencyUris": [
      "rest-kotlin-quickstart.main"
    ]
  },
  {
    "uri": "rest-kotlin-quickstart.native-test",
    "templateBaseDir": "file:/C:/Users/azerr/git/quarkus-kotlin-qute/src/native-test/src/main/resources/templates/",
    "projectDependencyUris": [
      "rest-kotlin-quickstart.test",
      "rest-kotlin-quickstart.integrationTest",
      "rest-kotlin-quickstart.main"
    ]
  },
  {
    "uri": "rest-kotlin-quickstart.main",
    "templateBaseDir": "file:/C:/Users/azerr/git/quarkus-kotlin-qute/src/main/src/main/resources/templates/",
    "projectDependencyUris": []
  },
  {
    "uri": "rest-kotlin-quickstart.integrationTest",
    "templateBaseDir": "file:/C:/Users/azerr/git/quarkus-kotlin-qute/.idea/src/main/resources/templates/",
    "projectDependencyUris": [
      "rest-kotlin-quickstart.test",
      "rest-kotlin-quickstart.main"
    ]
  }
]

With maven project, themodule is the root project, not main,test. I wonder if it is a standard layout for gradle to have a module for main, test?

@fbricon
Copy link
Contributor

fbricon commented Oct 16, 2023

it's the way IJ deals with Gradle projects. Not sure we can do something about it

@billoneil
Copy link
Author

@angelozerr all of the referenced templates live in the same module is this a problem because it doesn't know which project to look in?

@fbricon
Copy link
Contributor

fbricon commented Oct 16, 2023

for now our language servers don't support kotlin projects, so not finding templates might be a side effect (or not). We need to investigate.

@angelozerr
Copy link
Contributor

@angelozerr all of the referenced templates live in the same module is this a problem because it doesn't know which project to look in?

I need to investigate more, but the first problem is that we consider that there are 4 Qute projects (because of module) although there is just one module.

for now our language servers don't support kotlin projects, so not finding templates might be a side effect (or not). We need to investigate.

@fbricon for this issue, the problem is about modules. In Gradle, it seems that main,test are modules although in maven those folders are not a module.

@fbricon
Copy link
Contributor

fbricon commented Oct 16, 2023

OK the same problems occurs on gradle projects without kotlin.

@fbricon fbricon changed the title Qute template validation references Java paths when using Quarkus with Kotlin Qute template validation breaks when using Gradle Oct 16, 2023
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Oct 17, 2023
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Oct 17, 2023
@angelozerr angelozerr added this to the 1.30.0 milestone Oct 18, 2023
@angelozerr angelozerr self-assigned this Oct 18, 2023
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Oct 18, 2023
@angelozerr angelozerr modified the milestones: 1.30.0, 1.29.0 Oct 18, 2023
@fbricon fbricon modified the milestones: 1.29.0, 1.30.0 Oct 18, 2023
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Oct 18, 2023
@angelozerr angelozerr added the qute Qute support label Nov 6, 2023
@angelozerr
Copy link
Contributor

@billoneil we have fixed problem with gradle project, but your project will not work again because you are using Kotlin which is not a trivial issue. Please follow the issue #482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working qute Qute support
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants