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

Commenting functionality #696

Open
OliverTod opened this issue Sep 22, 2021 · 1 comment
Open

Commenting functionality #696

OliverTod opened this issue Sep 22, 2021 · 1 comment

Comments

@OliverTod
Copy link

OliverTod commented Sep 22, 2021

Allow commenting for the dual purposes of:

  • debugging; and
  • notes to other template developers

Use Case 1: Notes to other developers

Comments would be programmer-readable explanation or annotation in the cicero template. These comments will be added with the purpose of making the source code easier for humans to understand. The text in the comments are not included in the final rendering(s) of the grammar file.

For this use case, comments will likely only contain plain text - there will not be TemplateMark syntax inside the comments - and only be used in individual lines / code blocks.

Use case 2: Commenting out code

Comments can also be used to comment out a code snippet, meaning to add comment syntax causing that block of code to become a comment, so that it will not be executed by the compiler. This may be done to exclude certain pieces of code from the final template, or (more commonly) it can be used to find the source of an error. By systematically commenting out and running parts of the program, the source of an error can be determined, allowing it to be corrected.

For this use case, comments will likely contain TemplateMark syntax and apply to several lines / code blocks.

Issues

Some issues to discuss / look out for:

  • what syntax would comments in TemplateMark use?
  • how will commenting functionality be put into the VS Code extension so that existing keyboard shortcuts work?
  • will comments be removed when a contract instance is created? Will comments be supported in contract instances?
@OliverTod
Copy link
Author

OliverTod commented Sep 22, 2021

I thought you would all get a kick out of this part of the wikipedia entry on 'Comment (computer programming):

image

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

No branches or pull requests

1 participant