Settings -> Code Style -> Scala -> Multiline Strings. This page contains many settings for multil-line strings typing. If it's not enough for your multi-line strings style, please tell us, and we will try to implement such way too.
Right now the main thing I use multi-line strings for is for esper's dsl, eg:
epl {"""@Name("#ruleName: event C(_) -> C(P) while #{event.eventTypeName}(true).lastevent => Update CycleParts") select #event.streamName, prevCycle, currentCycle, state from pattern #[ every prevCycle=CurrentCycle -> (currentCycle=CurrentCycle(isProducing=true) and not CurrentCycle(isProducing=false)) #] unidirectional, #event.std_lastevent.sepl, #{{stateStream.as("state").sepl}} where #event.wepl and (PartsUpdatingUtil.isNewCycle(prevCycle, currentCycle) or PartsUpdatingUtil.isSameCycleWithNoParts(prevCycle, currentCycle)) and state.value = true """}
For this None seems to work best. But I can imagine I would like the other settings for more typical cases. So maybe it would be nice to have some kind of "shift-Return" that can be used to get the None behavior on demand.
I also use the scala enhanced-strings project a lot (ie, the #varname). I expect I will replace this in 2.10 with the built in string enhancements. Will there be direct support for substituions in s"" ?
Settings -> Code Style -> Scala -> Multiline Strings.
This page contains many settings for multil-line strings typing.
If it's not enough for your multi-line strings style, please tell us, and we will try to implement such way too.
Best regards,
Alexander Podkhalyuzin.
I looked there but missed the tab. Sorry.
Right now the main thing I use multi-line strings for is for esper's dsl, eg:
epl {"""@Name("#ruleName: event C(_) -> C(P) while #{event.eventTypeName}(true).lastevent => Update CycleParts")
select
#event.streamName, prevCycle, currentCycle, state
from
pattern #[ every prevCycle=CurrentCycle
-> (currentCycle=CurrentCycle(isProducing=true) and not CurrentCycle(isProducing=false))
#] unidirectional,
#event.std_lastevent.sepl,
#{{stateStream.as("state").sepl}}
where
#event.wepl
and (PartsUpdatingUtil.isNewCycle(prevCycle, currentCycle) or
PartsUpdatingUtil.isSameCycleWithNoParts(prevCycle, currentCycle))
and state.value = true
"""}
For this None seems to work best. But I can imagine I would like the other settings for more typical cases.
So maybe it would be nice to have some kind of "shift-Return" that can be used to get the None behavior
on demand.
I also use the scala enhanced-strings project a lot (ie, the #varname). I expect I will replace this in 2.10
with the built in string enhancements. Will there be direct support for substituions in s"" ?
Yep, string interpolation is already supported. Autocomplete, rename etc work for identifiers in interpolated strings.
-jason