GithubHelp home page GithubHelp logo

openliberty / liberty-tools-vscode Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 19.0 11.99 MB

Visual Studio Code extension for Liberty Tools

Home Page: https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext

License: Eclipse Public License 2.0

TypeScript 82.41% JavaScript 3.71% Shell 8.77% Dockerfile 0.22% Java 4.69% HTML 0.19%

liberty-tools-vscode's People

Contributors

benson-ning avatar bensonnw avatar cherylking avatar dependabot[bot] avatar dshimo avatar ericglau avatar evie-lau avatar kathrynkodama avatar mattbsox avatar mohlogan avatar rzgry avatar travis1111 avatar trevcraw avatar turkeylurkey avatar vkavitha avatar yeekangc avatar

Stargazers

 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

liberty-tools-vscode's Issues

Changing something in the build file causes a new terminal to open

Steps to reproduce:

  1. Start devmode using the dashboard
  2. Stop devmode
  3. Change something in the build.gradle (ie. reports.html.destination)
  4. Start devmode, notice a new terminal opens

A new terminal should not open and instead use the existing one already created. Otherwise on ever start/stop/modify we are creating a new terminal and it could be confusing to the user.

image

Customize test report locations

Users may have project setup that requires customizing test report locations for the extension to load the reports properly.

image (16)

An example is the above. Project from the Getting Started guide was used.

Change Boost groupId to org.microshed.boost

Boost Maven plugin has groupId org.microshed.boost. The VS Code extension (and the readme) should refer to this groupId when checking for dev projects.

e.g.

<groupId>org.microshed.boost</groupId>
<artifactId>boost-maven-plugin</artifactId>

Refresh extension when files are added/deleted/modified

Currently if a pom.xml or build.gradle file is added once the extension has started, the extension does not automatically refresh and pick up the new project even if the correct plugins are specified.

The extension should be able to refresh when build files are added, deleted, or modified.

Build tool wrapper ignored

Maven and Gradle start/stop commands are hard-coded. If project uses wrapper it is ignored.
VSCode settings option to use or ignore wrapper is ignored.

Killing the devmode terminal prevents you from re-launching devmode.

Steps to reproduce:

  1. Start devmode using the liberty dev dashboard.
  2. Kill the terminal either with:
  • The kill terminal button Screen Shot 2020-01-20 at 1 10 28 PM
  • Killing the terminal with the exit command. (Can be triggered by accidently running Stop from the liberty dev dashboard twice)
  1. Try to start devmode again from the liberty-dev dashboard.

Expected output:

Starts dev-mode

Actual output:

Nothing happens

Support for multi-module projects

Improve detection of multi-module projects, and consider a tree parent/child view in the dashboard for multiple modules.

Should cover both Maven and Gradle projects.

#61 is related.

"Start..." to provide selectable options

Provide users with common options that they can easily select and/or customize for the "Start..." command without them needing to know the actual properties that they need to use/specify.

Improve dev mode integration documentation

Create step-by-step documentation around how to configure your Liberty project and make use of the different actions offered by Open Liberty Tools for VS Code

  • How to add the Liberty Maven plugin or Liberty Gradle plugin to a pom.xml and configure a server.xml
  • Outline of the different actions available through the Liberty dashboard (starting and stopping dev mode)
  • Links to dev mode documentation and which project types are supported by dev mode

Exception when launching the extension in debug mode

stack trace: Error: Cannot find module 'gradle-to-js/lib/parser'
Require stack:

  • c:\git\devEx\liberty-dev-vscode-ext\out\utils\libertyProject.js
  • c:\git\devEx\liberty-dev-vscode-ext\out\extension.js
  • c:\sfs\Microsoft VS Code\resources\app\out\vs\loader.js
  • c:\sfs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
  • c:\sfs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
    at Function._resolveFilename (internal/modules/cjs/loader.js:627:15)
    at Function. (internal/modules/cjs/loader.js:531:27)
    at Function. (c:\sfs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:837:268)
    at Function. (c:\sfs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:807:106)
    at Function._load (c:\sfs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:803:550)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at n (c:\sfs\Microsoft VS Code\resources\app\out\vs\loader.js:15:524)
    at ProjectProvider. (c:\git\devEx\liberty-dev-vscode-ext\out\utils\libertyProject.js:89:26)
    at Generator.next ()
    at c:\git\devEx\liberty-dev-vscode-ext\out\utils\libertyProject.js:7:71
    at new Promise ()
    at c:\git\devEx\liberty-dev-vscode-ext\out\utils\libertyProject.js:3:12
    at ProjectProvider.findValidGradleBuildFiles (c:\git\devEx\liberty-dev-vscode-ext\out\utils\libertyProject.js:84:16)

Does not recognize project with plugin defined in profile

  1. Generate an Open Liberty project using https://start.microprofile.io/
  2. Unzip the project and open it in VS Code
  3. Liberty Dev Dashboard does not show the project, because the plugin is defined inside the <profiles><profile><build></build></profile></profiles> section instead of in the top level project's <build></build> section.

