GithubHelp home page GithubHelp logo

redhat-developer / intellij-quarkus Goto Github PK

View Code? Open in Web Editor NEW
114.0 14.0 43.0 16.1 MB

IntelliJ Quarkus Tools

License: Eclipse Public License 2.0

Java 74.65% HTML 23.96% Shell 0.25% Kotlin 1.06% Lua 0.01% JavaScript 0.05% CSS 0.01%
intellij intellij-plugin quarkus quarkus-properties intellij-quarkus jetbrains-plugins quarkusio quarkus-gradle quarkus-maven gradle

intellij-quarkus's Introduction

Quarkus Tools for IntelliJ

Java CI with Gradle Validate against IJ versions JetBrains plugins JetBrains plugins codecov

Description

A plugin aimed at Quarkus based development, providing easy bootstrapping and code assist from Quarkus related assets and Qute.

To provide those support, the plugin consumes:

by using LSP4IJ (Language Server Protocol for Intellij).

application.properties support

Code completion (Ctrl + ENTER)

Property documentation

Select a property and press Ctrl+Q

Goto property definition

Select a property and press Ctrl+B

Syntax validation

Wrong property key names or values are reported

Property hover in Java files

Property managed in your code through @ConfigProperty:

  • code completion in application.properties is adjusted accordingly if you define new properties
  • hover over the property field will display the current value

CodeLens / Inlay

When editing a resource class while the current Quarkus application is running in development mode (./mvnw compile quarkus:dev or ./gradlew quarkusDev), there are now CodeLenses that provide the URL for the GET endpoints.

This feature takes into account the path name and the HTTP server port from your application.properties file in order to create the URL.

Clicking on the CodeLens URL will open the URL in your default browser.

InLayHint

InlayHint is now a supported feature. It allows to add inline information about parameters and variables. This is very useful for Qute templates to get type information. InlayHints may also be clickable.

DocumentHighlight

DocumentHightlight allows to hightlight parts of the document that are related to the current selection. This is useful for Qute templates to highlight matching part of a Qute section.

CodeActions / Quick Fixes

When an error is detected on one of your Quarkus project files, it is highlighted in the source editor (example when you define one property through @ConfigProperty but it is not defined.).

If this error can be fixed through an automatic action, it will be available from the More actions context menu or through the Alt+Enter key binding.

In this example, we will add a default value for a property defined though @ConfigProperty

In this another example, a Microprofile REST Client is defined and bound to a REST resource but the RestClient annotation is missing from the binding.

MicroProfile Health

Syntax validation is being performed for Java files using the MicroProfile Health assets:

MicroProfile Fault Tolerance

MicroProfile Health related properties are supported in application.properties completion and syntax validation as soon as you use MicroProfile related annotation in your Java source files

Methods referenced in @Fallback(fallbackMethod) are validated:

Activating code completion on the @Fallback(fallbackMethod) value will get the list of available methods being proposed:

MicroProfile Rest Client

MicroProfile Rest Client references are checked against valid injections

MicroProfile LRA

MicroProfile LRA related properties references are supported in application.properties completion and syntax validation as soon as you use MicroProfile LRA in your Quarkus application

MicroProfile OpenAPI

MicroProfile OpenAPI related properties references are supported in application.properties completion and syntax validation as soon as you use MicroProfile OpenAPI in your Quarkus application

MicroProfile Metrics

MicroProfile Metrics related properties references are supported in application.properties completion and syntax validation as soon as you use MicroProfile Metrics in your Quarkus application

Invalid use of the @Gauge annotation is reported as well:

MicroProfile OpenTracing

MicroProfile OpenTracing related properties references are supported in application.properties completion and syntax validation as soon as you use MicroProfile OpenTracing in your Quarkus application

application.yaml

Code completion (Ctrl+ENTER)

Property documentation

Select a property and press Ctrl+Q

Syntax validation

Wrong property key names or values are reported

Qute templates

The Qute templating engine is supported in Java file and templates.

Quarkus project wizards

