replaced yedit syntax coloring implementation with textmate.java

This commit is contained in:
Martin Lippert
2017-01-18 13:07:04 +01:00
parent 31698c10dc
commit bd62b6f732
12 changed files with 2368 additions and 89 deletions

View File

@@ -10,6 +10,7 @@ Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
org.eclipse.ui.genericeditor;bundle-version="1.0.0",
org.eclipse.jface.text;bundle-version="3.11.100",
org.eclipse.jdt.ui;bundle-version="3.13.0",
org.dadacoalition.yedit;bundle-version="1.0.18"
org.eclipse.tm4e.core;bundle-version="1.0.0",
org.eclipse.tm4e.ui;bundle-version="1.0.0"
Import-Package: org.eclipse.jface.preference,
org.osgi.framework

View File

@@ -3,4 +3,5 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
servers/
servers/,\
syntaxes/

View File

@@ -28,11 +28,23 @@
<extension
point="org.eclipse.ui.genericeditor.presentationReconcilers">
<presentationReconciler
class="org.springframework.boot.ide.cloudfoundry.server.CloudFoundryYMLPresentationReconciler"
class="org.eclipse.tm4e.ui.text.TMPresentationReconciler"
contentType="org.springframework.boot.ide.manifest.yml">
</presentationReconciler>
</extension>
<extension
point="org.eclipse.tm4e.core.grammars">
<grammar
scopeName="source.yaml"
path="./syntaxes/YAML.tmLanguage" >
</grammar>
<scopeNameContentTypeBinding
contentTypeId="org.springframework.boot.ide.manifest.yml"
scopeName="source.yaml">
</scopeNameContentTypeBinding>
</extension>
<extension
point="org.eclipse.lsp4e.languageServer">
<server

View File

@@ -1,36 +0,0 @@
/*******************************************************************************
* Copyright (c) 2016 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.boot.ide.cloudfoundry.server;
import org.dadacoalition.yedit.editor.ColorManager;
import org.dadacoalition.yedit.editor.YEditDamageRepairer;
import org.dadacoalition.yedit.editor.scanner.YAMLScanner;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.rules.ITokenScanner;
/**
* @author Martin Lippert
*/
public class CloudFoundryYMLPresentationReconciler extends PresentationReconciler {
public CloudFoundryYMLPresentationReconciler() {
ColorManager colorManager = new ColorManager();
ITokenScanner yamlScanner = new YAMLScanner( colorManager );
DefaultDamagerRepairer dr = new YEditDamageRepairer(yamlScanner);
this.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
this.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
}
}

View File

@@ -10,6 +10,7 @@ Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
org.eclipse.ui.genericeditor;bundle-version="1.0.0",
org.eclipse.jface.text;bundle-version="3.11.100",
org.eclipse.jdt.ui;bundle-version="3.13.0",
org.dadacoalition.yedit;bundle-version="1.0.18"
org.eclipse.tm4e.core;bundle-version="1.0.0",
org.eclipse.tm4e.ui;bundle-version="1.0.0"
Import-Package: org.eclipse.jface.preference,
org.osgi.framework

View File

@@ -3,4 +3,5 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
servers/
servers/,\
syntaxes/

View File

@@ -59,11 +59,23 @@
<extension
point="org.eclipse.ui.genericeditor.presentationReconcilers">
<presentationReconciler
class="org.springframework.boot.ide.properties.servers.SpringYMLPresentationReconciler"
class="org.eclipse.tm4e.ui.text.TMPresentationReconciler"
contentType="org.springframework.boot.ide.properties.application.yml">
</presentationReconciler>
</extension>
<extension
point="org.eclipse.tm4e.core.grammars">
<grammar
scopeName="source.yaml"
path="./syntaxes/YAML.tmLanguage" >
</grammar>
<scopeNameContentTypeBinding
contentTypeId="org.springframework.boot.ide.properties.application.yml"
scopeName="source.yaml">
</scopeNameContentTypeBinding>
</extension>
<extension
point="org.eclipse.lsp4e.languageServer">
<server

View File

@@ -1,36 +0,0 @@
/*******************************************************************************
* Copyright (c) 2016 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.boot.ide.properties.servers;
import org.dadacoalition.yedit.editor.ColorManager;
import org.dadacoalition.yedit.editor.YEditDamageRepairer;
import org.dadacoalition.yedit.editor.scanner.YAMLScanner;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.rules.ITokenScanner;
/**
* @author Martin Lippert
*/
public class SpringYMLPresentationReconciler extends PresentationReconciler {
public SpringYMLPresentationReconciler() {
ColorManager colorManager = new ColorManager();
ITokenScanner yamlScanner = new YAMLScanner( colorManager );
DefaultDamagerRepairer dr = new YEditDamageRepairer(yamlScanner);
this.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
this.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
}
}

View File

@@ -12,6 +12,10 @@
<category-def name="deps" label="Dependencies"/>
<feature id="tm-feature">
<category name="deps"/>
</feature>
<bundle id="org.eclipse.lsp4e">
<category name="deps"/>
</bundle>
@@ -28,10 +32,6 @@
<category name="deps"/>
</bundle>
<bundle id="org.dadacoalition.yedit">
<category name="deps"/>
</bundle>
<bundle id="com.google.gson">
<category name="deps"/>
</bundle>

View File

@@ -76,11 +76,6 @@
<layout>p2</layout>
<url>http://download.eclipse.org/staging/oxygen/</url>
</repository>
<repository>
<id>oxygen-nightly</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/4.7-N-builds/</url>
</repository>
<repository>
<id>orbit</id>
<layout>p2</layout>
@@ -92,9 +87,9 @@
<url>http://download.eclipse.org/lsp4e/snapshots/</url>
</repository>
<repository>
<id>yedit</id>
<id>tm4e</id>
<layout>p2</layout>
<url>http://dist.springsource.com/release/TOOLS/third-party/yedit</url>
<url>http://oss.opensagres.fr/textmate/1.0.0-SNAPSHOT/</url>
</repository>
</repositories>
</profile>