You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Break at the last parameter if any of it, or anything subsequent (e.g. result type etc) crosses the margin - in this case it would be departureBoatTerminalLocation: CLPlacemark; - if any part of this crosses the margin, the whole parameter should begin on the next line, indented 2 spaces from the text directly above it - in this case, the keyword function.
If the remainder of the declaration also crosses the margin, apply the rule again, except indent at the same level as the last break
Comments related to deprecation etc should not break
Other rules need to be formulated for other declarations. Using the rules above, with a margin of 150 characters, the class declaration would become this:
This might be implemented in one of a couple of ways:
Modify TSourceWriter to keep track of the number of characters that have been written to the current line so far, have it be aware of what is about to be written (i.e. whether it's a method parameter etc), and "break" if what is about to be written will exceed the margin. This could prove difficult if a rule is to break before a parameter that has already been written.
Write the entire source, then use a parser (such as DelphiAST) to identify where breaks need to occur.
For example when importing the
Intents
framework, this code is generated:Line breaks should occur using these rules:
departureBoatTerminalLocation: CLPlacemark;
- if any part of this crosses the margin, the whole parameter should begin on the next line, indented 2 spaces from the text directly above it - in this case, the keywordfunction
.Other rules need to be formulated for other declarations. Using the rules above, with a margin of 150 characters, the class declaration would become this:
The text was updated successfully, but these errors were encountered: