Skip to content

Commit

Permalink
updated template
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBullen committed Oct 24, 2017
1 parent 5803448 commit c6d72b5
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 59 deletions.
36 changes: 36 additions & 0 deletions Eclipse_LS_Plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<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>
<groupId>org.eclipsecon</groupId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<artifactId>languageserverplugin</artifactId>
<name>Eclipse Plugin for LSP4J Excercises</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
<version>0.3.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Binary file not shown.
5 changes: 5 additions & 0 deletions Eclipse_LS_Plugin/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Generated by Maven
#Tue Oct 17 16:18:17 EDT 2017
version=0.0.1-SNAPSHOT
groupId=org.eclipsecon
artifactId=languageserverplugin
4 changes: 2 additions & 2 deletions Exercises/1/1-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Start by opening the [MANIFEST.MF](/Exercises/1/META-INF/MANIFEST.MF) file. Here

Either in the **Dependencies** tab or with the **Require-Bundle** tag, add the following two packages:

**`org.eclipse.lsp4j`** Version 0.3.0
**`org.eclipse.lsp4j`** Version 0.2.0

This package includes the interface for implementations of the LSP, `lsp4j.services.LanguageServer`, and all the request, parameter, and response formats for the messages sent between the server and client.

**`org.eclipse.lsp4j.jsonrpc`** Version 0.3.0
**`org.eclipse.lsp4j.jsonrpc`** Version 0.2.0

We use only one class from this package: `Launcher` which is the entry point for applications that use LSP4J. A `Launcher` does all the wiring that is necessary to connect your endpoint via an input stream and an output stream.

Expand Down
17 changes: 14 additions & 3 deletions Template LSP4J Language Server/.classpath
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
Expand All @@ -16,7 +27,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/lbullen/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j/0.3.0/org.eclipse.lsp4j-0.3.0.jar"/>
<classpathentry kind="lib" path="/home/lbullen/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.3.0/org.eclipse.lsp4j.jsonrpc-0.3.0.jar"/>
<classpathentry kind="lib" path="/Users/lucas/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.2.0/org.eclipse.lsp4j.jsonrpc-0.2.0.jar"/>
<classpathentry kind="lib" path="/Users/lucas/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j/0.2.0/org.eclipse.lsp4j-0.2.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion Template LSP4J Language Server/.project
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Template LSP4J Language Server</name>
<name>Template Language Server</name>
<comment></comment>
<projects>
</projects>
Expand Down
Empty file.
Empty file.
13 changes: 0 additions & 13 deletions Template LSP4J Language Server/README.md

This file was deleted.

66 changes: 36 additions & 30 deletions Template LSP4J Language Server/pom.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<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>
<groupId>org.eclipsecon</groupId>
<artifactId>template</artifactId>
<groupId>fr.alpesjug</groupId>
<artifactId>template-languageserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Template Language Server Built with LSP4J</name>
<name>Template Language Server</name>
<dependencies>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
Expand All @@ -27,23 +33,23 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>org.eclipsecon.template.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>org.eclipsecon.languageserver.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.eclipsecon.template;
package org.eclipsecon.languageserver;

import java.io.InputStream;
import java.io.OutputStream;
Expand Down
15 changes: 11 additions & 4 deletions ...econ/template/TemplateLanguageServer.java → ...anguageserver/TemplateLanguageServer.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package org.eclipsecon.template;
package org.eclipsecon.languageserver;

import java.util.concurrent.CompletableFuture;

import org.eclipse.lsp4j.CompletionOptions;
import org.eclipse.lsp4j.InitializeParams;
import org.eclipse.lsp4j.InitializeResult;
import org.eclipse.lsp4j.ServerCapabilities;
import org.eclipse.lsp4j.TextDocumentSyncKind;
import org.eclipse.lsp4j.services.LanguageClient;
import org.eclipse.lsp4j.services.LanguageServer;
import org.eclipse.lsp4j.services.TextDocumentService;
import org.eclipse.lsp4j.services.WorkspaceService;

public class TemplateLanguageServer implements LanguageServer {

private TemplateTextDocumentService textService;
private TemplateWorkspaceService workspaceService;
private TextDocumentService textService;
private WorkspaceService workspaceService;
LanguageClient client;

public TemplateLanguageServer() {
Expand All @@ -24,8 +25,14 @@ public TemplateLanguageServer() {

public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
final InitializeResult res = new InitializeResult(new ServerCapabilities());
res.getCapabilities().setCodeActionProvider(Boolean.TRUE);
res.getCapabilities().setCompletionProvider(new CompletionOptions());

res.getCapabilities().setDefinitionProvider(Boolean.TRUE);
res.getCapabilities().setHoverProvider(Boolean.TRUE);
res.getCapabilities().setReferencesProvider(Boolean.TRUE);
res.getCapabilities().setTextDocumentSync(TextDocumentSyncKind.Full);
res.getCapabilities().setDocumentSymbolProvider(Boolean.TRUE);

return CompletableFuture.supplyAsync(() -> res);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package org.eclipsecon.template;
package org.eclipsecon.languageserver;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;

import org.eclipse.lsp4j.CodeActionParams;
import org.eclipse.lsp4j.CodeLens;
import org.eclipse.lsp4j.CodeLensParams;
Expand Down Expand Up @@ -33,7 +32,8 @@

public class TemplateTextDocumentService implements TextDocumentService {

public TemplateTextDocumentService(TemplateLanguageServer languageServer) {

public TemplateTextDocumentService(TemplateLanguageServer templateLanguageServer) {
}

@Override
Expand Down Expand Up @@ -116,10 +116,12 @@ public CompletableFuture<WorkspaceEdit> rename(RenameParams params) {

@Override
public void didOpen(DidOpenTextDocumentParams params) {

}

@Override
public void didChange(DidChangeTextDocumentParams params) {

}

@Override
Expand All @@ -129,4 +131,5 @@ public void didClose(DidCloseTextDocumentParams params) {
@Override
public void didSave(DidSaveTextDocumentParams params) {
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.eclipsecon.template;
package org.eclipsecon.languageserver;

import java.util.List;
import java.util.concurrent.CompletableFuture;
Expand Down
1 change: 0 additions & 1 deletion Template LSP4J Language Server/target/.gitignore

This file was deleted.

0 comments on commit c6d72b5

Please sign in to comment.