Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Fixing of issue 280 #300

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f0ef981
Initial commit
jthoene Aug 1, 2019
e146ce7
initial draft of quickfix test class
jthoene Aug 6, 2019
54ce7a8
Initial working quickfix test infrastructure
jthoene Aug 6, 2019
ae9f093
Fixing Issue 284
jthoene Aug 6, 2019
b7e8af4
Formatting works for lines with less than 80 characters
Mazesch Aug 9, 2019
6374119
removed junk comments
Mazesch Aug 9, 2019
1c88003
added wrapping for more than 80 characters
Mazesch Aug 9, 2019
5d19313
Further Improving of test coverage for quickfixes
jthoene Aug 9, 2019
85107e4
Added missing testcases for quickfixes
jthoene Aug 13, 2019
2f3db0a
Initial commit
jthoene Aug 1, 2019
7f74284
initial draft of quickfix test class
jthoene Aug 6, 2019
939325b
Initial working quickfix test infrastructure
jthoene Aug 6, 2019
2f55c50
Fixing Issue 284
jthoene Aug 6, 2019
1a49bc6
Further Improving of test coverage for quickfixes
jthoene Aug 9, 2019
a8d8e4a
Added missing testcases for quickfixes
jthoene Aug 13, 2019
c696f93
Merge branch 'issues_279_280' of
jthoene Aug 13, 2019
dbb4c75
Removed unimplemented Quickfixes in the IdeCodeActionService
jthoene Aug 13, 2019
4d3137c
Removed unused class
jthoene Aug 13, 2019
77727e0
Fix platform test for MacOSX.
nyssen Aug 14, 2019
fee754f
Issue-301: Fix PLUGIN_ID constant value.
nyssen Aug 14, 2019
648630e
Merge pull request #302 from Yakindu/issue_301
flantony Aug 14, 2019
fca3a5b
Bugfixing
jthoene Aug 15, 2019
58bb1ac
Removed unused bindings
jthoene Aug 15, 2019
6ee4bf0
Added pom for the ui test project
jthoene Aug 15, 2019
469fa60
Added copyright and author tag
jthoene Aug 15, 2019
a847041
Fixed qualifier version
jthoene Aug 15, 2019
3c35eb7
Added dependencies to compiler plugins and set ui flag to true
jthoene Aug 15, 2019
a125a5d
fixed getLengthOfAssemblyExpression(FunctionalAssemblyExpression it)
Mazesch Aug 15, 2019
08b3b90
removed unused import
Mazesch Aug 15, 2019
cc34ee0
fixed dependencies declaration
jthoene Aug 15, 2019
89fba6d
Added maven-clean-plugin
jthoene Aug 15, 2019
c8f7f3e
Added some configs to the xtend plugin in the ui tests pom
jthoene Aug 15, 2019
5b29013
Merge pull request #305 from Yakindu/issue_297
flantony Aug 15, 2019
ccf4db9
fixed #298
Mazesch Aug 16, 2019
827b53e
Fixed indentation space between Contracts and after pragmas
Mazesch Aug 16, 2019
eeb62ed
Fixed a small change that was at the wrong location
Mazesch Aug 16, 2019
1ef3aa3
removed unused lines
Mazesch Aug 16, 2019
1314821
Tests are now running when building maven locally
jthoene Aug 20, 2019
d3a995a
Added UTF-8 specification to ui.tests plugin
jthoene Aug 20, 2019
790e047
Added feature resolution to the ui tests pom
jthoene Aug 20, 2019
ceb43d1
Ensure Solidity compiler can be used by Language Server for validation.
nyssen Aug 21, 2019
3190ec2
Ensure language server determines OS-version of compiler dynamically.
nyssen Aug 21, 2019
2ae516a
Replaced every occurrence of the old fragment names
jthoene Aug 22, 2019
adc84e6
Merge pull request #307 from Yakindu/issue_298
flantony Aug 22, 2019
172626e
Merge pull request #308 from Yakindu/issue_303
nyssen Aug 23, 2019
f5eb90f
Poms and Manifests were fixed
jthoene Aug 23, 2019
0e09f65
Initial commit
jthoene Aug 1, 2019
355b0ce
initial draft of quickfix test class
jthoene Aug 6, 2019
2116500
Initial working quickfix test infrastructure
jthoene Aug 6, 2019
256fdc1
Fixing Issue 284
jthoene Aug 6, 2019
f3ca57e
Further Improving of test coverage for quickfixes
jthoene Aug 9, 2019
dfb6f01
Added missing testcases for quickfixes
jthoene Aug 13, 2019
7043b54
Initial commit
jthoene Aug 1, 2019
f148213
initial draft of quickfix test class
jthoene Aug 6, 2019
415a36a
Initial working quickfix test infrastructure
jthoene Aug 6, 2019
5270f46
Fixing Issue 284
jthoene Aug 6, 2019
f45cfc6
Further Improving of test coverage for quickfixes
jthoene Aug 9, 2019
4a60823
Added missing testcases for quickfixes
jthoene Aug 13, 2019
30ef968
Removed unimplemented Quickfixes in the IdeCodeActionService
jthoene Aug 13, 2019
c0e4292
Removed unused bindings
jthoene Aug 15, 2019
d2b69c1
Added pom for the ui test project
jthoene Aug 15, 2019
cdc71ce
Added copyright and author tag
jthoene Aug 15, 2019
e4ec362
Fixed qualifier version
jthoene Aug 15, 2019
ba40f79
Added dependencies to compiler plugins and set ui flag to true
jthoene Aug 15, 2019
543d67d
fixed dependencies declaration
jthoene Aug 15, 2019
5d25fd4
Added maven-clean-plugin
jthoene Aug 15, 2019
88ffa6f
Added some configs to the xtend plugin in the ui tests pom
jthoene Aug 15, 2019
4dbbf6e
Tests are now running when building maven locally
jthoene Aug 20, 2019
ef2c5c1
Added UTF-8 specification to ui.tests plugin
jthoene Aug 20, 2019
94be445
Added feature resolution to the ui tests pom
jthoene Aug 20, 2019
a088828
Poms and Manifests were fixed
jthoene Aug 23, 2019
572a16f
Merge branch 'issues_279_280' of
jthoene Aug 23, 2019
3db311d
Fixing after Rebase
jthoene Aug 23, 2019
dde540e
Improved implementation of SolidityInjectorProvider
jthoene Aug 23, 2019
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
195 changes: 177 additions & 18 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- cd $TRAVIS_BUILD_DIR/extensions/vscode
- ./gradlew vscodeExtension
- cd $TRAVIS_BUILD_DIR
- cp -r plugins/com.yakindu.solidity.ide/target/languageserver extensions/theia/xtext-dsl-extension/lsp
- cp -r plugins/com.yakindu.solidity.ide/target/languageserver extensions/theia/xtext-dsl-extension/languageserver
- cd extensions/theia/
- yarn install
- cd $TRAVIS_BUILD_DIR
Expand Down
2 changes: 1 addition & 1 deletion extensions/theia/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/lsp/
*/examples/
/node_modules/
/xtext-dsl-extension/lsp
/xtext-dsl-extension/languageserver
/com.yakindu.solidity.web.ide.docker.tar.gz
2 changes: 1 addition & 1 deletion extensions/theia/xtext-dsl-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"prepare": "yarn run clean && yarn run build",
"copy-ls": "rimraf lsp && mkdir lsp && cp -r ../../../../plugins/com.yakindu.solidity.ide/target/languageserver/* ./lsp/",
"copy-ls": "rimraf lsp && mkdir languageserver && cp -r ../../../../plugins/com.yakindu.solidity.ide/target/languageserver/* ./languageserver/",
"clean": "rimraf lib",
"build": "tsc",
"local": "tsc && yarn run copy-ls",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export class SolidityContribution extends BaseLanguageServerContribution {
} else {
const ops = os.platform();

let command = path.resolve(__dirname, '../../lsp/bin/solidity-ls');
if (ops.toLowerCase().includes("win")){
let command = path.resolve(__dirname, '../../languageserver/bin/solidity-ls');
if (ops == "win32"){
command += ".bat"
}

Expand Down
4 changes: 2 additions & 2 deletions features/com.yakindu.solidity.solc.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ Public License instead of this License. But first, please read
unpack="false"/>

<plugin
id="com.yakindu.solidity.solc.win.fragment"
id="com.yakindu.solidity.solc.win32.fragment"
os="win32"
arch="x86_64"
download-size="0"
Expand All @@ -722,7 +722,7 @@ Public License instead of this License. But first, please read
unpack="false"/>

<plugin
id="com.yakindu.solidity.solc.mac.fragment"
id="com.yakindu.solidity.solc.macosx.fragment"
os="macosx"
arch="x86_64"
download-size="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: com.yakindu.sct.domain.solidity.ui
Export-Package: com.yakindu.sct.domain.solidity.ui
11 changes: 7 additions & 4 deletions plugins/com.yakindu.solidity.ide/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Bundle-Version: 0.7.3.qualifier
Bundle-SymbolicName: com.yakindu.solidity.ide;singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: com.yakindu.solidity,
com.yakindu.solidity.solc;bundle-version="0.7.3",
org.eclipse.xtext.ide,
org.eclipse.xtend.lib,
org.eclipse.xtext.xbase.lib,
Expand All @@ -14,11 +15,13 @@ Require-Bundle: com.yakindu.solidity,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
com.google.gson,
org.eclipse.emf.ecore.change,
org.slf4j.api;bundle-version="1.7.2"
org.slf4j.api;bundle-version="1.7.2",
org.eclipse.equinox.preferences;bundle-version="3.7.400",
org.apache.commons.lang;bundle-version="2.6.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.yakindu.solidity.ide.contentassist.antlr,
Export-Package: com.yakindu.solidity.ide,
com.yakindu.solidity.ide.contentassist.antlr,
com.yakindu.solidity.ide.contentassist.antlr.internal
Automatic-Module-Name: com.yakindu.solidity.ide
Bundle-ClassPath: lib/Java-WebSocket-1.4.0.jar,
.
Bundle-ClassPath: lib/Java-WebSocket-1.4.0.jar,.

137 changes: 58 additions & 79 deletions plugins/com.yakindu.solidity.ide/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?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">
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yakindu.solidity</groupId>
Expand Down Expand Up @@ -35,13 +36,13 @@
</dependency>
<dependency>
<groupId>com.yakindu.solidity</groupId>
<artifactId>com.yakindu.solidity.solc.mac.fragment</artifactId>
<artifactId>com.yakindu.solidity.solc.macosx.fragment</artifactId>
<version>0.7.3-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.yakindu.solidity</groupId>
<artifactId>com.yakindu.solidity.solc.win.fragment</artifactId>
<artifactId>com.yakindu.solidity.solc.win32.fragment</artifactId>
<version>0.7.3-SNAPSHOT</version>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -83,7 +84,6 @@
</filesets>
</configuration>
</plugin>

<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
Expand All @@ -95,73 +95,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeTransitive>true</excludeTransitive>
<excludeArtifactIds>
com.ibm.icu,
org.apache.ant,
org.apache.commons.lang,
org.apache.commons.logging,
org.eclipse.core.commands,
org.eclipse.core.contenttype,
org.eclipse.core.expressions,
org.eclipse.core.filesystem,
org.eclipse.core.variables,
org.eclipse.debug.core,
org.eclipse.emf.codegen.ecore,
org.eclipse.emf.codegen,
org.eclipse.emf.mwe.core,
org.eclipse.emf.mwe.utils,
org.eclipse.emf.mwe2.lib,
org.eclipse.emf.mwe2.runtime,
org.eclipse.equinox.app,
org.eclipse.equinox.registry,
org.eclipse.jdt.core,
org.eclipse.jdt.debug,
org.eclipse.jdt.launching,
org.eclipse.text,
org.eclipse.xtend.typesystem.emf,
org.eclipse.xtend,
</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>add-jars</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/libs</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
Expand All @@ -173,26 +106,72 @@
<goal>assemble</goal>
</goals>
<configuration>
<useAllProjectDependencies>true</useAllProjectDependencies>
<projectArtifactFirstInClassPath>true</projectArtifactFirstInClassPath>
<assembleDirectory>${project.build.directory}/languageserver</assembleDirectory>
<repositoryLayout>flat</repositoryLayout>
<useWildcardClassPath>true</useWildcardClassPath>
<!-- uncomment to enable remote debugging <extraJvmArguments>-Xdebug
-Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000</extraJvmArguments> -->
<!--<extraJvmArguments>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000</extraJvmArguments>-->
<programs>
<program>
<id>solidity-ls</id>
<!-- Use RunServer for Socket connection -->
<!-- <mainClass>com.yakindu.solidity.ide.RunServer</mainClass> -->
<mainClass>org.eclipse.xtext.ide.server.ServerLauncher</mainClass>
<!-- uncomment to enable options <commandLineArguments> <commandLineArgument>-trace</commandLineArgument>
<commandLineArgument>-log</commandLineArgument> <commandLineArgument>-noValidate</commandLineArgument>
</commandLineArguments> -->
<mainClass>com.yakindu.solidity.ide.LanguageServerLauncher</mainClass>
<!-- <mainClass>org.eclipse.xtext.ide.server.ServerLauncher</mainClass> -->
<commandLineArguments>
<commandLineArgument>-trace</commandLineArgument>
<commandLineArgument>-log</commandLineArgument>
<!-- <commandLineArgument>-noValidate</commandLineArgument> -->
<!-- Compiler path is given with ${os} variable, so the respective
os-specific compiler can be located. The language server will resolve the
variable. -->
<commandLineArgument>-compiler repo/com.yakindu.solidity.solc.\${os}.fragment/compiler/solc</commandLineArgument>
</commandLineArguments>
</program>
</programs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<unzip
dest="${project.build.directory}/languageserver/repo/com.yakindu.solidity.solc.macosx.fragment">
<fileset
dir="${project.build.directory}/languageserver/repo/">
<include
name="com.yakindu.solidity.solc.macosx.fragment-**-SNAPSHOT.jar" />
</fileset>
</unzip>
<unzip
dest="${project.build.directory}/languageserver/repo/com.yakindu.solidity.solc.linux.fragment">
<fileset
dir="${project.build.directory}/languageserver/repo/">
<include
name="com.yakindu.solidity.solc.linux.fragment-**-SNAPSHOT.jar" />
</fileset>
</unzip>
<unzip
dest="${project.build.directory}/languageserver/repo/com.yakindu.solidity.solc.win32.fragment">
<fileset
dir="${project.build.directory}/languageserver/repo/">
<include
name="com.yakindu.solidity.solc.win32.fragment-**-SNAPSHOT.jar" />
</fileset>
</unzip>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package com.yakindu.solidity.ide;

import java.io.File;
import java.io.IOException;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.Options;
import org.apache.commons.lang.SystemUtils;
import org.eclipse.xtext.ide.server.ServerLauncher;
import org.eclipse.xtext.ide.server.ServerModule;
import org.eclipse.xtext.util.Modules2;

import com.google.inject.Guice;
import com.yakindu.solidity.SolidityRuntimeModule;
import com.yakindu.solidity.solc.preferences.ICompilerPreferences;

/**
* @author Jonathan Thoene - Initial contribution and API
*/
public class LanguageServerLauncher {

public static final String COMPILER = "-compiler";

public static void main(String[] args) throws InterruptedException, IOException {
try {
Options o = new Options();
o.addOption(ServerLauncher.LOG.substring(1), false, "Log");
o.addOption(ServerLauncher.TRACE.substring(1), false, "Trace");
o.addOption(ServerLauncher.NO_VALIDATE.substring(1), false, "No Validate");
o.addOption(COMPILER.substring(1), true, "Path to Solc Compiler (relative to working dir)");
CommandLineParser p = new BasicParser();
CommandLine cmd = p.parse(o, args);
if (cmd.hasOption(COMPILER.substring(1))) {
String compilerPath = cmd.getOptionValue(COMPILER.substring(1)).replace("${os}", getOS());
String absoluteCompilerPath = getWorkDir() + compilerPath;
ICompilerPreferences prefs = Guice
.createInjector(Modules2.mixin(new SolidityRuntimeModule(), new SolidityIdeModule()))
.getInstance(ICompilerPreferences.class);
prefs.getPreferences().put(ICompilerPreferences.COMPILER_PATH, absoluteCompilerPath);
}
} catch (Exception e) {
e.printStackTrace();
}
ServerLauncher.launch(LanguageServerLauncher.class.getName(), args, new ServerModule());
/*
* Injector injector = Guice.createInjector(new ServerModule());
* LanguageServerImpl languageServer =
* injector.getInstance(LanguageServerImpl.class); Function<MessageConsumer,
* MessageConsumer> wrapper = consumer -> { return message -> {
* System.out.println(message); consumer.consume(message); }; };
* Launcher<LanguageClient> launcher = createSocketLauncher(languageServer,
* LanguageClient.class, new InetSocketAddress("localhost", 5007),
* Executors.newCachedThreadPool(), wrapper);
* languageServer.connect(launcher.getRemoteProxy()); Future<?> future =
* launcher.startListening(); while (!future.isDone()) { Thread.sleep(10_000l);
* }
*/
}

private static String getWorkDir() throws IOException {
// TODO: app workdir should be configured in Maven to be language server dir,
// not theia app dir, so we do not have to compensate this here.
String appDir = new File(".").getCanonicalPath();
return appDir.substring(0, appDir.indexOf("app")) + "xtext-dsl-extension/languageserver/";
}

private static CharSequence getOS() {
if (SystemUtils.IS_OS_LINUX) {
return "linux";
} else if (SystemUtils.IS_OS_WINDOWS) {
return "win32";
} else if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX) {
return "macosx";
} else {
throw new IllegalArgumentException("Unsupported OS");
}
}

/*
* static <T> Launcher<T> createSocketLauncher(Object localService, Class<T>
* remoteInterface, SocketAddress socketAddress, ExecutorService
* executorService, Function<MessageConsumer, MessageConsumer> wrapper) throws
* IOException { AsynchronousServerSocketChannel serverSocket =
* AsynchronousServerSocketChannel.open().bind(socketAddress);
* AsynchronousSocketChannel socketChannel; try { socketChannel =
* serverSocket.accept().get(); return Launcher.createIoLauncher(localService,
* remoteInterface, Channels.newInputStream(socketChannel),
* Channels.newOutputStream(socketChannel), executorService, wrapper); } catch
* (InterruptedException | ExecutionException e) { e.printStackTrace(); } return
* null; }
*/

}
Loading