Generate a Quarkus Maven project, based on https://code.quarkus.io/. Call File > New > Module > Quarkus. It is possible to filter the list of displayed Quarkus extension by name pattern and allow or disallow the inclusion of non platforms Quarkus extensions.

Quarkus application.properties Features

  • Completion support for Quarkus properties
  • Hover support for Quarkus properties
  • Validation support for Quarkus properties
  • Support for Quarkus profiles
  • Outline support (flat or tree view)

Quarkus run/debug command

It is possible to run or debug a Quarkus application from the IDE configurations. Select the Run -> Edit Configurations... menu and click the Add new... link:

Select the Quarkus configuration type:

The first module of the project is selected. For single Quarkus projects, it is ok. If you have a multi module Quarkus project, you can change the module to test. You can also specify a Quarkus profile to use (dev is the default) and environment variables (using the notation VARNAME=varvalue, separated by semicolon)

The click the OK button. The configuration will now appear on the top right side of the window:

If you click the Run icon, it will start the Quarkus application in dev mode. If you click the Debug button, it will start the Quarkus application in dev mode and connect a local Java debugger to the running application.

When the console is running, you can open a browser to either the Quarkus DevUI or to the Quarkus application. When the Quarkus application has been started, right click in the console and a sub menu Quarkus will be displayed. It has 2 sub menus Open DevUI and Open application. When one of these menus are selected, a new browser window is opened to the desired location.

Quarkus code snippets

This plugin provides several code snippets, available when editing Java files:

  • qrc - Create a new Quarkus resource class
  • qrm - Create a new Quarkus resource method
  • qtrc - Create a new Quarkus test resource class
  • qntrc - Create a new Quarkus native test resource class

When editing application.properties files, you have access to:

  • qds - Configure a Quarkus datasource
  • qj - Configure a Jaeger tracer

Requirements

  • Intellij IDEA 2023.2 or more recent (we try to support the last 4 major IDEA releases)

  • Java JDK (or JRE) 17 or more recent

Contributing

This is an open source project open to anyone. Contributions are extremely welcome!

Building

Project is managed by Gradle. So building is quite easy.

Building the plugin distribution file

Run the following command:

./gradlew buildPlugin

The plugin distribution file is located in build/distributions.

Testing

You can also easily test the plugin. Just run the following command:

./gradlew runIde

Unit test infrastructure

The IntelliJ SDK does not provide helpers to create Maven or Gradle based project. But the Maven and Gradle plugins have some test class helpers but they are not part of the IntelliJ SDK or the respective plugin distributions.

So we extracted these classes into the intellij-community folder. But as these classes are highly linked to the version of the IntelliJ SDK used to build, there is a script to copy them from the GitHub intellij-community repository.

This script is pull_intellij_tests

If the version of the IntelliJ SDK used to build is changed (see gradle.properties), you must update the branch in pull_intellij_tests and run the script again.

UI testing

You can perform UI testing by running the following command:

./gradlew integrationTest 

Testing nightly builds

You can easily install nightly builds from the nightly channel:

  • in IntelliJ, open Setting > Plugins > [Gear icon] > Manage Plugin Repositories...
  • Add https://plugins.jetbrains.com/plugins/nightly/13234 and press OK

Nightly Channel Repository

- install the latest `Quarkus Tools` version

Nightly builds are published once a day.

Testing the CI builds

You can also download and install CI builds of the latest commits or a specific pull request:

  • open the Build plugin zip workflow
  • click on the build you are interested in
  • scroll down and download the Quarkus Tools <version>.zip file
  • install Quarkus Tools <version>.zip into IntelliJ IDEA by following these instructions.

Data and Telemetry

The JetBrains IntelliJ Quarkus Tools plugin collects anonymous usage data and sends it to Red Hat servers to help improve our products and services. Read our privacy statement to learn more. This extension respects the Red Hat Telemetry setting which you can learn more about at https://github.com/redhat-developer/intellij-redhat-telemetry#telemetry-reporting

Articles

