From dddc57400b0e8d093f144da297ca4a8b92e3679f Mon Sep 17 00:00:00 2001 From: azerr Date: Fri, 21 Feb 2020 09:26:04 +0100 Subject: [PATCH] Use lemmninx. Signed-off-by: azerr --- CONTRIBUTING.md | 6 +++--- Jenkinsfile | 8 ++++---- README.md | 8 ++++---- gulpfile.js | 6 +++--- package.json | 2 +- src/extension.ts | 4 ++-- src/javaServerStarter.ts | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb2ffd93..a4551ee9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,18 +14,18 @@ Contributions are essential for keeping this extension great. We try to keep it ### Steps 1. Fork and clone this repository -2. Fork and clone the [XML Language Server (lsp4xml)](https://github.com/angelozerr/lsp4xml) +2. Fork and clone the [LemMinX - XML Language Server ](https://github.com/eclipse/lemminx) * **Note:** The directory format has to match the following: ``` YOUR_FOLDER/ - ├──── lsp4xml/ + ├──── lemminx/ │ ├──── vscode-xml/ ``` -3. `cd lsp4xml/` +3. `cd lemminx/` 4. Install the maven dependencies Mac/Linux: ```bash diff --git a/Jenkinsfile b/Jenkinsfile index 574371b5..b7aeb022 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,10 +14,10 @@ def buildVscodeExtension(){ node('rhel7'){ stage 'Build XML LS' - git url: 'https://github.com/angelozerr/lsp4xml.git' - sh "./mvnw clean verify -B -U -e -pl \"!extensions,!extensions/org.eclipse.lsp4xml.extensions.emmet,!extensions/org.eclipse.lsp4xml.extensions.web\" -P!jboss-maven-repos,!redhat-ga-repository,!redhat-ea-repository" + git url: 'https://github.com/eclipse/lemminx.git' + sh "./mvnw clean verify -B -U -e -pl \"!extensions,!extensions/org.eclipse.lemminx.extensions.emmet,!extensions/org.eclipse.lemminx.extensions.web\" -P!jboss-maven-repos,!redhat-ga-repository,!redhat-ea-repository" - def files = findFiles(glob: '**/org.eclipse.lsp4xml/target/org.eclipse.lsp4xml-uber.jar') + def files = findFiles(glob: '**/org.eclipse.lemminx/target/org.eclipse.lemminx-uber.jar') stash name: 'server_distro', includes :files[0].path } @@ -34,7 +34,7 @@ node('rhel7'){ stage 'Build vscode-xml' buildVscodeExtension() unstash 'server_distro' - def files = findFiles(glob: '**/org.eclipse.lsp4xml/target/org.eclipse.lsp4xml-uber.jar') + def files = findFiles(glob: '**/org.eclipse.lemminx/target/org.eclipse.lemminx-uber.jar') sh "mkdir ./server" sh "mv ${files[0].path} ./server" diff --git a/README.md b/README.md index b5e73d0e..f957b0a5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Description -This VS Code extension provides support for creating and editing XML documents, based on the [LSP4XML Language Server](https://github.com/angelozerr/lsp4xml), running with Java. +This VS Code extension provides support for creating and editing XML documents, based on the [LemMinX XML Language Server](https://github.com/eclipse/lemminx), running with Java. ![Basic features](https://user-images.githubusercontent.com/148698/45977901-df208a80-c018-11e8-85ec-71c70ba8a5ca.gif) @@ -72,20 +72,20 @@ The following settings are supported: * `xml.validation.noGrammar`: The message severity when a document has no associated grammar. Defaults to `hint`. * `xml.validation.disallowDocTypeDecl`: Enable/disable if a fatal error is thrown if the incoming document contains a DOCTYPE declaration. Default is `false`. * `xml.validation.resolveExternalEntities`: Enable/disable resolve of external entities. Default is `false`. -* `xml.server.workDir`: Set an absolute path for all cached schemas to be stored. Defaults to `~/.lsp4xml`. +* `xml.server.workDir`: Set an absolute path for all cached schemas to be stored. Defaults to `~/.lemminx`. * `xml.codeLens.enabled`: Enable/disable XML CodeLens. Default is `false`. * `xml.symbols.excluded`: Disable document symbols (Outline) for the given file name patterns. Updating file name patterns does not automatically reload the Outline view for the relevant file(s). Each file must either be reopened or changed, in order to trigger an Outline view reload. ## Custom XML Extensions -The [LSP4XML Language Server](https://github.com/angelozerr/lsp4xml) can be extended to support custom completion, hover, validation, rename, etc by using the [Java Service Provider Interface (SPI)](https://www.baeldung.com/java-spi) mechanism. vscode-xml provides the ability use your custom XML support provider, by adding external jars to the XML language server's classpath. +The [LemMinX - XML Language Server](https://github.com/eclipse/lemminx) can be extended to support custom completion, hover, validation, rename, etc by using the [Java Service Provider Interface (SPI)](https://www.baeldung.com/java-spi) mechanism. vscode-xml provides the ability use your custom XML support provider, by adding external jars to the XML language server's classpath. To do that: * create a Java project which provides a custom XML extension providing your custom completion, hover, validation, rename, etc: * create the XML extension like [MavenPlugin](https://github.com/angelozerr/lsp4xml-extensions-maven/blob/master/org.eclipse.lsp4xml.extensions.maven/src/main/java/org/eclipse/lsp4xml/extensions/maven/MavenPlugin.java). * register your custom completion participant in the XML extension like [MavenCompletionParticipant](https://github.com/angelozerr/lsp4xml-extensions-maven/blob/master/org.eclipse.lsp4xml.extensions.maven/src/main/java/org/eclipse/lsp4xml/extensions/maven/MavenCompletionParticipant.java#L28) - * register your custom XML extension with [Java Service Provider Interface (SPI)](https://www.baeldung.com/java-spi) mechanism in the [/META-INF/services/org.eclipse.lsp4xml.services.extensions.IXMLExtension](https://github.com/angelozerr/lsp4xml-extensions-maven/blob/master/org.eclipse.lsp4xml.extensions.maven/src/main/resources/META-INF/services/org.eclipse.lsp4xml.services.extensions.IXMLExtension) file. + * register your custom XML extension with [Java Service Provider Interface (SPI)](https://www.baeldung.com/java-spi) mechanism in the [/META-INF/services/org.eclipse.lemminx.services.extensions.IXMLExtension](https://github.com/angelozerr/lsp4xml-extensions-maven/blob/master/org.eclipse.lsp4xml.extensions.maven/src/main/resources/META-INF/services/org.eclipse.lsp4xml.services.extensions.IXMLExtension) file. * build a JAR `your-custom-xml-extension.jar`. * create a `vscode extension` which embeds the `your-custom-xml-extension.jar` JAR and declares this JAR path in the `package.json`: diff --git a/gulpfile.js b/gulpfile.js index 6463435d..a691f728 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,7 @@ const gulp = require('gulp'); const gulp_tslint = require('gulp-tslint'); const cp = require('child_process'); -const server_dir = '../lsp4xml'; +const server_dir = '../lemminx'; gulp.task('tslint', () => { return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**']) @@ -11,8 +11,8 @@ gulp.task('tslint', () => { }); gulp.task('build_server', function(done) { - cp.execSync(mvnw()+ " -o clean verify -DskipTests -pl \"!extensions,!extensions/org.eclipse.lsp4xml.extensions.emmet,!extensions/org.eclipse.lsp4xml.extensions.web\"", {cwd:server_dir, stdio:[0,1,2]} ); - gulp.src(server_dir +'/org.eclipse.lsp4xml/target/org.eclipse.lsp4xml-uber.jar') + cp.execSync(mvnw()+ " -o clean verify -DskipTests -pl \"!extensions,!extensions/org.eclipse.lemminx.extensions.emmet,!extensions/org.eclipse.lemminx.extensions.web\"", {cwd:server_dir, stdio:[0,1,2]} ); + gulp.src(server_dir +'/org.eclipse.lemminx/target/org.eclipse.lemminx-uber.jar') .pipe(gulp.dest('./server')); done(); }); diff --git a/package.json b/package.json index 5b2af439..3bba1ece 100644 --- a/package.json +++ b/package.json @@ -218,7 +218,7 @@ }, "xml.server.workDir": { "type": "string", - "default": "~/.lsp4xml", + "default": "~/.lemminx", "description": "Set a custom folder path for cached XML Schemas. An absolute path is expected, although the ~ prefix (for the user home directory) is supported.", "scope": "window" }, diff --git a/src/extension.ts b/src/extension.ts index 817ebe83..7d369543 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -35,9 +35,9 @@ namespace TagCloseRequest { export function activate(context: ExtensionContext) { let storagePath = context.storagePath; if (!storagePath) { - storagePath = os.homedir() + "/.lsp4xml"; + storagePath = os.homedir() + "/.lemminx"; } - let logfile = path.resolve(storagePath + '/lsp4xml.log'); + let logfile = path.resolve(storagePath + '/lemminx.log'); return requirements.resolveRequirements(context).catch(error => { //show error diff --git a/src/javaServerStarter.ts b/src/javaServerStarter.ts index c35bb635..e5e62bed 100644 --- a/src/javaServerStarter.ts +++ b/src/javaServerStarter.ts @@ -55,7 +55,7 @@ function prepareParams(requirements: RequirementsData, xmlJavaExtensions: string } parseVMargs(params, vmargs); let server_home: string = path.resolve(__dirname, '../server'); - let launchersFound: Array = glob.sync('**/org.eclipse.lsp4xml-uber.jar', { cwd: server_home }); + let launchersFound: Array = glob.sync('**/org.eclipse.lemminx-uber.jar', { cwd: server_home }); if (launchersFound.length) { let xmlJavaExtensionsClasspath = ''; if (xmlJavaExtensions.length > 0) { @@ -63,7 +63,7 @@ function prepareParams(requirements: RequirementsData, xmlJavaExtensions: string xmlJavaExtensionsClasspath = pathSeparator + xmlJavaExtensions.join(pathSeparator); } params.push('-cp'); params.push(path.resolve(server_home, launchersFound[0]) + xmlJavaExtensionsClasspath); - params.push('org.eclipse.lsp4xml.XMLServerLauncher'); + params.push('org.eclipse.lemminx.XMLServerLauncher'); } else { return null; }