) always start on a new line.Īn empty line is inserted after a namespace declaration. The use construct in anonymous functions is always on the same line as the function keyword.Ĭlose keywords of control flow constructs ( endif, endfor. The body is indented from the beginning of the line where the function keyword is defined. Subsequent lines are offset to match the first asterisk character on the first line Spaces are inserted after keywords, names and separators to make the code more readable.Ĭode is indented based on the number of embedded blocks. The styles share most features, summed up in the following table, while they differ in a couple of details, explained in their own sections. The code style that formatter is going to follow. Number of spaces that represent a single tab, this value is used only when editor.insertSpaces is trueĮnables or disables automatic formatting of code block upon typing or }. Spaces are used to indent code if true, tabs are used otherwise. All the relevant settings and their effects are summed up in the following table. The formatting behavior is set in settings.json. editor.formatOnPaste to true triggers format when pasting.editor.formatOnSave to true instructs the formatter to run when saving the document.editor.formatOnType to true which enables the editor to format code blocks and statements upon typing and }.Or it can be triggered based on specific user actions, such as typing, saving or pasting. Format Selection ( Ctrl+K Ctrl+F) - Format the selected text.Format Document ( Shift+Alt+F) - Format the entire active file.The formatting can be triggered explicitly by two actions: The code formatting normalizes whitespaces, line endings, opening and closing braces, indentation, adds or removes new lines when necessary and pretty print spaces. Note: In order to format the document, it must be syntax-error free. The integrated formatter helps you keep the code looking clean and maintain the selected code style (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |