-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow for the custom Xbase converter to be further customized,e.g.,Xtend
- Loading branch information
1 parent
1b1c64e
commit 328083d
Showing
5 changed files
with
41 additions
and
28 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
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
29 changes: 29 additions & 0 deletions
29
...eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/conversion/XbaseStringValueConverter.java
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,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Lorenzo Bettini and others. | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.xtext.xbase.conversion; | ||
|
||
import org.eclipse.xtext.conversion.impl.STRINGValueConverter; | ||
import org.eclipse.xtext.nodemodel.INode; | ||
import org.eclipse.xtext.util.Strings; | ||
|
||
/** | ||
* Avoid Windows EOL characters from the original parsed text: this would result | ||
* in different generated Java files in Windows see | ||
* https://github.com/eclipse/xtext/issues/2293 This is aligned with Java text | ||
* blocks' "Normalization of Line Terminators" | ||
* | ||
* @author Lorenzo Bettini - Initial contribution and API | ||
* @since 2.35 | ||
*/ | ||
public class XbaseStringValueConverter extends STRINGValueConverter { | ||
@Override | ||
public String toValue(String string, INode node) { | ||
return super.toValue(Strings.toUnixLineSeparator(string), node); | ||
} | ||
} |
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