onflow / cadence-tools

Developer tools for Cadence
https://www.onflow.org/
Apache License 2.0
24 stars 20 forks source link

[LS] Quick fix -> Add missing members not working properly #398

Closed alilloig closed 1 month ago

alilloig commented 3 months ago

Problem

When you use the aforementioned tool for adding e.g. missing functions to a contract or resource, the access modifier is badly constructed. It'll say all fun rather than access(all) fun. It also forgets the view modifier if the function has it.

Steps to Reproduce

This was found updating FungibleToken contracts to Cadence 1.0 and the new FT standard. Just create a contract or resource that implements an interface with any function declared on it, then scroll over its name to get to the vscode popup that shows you the error and allows you to apply the quick fix.

Context

This may be related to onflow/vscode-cadence#563