SIT102 - File Comment InsertThis extension inserts SIT102 assignment specific comments and docstrings into C/C++ and Python files. The extension assumes that the Splashkit project is created in a folder named after the exercise being completed. If not, any of the fields can be updated after the comment is inserted into the file. ConfigurationAdd your name and student ID to the SIT102 settings. To do this, in VS Code:
Default settings are provided, however the values can be changed to tailor the output. UseTo access the commands:
Shortcut keys are also available
For inserting a file comment, the comment will be automatically inserted at the top of the file. For inserting a procedure or function comment, place the cursor on the signature row of the procedure or function declaration (ie. the first row of the procedure or function). For inserting an enum or struct comment, place the cursor on the first row of the enum or struct declaration. For an example: Example File Level CommentsC/C++At the top of a .h, .hpp or .cpp file, the following comment will be inserted:
PythonAt the top of a .py file, the following docstring will be inserted:
For further information on the format, refer to PEP-8 and PEP-257. Example Procedure and Function CommentsFor procedures and functions, the output will be adjusted based on the signature when declaring the procedure or function. Some C/C++ examples include (Python will be similar, but for python multiline docstrings): Procedure with no Parameters
Procedure with Parameters
Function with no Parameters
Function with Parameters
Example Enum and Struct CommentsFor an enum, struct or comment for a preprocessor define, the following comment provides an example of the format for a C/C++ file:
NoteSince version 3.4, an enum type has been available for Python. As a result, the above format for enums and structs can be used with Python, however you are unlikely to need it during this subject. In Loving Memory of Grace Stacey |