Skip to content

Commit

Permalink
Add example of extension in regular bundle
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Läubrich <[email protected]>
  • Loading branch information
laeubi committed Nov 14, 2024
1 parent 5ba1378 commit 9e1f790
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions org.eclipse.m2e.bnd.ui/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/
jars.extra.classpath = platform:/plugin/org.eclipse.wildwebdeveloper.xml/language-servers/server/org.eclipse.lemminx-uber.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.eclipse.m2e.bnd.ui.lemminx;

import org.eclipse.lemminx.services.extensions.IXMLExtension;
import org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry;
import org.eclipse.lsp4j.InitializeParams;

public class MyExtension implements IXMLExtension {

@Override
public void start(InitializeParams arg0, XMLExtensionsRegistry arg1) {
// TODO Auto-generated method stub

}

@Override
public void stop(XMLExtensionsRegistry arg0) {
// TODO Auto-generated method stub

}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
classpath=true
dsVersion=V1_3
dsVersion=V1_5
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,32 @@ public void start(InitializeParams params, XMLExtensionsRegistry registry) {
@Override
public void onAttributeName(boolean arg0, ICompletionRequest arg1, ICompletionResponse arg2,
CancelChecker arg3) throws Exception {
logger.log(Level.INFO, "onAttributeName");
}

@Override
public void onAttributeValue(String arg0, ICompletionRequest arg1, ICompletionResponse arg2,
CancelChecker arg3) throws Exception {
logger.log(Level.INFO, "onAttributeValue");
}

@Override
public void onDTDSystemId(String arg0, ICompletionRequest arg1, ICompletionResponse arg2,
CancelChecker arg3) throws Exception {
logger.log(Level.INFO, "onDTDSystemId");
}

@Override
public void onTagOpen(ICompletionRequest arg0, ICompletionResponse arg1, CancelChecker arg2)
throws Exception {
logger.log(Level.INFO, "onTagOpen");
}

@Override
public void onXMLContent(ICompletionRequest completionRequest, ICompletionResponse response,
CancelChecker checker) throws Exception {

logger.log(Level.INFO, "onXMLContent");
try {
// FIXME CDATA do not trigger completion:
// https://github.com/eclipse/lemminx/issues/1694
Expand Down

0 comments on commit 9e1f790

Please sign in to comment.