You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable Java 15, use multiline strings and content assist does not work.
This works:
em.createNativeQuery("whatever").|
This does not:
em.createNativeQuery(""" SELECT first_name, last_name, count(*) films FROM actor AS a JOIN film_actor AS fa USING (actor_id) GROUP BY actor_id, first_name, last_name ORDER BY films DESC LIMIT 1; """).|
Environment
Operating System: OSX
JDK version: Java 15
Visual Studio Code version: vscodium 1.53.2
Java extension version: v0.75.0
Steps To Reproduce
here is a jbang example, look for em.createNativeQuery and try content assist.
///usr/bin/env jbang "$0" "$@" ; exit $?//JAVA 15// Update the Quarkus version to what you want here or run jbang with// `-Dquarkus.version=<version>` to override it.//DEPS io.quarkus:quarkus-bom:${quarkus.version:1.11.3.Final}@pom//DEPS io.quarkus:quarkus-picocli//DEPS io.quarkus:quarkus-hibernate-orm-panache//DEPS io.quarkus:quarkus-jdbc-postgresql//DEPS org.postgresql:postgresql:42.2.14//DEPS org.testcontainers:postgresql:1.15.2//DEPS io.quarkus:quarkus-hibernate-orm//Q:CONFIG quarkus.banner.enabled=false//Q:CONFIG quarkus.log.level=INFO//Q:CONFIG quarkus.hibernate-orm.log.sql=true//Q:CONFIG quarkus.hibernate-orm.log.format-sql=true//Q:CONFIG quarkus.datasource.db-kind=postgresql//Q:CONFIG quarkus.datasource.username=postgres//Q:CONFIG quarkus.datasource.password=sakila//Q:CONFIG quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/sakila//SOURCES *.javaimportjava.sql.Date;
importjava.util.Arrays;
importjava.util.stream.Stream;
importjavax.enterprise.context.Dependent;
importjavax.enterprise.context.control.ActivateRequestContext;
importjavax.inject.Inject;
importjavax.persistence.Entity;
importjavax.persistence.EntityManager;
importjavax.persistence.Id;
importjavax.persistence.Table;
importjavax.transaction.Transactional;
importio.quarkus.hibernate.orm.panache.PanacheEntityBase;
importio.quarkus.runtime.QuarkusApplication;
importio.quarkus.runtime.annotations.QuarkusMain;
importpicocli.CommandLine;
@CommandLine.Command@QuarkusMainpublicclassdbimplementsRunnable, QuarkusApplication {
@CommandLine.Parameters(index = "0", description = "The greeting to print", defaultValue = "World!")
Stringname;
@InjectCommandLine.IFactoryfactory;
privatefinalGreetingServicegreetingService;
publicdb(GreetingServicegreetingService) {
this.greetingService = greetingService;
}
@Overridepublicintrun(String... args) {
returnnewCommandLine(this, factory).execute(args);
}
@Override@ActivateRequestContext@Transactionalpublicvoidrun() {
greetingService.sayHello(name);
}
@Entity@Table(name = "actor")
staticpublicclassActorextendsPanacheEntityBase {
@Idpubliclongactor_id;
publicStringfirst_name;
publicStringlast_name;
publicDatelast_update;
@OverridepublicStringtoString() {
returnactor_id + ": " + first_name + " " + last_name;
}
}
}
@DependentclassGreetingService {
@InjectEntityManagerem;
@SuppressWarnings("unchecked") // here as we are dealing with non-type-safe streamsvoidsayHello(Stringname) {
System.out.println("Hello " + name + "!");
db.Actor.listAll().forEach(System.out::println);
em.createNativeQuery("select * from Actor").getResultStream()
.forEach(x -> System.out.println(Arrays.toString((Object[]) x)));
em.createNativeQuery(""" SELECT first_name, last_name, count(*) films FROM actor AS a JOIN film_actor AS fa USING (actor_id) GROUP BY actor_id, first_name, last_name ORDER BY films DESC LIMIT 1; """);
}
}
Current Result
content assist only show text options, not typed java.
Expected Result
content assist should show proper typed java.
The text was updated successfully, but these errors were encountered:
Enable Java 15, use multiline strings and content assist does not work.
This works:
This does not:
Environment
Steps To Reproduce
here is a jbang example, look for
em.createNativeQuery
and try content assist.Current Result
content assist only show text options, not typed java.
Expected Result
content assist should show proper typed java.
The text was updated successfully, but these errors were encountered: