mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Remove lsp4e-cpp code related to the unused 'reindex' command
This code was mostly commented out and non-functional anyways. Change-Id: Ib0713a1c419438c0973bac49d4bb1786517914ff
This commit is contained in:
parent
4cf155d79f
commit
0127ad7c93
3 changed files with 0 additions and 160 deletions
|
@ -38,62 +38,6 @@
|
|||
contentType="org.eclipse.lsp4e.languages.cpp">
|
||||
</presentationReconciler>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
id="org.eclipse.lsp4e.cpp.language.commands.reindex"
|
||||
name="%reindex.command.name">
|
||||
</command>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="org.eclipse.lsp4e.cpp.language.ReindexHandler"
|
||||
commandId="org.eclipse.lsp4e.cpp.language.commands.reindex">
|
||||
<activeWhen>
|
||||
<with
|
||||
variable="selection">
|
||||
<count
|
||||
value="1">
|
||||
</count>
|
||||
<iterate
|
||||
ifEmpty="false"
|
||||
operator="and">
|
||||
<test
|
||||
forcePluginActivation="true"
|
||||
property="org.eclipse.lsp4e.cpp.language.hasServer"
|
||||
value="org.eclipse.lsp4e.languages.cpp">
|
||||
</test>
|
||||
</iterate>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
allPopups="false"
|
||||
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
|
||||
<command
|
||||
commandId="org.eclipse.lsp4e.cpp.language.commands.reindex"
|
||||
label="%reindex.command.label"
|
||||
style="push">
|
||||
<visibleWhen
|
||||
checkEnabled="true">
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.expressions.propertyTesters">
|
||||
<propertyTester
|
||||
class="org.eclipse.lsp4e.cpp.language.LanguageServerPropertyTester"
|
||||
id="org.eclipse.lsp4e.cpp.language.propertyTester"
|
||||
namespace="org.eclipse.lsp4e.cpp.language"
|
||||
properties="hasServer"
|
||||
type="java.lang.Object">
|
||||
</propertyTester>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2017 Ericsson and others.
|
||||
* 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
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.lsp4e.cpp.language;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.expressions.PropertyTester;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.lsp4e.LanguageServersRegistry;
|
||||
import org.eclipse.lsp4e.LanguageServersRegistry.LanguageServerDefinition;
|
||||
import org.eclipse.lsp4e.LanguageServiceAccessor;
|
||||
import org.eclipse.lsp4e.ProjectSpecificLanguageServerWrapper;
|
||||
|
||||
/**
|
||||
* Tests whether of not a project is running the C/C++ server.
|
||||
*/
|
||||
public class LanguageServerPropertyTester extends PropertyTester {
|
||||
|
||||
private static final String KEY_HAS_SERVER = "hasServer"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
|
||||
//FIXME; needs https://git.eclipse.org/r/#/c/101835/
|
||||
// if (KEY_HAS_SERVER.equals(property)) {
|
||||
// if (receiver instanceof IProject) {
|
||||
// LanguageServerDefinition definition = LanguageServersRegistry.getInstance().getDefinition(CPPLanguageServer.ID);
|
||||
// try {
|
||||
// ProjectSpecificLanguageServerWrapper lsWrapperForConnection = LanguageServiceAccessor.getLSWrapperForConnection((IProject) receiver, definition, false);
|
||||
// return lsWrapperForConnection != null;
|
||||
// } catch (IOException e) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2017 Ericsson and others.
|
||||
* 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
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.lsp4e.cpp.language;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.Adapters;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.lsp4e.LanguageServersRegistry;
|
||||
import org.eclipse.lsp4e.LanguageServersRegistry.LanguageServerDefinition;
|
||||
import org.eclipse.lsp4e.LanguageServiceAccessor;
|
||||
import org.eclipse.lsp4e.ProjectSpecificLanguageServerWrapper;
|
||||
import org.eclipse.lsp4j.ExecuteCommandParams;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
/**
|
||||
* Temporary handler for temporary command in order to aid testing the indexing
|
||||
* support in Clangd.
|
||||
*/
|
||||
public class ReindexHandler extends AbstractHandler {
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
//FIXME; needs https://git.eclipse.org/r/#/c/101835/
|
||||
// IProject project = null;
|
||||
// ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
|
||||
// if (selection instanceof IStructuredSelection) {
|
||||
// Object item = ((IStructuredSelection)selection).getFirstElement();
|
||||
// project = Adapters.adapt(item, IProject.class);
|
||||
// }
|
||||
// if (project == null) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// LanguageServerDefinition definition = LanguageServersRegistry.getInstance().getDefinition(CPPLanguageServer.ID);
|
||||
// try {
|
||||
// ProjectSpecificLanguageServerWrapper lsWrapperForConnection = LanguageServiceAccessor.getLSWrapperForConnection(project, definition, false);
|
||||
// if (lsWrapperForConnection != null) {
|
||||
// ExecuteCommandParams params = new ExecuteCommandParams("reindex", null);
|
||||
// lsWrapperForConnection.getServer().getWorkspaceService().executeCommand(params);
|
||||
// }
|
||||
// } catch (IOException e) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue