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

out statement #1259

Closed
11 of 13 tasks
lars-reimann opened this issue Nov 9, 2024 · 1 comment · Fixed by #1262
Closed
11 of 13 tasks

out statement #1259

lars-reimann opened this issue Nov 9, 2024 · 1 comment · Fixed by #1262
Labels
dsl 🗒️ Issues regarding the domain specific programming language enhancement 💡 New feature or request released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Nov 9, 2024

Is your feature request related to a problem?

In order to get the output of the operations, users must use code lenses. These are only shown for placeholders, depending on their type.

Because of this, users must create many placeholders in their program that are solely used for output, but never referenced. Still, each placeholder must have a unique name, which either means that users spend time thinking of a proper name, or just quickly give them some garbage name.

Desired solution

Add a new statement

out <expression>,

that is essentially an expression statement that shows code lenses. Determine the names shown in the code lenses based on the results of the function, if <expression> is a call. Otherwise, just call it "expression".

Keep the current behavior of

  • disabling the unused placeholder warning if its name is prefixed by _,
  • showing code lenses for placeholders based on their type.

Possible alternatives (optional)

  • Show code lenses for any expression statement: This would mean that we could no longer show a warning that an expression statement does nothing, which often indicates a bug. It's preferable that users explicitly assign the result or indicate that it is only for output.

Screenshots (optional)

No response

Additional Context (optional)

out is already a keyword in the language (covariance), so this PR is a non-breaking change.

Tasks:

  • Update grammar
  • Update VS Code syntaxes
  • Update formatter
  • Update slicer
  • Update code generator (must autogenerate placeholder names)
  • Update code lens provider
  • Update commands (show, explore, print)
  • Adjust warning that expression statement does nothing. "Did you forget assignment/out..."
  • Don't warn that output statement does nothing.
  • Error: Expression produces no results
  • Error: out is only allowed in pipeline
  • Code added by EDA must replace the output statement by an assignment, so references are resolved (currently the EDA view is broken if triggered on an output statement)
  • Update documentation
@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Nov 9, 2024
@lars-reimann lars-reimann added this to DSL Nov 9, 2024
@lars-reimann lars-reimann added the dsl 🗒️ Issues regarding the domain specific programming language label Nov 9, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DSL Nov 9, 2024
@lars-reimann lars-reimann moved this from Backlog to In Progress in DSL Nov 9, 2024
@lars-reimann lars-reimann linked a pull request Nov 10, 2024 that will close this issue
lars-reimann added a commit that referenced this issue Nov 10, 2024
Closes #1259

### Summary of Changes

Add a new kind of statement, the output statement, to inspect results of
expressions without creating useless placeholders.
@github-project-automation github-project-automation bot moved this from In Progress to ✔️ Done in DSL Nov 10, 2024
lars-reimann pushed a commit that referenced this issue Nov 24, 2024
## [0.22.0](v0.21.1...v0.22.0) (2024-11-24)

### Features

* categorize API elements ([#1263](#1263)) ([d0d971e](d0d971e)), closes [#1243](#1243)
* disable inlay hints for assignee types by default ([#1260](#1260)) ([a651ade](a651ade))
* improve error messages from linker ([#1272](#1272)) ([eddd868](eddd868)), closes [#1268](#1268)
* output statement ([#1262](#1262)) ([011ba31](011ba31)), closes [#1259](#1259)
* remove schema concept from grammar ([#1273](#1273)) ([1a3bf80](1a3bf80)), closes [#1133](#1133)
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dsl 🗒️ Issues regarding the domain specific programming language enhancement 💡 New feature or request released Included in a release
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

1 participant