Skip to content

Commit

Permalink
Merge pull request #547 from turkeylurkey/removeLSP4IJ2
Browse files Browse the repository at this point in the history
Move lsp4ij to its own repository
  • Loading branch information
turkeylurkey authored Oct 31, 2023
2 parents 4db3d8b + 6570cce commit bbfc979
Show file tree
Hide file tree
Showing 57 changed files with 225 additions and 6,914 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
minimum-size: 8GB
maximum-size: 10GB
disk-root: "C:"
- name: 'Checkout lsp4ij'
uses: actions/checkout@v3
with:
repository: MicroShed/lsp4ij
path: lsp4ij
- name: 'Checkout liberty-tools-intellij'
uses: actions/checkout@v3
with:
Expand All @@ -40,16 +45,9 @@ jobs:
- name: 'Install required integration test software'
working-directory: ./liberty-tools-intellij
run: bash ./src/test/resources/ci/scripts/setup.sh
- name: 'Run UI integration tests'
working-directory: ./liberty-tools-intellij
run: bash ./src/test/resources/ci/scripts/run.sh
- name: 'Archive Test logs and reports'
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.reportName }}
path: |
liberty-tools-intellij/build/reports/
- name: 'Build lsp4ij jar and publish to local Maven repository'
working-directory: ./lsp4ij
run: bash ./gradlew publishToMavenLocal
- name: 'Build Liberty-Tools-Intellij'
working-directory: ./liberty-tools-intellij
run: bash ./gradlew buildPlugin
Expand All @@ -63,3 +61,13 @@ jobs:
./**/libs/*liberty-tools-intellij*.jar
if-no-files-found: warn
retention-days: 7
- name: 'Run UI integration tests'
working-directory: ./liberty-tools-intellij
run: bash ./src/test/resources/ci/scripts/run.sh
- name: 'Archive Test logs and reports'
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.reportName }}
path: |
liberty-tools-intellij/build/reports/
5 changes: 4 additions & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

This extension is built using the [gradle-intellij-plugin](https://github.com/JetBrains/gradle-intellij-plugin/).

1. Clone this repository: `git clone [email protected]:OpenLiberty/liberty-tools-intellij.git && cd liberty-tools-intellij`
1. Clone this repository: `git clone [email protected]:OpenLiberty/liberty-tools-intellij.git`
2. Clone the lsp4ij repository: `git clone [email protected]:MicroShed/lsp4ij.git`
3. Build lsp4ij: `./gradlew jar`
4. Save it in your local Maven repository: `./gradlew publishToMavenLocal` (this also runs the `jar` task)
2. Import this repository as a Gradle project in IntelliJ IDEA
3. Run `./gradlew runIde --stacktrace`. A new IntelliJ IDEA window will launch with the Liberty Tools plugin installed to it. You can connect the IntelliJ IDEA debugger to this process to debug the plugin.

Expand Down
25 changes: 17 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,26 @@ configurations {
}

dependencies {
// LSP4IJ dependencies
implementation 'org.eclipse.lsp4mp:org.eclipse.lsp4mp.ls:0.6.0'
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j:0.15.0'
implementation 'org.eclipse.lemminx:org.eclipse.lemminx:0.25.0'
implementation 'org.microshed:lsp4ij:0.0.1' // includes org.eclipse.lsp4j
implementation ('org.eclipse.lsp4mp:org.eclipse.lsp4mp.ls:0.6.0') {
exclude group: 'org.eclipse.lsp4j'
}
implementation ('org.eclipse.lemminx:org.eclipse.lemminx:0.25.0') {
exclude group: 'org.eclipse.lsp4j'
}
implementation 'io.openliberty.tools:liberty-langserver-lemminx:2.1-SNAPSHOT'
implementation 'io.openliberty.tools:liberty-langserver:2.1-SNAPSHOT'
implementation 'org.eclipse.lsp4jakarta:org.eclipse.lsp4jakarta.ls:0.1.1'
implementation ('io.openliberty.tools:liberty-langserver:2.1-SNAPSHOT') {
exclude group: 'org.eclipse.lsp4j'
}
implementation ('org.eclipse.lsp4jakarta:org.eclipse.lsp4jakarta.ls:0.1.1') {
exclude group: 'org.eclipse.lsp4mp'
exclude group: 'org.eclipse.lsp4j'
}
//required by lsp4j as the version from IJ is incompatible
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.vladsch.flexmark:flexmark:0.50.50'
implementation 'org.jsoup:jsoup:1.15.3'
// implementation 'com.google.code.gson:gson:2.8.9'
// implementation 'com.vladsch.flexmark:flexmark:0.50.50'
// implementation 'org.jsoup:jsoup:1.15.3'
//Add junit dependency back when tests are added
//testImplementation group: 'junit', name: 'junit', version: '4.13.1'
implementation 'org.apache.maven:maven-artifact:3.6.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@
package io.openliberty.tools.intellij.liberty.lsp;

import java.util.List;

import org.eclipse.lsp4j.DidChangeWatchedFilesParams;
import org.eclipse.lsp4j.FileChangeType;
import org.eclipse.lsp4j.FileEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.intellij.openapi.project.Project;
import com.intellij.util.messages.MessageBusConnection;

import io.openliberty.tools.intellij.lsp4mp.lsp4ij.LanguageClientImpl;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.LanguageServerWrapper;
import org.microshed.lsp4ij.LanguageClientImpl;
import org.microshed.lsp4ij.LanguageServerWrapper;

/**
* Client for Liberty language server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.extensions.PluginId;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.server.ProcessStreamConnectionProvider;
import io.openliberty.tools.intellij.util.JavaVersionUtil;
import io.openliberty.tools.intellij.util.Constants;
import org.microshed.lsp4ij.server.ProcessStreamConnectionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
Expand All @@ -34,7 +35,7 @@ public LibertyConfigLanguageServer() {
String javaHome = System.getProperty("java.home");
IdeaPluginDescriptor descriptor = PluginManagerCore.getPlugin(PluginId.getId("open-liberty.intellij"));
File libertyServerPath = new File(descriptor.getPluginPath().toFile(), "lib/server/liberty-langserver-jar-with-dependencies.jar");
if(!isJavaHomeValid(javaHome, Constants.LIBERTY_CONFIG_SERVER)){
if(!JavaVersionUtil.isJavaHomeValid(javaHome, Constants.LIBERTY_CONFIG_SERVER)){
return;
}
if (libertyServerPath.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
import com.intellij.openapi.vfs.newvfs.events.VFileEvent;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.LSPIJUtils;

import org.jetbrains.annotations.NotNull;
import org.microshed.lsp4ij.LSPIJUtils;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.vfs.VirtualFile;
import io.openliberty.tools.intellij.lsp4mp.MicroProfileProjectService;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.LanguageClientImpl;
import org.microshed.lsp4ij.LanguageClientImpl;
import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.lemminx.customservice.XMLLanguageClientAPI;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.extensions.PluginId;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.server.ProcessStreamConnectionProvider;
import io.openliberty.tools.intellij.util.JavaVersionUtil;
import io.openliberty.tools.intellij.util.Constants;
import org.microshed.lsp4ij.server.ProcessStreamConnectionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -36,7 +37,7 @@ public LibertyXmlServer() {
IdeaPluginDescriptor descriptor = PluginManagerCore.getPlugin(PluginId.getId("open-liberty.intellij"));
File lemminxServerPath = new File(descriptor.getPluginPath().toFile(), "lib/server/org.eclipse.lemminx-uber.jar");
File libertyServerPath = new File(descriptor.getPluginPath().toFile(), "lib/server/liberty-langserver-lemminx-jar-with-dependencies.jar");
if(!isJavaHomeValid(javaHome, Constants.LIBERTY_XML_SERVER)){
if(!JavaVersionUtil.isJavaHomeValid(javaHome, Constants.LIBERTY_XML_SERVER)){
return;
}
if (lemminxServerPath.exists() && libertyServerPath.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.vfs.VirtualFile;
import io.openliberty.tools.intellij.lsp4jakarta.lsp4ij.JDTUtils;
import io.openliberty.tools.intellij.lsp4jakarta.lsp4ij.PropertiesManagerForJakarta;
import io.openliberty.tools.intellij.lsp4mp.MicroProfileProjectService;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.LanguageClientImpl;
import org.microshed.lsp4ij.LanguageClientImpl;
import io.openliberty.tools.intellij.lsp4mp4ij.psi.core.utils.IPsiUtils;
import io.openliberty.tools.intellij.lsp4mp4ij.psi.internal.core.ls.PsiUtilsLSImpl;
import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.lsp4j.CodeAction;
import org.eclipse.lsp4j.PublishDiagnosticsParams;
import org.eclipse.lsp4j.jsonrpc.CompletableFutures;
import org.eclipse.lsp4jakarta.api.JakartaLanguageClientAPI;
import org.eclipse.lsp4jakarta.commons.*;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.extensions.PluginId;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.server.ProcessStreamConnectionProvider;
import io.openliberty.tools.intellij.util.Constants;
import io.openliberty.tools.intellij.util.JavaVersionUtil;
import org.microshed.lsp4ij.server.ProcessStreamConnectionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -34,7 +35,7 @@ public JakartaLanguageServer() {
String javaHome = System.getProperty("java.home");
IdeaPluginDescriptor descriptor = PluginManagerCore.getPlugin(PluginId.getId("open-liberty.intellij"));
File lsp4JakartaServerPath = new File(descriptor.getPluginPath().toFile(), JAR_DIR + LANGUAGESERVER_JAR);
if(!isJavaHomeValid(javaHome, Constants.JAKARTA_LANG_SERVER)){
if(!JavaVersionUtil.isJavaHomeValid(javaHome, Constants.JAKARTA_LANG_SERVER)){
return;
}
if (lsp4JakartaServerPath.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
package io.openliberty.tools.intellij.lsp4mp.lsp;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.EmptyProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.vfs.VirtualFile;
Expand All @@ -24,7 +21,7 @@
import io.openliberty.tools.intellij.lsp4mp4ij.psi.core.project.PsiMicroProfileProjectManager;
import io.openliberty.tools.intellij.lsp4mp.MicroProfileModuleUtil;
import io.openliberty.tools.intellij.lsp4mp.MicroProfileProjectService;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.LanguageClientImpl;
import org.microshed.lsp4ij.LanguageClientImpl;
import io.openliberty.tools.intellij.lsp4mp4ij.psi.internal.core.ls.PsiUtilsLSImpl;
import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.lsp4j.CodeAction;
Expand All @@ -44,7 +41,6 @@
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
import java.util.stream.Collectors;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.extensions.PluginId;
import io.openliberty.tools.intellij.lsp4mp.lsp4ij.server.ProcessStreamConnectionProvider;
import io.openliberty.tools.intellij.util.Constants;
import io.openliberty.tools.intellij.util.JavaVersionUtil;
import org.microshed.lsp4ij.server.ProcessStreamConnectionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -36,7 +37,7 @@ public MicroProfileServer() {
String javaHome = System.getProperty("java.home");
IdeaPluginDescriptor descriptor = PluginManagerCore.getPlugin(PluginId.getId("open-liberty.intellij"));
File lsp4mpServerPath = new File(descriptor.getPluginPath().toFile(), "lib/server/org.eclipse.lsp4mp.ls-uber.jar");
if(!isJavaHomeValid(javaHome, Constants.MICROPROFILE_SERVER)){
if(!JavaVersionUtil.isJavaHomeValid(javaHome, Constants.MICROPROFILE_SERVER)){
return;
}
if (lsp4mpServerPath.exists()) {
Expand Down

This file was deleted.

Loading

0 comments on commit bbfc979

Please sign in to comment.