e.g. the following is not recognized:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>demo</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <properties>
    <openliberty.maven.version>3.1</openliberty.maven.version>
    <final.name>demo</final.name>
    <failOnMissingWebXml>false</failOnMissingWebXml>
    <openliberty.version>[19.0.0.9,)</openliberty.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.eclipse.microprofile</groupId>
      <artifactId>microprofile</artifactId>
      <version>3.0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>demo</finalName>
  </build>

  <profiles>
    <profile>
      <id>liberty</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>io.openliberty.tools</groupId>
            <artifactId>liberty-maven-plugin</artifactId>
            <version>${openliberty.maven.version}</version>
            <executions>
              <execution>
                <id>package-server</id>
                <phase>package</phase>
                <goals>
                  <goal>create</goal>
                  <goal>install-feature</goal>
                  <goal>deploy</goal>
                  <goal>package</goal>
                </goals>
                <configuration>
                  <outputDirectory>target/wlp-package</outputDirectory>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <appArchive>${project.build.directory}/${final.name}.war</appArchive>
              <include>runnable</include>
              <serverName>${final.name}</serverName>
              <bootstrapProperties>
                <project.name>${final.name}</project.name>
                <jwt.issuer>https://server.example.com</jwt.issuer>
              </bootstrapProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

Leftover *-maven-cache folder

A *-maven-cache folder, which is peer to the project directory, is left behind after devc is launched from OLT and stopped.

Expect there isn't such folder present on user's file system.

Test reports not showing after running tests

Repro steps:

  1. Go to Liberty Dev Dashboard

  2. Pick one service and Start

  3. After service is started, right-click and "Run tests"

  4. After tests finishes, right-click and "View integration test report" / "View unit test report"
    image

  5. "Test report does not exist" was not showing
    image

Expected result

  1. Test reports should be presented

Recognize custom test report locations in build.gradle

A test report location can be specified in a build.gradle the following way:
test.reports.html.destination = file("$buildDir/reports/intTests”)

The extension should recognize custom locations and open the corresponding html file as opposed to simply looking in the default location for the test report (/build/reports/tests/test/index.html).

Use "category" to group commands for easier discovery

All the commands in this extension do not have a category specified. In this case, it's really hard for users to discover those commands. Check out how it looks like in the command palette:
Screen Shot 2019-11-29 at 11 24 29 AM
It's really hard to tell those two commands are related to your product and users could be very easily confused.

Please check out this example. This extension uses the "Java" category to group all its command.
https://github.com/redhat-developer/vscode-java/blob/master/package.json#L404
And it looks like this:
image

So here to suggest that you guys add category field to all your commands in here:
https://github.com/OpenLiberty/liberty-dev-vscode-ext/blob/master/package.json#L45

Consume the Liberty Language Server and Liberty LemMinx LS ext

Completion

  • server.xml schema elements
  • Open Liberty features

Diagnostics

  • Unknown/invalid server.xml elements
  • Duplicate features
  • Unknown features

Hover

  • Hover documentation of server.xml schema elements
  • Hover documentation for liberty server features

Other

  • Handle version of liberty

Debugging tests through this plugin?

I don't know if I'm just missing something or if there's a good way to do this, but I would love to be able to debug tests and I didn't see that option available.

There's not much context to this one since it's a feature request I suppose, but for what it's worth I am using Maven and right-clicked on my server in the Liberty dev dashboard, then checked the docs for an explanation of what the options in the right-click menu were. I didn't see one that looked like an obvious way to debug tests. I also checked whether this extension somehow interacted with the test runner for Java and the Maven support extension but nothing jumped out at me.

I believe the reason the test runner for Java plugin doesn't work for me has to do with variables set in pom.xml and server.xml - for instance, I attempted to run the tests in this guide but the default ports specified in the <liberty.var. ... > tags in pom.xml were null, so my tests failed. Evidently the way to debug Maven goals in VS Code is to right-click on the goals in the panel added by the Maven support extension, but there doesn't seem to be a goal to ONLY test liberty, I suppose since it needs to be run before tests can happen. So I thought an extension for Open Liberty projects might be a way to patch that, though it could also be me setting up Maven in VS Code wrong!

Unable to recognize a boost project

After importing this boost project, https://github.com/OpenLiberty/demo-devex into vscode, it is not rendering under the LIBERTY DEV DASHBOARD

The boost runtime dependency is defined within an <profile/> element in the project pom and not under project pom dependencies section.

               <profile>
                        <id>ol</id>
                        <activation>
                                <activeByDefault>true</activeByDefault>
                                <property>
                                        <name>boostRuntime</name>
                                        <value>ol</value>
                                </property>
                        </activation>
                        <dependencies>
                                <dependency>
                                        <groupId>boost.runtimes</groupId>
                                        <artifactId>openliberty</artifactId>
                                </dependency>
                        </dependencies>
                </profile>

Support for Eclipse Theia/Che

Ensure extension works w/ Eclipse Theia / Che / RH CodeReady Workspaces.

Could also maybe try VSCodium and gitpod etc.

Could not stop devc started from extension

Extension gave a "No Liberty dev found" error when stopping a devc instance started from the dashboard using the "Start in containers" option.

2 terminals opened in VS Code. The one started by extension for devc is named "xyz (liberty dev)".

Triggering a refresh of ProjectProvider while dev-mode is running breaks dev-mode commands.

Steps to reproduce

  1. Start devmode using the liberty dev dashboard.
  2. Do something that causes a refresh of the ProjectProvider Ex. edit / save pom.xml

You are then unable to Stop or Run tests from the liberty dev dashboard, and are shown a warning liberty:dev has not been started on project-name. (running tests or stopping devmode from the actual terminal still works).

Ex:
image

Detect custom subproject conditions in a parent build.gradle

Currently, Gradle support for the extension will detect a subproject Gradle project if:

  • the subproject is listed in the include block of the parent settings.gradle
  • the liberty-gradle-plugin is in the subprojects or allprojects section of the parent build.gradle

However, from the parent build.gradle there are ways to apply plugins only to specific subprojects (see example 4: https://docs.gradle.org/current/userguide/plugins.html). We should support these custom conditions when detecting subprojects.

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.