Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This page describes the noteworthy improvements provided by each release of Eclipse Wild Web Developer.

## 1.0.1

#### Editing improvements
* Bind schema/grammar (XSD, DTD, RelaxNG) with codelens in XML file

## 1.0.0

* 📅 Release Date: November 4th, 2022
Expand Down
4 changes: 2 additions & 2 deletions org.eclipse.wildwebdeveloper.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.eclipse.wildwebdeveloper.feature"
label="%name"
version="1.0.0.qualifier"
version="1.0.1.qualifier"
provider-name="Eclipse Wild Web Developer project"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand All @@ -25,7 +25,7 @@
optional="true"/>

<requires>
<import feature="org.eclipse.wildwebdeveloper.xml.feature" version="1.0.0"/>
<import feature="org.eclipse.wildwebdeveloper.xml.feature" version="1.0.1"/>
</requires>

<plugin
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.wildwebdeveloper.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<packaging>eclipse-feature</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.wildwebdeveloper.xml.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.eclipse.wildwebdeveloper.xml.feature"
label="%name"
version="1.0.0.qualifier"
version="1.0.1.qualifier"
provider-name="Eclipse Wild Web Developer project"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.wildwebdeveloper.xml.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<packaging>eclipse-feature</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
Expand Down
5 changes: 3 additions & 2 deletions org.eclipse.wildwebdeveloper.xml/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.xml;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 1.0.1.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Automatic-Module-Name: org.eclipse.wildwebdeveloper.xml
Expand All @@ -21,7 +21,8 @@ Require-Bundle: org.eclipse.tm4e.registry;bundle-version="0.3.0",
org.eclipse.core.net;bundle-version="1.3.0",
org.eclipse.lsp4j.jsonrpc,
org.eclipse.text,
org.eclipse.jface.text;bundle-version="3.20.100"
org.eclipse.jface.text;bundle-version="3.20.100",
com.google.gson
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.wildwebdeveloper.xml.internal.Activator
Export-Package: org.eclipse.wildwebdeveloper.xml;x-friends:="org.eclipse.m2e.editor.lemminx"
8 changes: 8 additions & 0 deletions org.eclipse.wildwebdeveloper.xml/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,12 @@
class="org.eclipse.wildwebdeveloper.xml.internal.ui.preferences.XMLPreferenceInitializer">
</initializer>
</extension>

<extension
point="org.eclipse.ui.handlers">
<handler
class="org.eclipse.wildwebdeveloper.xml.internal.commands.AssociateGrammarHandler"
commandId="xml.open.binding.wizard">
</handler>
</extension>
</plugin>
2 changes: 1 addition & 1 deletion org.eclipse.wildwebdeveloper.xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<packaging>eclipse-plugin</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -45,13 +46,28 @@

@SuppressWarnings("restriction")
public class XMLLanguageServer extends ProcessStreamConnectionProvider {

private static final String XML_LANGUAGE_SERVER_ID = "org.eclipse.wildwebdeveloper.xml";

private static final String SETTINGS_KEY = "settings";
private static final String XML_KEY = "xml";

// Extended capabilities for set CodeLens capabilities
private static final String EXTENDED_CLIENT_CAPABILITIES_KEY = "extendedClientCapabilities";
private static final String CODE_LENS_KEY = "codeLens";
private static final String CODE_LENS_KIND_KEY = "codeLensKind";
private static final String VALUE_SET_KEY = "valueSet";
private static final String BINDING_WIZARD_SUPPORT_KEY = "bindingWizardSupport";

private static enum CodeLensKind {
association;
}

private static final XMLExtensionRegistry extensionJarRegistry = new XMLExtensionRegistry();
private static final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
private static final LanguageServerDefinition lemminxDefinition = LanguageServersRegistry.getInstance()
.getDefinition("org.eclipse.wildwebdeveloper.xml");
.getDefinition(XML_LANGUAGE_SERVER_ID);

private static final IPropertyChangeListener psListener = event -> {
XMLPreferenceServerConstants.getLemminxPreference(event).ifPresent(pref -> {
Map<String, Object> config = mergeCustomInitializationOptions(
Expand Down Expand Up @@ -153,16 +169,29 @@ private String computeJavaPath() {
"bin/java" + (Platform.getOS().equals(Platform.OS_WIN32) ? ".exe" : "")).getAbsolutePath();
}

@Override
public String toString() {
return "XML Language Server: " + super.toString();
}

@Override
public Object getInitializationOptions(URI rootUri) {
return mergeCustomInitializationOptions(extensionJarRegistry.getInitiatizationOptions());
Map<String, Object> initializationOptions = new HashMap<>();
Map<String, Object> settings = mergeCustomInitializationOptions(
extensionJarRegistry.getInitiatizationOptions());
initializationOptions.put(SETTINGS_KEY, settings.get(SETTINGS_KEY));
Object extendedClientCapabilities = createExtendedClientCapabilities();
initializationOptions.put(EXTENDED_CLIENT_CAPABILITIES_KEY, extendedClientCapabilities);
return initializationOptions;
}

private static Object createExtendedClientCapabilities() {
Map<String, Object> extendedClientCapabilities = new HashMap<>();
Map<String, Object> codeLens = new HashMap<>();
extendedClientCapabilities.put(CODE_LENS_KEY, codeLens);
Map<String, Object> codeLensKind = new HashMap<>();
codeLens.put(CODE_LENS_KIND_KEY, codeLensKind);
List<String> valueSet = Arrays.asList(CodeLensKind.association.name());
codeLensKind.put(VALUE_SET_KEY, valueSet);
extendedClientCapabilities.put(BINDING_WIZARD_SUPPORT_KEY, Boolean.TRUE);
return extendedClientCapabilities;
}

private static Map<String, Object> mergeCustomInitializationOptions(Map<String, Object> defaults) {
Map<String, Object> xmlOpts = new HashMap<>(defaults);
XMLPreferenceServerConstants.storePreferencesToLemminxOptions(store, xmlOpts);
Expand All @@ -180,4 +209,9 @@ public void stop() {
store.removePropertyChangeListener(psListener);
super.stop();
}

@Override
public String toString() {
return "XML Language Server: " + super.toString();
}
}
Loading