Feedback

File a bug in GitHub Issues.

License

Eclipse Public License 2.0. See LICENSE file.

intellij-quarkus's People

Contributors

adietish avatar alerosmile avatar fbricon avatar gastaldi avatar jbosstoolsci avatar jeffmaury avatar jmartisk avatar kny78 avatar koentsje avatar lstocchi avatar paser4se avatar sbouchet avatar sdaschner avatar zcervink avatar zzhorizonzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intellij-quarkus's Issues

Implement extension guide link

code.quarkus.io now add an optional guide URL for extension. We should allow use to follow the link if we wants more information about the extension.

Suggest missing extensions based on code

A big hurdle to cross when coming from an Enterprise Java background is to add the correct extension dependencies to the pom.xml, especially when features changes.

E.g. when using Bean Validation in JAX-RS methods, Quarkus will silently ignore the validation, unless quarkus-hibernate-validator is added. This especially emerges, when using annotations that already ship with some other (transitive) dependency, but is not actually implemented due to a missing extension (e.g. BV annotations with JAX-RS)

Improvement: The plugin could suggest something along "you're using @Valid but you should add the quarkus-hibernate-validator for that."

Examples: Bean Validation annotations (quarkus-hibernate-validator), JAX-RS with JSON-B (quarkus-resteasy-jsonb), etc...

User agent sent to code.quarkus.io is non Google Analytics compliant

The User-Agent sent is:
Java/version

which seems not to be well managed by GA.
We should sent this form:

IJCode/version (${System.getProperty("os.name")}; ${System.getProperty("os.version")}; ${System.getProperty("os.arch")}, Java ${System.getProperty("java.version")})

where IJCode is the IJ product code name (IC / IU /...) and version is IJ version (2019.3.3).

Display preview extensions as preview

code.quarkus.io now adds a preview flag to the extensions model. Such extensions should be displayed as "extension name (Preview)" in the wizard UI

Issue with application.properties auto completion

Since I have installed the quarkus IntelliJ plugin I'm not able to edit the application.properties, intellij get frozen after writing some lines.

Also if do copy and paste a part of the property it gets duplicated when I try to finish the property tag.

My IntelliJ IDEA 2019.3.2 Preview (Ultimate Edition)
macOS 10.15.2
Thanks!

Quarkus version 0.17.0 when adding Framework support

Reproducing the issue:

  1. Right click on already created project in the Project Explorer
  2. Add Frame work support
  3. Select Quarkus from the framework list
  4. The dialog says "1 Jar will be downloaded ... Quarkus-0.17.0"
  5. Also shows the following error Failed to download when clicked OK. 'http://central.maven.org/maven2/io/quarkus/quarkus-core/0.17.0/quarkus-core-0.17.0.jar':
    central.maven.org

Environment:
IntelliJ IDEA 2019.3.4 (Ultimate Edition)
Build #IU-193.6911.18, built on March 17, 2020

Is this the Quarkus version, that Quarkus tools tries to download for the project? should this be a newer version like 1.3.0.Final?

Must close and reopen application.properties to clean some errors

Had an error with unregognized Hibernate ORM properties even though I had hibernate-orm-panache in my pom.xml
I tried ot add hibernate-orm in too (not necessary in theory), then the app.properties file showed the same errors. Closing it and reopening it fixed it

Installing the Intellij plugin for Quarkus tools in breaking spring application.properties

reported originally at quarkusio/code.quarkus.io#289 by @vinchauhan

Describe the bug
Quarkus Intellij plugin is making spring projects created from Intellij start.spring.io plugin not working as application.properties is loosing autocompletion.

Expected behavior
Spring projects application.properties shouldnt be affected.
Actual behavior
The application.properties are loosing spring autocompletion as well as an lts folder is created on the root which application.properties_error.log

To Reproduce
Steps to reproduce the behavior:

  1. Install the Quarkus tools from Intellij plugin website or IDE
  2. Create a spring project from Intellij IDE using start.spring.io
  3. The application.properties are loosing spring autocompletion as well as an lts folder is created on the root which application.properties_error.log

