Pasting plain text code

If, like me, you sometime munge text into code and then want to paste it into the IDE that can sometimes be a real chore

Unless you happen to know this little trick

If you have plain text lke

Public Function ToString(extends enumValue as Untitled) as String
  select case enumValue
    case Untitled.valueName
        return "valueName"
    case Untitled.valueName
        return "valueName"
    case Untitled.valueName
        return "valueName"
Else
 raise new UnsupportedOperationException
  end select
End Function


Public Function ToUntitled(extends stringValue as String) as Untitled
  select case stringValue
    case "valueName"
        return Untitled.valueName
    case "valueName"
        return Untitled.valueName
    case "valueName"
        return Untitled.valueName
  end select
Else
 raise new UnsupportedOperationException
End Function

Public Function Untitled_ToString( enumValue as Untitled) as String
  select case enumValue
    case Untitled.valueName
        return "valueName"
    case Untitled.valueName
        return "valueName"
    case Untitled.valueName
        return "valueName"
Else
 raise new UnsupportedOperationException
  end select
End Function


Public Function Untitled_FromString(stringValue as String) as Untitled
  select case stringValue
    case "valueName"
        return Untitled.valueName
    case "valueName"
        return Untitled.valueName
    case "valueName"
        return Untitled.valueName
Else
 raise new UnsupportedOperationException
  end select
End Function

and select it all and copy then, in the IDE select the MODULE, WINDOW, CLASS (not the methods group in any of those) and Paste

The downside here is that only the FIRST method gets pasted – but it does get pasted

So you have to do them one by one

But its better than nothing

Works well with a little helper app I’ll post later than writes methods to extend enums so its easy to convert them to/from strings