Skip to content

Commit

Permalink
[#2902] LSP4J 0.21.2
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Dietrich <christian.dietrich.opensource@gmail.com>
  • Loading branch information
cdietrich committed Jan 10, 2024
1 parent aff64b8 commit 9f2e95e
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 38 deletions.
14 changes: 7 additions & 7 deletions org.eclipse.xtext.dev-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,37 +287,37 @@
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.debug</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.generator</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc.debug</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.websocket.jakarta</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.websocket</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
<version>0.21.1</version>
<version>0.21.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.platform</groupId>
Expand Down
4 changes: 2 additions & 2 deletions org.eclipse.xtext.ide.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Require-Bundle: org.eclipse.xtext;bundle-version="2.34.0";visibility:=reexport,
org.eclipse.core.runtime;bundle-version="3.24.100",
org.eclipse.xtext.ide;bundle-version="2.34.0",
org.junit;bundle-version="4.13.2",
org.eclipse.lsp4j;bundle-version="[0.21.1,0.22.0)";resolution:=optional,
org.eclipse.lsp4j.jsonrpc;bundle-version="[0.21.1,0.22.0)";resolution:=optional,
org.eclipse.lsp4j;bundle-version="[0.21.2,0.22.0)";resolution:=optional,
org.eclipse.lsp4j.jsonrpc;bundle-version="[0.21.2,0.22.0)";resolution:=optional,
org.eclipse.xtext.testlanguages;bundle-version="2.34.0",
org.eclipse.xtext.testlanguages.ide;bundle-version="2.34.0",
org.eclipse.emf.mwe2.lib;bundle-version="2.17.0",
Expand Down
4 changes: 2 additions & 2 deletions org.eclipse.xtext.ide/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Require-Bundle: org.eclipse.xtext;bundle-version="2.34.0";visibility:=reexport,
org.eclipse.xtend.lib;bundle-version="2.34.0",
org.eclipse.core.runtime;bundle-version="3.24.100";resolution:=optional;x-installation:=greedy,
org.eclipse.equinox.common;bundle-version="3.16.0",
org.eclipse.lsp4j;bundle-version="[0.21.1,0.22.0)";resolution:=optional,
org.eclipse.lsp4j.jsonrpc;bundle-version="[0.21.1,0.22.0)";resolution:=optional,
org.eclipse.lsp4j;bundle-version="[0.21.2,0.22.0)";resolution:=optional,
org.eclipse.lsp4j.jsonrpc;bundle-version="[0.21.2,0.22.0)";resolution:=optional,
org.eclipse.emf.ecore.change;bundle-version="[2.14.0,3)"
Import-Package: org.apache.log4j;version="1.2.24"
Export-Package: org.eclipse.xtext.ide;version="2.34.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.inject.Inject;

Expand Down Expand Up @@ -1106,7 +1105,9 @@ protected void constructorCallToJavaExpression(final XConstructorCall expr, ITre
}
ITreeAppendable typeAppendable = appendableWithNewKeyword.trace(expr, XbasePackage.Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR, 0);
appendConstructedTypeName(expr, typeAppendable);
if (hasTypeArguments || (expr.isAnonymousClassConstructorCall() && !explicitTypeArguments.isEmpty() && ((JvmGenericType) constructor.getDeclaringType()).isAnonymous())) {
if (hasTypeArguments ||
(!explicitTypeArguments.isEmpty() &&
canCompileToJavaAnonymousClass(expr))) {
if (typeArguments.isEmpty()) {
LightweightTypeReference createdType = resolvedTypes.getActualType(expr);
typeArguments = createdType.getNamedType().getTypeArguments();
Expand All @@ -1132,16 +1133,25 @@ protected void constructorCallToJavaExpression(final XConstructorCall expr, ITre
}

protected void appendConstructedTypeName(XConstructorCall constructorCall, ITreeAppendable typeAppendable) {
JvmDeclaredType type = constructorCall.getConstructor().getDeclaringType();
if (type instanceof JvmGenericType && ((JvmGenericType) type).isAnonymous()) {
typeAppendable.append(Iterables.getLast(type.getSuperTypes()).getType());
IResolvedTypes resolvedTypes = batchTypeResolver.resolveTypes(constructorCall);
LightweightTypeReference actualType = resolvedTypes.getActualType(constructorCall);
if (canCompileToJavaAnonymousClass(constructorCall)) {
typeAppendable.append(actualType.getNamedType().getRawTypeReference());
} else {
IResolvedTypes resolvedTypes = batchTypeResolver.resolveTypes(constructorCall);
LightweightTypeReference actualType = resolvedTypes.getActualType(constructorCall).getRawTypeReference();
typeAppendable.append(actualType);
typeAppendable.append(actualType.getRawTypeReference());
}
}


/**
* @since 2.34
*/
protected boolean canCompileToJavaAnonymousClass(XConstructorCall constructorCall) {
if (!constructorCall.isAnonymousClassConstructorCall())
return false;
JvmDeclaredType type = constructorCall.getConstructor().getDeclaringType();
return type instanceof JvmGenericType && ((JvmGenericType) type).isAnonymous();
}

/* @Nullable */
protected ILocationData getLocationWithNewKeyword(XConstructorCall call) {
final ICompositeNode startNode = NodeModelUtils.getNode(call);
Expand Down Expand Up @@ -2167,6 +2177,13 @@ protected boolean isVariableDeclarationRequired(XExpression expr, ITreeAppendabl
}
}
}
if (expr instanceof XConstructorCall) {
XConstructorCall constructorCall = (XConstructorCall) expr;
if (constructorCall.isAnonymousClassConstructorCall()) {
return isVariableDeclarationRequired((XExpression) container, b, recursive) &&
!canCompileToJavaAnonymousClass(constructorCall);
}
}
return super.isVariableDeclarationRequired(expr, b, recursive);
}

Expand Down
4 changes: 2 additions & 2 deletions xtext-latest.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-latest" sequenceNumber="15">
<target name="xtext-latest" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/nightly/latest" />
Expand Down Expand Up @@ -29,7 +29,7 @@
<repository location="https://download.eclipse.org/eclipse/updates/4.31-I-builds" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202203.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202203" sequenceNumber="15">
<target name="xtext-r202203" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.29"/>
Expand All @@ -27,7 +27,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202206.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202206" sequenceNumber="15">
<target name="xtext-r202206" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.30"/>
Expand All @@ -26,7 +26,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202209.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202209" sequenceNumber="15">
<target name="xtext-r202209" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.31"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202212.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202212" sequenceNumber="15">
<target name="xtext-r202212" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.32"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202303.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202303" sequenceNumber="15">
<target name="xtext-r202303" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.33.0"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202306.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202306" sequenceNumber="15">
<target name="xtext-r202306" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.34.0"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202309.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202309" sequenceNumber="15">
<target name="xtext-r202309" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.35.0"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down
4 changes: 2 additions & 2 deletions xtext-r202312.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="xtext-r202312" sequenceNumber="15">
<target name="xtext-r202312" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/modeling/emf/emf/builds/release/2.36.0"/>
Expand Down Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.buildship.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.1"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.2"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down

0 comments on commit 9f2e95e

Please sign in to comment.