Screenshots
(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

  • Browser:
  • OS:

Additional context
(Add any other context about the problem here.)

Mouse hover UI bug in New Quarkus Project wizard on page where you select extensions

Navigate to: New Project > Quarkus tab -> next -> next
In some extensions categories (such as "Messaging", "Compatibility" etc. - left column) are extension (right column items), that have too long names to display in the column. When you hover with your mouse over them and then you move out of them, the text disappear. See the screenhots:

BEFORE HOVER:
before_hover

AFTER HOVER OF THE 4 ITEMS:
after-hover

Cannot work with the IDE when run using the ./gradlew runIde cmd

  • when I run the IDE using the ./gradlew runIde cmd and then when I click "Create New Project", the IDE opens the New Project dialogue, but the dialogue cannot be closed using the cancel button or using the window close button. The wizard cannot be even finished, when I click on the Finish button, nothing happens.

pre select default extensions

he extensions model has the notion of default extensions. Such extensions should be pre selected when launching the wizard

Add support for property definition

quarkus-ls defines a quarkus/propertyDefinition method that should allow navigating from a property use in application.properties to the property definition in the source code.
We should support this new message

Error in artifact version when creating a new project

When I create a new Quarkus module (as a new project) it is generated with <verison>/hello</version> instead of <version>1.0.0-SNAPSHOT</version> in the pom.xml.

Environmental details:

IntelliJ IDEA 2019.3 (Ultimate Edition)
Build #IU-193.5233.102, built on November 27, 2019
Licensed to Thomas Qvarnström
Subscription is active until April 25, 2020
Runtime version: 11.0.4+10-b520.11 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.1
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry: 
Non-Bundled Plugins: BashSupport, com.intellij.plugins.html.instantEditing, com.oliverlockwood.plugins.jenkinsfile, com.redhat.devtools.intellij.quarkus, io.protostuff.protostuff-jetbrains-plugin, org.asciidoctor.intellij.asciidoc, org.intellij.scala, org.jetbrains.plugins.vue, training

Extends unit tests

We should extend unit tests so that we have same coverage that JDT quarkus

Make the plugin build against version 2020.1

The plugin currently does not compile against the most recent versions of Idea

  • org.jetbrains.intellij plugin version 0.4.19
  • Idea version IC-2020.1
    This is because of removed APIs

New project can be created with blank "Class name" and "Path" fields

  • firstly I think all required field should be marked with an asterisk
  • new project can be created with blank "Class name" and "Path" fields, which leads to issues

A) empty project will be created (only project folder with empty src folder, .idea folder and 1 file inside - and code-with-quarkus.iml)

Content of the code-with-quarkus.iml file:

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>

B) following exception appears:

com.intellij.util.io.HttpRequests$HttpStatusException: Request failed with status code 400. Status=400, Url=https://code.quarkus.io/api/download?p&a=code-with-quarkus&b=MAVEN&c&v=1.0.0-SNAPSHOT&g=org.acme
	at com.intellij.util.io.HttpRequests.throwHttpStatusError(HttpRequests.java:643)
	at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:624)
	at com.intellij.util.io.HttpRequests.access$300(HttpRequests.java:56)
	at com.intellij.util.io.HttpRequests$RequestImpl.getConnection(HttpRequests.java:375)
	at com.intellij.util.io.HttpRequests$RequestImpl.getInputStream(HttpRequests.java:384)
	at com.redhat.devtools.intellij.quarkus.module.QuarkusModuleBuilder.lambda$null$2(QuarkusModuleBuilder.java:142)
	at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:516)
	at com.intellij.util.io.HttpRequests.process(HttpRequests.java:498)
	at com.intellij.util.io.HttpRequests.access$100(HttpRequests.java:56)
	at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:349)
	at com.redhat.devtools.intellij.quarkus.module.QuarkusModuleBuilder.lambda$processDownload$3(QuarkusModuleBuilder.java:141)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.