diff --git a/.dockerignore b/.dockerignore index 7f41b2fcf..3c3629e64 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,10 +1 @@ -## Linked packages are problematic during build, npm i during start will fix it -#node_modules/@typefox/monaco-editor-react -#node_modules/example-client-vite -#node_modules/example-client-webpack -#node_modules/monaco-languageclient -#node_modules/monaco-editor-wrapper -#node_modules/monaco-languageclient-examples -#node_modules/vscode-ws-jsonrpc - node_modules diff --git a/.vscode/settings.json b/.vscode/settings.json index 50ee1ba88..c4458aa22 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,5 +20,4 @@ "[json]": { "editor.defaultFormatter": "vscode.json-language-features" } - } diff --git a/index.html b/index.html index ec7d56a94..b55d8fefd 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@

Python

Please execute npm run start:example:server:python beforehand:
Python Language Client & Pyright Language Server (Web Socket)
-

Java

+

Java / Eclipse JDS LS

Requires docker. Please execute docker compose -f ./packages/examples/resources/eclipse.jdt.ls/docker-compose.yml up -d beforehand:
Java Language Client & Language Server (Web Socket)
diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 1f08a6923..1d8cd34e0 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this npm module are documented in this file. ## [8.7.0] - 2024-07-1x -- Update to latest monaco-vscode-api [#7xx](https://github.com/TypeFox/monaco-languageclient/pull/7xx) +- Update to latest monaco-vscode-api [#707](https://github.com/TypeFox/monaco-languageclient/pull/7xx) - Updated to version `7.0.3` of `@codingame/monaco-vscode` packages ## [8.6.0] - 2024-06-29 diff --git a/packages/examples/CHANGELOG.md b/packages/examples/CHANGELOG.md index 057947a7b..ef9894c9d 100644 --- a/packages/examples/CHANGELOG.md +++ b/packages/examples/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this npm module are documented in this file. ## [2024.7.3] - 2024-07-1x -- Update to latest monaco-vscode-api [#7xx](https://github.com/TypeFox/monaco-languageclient/pull/7xx) +- Update to latest monaco-vscode-api [#707](https://github.com/TypeFox/monaco-languageclient/pull/707) - Updated to `monaco-languageclient@8.7.0`, `monaco-editor-wrapper@5.4.0` and `@typefox/monaco-editor-react@4.4.0`. Updated all `@codingame/monaco-vscode` packages to `7.0.3`. ## [2024.7.2] - 2024-07-02 diff --git a/packages/examples/package.json b/packages/examples/package.json index 4add6a7c9..1aba0f563 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -117,9 +117,9 @@ "build:msg": "echo Building main examples:", "build": "npm run build:msg && npm run clean && npm run resources:download && npm run compile", "build:bundle": "vite --config vite.bundle.config.ts build", - "start:server:json": "node --loader ts-node/esm src/json/server/direct.ts", - "start:server:python": "node --loader ts-node/esm src/python/server/direct.ts", - "start:server:groovy": "node --watch --loader ts-node/esm src/groovy/server/direct.ts", + "start:server:json": "vite-node src/json/server/direct.ts", + "start:server:python": "vite-node src/python/server/direct.ts", + "start:server:groovy": "vite-node src/groovy/server/direct.ts", "start:server:jdtls": "vite-node src/eclipse.jdt.ls/server/direct.ts", "langium:generate": "langium generate --file ./src/langium/statemachine/config/langium-config.json" } diff --git a/packages/examples/resources/eclipse.jdt.ls/Dockerfile b/packages/examples/resources/eclipse.jdt.ls/Dockerfile index 56619701d..10b3c39c8 100644 --- a/packages/examples/resources/eclipse.jdt.ls/Dockerfile +++ b/packages/examples/resources/eclipse.jdt.ls/Dockerfile @@ -1,7 +1,7 @@ FROM eclipse-temurin:17-jdk -ARG MLC_PATH=/home/mlc -ARG ECLIPSE_JDT_PATH=${MLC_PATH}/packages/examples/resources/eclipse.jdt.ls/ls +ARG PATH_MLC=/home/mlc +ARG PATH_ECLIPSE_JDT=${PATH_MLC}/packages/examples/resources/eclipse.jdt.ls/ls ARG JDT_TAR_URL=https://download.eclipse.org/jdtls/milestones/1.37.0/jdt-language-server-1.37.0-202406271335.tar.gz ARG JDT_TAR_LOCAL=eclipse.jdt.ls.tar.gz @@ -15,15 +15,18 @@ ENV VOLTA_HOME "/root/.volta" ENV PATH "$VOLTA_HOME/bin:$PATH" RUN volta install node@20 -RUN mkdir -p ${MLC_PATH} +# prepare +RUN mkdir -p ${PATH_MLC} -COPY ./ ${MLC_PATH} +# copy repo content +COPY ./ ${PATH_MLC} -RUN mkdir -p ${ECLIPSE_JDT_PATH} \ - && cd ${ECLIPSE_JDT_PATH} \ +# download and extract Eclipse JDT LS in target folder +RUN mkdir -p ${PATH_ECLIPSE_JDT} \ + && cd ${PATH_ECLIPSE_JDT} \ && wget -O ${JDT_TAR_LOCAL} ${JDT_TAR_URL} \ && tar -xzf ${JDT_TAR_LOCAL} -WORKDIR ${MLC_PATH} +WORKDIR ${PATH_MLC} CMD ["/bin/bash", "npm i && npm run start:example:server:jdtls"] diff --git a/packages/examples/resources/eclipse.jdt.ls/docker-compose.yml b/packages/examples/resources/eclipse.jdt.ls/docker-compose.yml index b1fad8c19..22f451e33 100644 --- a/packages/examples/resources/eclipse.jdt.ls/docker-compose.yml +++ b/packages/examples/resources/eclipse.jdt.ls/docker-compose.yml @@ -4,7 +4,7 @@ services: dockerfile: ./packages/examples/resources/eclipse.jdt.ls/Dockerfile context: ../../../.. environment: - - MLC_PATH=/home/mlc + - PATH_MLC=/home/mlc - JDT_TAR_URL=https://download.eclipse.org/jdtls/milestones/1.37.0/jdt-language-server-1.37.0-202406271335.tar.gz - JDT_TAR_LOCAL=eclipse.jdt.ls.tar.gz command: [ diff --git a/packages/examples/resources/groovy/Dockerfile b/packages/examples/resources/groovy/Dockerfile index 9bfac6f74..9b674c905 100644 --- a/packages/examples/resources/groovy/Dockerfile +++ b/packages/examples/resources/groovy/Dockerfile @@ -1,10 +1,13 @@ FROM gradle:7-jdk17-focal -ARG MLC_PATH=/home/gradle/mlc +ARG HOME_DIR=/home/gradle +ARG PATH_MLC=${HOME_DIR}/mlc +ARG PATH_GLS=${HOME_DIR}/groovy-language-server +ARG PATH_GROOVY_JAR=${PATH_MLC}/packages/examples/resources/groovy/lib RUN apt update \ - && apt upgrade -y \ - && apt install -y ca-certificates curl gnupg unzip + && apt upgrade -y +RUN apt install -y curl RUN curl https://get.volta.sh | bash ENV VOLTA_FEATURE_PNPM=1 @@ -12,13 +15,24 @@ ENV VOLTA_HOME "/root/.volta" ENV PATH "$VOLTA_HOME/bin:$PATH" RUN volta install node@20 -RUN git clone https://github.com/GroovyLanguageServer/groovy-language-server \ - && cd groovy-language-server \ +# prepare +RUN cd ${HOME_DIR} \ + && mkdir -p ${PATH_MLC} + +# build groovy language server +RUN cd ${HOME_DIR} \ + && git clone https://github.com/GroovyLanguageServer/groovy-language-server \ + && cd ${PATH_GLS} \ && ./gradlew build \ - && cd .. + && cd ${HOME_DIR} + +# copy repo content +COPY ./ ${PATH_MLC} -RUN mkdir -p ${MLC_PATH} +# copy language server to target +RUN mkdir -p ${PATH_GROOVY_JAR} \ + && cp ${PATH_GLS}/build/libs/groovy-language-server-all.jar ${PATH_GROOVY_JAR} -COPY ./ ${MLC_PATH} +WORKDIR ${PATH_MLC} -WORKDIR ${MLC_PATH} +CMD ["/bin/bash", "npm i && npm run start:example:server:groovy"] diff --git a/packages/examples/resources/groovy/docker-compose.yml b/packages/examples/resources/groovy/docker-compose.yml index 6c1cc5e9b..53a1a75e9 100644 --- a/packages/examples/resources/groovy/docker-compose.yml +++ b/packages/examples/resources/groovy/docker-compose.yml @@ -4,7 +4,10 @@ services: dockerfile: ./packages/examples/resources/groovy/Dockerfile context: ../../../.. environment: - - LANG_SERVER_JAR_PATH=/home/gradle/groovy-language-server/build/libs/groovy-language-server-all.jar + - HOME_DIR=/home/gradle + - PATH_MLC=/home/gradle/mlc + - PATH_GLS=/home/gradle/groovy-language-server + - PATH_GROOVY_JAR=/home/gradle/mlc/packages/examples/resources/groovy/lib command: [ "bash", "-c", "npm i && npm run start:example:server:groovy" ] diff --git a/packages/examples/src/eclipse.jdt.ls/client/main.ts b/packages/examples/src/eclipse.jdt.ls/client/main.ts index 3ebc7c367..8c4bcb388 100644 --- a/packages/examples/src/eclipse.jdt.ls/client/main.ts +++ b/packages/examples/src/eclipse.jdt.ls/client/main.ts @@ -47,7 +47,8 @@ export const runEclipseJdtLsClient = () => { userConfiguration: { json: JSON.stringify({ 'workbench.colorTheme': 'Default Dark Modern', - 'editor.guides.bracketPairsHorizontal': 'active' + 'editor.guides.bracketPairsHorizontal': 'active', + 'editor.wordBasedSuggestions': 'off' }) } } diff --git a/packages/examples/src/groovy/client/main.ts b/packages/examples/src/groovy/client/main.ts index 932a000e0..d5618b8e4 100644 --- a/packages/examples/src/groovy/client/main.ts +++ b/packages/examples/src/groovy/client/main.ts @@ -44,7 +44,8 @@ const userConfig: UserConfig = { userConfiguration: { json: JSON.stringify({ 'workbench.colorTheme': 'Default Dark Modern', - 'editor.guides.bracketPairsHorizontal': 'active' + 'editor.guides.bracketPairsHorizontal': 'active', + 'editor.wordBasedSuggestions': 'off' }) } } diff --git a/packages/examples/src/groovy/config.ts b/packages/examples/src/groovy/config.ts index 1a4c35934..e63344733 100644 --- a/packages/examples/src/groovy/config.ts +++ b/packages/examples/src/groovy/config.ts @@ -4,5 +4,6 @@ * ------------------------------------------------------------------------------------------ */ export const groovyConfig = { port: 30002, - path: '/groovy' + path: '/groovy', + basePath: '/home/gradle/mlc/packages/examples/resources/groovy' }; diff --git a/packages/examples/src/groovy/server/README.md b/packages/examples/src/groovy/server/README.md deleted file mode 100644 index 85b07c638..000000000 --- a/packages/examples/src/groovy/server/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Groovy Language Server self-built instructions - -## Preperation - -In another directory run (Requires Gradle 7 and OpenJDK 17) - -```shell -git clone https://github.com/GroovyLanguageServer/groovy-language-server -./gradlew build -``` - -Afterwards copy the jar file from from `groovy-language-server/build/libs/groovy-language-server-all.jar` to `packages/examples/resources/external/groovy`. - -From the root of this repository run: - -```shell -# start the express server with the language server running as external Java process. -npm run start:example:server:groovy -``` diff --git a/packages/examples/src/groovy/server/direct.ts b/packages/examples/src/groovy/server/direct.ts index 656da8bd8..afb2be45f 100644 --- a/packages/examples/src/groovy/server/direct.ts +++ b/packages/examples/src/groovy/server/direct.ts @@ -3,16 +3,6 @@ * Licensed under the MIT License. See LICENSE in the package root for license information. * ------------------------------------------------------------------------------------------ */ -import { resolve } from 'node:path'; import { runGroovyLanguageServer } from './main.js'; -import { getLocalDirectory } from '../../common/node/server-commons.js'; -const baseDir = resolve(getLocalDirectory(import.meta.url)); -const groovyJar = resolve(baseDir, '../../../resources/groovy/external/groovy-language-server-all.jar'); -const relativeDir = process.env.LANG_SERVER_JAR_PATH ?? groovyJar; -console.log(`basedir: ${baseDir}`); -console.log(`groovyJar: ${groovyJar}`); -console.log(`LANG_SERVER_JAR_PATH: ${process.env.LANG_SERVER_JAR_PATH}`); -console.log(`relativeDir: ${relativeDir}`); - -runGroovyLanguageServer(baseDir, relativeDir); +runGroovyLanguageServer(); diff --git a/packages/examples/src/groovy/server/main.ts b/packages/examples/src/groovy/server/main.ts index a880aa090..247715f1f 100644 --- a/packages/examples/src/groovy/server/main.ts +++ b/packages/examples/src/groovy/server/main.ts @@ -3,13 +3,11 @@ * Licensed under the MIT License. See LICENSE in the package root for license information. * ------------------------------------------------------------------------------------------ */ -import { resolve } from 'node:path'; import { runLanguageServer } from '../../common/node/language-server-runner.js'; import { LanguageName } from '../../common/node/server-commons.js'; import { groovyConfig } from '../config.js'; -export const runGroovyLanguageServer = (baseDir: string, relativeDir: string) => { - const processRunPath = resolve(baseDir, relativeDir); +export const runGroovyLanguageServer = () => { runLanguageServer({ serverName: 'GROOVY', pathName: groovyConfig.path, @@ -17,7 +15,7 @@ export const runGroovyLanguageServer = (baseDir: string, relativeDir: string) => runCommand: LanguageName.java, runCommandArgs: [ '-jar', - processRunPath + `${groovyConfig.basePath}/lib/groovy-language-server-all.jar` ], wsServerOptions: { noServer: true, diff --git a/packages/examples/src/json/client/wrapperWs.ts b/packages/examples/src/json/client/wrapperWs.ts index 0018cff57..a61c74d33 100644 --- a/packages/examples/src/json/client/wrapperWs.ts +++ b/packages/examples/src/json/client/wrapperWs.ts @@ -45,7 +45,8 @@ export const jsonClientUserConfig: UserConfig = { json: JSON.stringify({ 'workbench.colorTheme': 'Default Dark Modern', 'editor.guides.bracketPairsHorizontal': 'active', - 'editor.lightbulb.enabled': 'On' + 'editor.lightbulb.enabled': 'On', + 'editor.wordBasedSuggestions': 'off' }) } } diff --git a/packages/examples/src/python/client/config.ts b/packages/examples/src/python/client/config.ts index 2cbee70a8..cdb670e5a 100644 --- a/packages/examples/src/python/client/config.ts +++ b/packages/examples/src/python/client/config.ts @@ -65,7 +65,9 @@ export const createUserConfig = (workspaceRoot: string, code: string, codeUri: s }, userConfiguration: { json: JSON.stringify({ - 'workbench.colorTheme': 'Default Dark Modern' + 'workbench.colorTheme': 'Default Dark Modern', + 'editor.guides.bracketPairsHorizontal': 'active', + 'editor.wordBasedSuggestions': 'off' }) }, useDiffEditor: false diff --git a/packages/wrapper-react/CHANGELOG.md b/packages/wrapper-react/CHANGELOG.md index 614c90017..5385e3106 100644 --- a/packages/wrapper-react/CHANGELOG.md +++ b/packages/wrapper-react/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to npm module [@typefox/monaco-editor-react](https://www.npm ## [4.4.0] - 2024-07-1x -- Update to latest monaco-vscode-api [#7xx](https://github.com/TypeFox/monaco-languageclient/pull/7xx) +- Update to latest monaco-vscode-api [#707](https://github.com/TypeFox/monaco-languageclient/pull/707) - Updated to `monaco-editor-wrapper@5.4.0`, `monaco-languageclient@8.7.0` and version `7.0.3` of `@codingame/monaco-vscode` packages ## [4.3.2] - 2024-07-02 diff --git a/packages/wrapper/CHANGELOG.md b/packages/wrapper/CHANGELOG.md index 06f40f484..45c1ea9d2 100644 --- a/packages/wrapper/CHANGELOG.md +++ b/packages/wrapper/CHANGELOG.md @@ -4,8 +4,10 @@ All notable changes to npm module [monaco-editor-wrapper](https://www.npmjs.com/ ## [5.4.0] - 2024-07-1x -- Update to latest monaco-vscode-api [#7xx](https://github.com/TypeFox/monaco-languageclient/pull/7x) +- Update to latest monaco-vscode-api [#707](https://github.com/TypeFox/monaco-languageclient/pull/707) - Updated to `monaco-languageclient@8.7.0`, `7.0.3` of `@codingame/monaco-vscode` packages +- Add Eclipse JDT Language Server example [#708](https://github.com/TypeFox/monaco-languageclient/pull/708) + - Harmonize the Groovy Language Server configuration and execution, both are container based ## [5.3.1] - 2024-07-02