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

Suggested fixes for pub and priv are surrounded in backticks #3045

Closed
jribbink opened this issue Jan 25, 2024 · 0 comments · Fixed by #3046
Closed

Suggested fixes for pub and priv are surrounded in backticks #3045

jribbink opened this issue Jan 25, 2024 · 0 comments · Fixed by #3046
Assignees
Labels
Bug Something isn't working Feedback

Comments

@jribbink
Copy link
Contributor

Current Behavior

Currently, the suggested fixes for pub and priv access modifiers are surrounded in backticks (i.e. `access(all)` or `access(self)`)

This is technically not the semantically correct correction to the token and is problematic for external consumers of these suggestions (i.e. Language Server) which seek to actually apply this correction, but produce invalid Cadence when doing so.

p.report(p.syntaxErrorWithSuggestedFix(
"`priv` is no longer a valid access keyword",
"`access(self)`",
))

p.report(NewSyntaxErrorWithSuggestedReplacement(
pubToken.Range,
"`pub` is no longer a valid access keyword",
"`access(all)`",
))

Expected Behavior

There should be no backticks. It should be up to external clients to encapsulate the suggestion in any formatting if they wish to do so as this is fairly trivial & the raw suggestion is much more important.

Steps To Reproduce

Try replacing pub or priv in VSCode extension

Screenshot 2024-01-24 at 10 52 56 PM

results in...

Screenshot 2024-01-24 at 10 53 00 PM

Environment

- Cadence version: v1.0.0-preview.1.0.20231213191345-0ff20e15e7e1
- Network: n/a
@jribbink jribbink added Bug Something isn't working Feedback labels Jan 25, 2024
@jribbink jribbink self-assigned this Jan 25, 2024
@jribbink jribbink moved this to 🏗 In Progress in 🌊 Flow 4D Jan 25, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in 🌊 Flow 4D Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feedback
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant