Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.

CHE-6914: Move Java Debugger Location Conversion to jdt.ls extension #4

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ public class Commands {
public static final String RESOLVE_CLASSPATH_COMMAND = "che.jdt.ls.extension.resolveClasspath";
public static final String GET_OUTPUT_DIR_COMMAND = "che.jdt.ls.extension.outputDir";

// debug

public static final String FQN_TO_LOCATION_COMMAND = "che.jdt.ls.extension.debug.fqnToLocation";
public static final String LOCATION_TO_FQN_COMMAND = "che.jdt.ls.extension.debug.locationToFqn";

private Commands() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2012-2017 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.jdt.ls.extension.api.dto;

/** @author Anatolii Bazko */
public class LocationParameters {
private String projectPath;
private String target;
private int lineNumber;
private int libId;

public LocationParameters() {}

public LocationParameters(String target, int lineNumber, String projectPath) {
this.target = target;
this.lineNumber = lineNumber;
this.projectPath = projectPath;
this.libId = 0;
}

public LocationParameters(String target, int lineNumber, int libId, String projectPath) {
this.target = target;
this.lineNumber = lineNumber;
this.projectPath = projectPath;
this.libId = libId;
}

public int getLineNumber() {
return lineNumber;
}

public void setLineNumber(int lineNumber) {
this.lineNumber = lineNumber;
}

public String getTarget() {
return target;
}

public void setTarget(String target) {
this.target = target;
}

public String getProjectPath() {
return projectPath;
}

public void setProjectPath(String projectPath) {
this.projectPath = projectPath;
}

public int getLibId() {
return libId;
}

public void setLibId(int libId) {
this.libId = libId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ Bundle-Name: jdt.ls.extension Core Extension
Bundle-SymbolicName: jdt.ls.extension.core;singleton:=true
Bundle-Version: 0.0.1.qualifier
Bundle-Activator: org.eclipse.che.jdt.ls.extension.core.internal.ExtensionActivator
Import-Package: com.google.gson,
Import-Package: com.google.common.base;version="15.0.0",
com.google.gson,
org.apache.commons.lang3.tuple;version="3.1.0",
org.eclipse.che.jdt.ls.extension.api,
org.eclipse.che.jdt.ls.extension.api.dto,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.jdt.core,
org.eclipse.jdt.launching,
org.eclipse.jdt.ls.core.internal,
org.eclipse.core.runtime,
org.eclipse.lsp4j,
org.eclipse.lsp4j.jsonrpc.json.adapters
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.core,
org.eclipse.jdt.ls.core,
org.eclipse.jface.text,
org.eclipse.jdt.core.manipulation
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.5"?>
<plugin>
<extension point="org.eclipse.jdt.ls.core.delegateCommandHandler">
<delegateCommandHandler class="org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler">
<extension point="org.eclipse.jdt.ls.core.delegateCommandHandler">
<delegateCommandHandler class="org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler">
<command id="che.jdt.ls.extension.detectTest"/>
<command id="che.jdt.ls.extension.findTestByCursor"/>
<command id="che.jdt.ls.extension.findTestFromProject"/>
Expand All @@ -12,6 +12,8 @@
<command id="che.jdt.ls.extension.resolveClasspath"/>
<command id="che.jdt.ls.extension.outputDir"/>
<command id="org.eclipse.che.jdt.ls.extension.filestructure"/>
</delegateCommandHandler>
</extension>
<command id="che.jdt.ls.extension.debug.fqnToLocation"/>
<command id="che.jdt.ls.extension.debug.locationToFqn"/>
</delegateCommandHandler>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<packaging>eclipse-plugin</packaging>
<name>Che Ls Jdt :: Extension :: Core</name>
<build>
<plugins>
<plugin>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
Expand All @@ -33,6 +33,6 @@
</excludes>
</configuration>
</plugin>
</plugins>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.function.BiFunction;
import org.eclipse.che.jdt.ls.extension.api.Commands;
import org.eclipse.che.jdt.ls.extension.core.internal.classpath.ResolveClassPathsHandler;
import org.eclipse.che.jdt.ls.extension.core.internal.debug.FqnConverter;
import org.eclipse.che.jdt.ls.extension.core.internal.testdetection.TestDetectionHandler;
import org.eclipse.che.jdt.ls.extension.core.internal.testdetection.TestFinderHandler;
import org.eclipse.core.runtime.IProgressMonitor;
Expand All @@ -42,6 +43,8 @@ public class CheDelegateCommandHandler implements IDelegateCommandHandler {
commands.put(Commands.FIND_TESTS_IN_FILE_COMMAND, TestFinderHandler::getClassFqn);
commands.put(Commands.RESOLVE_CLASSPATH_COMMAND, ResolveClassPathsHandler::resolveClasspaths);
commands.put(Commands.GET_OUTPUT_DIR_COMMAND, ResolveClassPathsHandler::getOutputDirectory);
commands.put(Commands.LOCATION_TO_FQN_COMMAND, FqnConverter::locationToFqn);
commands.put(Commands.FQN_TO_LOCATION_COMMAND, FqnConverter::fqnToLocation);
}

@Override
Expand Down
Loading