Skip to content

alternative to fraction field for progress on open-ended tasks #39

@goretkin

Description

@goretkin

The Progress type has a fraction field, and I am considering an alternative that stores two quantities e.g. completed and total, which conceptually are just the numerator and denominator of the fraction.

Having that structure, however, allows the denominator to take on a sentinel value (perhaps 0, perhaps -1, perhaps missing) in order to log progress on tasks with an unknown amount of steps.

I think it's a worthwhile idea to explore.

The Progress type could acquire additional fields, and keep the fraction field redundantly.
This would keep e.g. VSCodeServer working.

I would prefer not keeping this redundant information, but the default behavior for serializing the object is based on fieldnames not propertynames: https://github.com/JuliaIO/JSON.jl/blob/4b3913d58f04cc5bb2f8d23c6ef82e0fbed20525/src/Writer.jl#L23

Furthermore, VSCodeServer.jl vendors JSON.jl, so avoiding the redundant information would require a modification to VSCodeServer.jl itself. I think that's the winning solution, but perhaps there's an alternative that I am missing.

Related: #27 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions