Commits (2)
......@@ -76,6 +76,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<!-- Standalone -->
<module>../plugins/org.etsi.mts.tdl.standalone</module>
<!-- Web Editors -->
<module>../plugins/org.etsi.mts.tdl.tx.ls</module>
<module>../plugins/org.etsi.mts.tdl.tx.web</module>
<!--<module>org.etsi.mts.tdl.tx.web.static</module>-->
......
......@@ -12,6 +12,7 @@
<unit id="com.google.gson" version="0.0.0"/>
<unit id="org.eclipse.sirius.specifier.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sirius.aql.feature.group" version="0.0.0"/>
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2023-09"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
......@@ -32,6 +33,7 @@
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.apache.commons.math3" version="0.0.0"/>
<unit id="org.apache.commons.logging" version="1.2.0.v20180409-1502"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20211213173813/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src-gen">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="xtend-gen">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.etsi.mts.tdl.tx.ls</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
<filteredResources>
<filter>
<id>1681418411977</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Manifest-Version: 1.0
Automatic-Module-Name: org.etsi.mts.tdl.tx.ls
Bundle-ManifestVersion: 2
Bundle-Name: org.etsi.mts.tdl.tx.ls
Bundle-Vendor: ETSI
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: org.etsi.mts.tdl.tx.ls;singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.etsi.mts.tdl.tx,
org.etsi.mts.tdl.model,
org.eclipse.xtext.ide,
org.eclipse.xtext.xbase.ide,
org.eclipse.core.resources,
org.eclipse.lsp4j,
org.eclipse.lsp4j.jsonrpc,
com.google.gson,
org.aopalliance,
io.github.classgraph,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
org.etsi.mts.tdl.helper,
org.etsi.mts.tdl.tx.ide,
org.eclipse.xtext,
org.apache.commons.logging
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.etsi.mts.tdl.web
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.etsi.mts.tdl</groupId>
<artifactId>org.etsi.mts.tdl.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../org.etsi.mts.tdl.parent</relativePath>
</parent>
<artifactId>org.etsi.mts.tdl.tx.ls</artifactId>
<packaging>eclipse-plugin</packaging>
<name>TDLtx Brace-Based Textual Syntax Language Server</name>
<dependencies>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.25</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
<version>0.22.0</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.6</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
<version>0.22.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.35.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.xtext</groupId>
<artifactId>org.eclipse.xtext.web.servlet</artifactId>
<version>2.32.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId>
<version>11.0.15</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>11.0.15</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>11.0.15</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
-->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeGroupIds>p2.eclipse-feature</excludeGroupIds>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<!--
Exclude transitive? Reference says true, but prototype says false
<excludeTransitive>true</excludeTransitive>
-->
<excludeTransitive>false</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.jobs,
org.eclipse.core.resources,
<!--
Include runtime? (Reference yes, prototype no)
org.eclipse.core.runtime,
-->
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.preferences,
org.eclipse.equinox.registry,
org.eclipse.jdt.core,
org.eclipse.jdt.debug,
org.eclipse.jdt.launching,
org.eclipse.text,
<!-- additional -->
</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.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.eclipse.xtext.ide.server.ServerLauncher</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>plugin.properties</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
</transformer>
</transformers>
<artifactSet>
<excludes><!-- avoid duplicate inclusion due to addjars plugin -->
<exclude>*:org.etsi.mts.tdl.tx.ide-org.eclipse.lsp4j*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-org.eclipse.xtext.xbase.lib*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-org.eclipse.xtend.lib*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-com.google.guava*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-asm*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-log4j*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-reload4j*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-org.objectweb.asm*</exclude>
<exclude>*:org.etsi.mts.tdl.tx.ide-org.apache.log4j*</exclude>
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/INDEX.LIST</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>.options</exclude>
<exclude>.api_description</exclude>
<exclude>*.profile</exclude>
<exclude>*.html</exclude>
<exclude>about.*</exclude>
<exclude>about_files/*</exclude>
<exclude>plugin.xml</exclude>
<exclude>systembundle.properties</exclude>
<exclude>profile.list</exclude>
<exclude>**/*._trace</exclude>
<exclude>**/*.g</exclude>
<exclude>**/*.mwe2</exclude>
<exclude>**/*.xtext</exclude>
</excludes>
</filter>
</filters>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>ls</shadedClassifierName>
<minimizeJar>false</minimizeJar>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.etsi.mts.tdl</groupId>
<artifactId>org.etsi.mts.tdl.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../org.etsi.mts.tdl.parent</relativePath>
</parent>
<artifactId>org.etsi.mts.tdl.tx.ls</artifactId>
<packaging>eclipse-plugin</packaging>
<name>TDLtx Brace-Based Textual Syntax Language Server</name>
<build>
<plugins>
<!--
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
-->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeGroupIds>p2.eclipse-feature</excludeGroupIds>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<!--
Exclude transitive? Reference says true, but prototype says false
<excludeTransitive>true</excludeTransitive>
-->
<excludeTransitive>false</excludeTransitive>
<excludeArtifactIds>
com.ibm.icu,
org.apache.ant,
org.apache.commons.lang,
org.eclipse.core.commands,
org.eclipse.core.contenttype,
org.eclipse.core.expressions,
org.eclipse.core.filesystem,
org.eclipse.core.jobs,
<!--
org.apache.commons.logging,
org.eclipse.core.resources,
Include runtime? (Reference yes, prototype no)
org.eclipse.core.runtime,
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.registry,
-->
org.eclipse.core.variables,
org.eclipse.debug.core,
org.eclipse.equinox.appi
org.eclipse.equinox.preferences,
org.eclipse.jdt.core,
org.eclipse.jdt.debug,
org.eclipse.jdt.launching,
org.eclipse.text,
<!-- additional -->
</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>
<version>2.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
<configuration>
<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>
-->
<programs>
<program>
<id>tdltx-ls</id>
<!--
<mainClass>org.eclipse.xtext.ide.server.ServerLauncher</mainClass>
-->
<mainClass>org.etsi.mts.tdl.web.RunServer</mainClass>
<!-- uncomment to enable options
<commandLineArguments>
<commandLineArgument>-trace</commandLineArgument>
<commandLineArgument>-log</commandLineArgument>
<commandLineArgument>-noValidate</commandLineArgument>
</commandLineArguments>
-->
</program>
</programs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package org.etsi.mts.tdl.web;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.AsynchronousServerSocketChannel;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.Channels;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.function.Function;
import org.eclipse.lsp4j.jsonrpc.JsonRpcException;
import org.eclipse.lsp4j.jsonrpc.Launcher;
import org.eclipse.lsp4j.jsonrpc.MessageConsumer;
import org.eclipse.lsp4j.jsonrpc.MessageIssueException;
import org.eclipse.lsp4j.jsonrpc.messages.Message;
import org.eclipse.lsp4j.services.LanguageClient;
import org.eclipse.xtext.ide.server.LanguageServerImpl;
import org.eclipse.xtext.ide.server.ServerModule;
import org.etsi.mts.tdl.helper.TDLHelper;
import com.google.inject.Guice;
import com.google.inject.Injector;
/**
* @author dietrich - Initial contribution and API
*/
public class RunServer {
public static void main(String[] args) throws InterruptedException, IOException {
Injector injector = Guice.createInjector(new ServerModule());
TDLHelper.init();
LanguageServerImpl languageServer = injector.getInstance(LanguageServerImpl.class);
Function<MessageConsumer, MessageConsumer> wrapper = consumer -> {
MessageConsumer result = new MessageConsumer() {
@Override
public void consume(Message message) throws MessageIssueException, JsonRpcException {
System.out.println(message);
consumer.consume(message);
}
};
return result;
};
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);
}
}
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;
}
}
\ No newline at end of file
......@@ -49,6 +49,7 @@
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.etsi.mts.tdl.web.ServerLauncher</mainClass>
<!-- <mainClass>org.etsi.mts.tdl.web.RunServer</mainClass> -->
</manifest>
</archive>
</configuration>
......@@ -164,6 +165,11 @@
<artifactId>jetty-webapp</artifactId>
<version>11.0.15</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.0</version>
</dependency>
<!-- <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-runner</artifactId>
......@@ -299,7 +305,17 @@
<groupId>org.eclipse.epsilon.eol</groupId>
<artifactId>engine</artifactId>
<version>2.4.0.202203041826</version>
</dependency>
</dependency>
<dependency>
<groupId>org.eclipse.emf.codegen</groupId>
<artifactId>ecore</artifactId>
<version>2.35.0.v20230801-1141</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>codegen</artifactId>
<version>2.23.0.v20230211-1150</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.emf</groupId>
<artifactId>codegen</artifactId>
<version>2.23.0.v20230211-1150</version>
<description>POM was created from install:install-file</description>
</project>