mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +02:00

This plug-in adds an simple integration between LSP4E and Clangd. It simply launches clangd when opening C/C++ files with the Generic Editor. To try it, you need to: - Import the projects in your Eclipse workspace (you can only import the lsp4-cpp ones, the sources for CDT are not needed) - Open lsp4e.cpp-staging.target and set it as the target platform - You need to have clangd built and on the PATH. See https://clang.llvm.org/get_started.html - Start Eclipse: right-click on a project > Run as > Eclipse Application - In the new Eclipse instance, you can right-click on a C/C++ file > Open As > Generic Editor. This should make use of clangd, providing some basic diagnostics and formatting commands. This should help the Eclipse community to start playing with Clangd. Change-Id: I688d3a952dbc80d9f61186178f3c8a033afcc587 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
96 lines
3.4 KiB
XML
96 lines
3.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?eclipse version="3.4"?>
|
|
<plugin>
|
|
<extension
|
|
point="org.eclipse.core.contenttype.contentTypes">
|
|
<content-type
|
|
base-type="org.eclipse.core.runtime.text"
|
|
file-extensions="cpp,c,h,cxx,cc,hxx,hpp"
|
|
id="org.eclipse.lsp4e.languages.cpp"
|
|
name="%content-type.name"
|
|
priority="normal">
|
|
</content-type>
|
|
</extension>
|
|
<extension
|
|
point="org.eclipse.lsp4e.languageServer">
|
|
<server
|
|
class="org.eclipse.lsp4e.cpp.language.CPPLanguageServer"
|
|
id="org.eclipse.lsp4e.languages.cpp"
|
|
label="%server.label">
|
|
</server>
|
|
<contentTypeMapping
|
|
contentType="org.eclipse.lsp4e.languages.cpp"
|
|
id="org.eclipse.lsp4e.languages.cpp">
|
|
</contentTypeMapping>
|
|
</extension>
|
|
<extension
|
|
point="org.eclipse.ui.editors">
|
|
<editorContentTypeBinding
|
|
contentTypeId="org.eclipse.lsp4e.languages.cpp"
|
|
editorId="org.eclipse.ui.genericeditor.GenericEditor">
|
|
</editorContentTypeBinding>
|
|
</extension>
|
|
<extension
|
|
point="org.eclipse.ui.genericeditor.presentationReconcilers">
|
|
<presentationReconciler
|
|
class="org.eclipse.lsp4e.cpp.language.PresentationReconcilerCPP"
|
|
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>
|
|
</plugin>
|