> I now have implemented user configurable explicit fold points (like
> jEdit's "Configurable Fold Handler") in the C++ and D Lexer.
That sounds useful.
> I've followed the approach "one folding feature, one folding property"
> and removed "fold.comment" and "fold.cpp.comment.explicit"
> in these lexers, introduced "lexer.cpp/d.fold.multiline.comment" and
> "lexer.cpp/d.fold.explicit.fold.points" instead. Having also
> a property ("lexer.cpp/d.fold.sytax.based") for the sytax based
> folding feature, pure explicit code folding can be configured.
There are many active projects downstream from Scintilla with
serious investment in current Scintilla features. By changing the
names of feature control properties in Scintilla these features will
stop working until their absence is noticed and a fix released. This
will churn downstream projects and damage Scintilla's reputation as a
stable, dependable component.
While it is possible to make incompatible changes to Scintilla,
there must be large corresponding benefits or a long deprecation and
migration process started. If at all possible, changes should be
additions to current behaviour where projects can decide to opt-in to
any changes.
Neil
> Ok Neil, I've tuned my "compatible" version, so it should be 100%
> compatible to current version.
> (I've also preserved "fold.cpp.comment.explicit").
This adds second names for existing properties which just makes it
more complex to understand.
If you want to convert the D lexer to a lexer object, send in a
patch that does only that. Mixing changes in a single commit makes it
much harder to understand, to trace the cause of bugs, and apply
changes to externally maintained branches.
Neil
> I can't agree - I haven't add second names for existing properties,
> I've add privat,
"private" - I was confused when you used "privat" and "commen" in
an earlier version. I understand its not your first language but
"commen" could be either "comment" or "common".
> language specific properties for these languages
> enabling independant configuration of these (and further) languages.
> Nevertheless these privat, language specific properties could be
> feed from one single, global property set by generating the
> neccessary property names with string concatenation
> ("lexer.XYZ.fold." + "name.of.property").
Too much churn for insufficient benefit. Applications do not have
to use a global property set - that is just the way SciTE is
organised.
These appear inverted:
DefineProperty("fold.cpp.comment.multiline", &OptionsCPP::foldCommentMultiline,
"Set this property to 0 to disable folding explicit fold points when
fold.comment=1.");
DefineProperty("fold.cpp.comment.explicit", &OptionsCPP::foldCommentExplicit,
"Set this property to 0 to disable folding multi-line comments when
fold.comment=1.");
Options, like variables should be positively named rather than
include a negation like fold.cpp.not.syntax.based. Note that all
references inside Fold are negated again like:
if (!options.foldNotSyntaxBased
Options should not include data types like fold.cpp.start.string.
I'd use fold.cpp.explicit.start.
Chatty explanations ("your choice") are too long for the
information they are communicating:
"Set this property to the string of your choice to replace the
standard end string //} "
"used by the C++ lexer for explicit fold points, e.g. //].");
I'd use
"The string to use for explicit fold start points, replacing
the standard //{."
The use of "Set to x" in earlier explanations is because a
particular value (the only possible non-default) is being proposed.
The options object should be considered read-only inside the Fold
call - its the responsibility of LexerCPP::PropertySet to deal with
any modifications to options. I'd also like to avoid potentially
expensive Match calls for the defaults by retaining the current code.
Attached is my version of fold.cpp.explicit.*
Neil