tek / splain

better implicit errors for scala
MIT License
370 stars 29 forks source link

API/settings cleanup for new features added to 1.1.0 #117

Closed tribbloid closed 8 months ago

tribbloid commented 8 months ago

So here are all the option keywords introduced in the pre-release build:

    val enabled = "enabled" // use plugin instead of scalac compiler to generate error information 
    val enableAll = "all" // set all boolean features to "true"

    val typeReduction = "Vtype-reduction"

    val typeDefPosition = "Vtype-def-position"

    val typeDetail = "Vtype-detail" // integer value: 0 ~ 4

    val typeDiffsDetail = "Vtype-diffs-detail" // integer value: 1 ~ 3

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.:

I'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?

tribbloid commented 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

tek commented 8 months ago

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.

tribbloid commented 8 months ago

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

tribbloid commented 8 months ago

Will add the following section into README:

type detail (experimental)

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.

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.

type diffs detail (experimental)

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.

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

tribbloid commented 8 months ago

PR submitted, 1.1.0-RC0 countdown to publishing

actually why countdown? It is a release candidate, should be published ASAP

tribbloid commented 8 months ago

finished, will release 1.1.0-RC0 ASAP