Press Control+Alt+S to open the IDE settings and then select Editor | Copyright.Ĭlick (or press Alt+Insert), and select an existing shared scope from the list. Select the scope of files to which you want to add the configured copyright text: So, make sure to edit the part of template that pulls the year from files so that it matches the format of the original copyright.įor example, if your original notice was Copyright 2019-2021 MongoDB, Inc., remove the copyright sign (c) from the template: $originalComment.match("Copyright (\d+)", 1, "-"). Note that the year is going to update correctly if the format of the new copyright matches the format of the previous copyright in the template. In the template, the original year is pulled with the $originalComment.match("Copyright \(c\) (\d+)", 1, "-") code, and the current year is inserted with $today.year. This way you don't have to add the year manually every time you update the copyright. The next year, when you update your copyright, you will be able to regenerate the notice, so that the original year is going to appear alongside the current year ( 2021 – 2022). If you insert a new copyright notice, the original year is going to match the current year, so only one year is going to be added (for example, 2021). Dates in the copyright templateīy default, the copyright template contains two years: the original year that and the current year. Once the profile is configured, you can select the scope of files to which you want to add the text or set this profile as the default profile for all files in the project that are not included to any scope. For the template, use variables, and click Validate to make sure that it is configured correctly. You can enter plain text, or configure a Velocity template. To configure the default profile for all newly created projects, select File | New Projects Setup | Settings for New Projects. Press Control+Alt+S to open the IDE settings and then select Editor | Copyright | Copyright Profiles. Configure copyright profiles Create a new copyright profileĪ profile allows you to define a copyright text that you can later insert across the project or add to specific files only.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |