forked from eclipse-vorto/vorto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes eclipse-vorto#956 - Allow FB section names as property names.
Signed-off-by: Simon Pizonka <[email protected]>
- Loading branch information
Showing
6 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...vorto/editor/datatype/ide/syntaxcoloring/PropertyNameSemanticHighlightingCalculator.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2018 Bosch Software Innovations GmbH and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* and Eclipse Distribution License v1.0 which accompany this distribution. | ||
* | ||
* The Eclipse Public License is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* The Eclipse Distribution License is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* Contributors: | ||
* Bosch Software Innovations GmbH - Please refer to git log | ||
*/ | ||
package org.eclipse.vorto.editor.datatype.ide.syntaxcoloring | ||
|
||
import javax.inject.Inject | ||
import org.eclipse.emf.ecore.EObject | ||
import org.eclipse.xtext.ide.editor.syntaxcoloring.DefaultSemanticHighlightingCalculator | ||
import org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor | ||
import org.eclipse.xtext.util.CancelIndicator | ||
|
||
import org.eclipse.vorto.core.api.model.datatype.Property | ||
import org.eclipse.vorto.core.api.model.datatype.DatatypePackage | ||
import org.eclipse.vorto.editor.datatype.services.DatatypeGrammarAccess | ||
import org.eclipse.xtext.ide.editor.syntaxcoloring.HighlightingStyles | ||
|
||
class PropertyNameSemanticHighlightingCalculator extends DefaultSemanticHighlightingCalculator { | ||
@Inject package DatatypeGrammarAccess grammar | ||
|
||
override protected boolean highlightElement(EObject object, IHighlightedPositionAcceptor acceptor, | ||
CancelIndicator cancelIndicator) { | ||
switch (object) { | ||
Property: { | ||
highlightFeature(acceptor, object, DatatypePackage.eINSTANCE.property_Name, HighlightingStyles.DEFAULT_ID) | ||
return true | ||
} | ||
default: false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters