├── eclipse-che
├── chamrousse-workspace-image
│ ├── src
│ │ └── main
│ │ │ └── docker
│ │ │ ├── .gitignore
│ │ │ ├── launch.sh
│ │ │ └── Dockerfile
│ └── pom.xml
├── start-che.sh
├── plugin-chamrousse
│ ├── che-plugin-chamrousse-lang-ide
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── resources
│ │ │ │ └── org
│ │ │ │ │ └── eclipse
│ │ │ │ │ └── che
│ │ │ │ │ └── plugin
│ │ │ │ │ └── chamrousse
│ │ │ │ │ └── ide
│ │ │ │ │ ├── ChamrousseLocalizationConstant.properties
│ │ │ │ │ └── svg
│ │ │ │ │ └── chamrousse.svg
│ │ │ │ ├── module.gwt.xml
│ │ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── eclipse
│ │ │ │ └── che
│ │ │ │ └── plugin
│ │ │ │ └── chamrousse
│ │ │ │ └── ide
│ │ │ │ ├── ChamrousseLocalizationConstant.java
│ │ │ │ ├── ChamrousseResources.java
│ │ │ │ ├── inject
│ │ │ │ └── ChamrousseGinModule.java
│ │ │ │ ├── project
│ │ │ │ └── ChamrousseProjectWizardRegistrar.java
│ │ │ │ ├── ChamrousseExtension.java
│ │ │ │ └── action
│ │ │ │ └── CreateChamrousseFileAction.java
│ │ └── pom.xml
│ ├── pom.xml
│ └── che-plugin-chamrousse-lang-server
│ │ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── eclipse
│ │ │ └── che
│ │ │ └── plugin
│ │ │ └── chamrousse
│ │ │ ├── inject
│ │ │ └── ChamrousseModule.java
│ │ │ └── languageserver
│ │ │ └── ChamrousseLanguageServerLauncher.java
│ │ └── pom.xml
└── README.md
├── vscode-chamrousse
├── .gitignore
├── icons
│ └── icon128.png
├── images
│ ├── statusMarker.png
│ └── vscode-java.0.0.1.gif
├── .editorconfig
├── .vscodeignore
├── .project
├── gulpfile.js
├── .vscode
│ ├── extensions.json
│ ├── settings.json
│ ├── launch.json
│ └── tasks.json
├── tsconfig.json
├── tslint.json
├── .github
│ └── ISSUE_TEMPLATE.md
├── LICENSE
├── language-configuration.json
├── test
│ └── index.ts
├── package.json
└── src
│ ├── protocol.ts
│ └── extension.ts
├── fr.alpesjug.lsp.eclipse
├── build.properties
├── .classpath
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── META-INF
│ └── MANIFEST.MF
├── .project
├── src
│ └── fr
│ │ └── alpesjug
│ │ └── lsp
│ │ └── eclipse
│ │ └── ChamrousseLanguageServerStreamProvider.java
└── plugin.xml
├── Le LanguageServer de Chamrousse
├── .settings
│ ├── org.eclipse.m2e.core.prefs
│ └── org.eclipse.jdt.core.prefs
├── .project
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── fr
│ │ │ │ └── alpesjug
│ │ │ │ └── languageserver
│ │ │ │ └── chamrousseMap.properties
│ │ └── java
│ │ │ └── fr
│ │ │ └── alpesjug
│ │ │ └── languageserver
│ │ │ ├── ChamrousseWorkspaceService.java
│ │ │ ├── Main.java
│ │ │ ├── ChamrousseLanguageServer.java
│ │ │ ├── ChamrousseMap.java
│ │ │ ├── ChamrousseDocumentModel.java
│ │ │ └── ChamrousseTextDocumentService.java
│ └── test
│ │ └── java
│ │ └── fr
│ │ └── alpesjug
│ │ └── languageserver
│ │ └── tests
│ │ └── TestLanguageServer.java
├── .classpath
└── pom.xml
└── README.md
/eclipse-che/chamrousse-workspace-image/src/main/docker/.gitignore:
--------------------------------------------------------------------------------
1 | lsp.jar
2 |
3 |
--------------------------------------------------------------------------------
/eclipse-che/chamrousse-workspace-image/src/main/docker/launch.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | java -jar /home/user/ls-chamrousse/launch.jar
3 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.gitignore:
--------------------------------------------------------------------------------
1 | out
2 | server
3 | node_modules
4 | *.vsix
5 | .DS_Store
6 | .vscode-test
7 | undefined
8 | target
9 |
--------------------------------------------------------------------------------
/vscode-chamrousse/icons/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mickaelistria/eclipse-languageserver-demo/HEAD/vscode-chamrousse/icons/icon128.png
--------------------------------------------------------------------------------
/vscode-chamrousse/images/statusMarker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mickaelistria/eclipse-languageserver-demo/HEAD/vscode-chamrousse/images/statusMarker.png
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/
2 | output.. = bin/
3 | bin.includes = META-INF/,\
4 | .,\
5 | plugin.xml
6 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/vscode-chamrousse/images/vscode-java.0.0.1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mickaelistria/eclipse-languageserver-demo/HEAD/vscode-chamrousse/images/vscode-java.0.0.1.gif
--------------------------------------------------------------------------------
/eclipse-che/start-che.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -e CHE_DOCKER_ALWAYS__PULL__IMAGE="false" -v /tmp/da6:/data florentbenoit/che:chamrousse-demo start --fast
3 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.editorconfig:
--------------------------------------------------------------------------------
1 | # Tab indentation
2 | [*]
3 | indent_style = tab
4 | indent_size = 4
5 | trim_trailing_whitespace = true
6 |
7 | [{.travis.yml,npm-shrinkwrap.json,package.json}]
8 | indent_style = space
9 | indent_size = 2
--------------------------------------------------------------------------------
/vscode-chamrousse/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | typings/**
3 | out/test/**
4 | test/**
5 | src/**
6 | images/**
7 | **/*.map
8 | .gitignore
9 | tsconfig.json
10 | vsc-extension-quickstart.md
11 | undefined/**
12 | CONTRIBUTING.md
13 | .vscode-test/**
14 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | vscode-chamrousse
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/vscode-chamrousse/gulpfile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | const gulp = require('gulp');
3 | const gulp_tslint = require('gulp-tslint');
4 | //...
5 | gulp.task('tslint', () => {
6 | return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**'])
7 | .pipe(gulp_tslint())
8 | .pipe(gulp_tslint.report());
9 | });
--------------------------------------------------------------------------------
/vscode-chamrousse/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
6 | "eg2.tslint",
7 | "EditorConfig.EditorConfig"
8 | ]
9 | }
--------------------------------------------------------------------------------
/vscode-chamrousse/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es6",
4 | "lib": [
5 | "es6"
6 | ],
7 | "module": "commonjs",
8 | "moduleResolution": "node",
9 | "outDir": "out",
10 | "sourceMap": true
11 | },
12 | "exclude": [
13 | "node_modules",
14 | "server",
15 | ".vscode-test"
16 | ]
17 | }
--------------------------------------------------------------------------------
/vscode-chamrousse/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "no-unused-expression": true,
4 | "no-duplicate-variable": true,
5 | "no-duplicate-key": true,
6 | "no-unused-variable": true,
7 | "curly": true,
8 | "class-name": true,
9 | "semicolon": ["always"],
10 | "triple-equals": true,
11 | "quotemark": [true, "single", "avoid-escape"]
12 | }
13 | }
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4 | org.eclipse.jdt.core.compiler.compliance=1.8
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.8
8 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | [provide a description of the issue]
2 |
3 | ##### Environment
4 | - Operating System:
5 | - JDK version:
6 | - Visual Studio Code version:
7 | - Java extension version:
8 |
9 | ##### Steps To Reproduce
10 | 1. [step 1]
11 | 2. [step 2]
12 |
13 | [attach a sample project reproducing the error]
14 |
15 | ##### Current Result
16 |
17 | ##### Expected Result
18 |
19 | ##### Additional Informations
20 |
--------------------------------------------------------------------------------
/eclipse-che/chamrousse-workspace-image/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM eclipse/ubuntu_jdk8
2 |
3 | #ENV DEBIAN_FRONTEND noninteractive
4 |
5 | RUN mkdir /home/user/ls-chamrousse
6 | ADD launch.sh /home/user/ls-chamrousse/launch.sh
7 | ADD lsp.jar /home/user/ls-chamrousse/launch.jar
8 | RUN sudo chmod 755 /home/user/ls-chamrousse/launch.sh && \
9 | sudo chgrp -R 0 /home/user/ls-chamrousse && \
10 | sudo chmod -R g+rwX /home/user/ls-chamrousse
11 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "files.exclude": {
4 | "out": false // set this to true to hide the "out" folder with the compiled JS files
5 | },
6 | "search.exclude": {
7 | "out": true // set this to false to include "out" folder in search results
8 | },
9 | "typescript.tsdk": "./node_modules/typescript/lib",
10 | "vsicons.presets.angular": false // we want to use the TS server from our node_modules folder to control its version
11 | }
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: Consume the Toulouse LS in Eclipse
4 | Bundle-SymbolicName: fr.alpesjug.lsp.eclipse;singleton:=true
5 | Bundle-Version: 1.0.0.qualifier
6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8
7 | Require-Bundle: org.eclipse.ui.genericeditor;bundle-version="1.0.0",
8 | org.eclipse.lsp4e;bundle-version="0.2.0",
9 | org.eclipse.lsp4j;bundle-version="0.2.0",
10 | org.eclipse.core.contenttype;bundle-version="3.6.0",
11 | org.eclipse.core.runtime
12 |
--------------------------------------------------------------------------------
/vscode-chamrousse/LICENSE:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2017 Mickael Istria
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
--------------------------------------------------------------------------------
/vscode-chamrousse/language-configuration.json:
--------------------------------------------------------------------------------
1 | {
2 | "comments": {
3 | "lineComment": "//",
4 | "blockComment": [ "/*", "*/" ]
5 | },
6 | "brackets": [
7 | ["{", "}"],
8 | ["[", "]"],
9 | ["(", ")"]
10 | ],
11 | "autoClosingPairs": [
12 | ["{", "}"],
13 | ["[", "]"],
14 | ["(", ")"],
15 | ["\"", "\""],
16 | ["'", "'"],
17 | { "open": "/**", "close": " */", "notIn": ["string"] }
18 | ],
19 | "surroundingPairs": [
20 | ["{", "}"],
21 | ["[", "]"],
22 | ["(", ")"],
23 | ["\"", "\""],
24 | ["'", "'"],
25 | ["<", ">"]
26 | ]
27 | }
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Le LanguageServer de Chamrousse
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/resources/org/eclipse/che/plugin/chamrousse/ide/ChamrousseLocalizationConstant.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2012-2017 Red Hat, Inc.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 | # Contributors:
9 | # Red Hat, Inc. - initial API and implementation
10 | #
11 |
12 | ##### Action #####
13 | chamrousse.action.create.file.title = Chamrousse File
14 | chamrousse.action.create.file.description = Create Chamrousse File
15 |
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | fr.alpesjug.lsp.eclipse
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.pde.ManifestBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.pde.SchemaBuilder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.pde.PluginNature
26 | org.eclipse.jdt.core.javanature
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/src/main/resources/fr/alpesjug/languageserver/chamrousseMap.properties:
--------------------------------------------------------------------------------
1 | Tsd\u0020de\u0020Casserousse.startsFrom=Olympique Hommes
2 | Tsd\u0020de\u0020Casserousse.type=TS
3 | Col\u0020de\u0020Balme.startsFrom=Olympique Hommes,TSD de Casserousse
4 | Col\u0020de\u0020Balme.type=Blue
5 | Balmette.startsFrom=Olympique Hommes,Olympique Dames,TSD de Casserousse
6 | Balmette.type=Green
7 | Olympique\u0020Hommes.starts=TC de la Croix
8 | Olympique\u0020Hommes=Black
9 | TC\u0020de\u0020la\u0020Croix.startsFrom=Col de Balme,Balmette
10 | TC\u0020de\u0020la\u0020Croix.type=TC
11 | Olympique\u0020Dames.startsFrom=TC de la Croix,Retour P2
12 | Olympique\u0020Dames.type=Red
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | # TODO: enrich language
21 | #Retour\u0020P2.startsFrom=Olympique Hommes
22 | #Retour\u0020P2.type=Blue
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/module.gwt.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.8
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
13 | org.eclipse.jdt.core.compiler.release=disabled
14 | org.eclipse.jdt.core.compiler.source=1.8
15 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/src/main/java/fr/alpesjug/languageserver/ChamrousseWorkspaceService.java:
--------------------------------------------------------------------------------
1 | package fr.alpesjug.languageserver;
2 |
3 | import java.util.List;
4 | import java.util.concurrent.CompletableFuture;
5 |
6 | import org.eclipse.lsp4j.DidChangeConfigurationParams;
7 | import org.eclipse.lsp4j.DidChangeWatchedFilesParams;
8 | import org.eclipse.lsp4j.SymbolInformation;
9 | import org.eclipse.lsp4j.WorkspaceSymbolParams;
10 | import org.eclipse.lsp4j.services.WorkspaceService;
11 |
12 | public class ChamrousseWorkspaceService implements WorkspaceService {
13 |
14 | @Override
15 | public CompletableFuture> symbol(WorkspaceSymbolParams params) {
16 | return null;
17 | }
18 |
19 | @Override
20 | public void didChangeConfiguration(DidChangeConfigurationParams params) {
21 | }
22 |
23 | @Override
24 | public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) {
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | {
3 | "version": "0.1.0",
4 | "configurations": [
5 | {
6 | "name": "Launch Extension",
7 | "type": "extensionHost",
8 | "request": "launch",
9 | "runtimeExecutable": "${execPath}",
10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--debug" ],
11 | "stopOnEntry": false,
12 | "sourceMaps": true,
13 | "outDir": "${workspaceRoot}/out/src",
14 | "preLaunchTask": "compile"
15 | },
16 | {
17 | "name": "Launch Tests",
18 | "type": "extensionHost",
19 | "request": "launch",
20 | "runtimeExecutable": "${execPath}",
21 | "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
22 | "stopOnEntry": false,
23 | "sourceMaps": true,
24 | "outDir": "${workspaceRoot}/out/test",
25 | "preLaunchTask": "compile"
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/src/fr/alpesjug/lsp/eclipse/ChamrousseLanguageServerStreamProvider.java:
--------------------------------------------------------------------------------
1 | package fr.alpesjug.lsp.eclipse;
2 |
3 | import java.io.File;
4 | import java.util.Arrays;
5 |
6 | import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider;
7 | import org.eclipse.lsp4e.server.StreamConnectionProvider;
8 |
9 | public class ChamrousseLanguageServerStreamProvider extends ProcessStreamConnectionProvider
10 | implements StreamConnectionProvider {
11 |
12 |
13 | public ChamrousseLanguageServerStreamProvider() {
14 | super(
15 | Arrays.asList("/usr/bin/java", "-jar", "/home/mistria/workspaceDemoLSP/Le LanguageServer de Chamrousse/target/chamrousse-languageserver-0.0.1-SNAPSHOT-jar-with-dependencies.jar"),
16 | new File(".").getAbsolutePath());
17 | // super(
18 | // Arrays.asList(new String[] { "docker",
19 | // "run",
20 | // "-v",
21 | // "/home/mistria:/home/mistria",
22 | // "-i",
23 | // "chamrousse-ls",
24 | // }), System.getProperty("user.dir"));
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/java/org/eclipse/che/plugin/chamrousse/ide/ChamrousseLocalizationConstant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2017 Red Hat, Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | */
11 | package org.eclipse.che.plugin.chamrousse.ide;
12 |
13 | import com.google.gwt.i18n.client.Messages;
14 |
15 | /**
16 | * Localization constants.
17 | *
18 | * @author Florent Benoit
19 | */
20 | public interface ChamrousseLocalizationConstant extends Messages {
21 | @Key("chamrousse.action.create.file.title")
22 | String createChamrousseFileActionTitle();
23 |
24 | @Key("chamrousse.action.create.file.description")
25 | String createChamrousseFileActionDescription();
26 | }
27 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/src/main/java/fr/alpesjug/languageserver/Main.java:
--------------------------------------------------------------------------------
1 | package fr.alpesjug.languageserver;
2 |
3 | import java.io.InputStream;
4 | import java.io.OutputStream;
5 | import java.util.concurrent.ExecutionException;
6 | import java.util.concurrent.Future;
7 |
8 | import org.eclipse.lsp4j.jsonrpc.Launcher;
9 | import org.eclipse.lsp4j.launch.LSPLauncher;
10 | import org.eclipse.lsp4j.services.LanguageClient;
11 |
12 | public class Main {
13 |
14 | public static void main(String[] args) throws InterruptedException, ExecutionException {
15 | startServer(System.in, System.out);
16 | }
17 |
18 | public static void startServer(InputStream in, OutputStream out) throws InterruptedException, ExecutionException {
19 | ChamrousseLanguageServer server = new ChamrousseLanguageServer();
20 | Launcher l = LSPLauncher.createServerLauncher(server, in, out);
21 | Future> startListening = l.startListening();
22 | server.setRemoteProxy(l.getRemoteProxy());
23 | startListening.get();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/java/org/eclipse/che/plugin/chamrousse/ide/ChamrousseResources.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2017 Red Hat, Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | */
11 | package org.eclipse.che.plugin.chamrousse.ide;
12 |
13 | import com.google.gwt.core.client.GWT;
14 | import com.google.gwt.resources.client.ClientBundle;
15 | import org.vectomatic.dom.svg.ui.SVGResource;
16 |
17 | /** @author Florent Benoit */
18 | public interface ChamrousseResources extends ClientBundle {
19 | ChamrousseResources INSTANCE = GWT.create(ChamrousseResources.class);
20 |
21 | @Source("svg/chamrousse.svg")
22 | SVGResource pythonFile();
23 |
24 | @Source("svg/chamrousse.svg")
25 | SVGResource category();
26 | }
27 |
--------------------------------------------------------------------------------
/vscode-chamrousse/test/index.ts:
--------------------------------------------------------------------------------
1 | //
2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
3 | //
4 | // This file is providing the test runner to use when running extension tests.
5 | // By default the test runner in use is Mocha based.
6 | //
7 | // You can provide your own test runner if you want to override it by exporting
8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension
9 | // host can call to run the tests. The test runner is expected to use console.log
10 | // to report the results back to the caller. When the tests are finished, return
11 | // a possible error to the callback or null if none.
12 |
13 | var testRunner = require('vscode/lib/testrunner');
14 |
15 | // You can directly control Mocha options by uncommenting the following lines
16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
17 | testRunner.configure({
18 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
19 | useColors: true // colored output from test results
20 | });
21 |
22 | module.exports = testRunner;
--------------------------------------------------------------------------------
/fr.alpesjug.lsp.eclipse/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
12 |
13 |
14 |
16 |
20 |
21 |
24 |
25 |
26 |
28 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 | 4.0.0
16 |
17 | che-plugin-parent
18 | org.eclipse.che.plugin
19 | 6.0.0-M5-SNAPSHOT
20 | ../pom.xml
21 |
22 | che-plugin-chamrousse-parent
23 | pom
24 | Che Plugin :: Chamrousse :: Parent
25 |
26 | che-plugin-chamrousse-lang-server
27 | che-plugin-chamrousse-lang-ide
28 |
29 |
30 |
--------------------------------------------------------------------------------
/eclipse-che/README.md:
--------------------------------------------------------------------------------
1 | ## build workspace image
2 |
3 | ```
4 | $ cd chamrousse-workspace-image
5 | $ mvn clean install
6 | ```
7 |
8 | it will build local docker image
9 |
10 | ```
11 | [INFO] DOCKER> [florentbenoit/chamrousse:latest]: Created docker-build.tar in 65 milliseconds
12 | [INFO] DOCKER> [florentbenoit/chamrousse:latest]: Built image sha256:a48db
13 | ```
14 |
15 | ## Start Eclipse Che
16 | Then we can start Eclipse Che with script start-che.sh
17 | the script includes parameter CHE_DOCKER_ALWAYS__PULL__IMAGE="false" to not try to pull image from dockerhub at each start (helpful if internet access is down)
18 |
19 | ## Build stack
20 | Once che is started and available at http://localhost:8080 we add the chamrousse stack from http://localhost:8080/dashboard/#/stacks
21 |
22 | "Build stack from recipe"
23 |
24 | we select `docker image` tab and enter `florentbenoit/chamrousse`
25 |
26 | we pickup a name like "A chamrousse stack" and save
27 |
28 | ## Create and start workspace
29 | From http://localhost:8080/dashboard/#/workspaces
30 | Select `Add workspace` and pickup "A chamrousse stack` from the list
31 |
32 | ## Create a project
33 | Once workspace is booted
34 | Create a project with menu "Workspace/Create project..."
35 | Select blank type and enter project name like "Chamrousse"
36 |
37 | ## Create a file
38 | Right click on "chamrousse" project and select "New..." and "Chamrousse File"
39 |
40 | pickup dummy name like example
41 | Use ctrl+tab in the ski file and there is code assist
42 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/java/org/eclipse/che/plugin/chamrousse/ide/inject/ChamrousseGinModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2017 Red Hat, Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | */
11 | package org.eclipse.che.plugin.chamrousse.ide.inject;
12 |
13 | import com.google.gwt.inject.client.AbstractGinModule;
14 | import com.google.gwt.inject.client.multibindings.GinMultibinder;
15 | import com.google.inject.Provides;
16 | import com.google.inject.Singleton;
17 | import com.google.inject.name.Named;
18 | import org.eclipse.che.ide.api.extension.ExtensionGinModule;
19 | import org.eclipse.che.ide.api.filetypes.FileType;
20 | import org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar;
21 | import org.eclipse.che.plugin.chamrousse.ide.ChamrousseResources;
22 |
23 | /** @author Florent Benoit */
24 | @ExtensionGinModule
25 | public class ChamrousseGinModule extends AbstractGinModule {
26 |
27 | @Override
28 | protected void configure() {
29 | GinMultibinder.newSetBinder(binder(), ProjectWizardRegistrar.class)
30 | .addBinding()
31 | .to(org.eclipse.che.plugin.chamrousse.ide.project.ChamrousseProjectWizardRegistrar.class);
32 | }
33 |
34 | @Provides
35 | @Singleton
36 | @Named("ChamrousseFileType")
37 | protected FileType providePythonFile() {
38 | return new FileType(ChamrousseResources.INSTANCE.pythonFile(), "ski");
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/java/org/eclipse/che/plugin/chamrousse/ide/project/ChamrousseProjectWizardRegistrar.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2017 Red Hat, Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | */
11 | package org.eclipse.che.plugin.chamrousse.ide.project;
12 |
13 | import com.google.inject.Provider;
14 | import java.util.ArrayList;
15 | import java.util.List;
16 | import javax.validation.constraints.NotNull;
17 | import org.eclipse.che.ide.api.project.MutableProjectConfig;
18 | import org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar;
19 | import org.eclipse.che.ide.api.wizard.WizardPage;
20 |
21 | /**
22 | * Provides information for registering Python project type into project wizard.
23 | *
24 | * @author Florent Benoit
25 | */
26 | public class ChamrousseProjectWizardRegistrar implements ProjectWizardRegistrar {
27 | private final List>> wizardPages;
28 |
29 | public ChamrousseProjectWizardRegistrar() {
30 | wizardPages = new ArrayList<>();
31 | }
32 |
33 | @NotNull
34 | public String getProjectTypeId() {
35 | return "chamrousse";
36 | }
37 |
38 | @NotNull
39 | public String getCategory() {
40 | return "chamrousse";
41 | }
42 |
43 | @NotNull
44 | public List>> getWizardPages() {
45 | return wizardPages;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/vscode-chamrousse/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vscode-chamrousse",
3 | "displayName": "Language Support for Chamrousse",
4 | "description": "Language Support for Chamrousse",
5 | "author": "Mickael Istria",
6 | "icon": "icons/icon128.png",
7 | "license": "WTFPL",
8 | "version": "0.0.1",
9 | "preview": true,
10 | "publisher": "Mickael Istria",
11 | "engines": {
12 | "vscode": "^1.7.0"
13 | },
14 | "repository": {
15 |
16 | },
17 | "categories": [
18 | "Languages",
19 | "Linters"
20 | ],
21 | "activationEvents": [
22 | "onLanguage:ski",
23 | "workspaceContains:*.ski"
24 | ],
25 | "main": "./out/src/extension",
26 | "contributes": {
27 | "languages": [{
28 | "id": "ski",
29 | "extensions": [ ".ski" ],
30 | "configuration": "./language-configuration.json"
31 | }]
32 | },
33 | "scripts": {
34 | "vscode:prepublish": "tsc -p ./",
35 | "compile": "tsc -watch -p ./",
36 | "postinstall": "node ./node_modules/vscode/bin/install",
37 | "test": "node ./node_modules/vscode/bin/test",
38 | "tslint": "gulp tslint"
39 | },
40 | "devDependencies": {
41 | "typescript": "^2.0.3",
42 | "vscode": "^1.0.0",
43 | "mocha": "^2.3.3",
44 | "@types/node": "^6.0.40",
45 | "@types/mocha": "^2.2.32",
46 | "@types/glob":"5.0.30",
47 | "gulp" :"^3.9.1",
48 | "gulp-tslint": "^6.1.2",
49 | "tslint" : "^3.15.1"
50 | },
51 | "dependencies": {
52 | "vscode-languageclient": "^2.6.3",
53 | "find-java-home": "0.1.4",
54 | "http-proxy-agent": "^1.0.0",
55 | "https-proxy-agent": "^1.0.0",
56 | "tmp" : "^0.0.29",
57 | "decompress": "^4.0.0",
58 | "progress-stream": "^1.2.0",
59 | "path-exists":"^3.0.0",
60 | "expand-home-dir":"^0.0.3",
61 | "glob":"^7.1.1"
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/vscode-chamrousse/src/protocol.ts:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import { RequestType, NotificationType, TextDocumentIdentifier} from 'vscode-languageclient';
4 | import { Command } from 'vscode';
5 |
6 | /**
7 | * The message type. Copied from vscode protocol
8 | */
9 | export enum MessageType {
10 | /**
11 | * An error message.
12 | */
13 | Error = 1,
14 | /**
15 | * A warning message.
16 | */
17 | Warning = 2,
18 | /**
19 | * An information message.
20 | */
21 | Info = 3,
22 | /**
23 | * A log message.
24 | */
25 | Log = 4,
26 | }
27 |
28 | /**
29 | * A functionality status
30 | */
31 | export enum FeatureStatus {
32 | /**
33 | * Disabled.
34 | */
35 | disabled = 0,
36 | /**
37 | * Enabled manually.
38 | */
39 | interactive = 1,
40 | /**
41 | * Enabled automatically.
42 | */
43 | automatic = 2,
44 | }
45 |
46 | export interface StatusReport {
47 | message: string;
48 | type: string;
49 | }
50 |
51 | export interface ActionableMessage {
52 | severity: MessageType;
53 | message: string;
54 | data?: any;
55 | commands?: Command[];
56 | }
57 |
58 | export namespace StatusNotification {
59 | export const type: NotificationType = { get method() { return 'language/status'; } };
60 | }
61 |
62 | export namespace ClassFileContentsRequest {
63 | export const type: RequestType = { get method() { return 'java/classFileContents'; }};
64 | }
65 |
66 | export namespace ProjectConfigurationUpdateRequest {
67 | export const type: NotificationType = { get method() { return 'java/projectConfigurationUpdate'; }};
68 | }
69 |
70 | export namespace ActionableNotification {
71 | export const type: NotificationType = { get method() { return 'language/actionableNotification'; }};
72 | }
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-server/src/main/java/org/eclipse/che/plugin/chamrousse/inject/ChamrousseModule.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2012-2017 Codenvy, S.A.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Codenvy, S.A. - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipse.che.plugin.chamrousse.inject;
12 |
13 | import static java.util.Arrays.asList;
14 |
15 | import com.google.inject.AbstractModule;
16 | import com.google.inject.multibindings.Multibinder;
17 | import org.eclipse.che.api.languageserver.launcher.LanguageServerLauncher;
18 | import org.eclipse.che.api.languageserver.shared.model.LanguageDescription;
19 | import org.eclipse.che.inject.DynaModule;
20 | import org.eclipse.che.plugin.chamrousse.languageserver.ChamrousseLanguageServerLauncher;
21 |
22 | /**
23 | * @author Florent Benoit
24 | */
25 | @DynaModule
26 | public class ChamrousseModule extends AbstractModule {
27 |
28 | public static final String LANGUAGE_ID = "chamrousse";
29 | private static final String[] EXTENSIONS = new String[] {"tls", "gnb", "ski"};
30 | private static final String MIME_TYPE = "text/x-chamroussse";
31 |
32 |
33 | @Override
34 | protected void configure() {
35 |
36 | Multibinder.newSetBinder(binder(), LanguageServerLauncher.class).addBinding().to(ChamrousseLanguageServerLauncher.class);
37 |
38 |
39 | LanguageDescription description = new LanguageDescription();
40 | description.setFileExtensions(asList(EXTENSIONS));
41 | description.setLanguageId(LANGUAGE_ID);
42 | description.setMimeType(MIME_TYPE);
43 | Multibinder.newSetBinder(binder(), LanguageDescription.class)
44 | .addBinding()
45 | .toInstance(description);
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | fr.alpesjug
4 | chamrousse-languageserver
5 | 0.0.1-SNAPSHOT
6 | Demo d'un Language Server (code en Java) pour les Grenoblois
7 |
8 |
9 | org.eclipse.lsp4j
10 | org.eclipse.lsp4j
11 | 0.6.0
12 |
13 |
14 | org.eclipse.lsp4j
15 | org.eclipse.lsp4j.jsonrpc
16 | 0.6.0
17 |
18 |
19 | junit
20 | junit
21 | 4.11
22 | test
23 |
24 |
25 | commons-io
26 | commons-io
27 | 2.6
28 |
29 |
30 |
31 |
32 | 1.8
33 | 1.8
34 |
35 |
36 |
37 |
38 |
39 | maven-assembly-plugin
40 |
41 |
42 | make-assembly
43 | package
44 |
45 | single
46 |
47 |
48 |
49 |
50 | fr.alpesjug.languageserver.Main
51 |
52 |
53 |
54 | jar-with-dependencies
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/vscode-chamrousse/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | // Available variables which can be used inside of strings.
2 | // ${workspaceRoot}: the root folder of the team
3 | // ${file}: the current opened file
4 | // ${fileBasename}: the current opened file's basename
5 | // ${fileDirname}: the current opened file's dirname
6 | // ${fileExtname}: the current opened file's extension
7 | // ${cwd}: the current working directory of the spawned process
8 | // A task runner that calls a custom npm script that compiles the extension.
9 | {
10 | "version": "0.1.0",
11 | // we want to run npm
12 | "command": "npm",
13 | // the command is a shell script
14 | "isShellCommand": true,
15 | // show the output window only if unrecognized errors occur.
16 | "showOutput": "silent",
17 | "suppressTaskName": true,
18 | "tasks": [
19 | {
20 | "taskName": "compile",
21 | // we run the custom script "compile" as defined in package.json
22 | "args": [
23 | "run",
24 | "compile",
25 | "--loglevel",
26 | "silent"
27 | ],
28 | // The tsc compiler is started in watching mode
29 | "isWatching": true,
30 | // use the standard tsc in watch mode problem matcher to find compile problems in the output.
31 | "problemMatcher": "$tsc-watch",
32 | "isBuildCommand": true
33 | },
34 | {
35 | "taskName": "test",
36 | "args": [
37 | "run",
38 | "test"
39 | ],
40 | "isTestCommand": true
41 | },
42 | {
43 | "taskName": "build-server",
44 | // we run the custom script "compile" as defined in package.json
45 | "args": [
46 | "run",
47 | "build-server",
48 | "--loglevel",
49 | "silent"
50 | ],
51 | // The tsc compiler is started in watching mode
52 | "isWatching": false
53 | },
54 | {
55 | "taskName": "tslint",
56 | "args": [
57 | "run",
58 | "tslint"
59 | ],
60 | "problemMatcher": {
61 | "owner": "tslint",
62 | "fileLocation": [
63 | "relative",
64 | "${workspaceRoot}"
65 | ],
66 | "severity": "warning",
67 | "pattern": {
68 | "regexp": "^(\\S.*)\\[(\\d+), (\\d+)\\]:\\s+(.*)$",
69 | "file": 1,
70 | "line": 2,
71 | "column": 3,
72 | "message": 4
73 | }
74 | }
75 | }
76 | ]
77 | }
--------------------------------------------------------------------------------
/eclipse-che/plugin-chamrousse/che-plugin-chamrousse-lang-ide/src/main/java/org/eclipse/che/plugin/chamrousse/ide/ChamrousseExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2017 Red Hat, Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | */
11 | package org.eclipse.che.plugin.chamrousse.ide;
12 |
13 | import static org.eclipse.che.ide.api.action.IdeActions.GROUP_FILE_NEW;
14 | import static org.eclipse.che.plugin.python.shared.ProjectAttributes.PYTHON_CATEGORY;
15 |
16 | import com.google.inject.Inject;
17 | import com.google.inject.name.Named;
18 | import org.eclipse.che.ide.api.action.ActionManager;
19 | import org.eclipse.che.ide.api.action.DefaultActionGroup;
20 | import org.eclipse.che.ide.api.constraints.Constraints;
21 | import org.eclipse.che.ide.api.extension.Extension;
22 | import org.eclipse.che.ide.api.filetypes.FileType;
23 | import org.eclipse.che.ide.api.filetypes.FileTypeRegistry;
24 | import org.eclipse.che.ide.api.icon.Icon;
25 | import org.eclipse.che.ide.api.icon.IconRegistry;
26 | import org.eclipse.che.plugin.chamrousse.ide.action.CreateChamrousseFileAction;
27 |
28 | /**
29 | * Chamrousse extension entry point.
30 | *
31 | * @author Florent Benoit
32 | */
33 | @Extension(title = "Chamrousse")
34 | public class ChamrousseExtension {
35 | @Inject
36 | public ChamrousseExtension(
37 | FileTypeRegistry fileTypeRegistry,
38 | CreateChamrousseFileAction createChamrousseFileAction,
39 | ActionManager actionManager,
40 | org.eclipse.che.plugin.chamrousse.ide.ChamrousseResources chamrousseResources,
41 | IconRegistry iconRegistry,
42 | @Named("ChamrousseFileType") FileType chamrousseFile) {
43 | fileTypeRegistry.registerFileType(chamrousseFile);
44 |
45 | DefaultActionGroup newGroup = (DefaultActionGroup) actionManager.getAction(GROUP_FILE_NEW);
46 | actionManager.registerAction("chamrousseFile", createChamrousseFileAction);
47 | newGroup.add(createChamrousseFileAction, Constraints.FIRST);
48 |
49 | iconRegistry.registerIcon(
50 | new Icon(PYTHON_CATEGORY + ".samples.category.icon", chamrousseResources.category()));
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Le LanguageServer de Chamrousse/src/main/java/fr/alpesjug/languageserver/ChamrousseLanguageServer.java:
--------------------------------------------------------------------------------
1 | package fr.alpesjug.languageserver;
2 |
3 | import java.util.Collections;
4 | import java.util.concurrent.CompletableFuture;
5 |
6 | import org.eclipse.lsp4j.CodeActionOptions;
7 | import org.eclipse.lsp4j.CodeLensOptions;
8 | import org.eclipse.lsp4j.CompletionOptions;
9 | import org.eclipse.lsp4j.InitializeParams;
10 | import org.eclipse.lsp4j.InitializeResult;
11 | import org.eclipse.lsp4j.ServerCapabilities;
12 | import org.eclipse.lsp4j.TextDocumentSyncKind;
13 | import org.eclipse.lsp4j.services.LanguageClient;
14 | import org.eclipse.lsp4j.services.LanguageServer;
15 | import org.eclipse.lsp4j.services.TextDocumentService;
16 | import org.eclipse.lsp4j.services.WorkspaceService;
17 |
18 | public class ChamrousseLanguageServer implements LanguageServer {
19 |
20 | private TextDocumentService textService;
21 | private WorkspaceService workspaceService;
22 | LanguageClient client;
23 |
24 | public ChamrousseLanguageServer() {
25 | textService = new ChamrousseTextDocumentService(this);
26 | workspaceService = new ChamrousseWorkspaceService();
27 | }
28 |
29 | public CompletableFuture initialize(InitializeParams params) {
30 | final InitializeResult res = new InitializeResult(new ServerCapabilities());
31 | res.getCapabilities().setCodeActionProvider(new CodeActionOptions());
32 | res.getCapabilities().setCompletionProvider(new CompletionOptions(false, ChamrousseMap.INSTANCE.getAllPossibleChars()));
33 | res.getCapabilities().setDefinitionProvider(Boolean.TRUE);
34 | res.getCapabilities().setHoverProvider(Boolean.TRUE);
35 | res.getCapabilities().setReferencesProvider(Boolean.TRUE);
36 | res.getCapabilities().setTextDocumentSync(TextDocumentSyncKind.Full);
37 | res.getCapabilities().setDocumentSymbolProvider(Boolean.TRUE);
38 | res.getCapabilities().setCodeLensProvider(new CodeLensOptions(true));
39 |
40 | return CompletableFuture.completedFuture(res);
41 | }
42 |
43 | public CompletableFuture