Giter Site home page Giter Site logo

Comments (8)

sphaso avatar sphaso commented on May 29, 2024 1

@chshersh sorry, do you mean something like:

data Suggestion = Suggestion
    { suggestionLine : Line
    , suggestionFile : FilePath
    , suggestionChange : LineChange
    }

data LineChange = LineChange
    { lineChangeNew     :: Text
    , lineChangeComment :: Maybe Text  -- ^ Optional comment to the suggestion
    , lineChangeType :: ChangeType
    } deriving (Eq, Show)

?

from hintman.

sphaso avatar sphaso commented on May 29, 2024

Perhaps it might make sense to have a "suggestion type" union type, so we know that if the suggestion is of type "delete line" every other suggestion on that line can be discarded?

from hintman.

willbasky avatar willbasky commented on May 29, 2024

Does #3 suit?

from hintman.

chshersh avatar chshersh commented on May 29, 2024

@nixorn Is working on the Config type for checks. So we can add one more field to the Suggestion data type with something like suggestionType :: SuggestionType and then we can implement Semigroup instance for Suggestion that will handle joining of suggestions for us.

Not in PR #3, in separate PR, we're just discussing the architecture here 🙂

from hintman.

sphaso avatar sphaso commented on May 29, 2024

I'm implementing suggestionType in #14 , I have a doubt: Suggest currently does not have a line number, shouldn't it have one? how would we link a line number (input) with the suggestion otherwise? do you think it's better to have a Line type inside Suggest or just a suggestLineNumber field?

from hintman.

chshersh avatar chshersh commented on May 29, 2024

@sphaso I think you can rename Suggest data type to LineChange (or better name) and also introduce new data type:

data Suggestion = Suggestion
    { suggestionLine :: Line
    , suggestionChange :: SuggestionChange
    }

from hintman.

chshersh avatar chshersh commented on May 29, 2024

@sphaso This also looks valid 👍

from hintman.

sphaso avatar sphaso commented on May 29, 2024

I've just pushed the types discussed above in #14

from hintman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.