Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with extension and pretty printer #955

Closed
nilehmann opened this issue Dec 18, 2024 · 2 comments · Fixed by #957
Closed

Issues with extension and pretty printer #955

nilehmann opened this issue Dec 18, 2024 · 2 comments · Fixed by #957
Assignees

Comments

@nilehmann
Copy link
Member

nilehmann commented Dec 18, 2024

I found a couple of issues with the extension when trying the following (note that you need to save without running rustfmt)

#[flux::sig(fn(c: Option<bool>) -> Option<i32{v:0 <= v}>)]
pub fn test0(c: Option<bool>) -> Option<i32> {
    c.map(|b| 
        if b { 
            1 
        } else { 
            2 
        }
    )
}

Type with no indices has confusing formatting

As shown in the image, Option is pretty printed as Option<λb0. bool[b0]>[{..}] . I find the ellipsis confusing because Option has no indices so there's nothing to expand (or rather it is indexed by a unit sort). I think we should show it as Option<λb0. bool[b0]> (I'm not worried about the lambda here, but we can discuss that)

image

The extension shows trace data from the shape phase

As shown below, the extension shows a hole (i.e., *) as part of the constraints which indicates it is not filtering out the trace data coming from the shape phase (related to #916)

image

@ranjitjhala
Copy link
Contributor

Btw, what is the relevance of rustfmt here?

@nilehmann
Copy link
Member Author

If you run rustfmt on save everything is collapsed in one line so you can't put the cursor inside the closure to get the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants