Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:eclipse/lsp4e.git
Browse files Browse the repository at this point in the history
  • Loading branch information
basilevs committed Mar 19, 2024
2 parents 1f3638c + f0924b0 commit 5c3e6ef
Show file tree
Hide file tree
Showing 182 changed files with 5,884 additions and 1,924 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Expand Up @@ -3,6 +3,6 @@
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>3.0.4</version>
<version>4.0.6</version>
</extension>
</extensions>
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
## LSP4E Changelog and New and Noteworthy

The [GitHub releases page](https://github.com/eclipse/lsp4e/releases) provides changelog and details on all releases.
Older releases are listed below.

### 0.20.2

📅 Release Date: February 3rd, 2022
Expand Down
73 changes: 58 additions & 15 deletions CONTRIBUTING.md
Expand Up @@ -11,50 +11,79 @@ The project license is available at [LICENSE](LICENSE).
This Eclipse Foundation open project is governed by the Eclipse Foundation
Development Process and operates under the terms of the Eclipse IP Policy.

Before your contribution can be accepted by the project team,
contributors must have an Eclipse Foundation account and
Before your contribution can be accepted by the project team,
contributors must have an Eclipse Foundation account and
must electronically sign the Eclipse Contributor Agreement (ECA).

* [http://www.eclipse.org/legal/ECA.php](http://www.eclipse.org/legal/ECA.php)

For more information, please see the Eclipse Committer Handbook:
[https://www.eclipse.org/projects/handbook/#resources-commit](https://www.eclipse.org/projects/handbook/#resources-commit).


## 💬 Get in touch with the community

Eclipse LSP4E use mainly 2 channels for strategical and technical discussions

* 🐞 View and report issues through uses GitHub Issues at https://github.com/eclipse/lsp4e/issues. _📜 Migration to GitHub tracker took place in November 2021, for older tickets, see https://bugs.eclipse.org/bugs/buglist.cgi?product=lsp4e 📜_
* 🐞 View and report issues through uses GitHub Issues at https://github.com/eclipse/lsp4e/issues.
* 📧 Join the lsp4e-dev@eclipse.org mailing-list to get in touch with other contributors about project organization and planning, and browse archive at 📜 [https://accounts.eclipse.org/mailing-list/lsp4e-dev](https://accounts.eclipse.org/mailing-list/lsp4e-dev)


## 🆕 Trying latest builds

Latest snapshot builds, for testing, can usually be found at `https://download.eclipse.org/lsp4e/snapshots/` .


## 🧑‍💻 Developer resources

### Prerequisites
### ⌨️ Setting up the Development Environment

Eclipse IDE with Plugin Development Environment installed for development; and Maven 3.8.x or Eclipse m2e if you want to run Maven build
#### Install Software

### ⌨️ Setting up the Development Environment manually
1. Install the **Eclipse IDE for Eclipse Committers** from https://www.eclipse.org/downloads/packages/ or
any another Eclipse distribution with:
1. [Plug-in Development Environment (PDE)](https://www.eclipse.org/pde/) installed
1. Eclipse [m2e](https://www.eclipse.org/m2e/) installed
1. To run Maven builds from the command line, install [JDK17](https://adoptium.net/temurin/releases/?version=17) and [Maven 3.9.x](https://maven.apache.org/download.cgi)

* Clone this repository <a href="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/redirect.html"><img src="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/cloneToEclipseBadge.png" alt="Clone to Eclipse IDE"/></a> for lsp4e.
* _File > Open Projects from Filesystem..._ , select the path to LSP4E Git repo and the relevant children projects you want to import
* Depending on the task you're planning to work on, multiple workflows are available to configure the [target-platform](https://help.eclipse.org/latest/topic/org.eclipse.pde.doc.user/concepts/target.htm?cp=4_1_5)
* In many cases, this simplest workflow will be sufficient: Install latest LSP4E snapshot in your target-platform (can be your current IDE), or
* If you don't want to mix versions of LSP4E, open __target-platforms/target-platform-latest/target-platform-latest.target__ and _Set as Target-Platform_ from the editor, or
* Open the project modules you want to work on (right-click > Open project) and their dependencies
* Happy coding!
#### Import Project

1. Clone this repository <a href="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/redirect.html"><img src="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/cloneToEclipseBadge.png" alt="Clone to Eclipse IDE"/></a> for LSP4E.
1. _File > Open Projects from Filesystem..._ , select the path to the LSP4E Git repo and the relevant children projects you want to import
1. Depending on the task you're planning to work on, multiple workflows are available to configure the [target-platform](https://help.eclipse.org/latest/topic/org.eclipse.pde.doc.user/concepts/target.htm?cp=4_1_5)
* In many cases, this simplest workflow will be sufficient: Install latest LSP4E snapshot in your target-platform (can be your current IDE), or
* If you don't want to mix versions of LSP4E, open [target-platforms/target-platform-latest/target-platform-latest.target](target-platforms/target-platform-latest/target-platform-latest.target) from within Eclipse and click **Set as Active Target-Platform** in the top right corner.
1. Open the project modules you want to work on (right-click > Open project) and their dependencies
1. Happy coding! 🤗

### 🏗️ Build

Just `mvn clean verify`.
1. From the command line: run `mvn clean verify`
1. From within Eclipse : right-click on the LSP4E root folder > Run As > Maven build

### Running single unit tests via the command line

To run single unit tests via the command line, one can use the following command from the project's root:
```
mvn -Dtest=<TestClassName>#<MethodName> -DfailIfNoTests=false verify
```

For example:
```
mvn -Dtest=HighlightTest#testCheckIfOtherAnnotationsRemains -DfailIfNoTests=false verify
```

To run a unit test in JVM debug mode via the command line one can use:
```
mvn -Dtest=<TestClassName>#<MethodName> -DfailIfNoTests=false -Dtycho.testArgLine="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000" verify
```
Once Maven is about to execute the test it will wait for you to attach to the test JVM using a remote debugger, e.g. using Eclipse's `Remote Java Application` debug configuration.


### ⬆️ Version bump

LSP4E tries to use OSGi Semantic Version (to properly expose its API contracts and breakage) and Reproducible Version Qualifiers (to minimize the avoid producing multiple equivalent artifacts for identical source). This requires the developer to manually bump version from time to time. Some rules are that:
LSP4E tries to use OSGi Semantic Version (to properly expose its API contracts and breakage) and Reproducible Version Qualifiers (to minimize the avoid producing multiple equivalent artifacts for identical source).
This requires the developer to manually bump version from time to time. Some rules are that:

* Versions are bumped on a __per module grain__ (bump version of individual bundles/features one by one when necessary), __DON'T bump version of parent pom, nor of other modules you don't change__
* __Versions are bumped maximum once per release__ (don't bump versions that were already bumped since last release)
Expand All @@ -72,3 +101,17 @@ The delta for version bumps are:
### ➕ Submit changes

LSP4E only accepts contributions via GitHub Pull Requests against [https://github.com/eclipse/lsp4e](https://github.com/eclipse/lsp4e) repository.

Before sending us a pull request, please ensure that:

1. You are working against the latest source on the **master** branch.
1. You check existing open and recently merged pull requests to make sure someone else hasn't already addressed the issue.

To send us a pull request, please:

1. Fork the repository.
1. Modify the source while focusing on the specific change you are contributing.
1. Commit to your fork using clear, descriptive commit messages.
1. Send us a pull request, answering any default questions in the pull request interface.

GitHub provides additional documentation on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/)
20 changes: 14 additions & 6 deletions Jenkinsfile
@@ -1,20 +1,28 @@
pipeline {
options {
timeout(time: 40, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'10'))
buildDiscarder(logRotator(numToKeepStr: '10'))
disableConcurrentBuilds(abortPrevious: true)
}
agent {
label "centos-latest"
label 'centos-latest'
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk17-latest'
jdk 'temurin-jdk17-latest'
}
stages {
stage('Build') {
steps {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh 'mvn clean verify org.eclipse.dash:license-tool-plugin:license-check -B -Psign -Dmaven.repo.local=$WORKSPACE/.m2/repository -Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true -Ddash.fail=false'
sh """
mvn clean verify \
org.eclipse.dash:license-tool-plugin:license-check \
-B ${env.BRANCH_NAME=='master' ? '-Psign': ''} \
-Dmaven.test.failure.ignore=true \
-Ddash.fail=false \
-Dsurefire.rerunFailingTestsCount=3
"""
}
}
post {
Expand All @@ -29,12 +37,12 @@ pipeline {
branch 'master'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sshagent (['projects-storage.eclipse.org-bot-ssh']) {
sh '''
DOWNLOAD_AREA=/home/data/httpd/download.eclipse.org/lsp4e/snapshots/
echo DOWNLOAD_AREA=$DOWNLOAD_AREA
ssh genie.lsp4e@projects-storage.eclipse.org "\
rm -rf ${DOWNLOAD_AREA}/* && \
rm -rf ${DOWNLOAD_AREA}/* && \
mkdir -p ${DOWNLOAD_AREA}"
scp -r repository/target/repository/* genie.lsp4e@projects-storage.eclipse.org:${DOWNLOAD_AREA}
'''
Expand Down
1 change: 1 addition & 0 deletions README.md
@@ -1,5 +1,6 @@
# Eclipse LSP4E - Language Server Protocol client for Eclipse IDE

[![Jenkins Tests](https://img.shields.io/jenkins/tests?jobUrl=https%3A%2F%2Fci.eclipse.org%2Flsp4e%2Fjob%2Flsp4e-github%2Fjob%2Fmaster%2F&logo=jenkins&logoColor=white&label=Jenkins%20Tests)](https://ci.eclipse.org/lsp4e/job/lsp4e-github/job/master/)
[![License](https://img.shields.io/github/license/eclipse/lsp4e.svg?color=blue)](LICENSE)

[![Clone to Eclipse IDE](https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/cloneToEclipseBadge.png)](https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/redirect.html)
Expand Down
11 changes: 6 additions & 5 deletions org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF
Expand Up @@ -2,21 +2,22 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Debug Adapter client for Eclipse IDE (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e.debug;singleton:=true
Bundle-Version: 0.15.2.qualifier
Bundle-Version: 0.15.7.qualifier
Bundle-Activator: org.eclipse.lsp4e.debug.DSPPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.jface,
org.eclipse.lsp4j.jsonrpc;bundle-version="[0.21.0,0.22.0)",
org.eclipse.lsp4j.jsonrpc.debug;bundle-version="[0.21.0,0.22.0)",
org.eclipse.lsp4j.debug;bundle-version="[0.21.0,0.22.0)",
org.eclipse.lsp4j.jsonrpc;bundle-version="[0.22.0,0.23.0)",
org.eclipse.lsp4j.jsonrpc.debug;bundle-version="[0.22.0,0.23.0)",
org.eclipse.lsp4j.debug;bundle-version="[0.22.0,0.23.0)",
org.eclipse.ui.editors,
org.eclipse.core.filesystem,
org.eclipse.ui.ide;bundle-version="[3.16.0,4.0.0)",
org.eclipse.jface.text,
org.eclipse.ui.genericeditor
org.eclipse.ui.genericeditor,
org.eclipse.core.variables
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Import-Package: com.google.gson,
Expand Down
Expand Up @@ -9,9 +9,13 @@
package org.eclipse.lsp4e.debug.console;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.lsp4e.debug.debugmodel.DSPDebugTarget;
Expand All @@ -27,6 +31,7 @@ public class DSPProcess implements IProcess {
private final DSPStreamsProxy proxy;
private final ProcessEventArguments processArgs;
private final Optional<ProcessHandle> handle;
private boolean terminated;

public DSPProcess(DSPDebugTarget target) {
this(target, null);
Expand All @@ -36,26 +41,36 @@ public DSPProcess(DSPDebugTarget dspDebugTarget, ProcessEventArguments args) {
this.target = dspDebugTarget;
this.proxy = new DSPStreamsProxy(target.getDebugProtocolServer());
this.processArgs = args;
handle = ProcessHandle.of(args.getSystemProcessId());
handle = args != null && args.getSystemProcessId() != null ? ProcessHandle.of(args.getSystemProcessId()) : Optional.empty();
}

@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter(Class<T> adapter) {
if (adapter.isInstance(handle)) {
return (T) handle.orElse(null);
}
return target.getAdapter(adapter);
}

@Override
public boolean canTerminate() {
return target.canTerminate();
return !isTerminated();
}

@Override
public boolean isTerminated() {
return target.isTerminated();
return handle.map(h -> !h.isAlive()).orElse(terminated);
}

@Override
public void terminate() throws DebugException {
terminated = true;
handle.ifPresent(h -> {
h.destroy(); // normal termination
CompletableFuture.runAsync(() -> h.destroyForcibly(), CompletableFuture.delayedExecutor(5, TimeUnit.SECONDS)); // forced termination if normal is not sufficient
});
DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { new DebugEvent(this, DebugEvent.TERMINATE) });
target.terminate();
}

Expand Down
Expand Up @@ -17,7 +17,7 @@ public class DSPStreamMonitor implements IFlushableStreamMonitor {

private final ListenerList<IStreamListener> listeners = new ListenerList<>();
private final StringBuilder stream = new StringBuilder();
private boolean buffer;
private boolean buffer = true; // buffer by default as first output can happen before listeners are in place

@Override
public String getContents() {
Expand Down

0 comments on commit 5c3e6ef

Please sign in to comment.