summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-07-25 01:57:16 -0400
committerNathan Ridge2018-08-01 02:54:59 -0400
commit09d4a1121c9af18ff0cb42c5398c29e979a45aa4 (patch)
treeb2a95698fa7327e1446c1631ef20d9bd5d1cf3c5
parent17c79ab310b609695c3ac1fc0b510510fb542799 (diff)
downloadorg.eclipse.cdt-09d4a1121c9af18ff0cb42c5398c29e979a45aa4.tar.gz
org.eclipse.cdt-09d4a1121c9af18ff0cb42c5398c29e979a45aa4.tar.xz
org.eclipse.cdt-09d4a1121c9af18ff0cb42c5398c29e979a45aa4.zip
Bug 537357 - [lsp4e-cpp] Set the document partitioner in a document setup participant
-rw-r--r--lsp4e-cpp/org.eclipse.lsp4e.cpp.language/OSGI-INF/l10n/bundle.properties5
-rw-r--r--lsp4e-cpp/org.eclipse.lsp4e.cpp.language/plugin.xml9
-rw-r--r--lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/PresentationReconcilerCPP.java11
3 files changed, 13 insertions, 12 deletions
diff --git a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/OSGI-INF/l10n/bundle.properties b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/OSGI-INF/l10n/bundle.properties
index edc62e5f8c..19675c4c96 100644
--- a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/OSGI-INF/l10n/bundle.properties
+++ b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/OSGI-INF/l10n/bundle.properties
@@ -6,4 +6,7 @@ server.label = C/C++ Language Server
reindex.command.name = Reindex
reindex.command.label = Reindex
-PreferencePageTitle=C/C++ Language Server \ No newline at end of file
+
+cDocumentSetupParticipant =C Document Setup Participant
+
+PreferencePageTitle=C/C++ Language Server
diff --git a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/plugin.xml b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/plugin.xml
index 8816ee5b2b..58929f970e 100644
--- a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/plugin.xml
+++ b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/plugin.xml
@@ -25,6 +25,15 @@
</contentTypeMapping>
</extension>
<extension
+ id="org.eclipse.lsp4e.cpp.language.CDocumentSetupParticipant"
+ name="%cDocumentSetupParticipant"
+ point="org.eclipse.core.filebuffers.documentSetup">
+ <participant
+ class="org.eclipse.cdt.internal.ui.editor.CDocumentSetupParticipant"
+ contentTypeId="org.eclipse.lsp4e.languages.cpp">
+ </participant>
+ </extension>
+ <extension
point="org.eclipse.ui.editors">
<editorContentTypeBinding
contentTypeId="org.eclipse.lsp4e.languages.cpp"
diff --git a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/PresentationReconcilerCPP.java b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/PresentationReconcilerCPP.java
index e50d187fbc..520e531d35 100644
--- a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/PresentationReconcilerCPP.java
+++ b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/PresentationReconcilerCPP.java
@@ -58,7 +58,6 @@ public class PresentationReconcilerCPP extends CPresentationReconciler {
private CCommentScanner fMultilineCommentScanner;
private SingleTokenCScanner fStringScanner;
private AbstractCScanner fCodeScanner;
- private boolean fSettingPartitioner = false;
private CqueryLineBackgroundListener fLineBackgroundListener = new CqueryLineBackgroundListener();
private ITextViewer textViewer;
private TextInputListenerCPP textInputListener;
@@ -155,16 +154,6 @@ public class PresentationReconcilerCPP extends CPresentationReconciler {
@Override
protected TextPresentation createPresentation(IRegion damage, IDocument document) {
- if (fSettingPartitioner) {
- return null;
- }
- //FIXME: Need a better place to set the partitioner
- if (!(document.getDocumentPartitioner() instanceof FastCPartitioner)) {
- // Prevent infinite recursion
- fSettingPartitioner = true;
- CUIPlugin.getDefault().getTextTools().setupCDocument(document);
- fSettingPartitioner = false;
- }
TextPresentation createPresentation = super.createPresentation(damage, document);
return createPresentation;
}