/*******************************************************************************
 * Copyright (c) 2017 Pivotal, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Pivotal, Inc. - initial API and implementation
 *******************************************************************************/
package org.springframework.tooling.boot.java.ls;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
 * Boot-Java LS extension plugin
 * 
 * @author Alex Boyko
 *
 */
public class BootJavaLanguageServerPlugin extends AbstractUIPlugin {
	
	public static final String ID = "org.springframework.tooling.boot.java.ls";
	
	// The shared instance
	private static BootJavaLanguageServerPlugin plugin;

	public BootJavaLanguageServerPlugin() {
		// Empty
	}

	@Override
	public void start(BundleContext context) throws Exception {
		plugin = this;
		super.start(context);
	}

	@Override
	public void stop(BundleContext context) throws Exception {
		super.stop(context);
		plugin = null;
	}
	
	public static BootJavaLanguageServerPlugin getDefault() {
		return plugin;
	}

}

@@ -563,16 +563,217 @@
 va.ls;%0A%0A
+import java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.eclipse.jface.bindings.Binding;%0Aimport org.eclipse.ui.PlatformUI;%0Aimport org.eclipse.ui.keys.IBindingService;%0A
 import o
@@ -811,16 +811,16 @@
 Plugin;%0A
-
 import o
@@ -1070,16 +1070,121 @@
 ava.ls%22;
+%0A%0A%09private static final Object LSP4E_COMMAND_SYMBOL_IN_WORKSPACE = %22org.eclipse.lsp4e.symbolinworkspace%22;
 %0A%09%0A%09// T
@@ -1425,16 +1425,55 @@
 ntext);%0A
+%09%09%0A%09%09deactivateDuplicateKeybindings();%0A
 %09%7D%0A%0A%09@Ov
@@ -1643,16 +1643,16 @@
 ult() %7B%0A
-
 %09%09return
@@ -1664,10 +1664,1105 @@
 in;%0A%09%7D%0A%0A
+%09private void deactivateDuplicateKeybindings() %7B%0A%09%09IBindingService service = PlatformUI.getWorkbench().getService(IBindingService.class);%0A%09%09if (service != null) %7B%0A%09%09%09List%3CBinding%3E newBindings = new ArrayList%3C%3E();%0A%09%09%09Binding%5B%5D bindings = service.getBindings();%0A%0A%09%09%09for (Binding binding : bindings) %7B%0A%09%09%09%09String commandId = null;%0A%0A%09%09%09%09if (binding != null && binding.getParameterizedCommand() != null && binding.getParameterizedCommand().getCommand() != null) %7B%0A%09%09%09%09%09commandId = binding.getParameterizedCommand().getCommand().getId();%0A%0A%09%09%09%09%09if (commandId == null) %7B%0A%09%09%09%09%09%09newBindings.add(binding);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09else if (!commandId.equals(LSP4E_COMMAND_SYMBOL_IN_WORKSPACE)) %7B%0A%09%09%09%09%09%09newBindings.add(binding);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09else %7B%0A%09%09%09%09%09newBindings.add(binding);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() %7B%0A%09%09%09%09@Override%0A%09%09%09%09public void run() %7B%0A%09%09%09%09%09try %7B%0A%09%09%09%09%09%09service.savePreferences(service.getActiveScheme(),%0A%09%09%09%09%09%09%09%09newBindings.toArray(new Binding%5BnewBindings.size()%5D));%0A%09%09%09%09%09%7D catch (IOException e) %7B%0A%09%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D);%0A%09%09%7D%0A%09%7D%0A%0A
 %7D%0A

disable lsp4e go to symbol in workspace keybinding altogether as long as there is no fix in LSP4E