I was really confused by your last reply. Actually I’ve got a better idea for a 
fix-it. :-)

let str_8 = """↵  
····foo··········↵
····"""
warning: line # includes trailing space characters in multi-line string literal
  ····foo··········
         ~~~~~~~~~~  
  Fix-it: Insert "\n\" (after these space characters)
The fix-it will inset \n\ after all your space characters, so the developer is 
kinda forced to strip them manually to ····foo or let the IDE add \n\ if he 
really needs that precision.

That would work. :)



-- 
Adrian Zubarev
Sent with Airmail

Am 13. April 2017 um 15:46:52, John Holdsworth (m...@johnholdsworth.com) 
schrieb:

\n\
would work

On 13 Apr 2017, at 14:44, John Holdsworth <m...@johnholdsworth.com> wrote:


I’ve never understood how you mean "explicit backslash". backslash has specific 
roles
and at the moment it is assigned to meaning standard escapes or "don’t include 
this next
newline in the literal". I can’t see how it could be reassigned to mean 
“include whitespace”
without loosing the option to concatenate lines.

fix-its are beyond my pay grade so that’ll have to wait until Apple looks at 
the implementation!


On 13 Apr 2017, at 14:32, Adrian Zubarev <adrian.zuba...@devandartist.com> 
wrote:

A warning that will popup when you included any trailing spaces in a ‘content 
line’ without the explicit backslash could also provide a fix-it to the user to 
remove these spaces. However if you can emit that warning and calculate the 
spaces to remove, than the compiler should be able to swallow these characters 
by default right?




_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to