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

fix: Qute fragments doesn't work with non inner Templates Java file #1170

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Sep 15, 2023

fix: Qute fragments doesn't work with non inner Templates Java file

Fixes #1169

Given this non inner class:

package org.acme;

import io.quarkus.qute.CheckedTemplate;
import io.quarkus.qute.TemplateInstance;

@CheckedTemplate
public class Templates {

    public static native TemplateInstance auth$emailVerification(String email);
}

With this PR Fragment should be recognized

image

@angelozerr
Copy link
Contributor Author

I need to write test.

@angelozerr
Copy link
Contributor Author

I have written tests, let's see if CI build is working.

@fbricon
Copy link
Contributor

fbricon commented Sep 15, 2023

looks like the open fragment codelens only open the file at Line 1, regardless of the fragment's offset.

I don't know how the links work, but maybe something like editor.getCaretModel().moveToOffsetfragmentOffset) could work?

@angelozerr
Copy link
Contributor Author

looks like the open fragment codelens only open the file at Line 1, regardless of the fragment's offset.

Indeed it is because it is not implemented, see #1169 (comment)

I don't know how the links work, but maybe something like editor.getCaretModel().moveToOffsetfragmentOffset) could work?

Perhaps but it requires that Qute Language server provides a command which returns the offset of a given fragment for a given template

@angelozerr angelozerr force-pushed the qute-fragment-fix branch 3 times, most recently from 0192271 to 7de6786 Compare September 15, 2023 21:39
@sonarcloud
Copy link

sonarcloud bot commented Sep 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@angelozerr
Copy link
Contributor Author

Tests are woking now.

@fbricon fbricon merged commit db1ab9b into redhat-developer:main Sep 18, 2023
12 of 13 checks passed
@fbricon
Copy link
Contributor

fbricon commented Sep 18, 2023

Thanks @angelozerr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qute fragments doesn't work with non inner Templates Java file
2 participants