diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml b/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml index b9727aed7..204c567a1 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml @@ -14,7 +14,7 @@ contentType="org.eclipse.jdt.core.javaSource" id="org.eclipse.languageserver.languages.springboot"> - + - + @@ -133,7 +133,7 @@ - + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/SpringPropertiesPresentationReconciler.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/SpringPropertiesPresentationReconciler.java deleted file mode 100644 index 4cbe61603..000000000 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/SpringPropertiesPresentationReconciler.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016, 2018 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.ls; - -import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions; -import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertyValueScanner; -import org.eclipse.jdt.internal.ui.text.SingleTokenJavaScanner; -import org.eclipse.jdt.ui.PreferenceConstants; -import org.eclipse.jdt.ui.text.IColorManager; -import org.eclipse.jface.preference.IPreferenceStore; -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 - */ -@SuppressWarnings("restriction") -public class SpringPropertiesPresentationReconciler extends PresentationReconciler { - - public SpringPropertiesPresentationReconciler() { - - IColorManager colorManager = JavaPlugin.getDefault().getJavaTextTools().getColorManager(); - IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); - - ITokenScanner propertyKeyScanner= new SingleTokenJavaScanner(colorManager, store, PreferenceConstants.PROPERTIES_FILE_COLORING_KEY); - ITokenScanner propertyValueScanner= new PropertyValueScanner(colorManager, store); - ITokenScanner propertyCommentScanner= new SingleTokenJavaScanner(colorManager, store, PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT); - - this.setDocumentPartitioning(IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING); - - DefaultDamagerRepairer dr= new DefaultDamagerRepairer(propertyKeyScanner); - this.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - this.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - - dr= new DefaultDamagerRepairer(propertyCommentScanner); - this.setDamager(dr, IPropertiesFilePartitions.COMMENT); - this.setRepairer(dr, IPropertiesFilePartitions.COMMENT); - - dr= new DefaultDamagerRepairer(propertyValueScanner); - this.setDamager(dr, IPropertiesFilePartitions.PROPERTY_VALUE); - this.setRepairer(dr, IPropertiesFilePartitions.PROPERTY_VALUE); - - } - -} diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/syntaxes/JavaProperties.tmLanguage b/eclipse-language-servers/org.springframework.tooling.boot.ls/syntaxes/JavaProperties.tmLanguage new file mode 100644 index 000000000..bf25ce875 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/syntaxes/JavaProperties.tmLanguage @@ -0,0 +1,160 @@ + + + + + fileTypes + + properties + + foldingStartMarker + ^[a-zA-Z0-9.-_]+=.*\ + + foldingStopMarker + ^(.*(?<!\) +) + keyEquivalent + ^~J + name + Java Properties + patterns + + + comment + Ignore blank lines + match + ^\s*$ + + + include + #comment-line + + + include + #property-name + + + include + #property-definition + + + repository + + comment-line + + captures + + 1 + + name + punctuation.whitespace.comment.leading.java-properties + + 2 + + name + punctuation.definition.comment.java-properties + + + match + ^(\s*)([#!])(.+)?$\n? + name + comment.line.java-properties + + property-definition + + begin + ^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s* + beginCaptures + + 1 + + name + punctuation.whitespace.leading.java-properties + + 2 + + name + support.constant.java-properties + patterns + + + match + \\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + + 3 + + name + punctuation.separator.key-value.java-properties + + + contentName + string.unquoted.java-properties + end + (?<!\\{1})$\n + name + meta.key-value.java-properties + patterns + + + comment + Leading space on a continued line is ignored + match + ^\s* + name + punctuation.whitespace.leading.java-properties + + + match + (\\{1})(?=$\n) + name + punctuation.separator.continuation.java-properties + + + match + \\(?:[\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + + property-name + + captures + + 1 + + name + punctuation.whitespace.comment.leading.java-properties + + 2 + + name + support.constant.java-properties + patterns + + + match + \\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + + + comment + A property name with no value + match + ^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s*$\n + name + meta.key-value.java-properties + + + scopeName + source.java-properties + uuid + D364E829-7643-4AFF-948D-3C0D6B4EA8A4 + +