Closed tribbloid closed 8 months ago
Just realized that enabled=all/max
wont' be able to affect existing compiler settings (e.g. "Vimplicits" & "VtypeDiffs"), so they have to be removed
Personally, I appreciate more granular configurability, but for the sake of accessibility I think it should be enough to document the simple and complex options separately with a disclaimer.
Regarding the test domain inflation issue, I guess it boils down to how you structure the pipeline of collecting the data and formatting it – if you manage to move the interaction with the the level options fully into the (pure) formatting part, it should be feasible to have that many combinations…just my intuition.
thanks a lot @tek , just revised typeDetail
and typeDiffsDetail
, I'll post the new README section here shortly.
This should be the last ticket of 1.1.0-RC0 release
Will add the following section into README:
The option -P:splain:Vtype-detail:X
can take an integer from 1 to 6 to attach different kinds of details to type information in any error message.
1
(DEFAULT) : type info in short form, by using toString (same as pre-1.1.0)2
= long : type info in long form, by using toLongString3
= 2
+ (existential : existential context)4
= 3
+ (reduction : explain type reduction process)5
= 4
+ (position : type definition position in code)6
= 5
+ (alias : explain type aliases, this generally contains duplicate information with 3
, it is only included for completeness)In addition, multiple names of the detail kind (denoted by bold text in the above list) can be appended to the option value to enable it, e.g. -P:splain:Vtype-detail:1,reduction,position
can attach type reduction process & type definition position while bypassing long and existential.
The option -P:splain:Vtype-diffs-detail:X
can take an integer from 1 to 4 to augment type diff errors with different kinds of details.
1
(DEFAULT) : no augmentation (same as pre-1.1.0)2
= disambiguation : augment type info with disambiguation for both sides in <found>|<required>
and infix types (e.g. A =:= B
, A <:< B
) in error message3
= 2
+ (builtIn : attach built-in found/required errors emitted by Scala compiler IF AND ONLY IF both sides of the error message are identical)4
= 3
+ (builtInAlways : ALWAYS attach original found/required error info, even if both sides of the error message are different)In addition, multiple names of the detail kind (denoted by bold text in the above list) can be appended to the option value to enable it, e.g. -P:splain:Vtype-diffs-detail:1,builtIn
can attach built-in errors while bypassing disambiguation.
@tek the patch & release countdown should be submitted shortly, it they look good to you
PR submitted, 1.1.0-RC0 countdown to publishing
actually why countdown? It is a release candidate, should be published ASAP
finished, will release 1.1.0-RC0 ASAP
So here are all the option keywords introduced in the pre-release build:
that's too many and too difficult to memorize.
The easiest way to simplify it is probably allowing some of the options to take more values, e.g.:
enableAll
will be removed for being incompatible with -Vimplicits & -VtypeDiffsenabled
will only take value false/truefalse
: plugin disabled, emit scalac errors, -Vimplicits & -VtypeDiffs still works tho.true
(DEFAULT) : plugin enabled, but features have to be enabled on demandtypeReduction
andtypeDefPosition
can fold intotypeDetail
, which now takes value 0 ~ 61
/2
/long
: type info uses toLongString3
/long,existential
:2
+ append existential context4
/long,existential,reduction
:3
+ explain type reduction process5
/long,existential,reduction,position
:4
+ append type definition position in code6
/long,existential,reduction,position,alias
:5
+ explain type aliasestypeDiffsDetail
can't be simplified further.1
/2
/disambiguation
: augment type info with disambiguation for both sides in<found>|<required>
and infix types (e.g.A =:= B
,A <:< B
) in error message3
/disambiguation,builtin
: append original found/required error info emitted by Scala compiler IF AND ONLY IF augmented type info from both sides are identical4
/disambiguation,builtinAlways
: same as3
, but always appendI'm not sure if this level of control is good enough, obviously, more refinement could be added by mapping every number in the setting to a feature bit that can be turned on & off on demand, but writing their testing matrices will be a nightmare.
@tek what do you think?