├── .gitattributes ├── .gitignore ├── .idea ├── .name ├── checkstyle-idea.xml ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── compiler.xml ├── encodings.xml ├── misc.xml └── vcs.xml ├── .travis.yml ├── COPYING.LESSER.md ├── COPYING.md ├── README.md ├── build.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── license └── HEADER.txt ├── settings.gradle.kts └── src ├── main ├── java │ └── com │ │ └── github │ │ └── _1c_syntax │ │ └── bsl │ │ └── intellij │ │ ├── BSLCommenter.java │ │ ├── BSLIcons.java │ │ ├── BSLLanguage.java │ │ ├── BSLPairedBraceMatcher.java │ │ ├── BSLParserDefinition.java │ │ ├── BSLPreloadingActivity.java │ │ ├── BSLSyntaxHighlighter.java │ │ ├── BSLSyntaxHighlighterFactory.java │ │ ├── files │ │ ├── BSLFileType.java │ │ └── OSFileType.java │ │ ├── psi │ │ └── BSLFile.java │ │ └── settings │ │ ├── BSLConfigurable.java │ │ ├── BSLConfigurableGUI.form │ │ ├── BSLConfigurableGUI.java │ │ ├── DiagnosticLanguage.java │ │ └── LanguageServerSettingsState.java └── resources │ ├── META-INF │ └── plugin.xml │ └── com │ └── github │ └── _1c_syntax │ └── bsl │ └── intellij │ └── icons │ ├── bsl.png │ └── os.png └── test ├── java └── com │ └── github │ └── _1c_syntax │ └── bsl │ └── intellij │ ├── BSLParserTest.java │ └── util │ └── TestUtils.java └── resources └── parser ├── .idea ├── encodings.xml ├── modules.xml ├── parser.iml ├── vcs.xml └── workspace.xml ├── Hello.bsl └── Hello.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java eol=lf 2 | *.bsl eol=lf 3 | *.xml eol=lf 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 2 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 3 | 4 | # User-specific stuff 5 | .idea/**/workspace.xml 6 | .idea/**/tasks.xml 7 | .idea/**/usage.statistics.xml 8 | .idea/**/dictionaries 9 | .idea/**/shelf 10 | 11 | # Generated files 12 | .idea/**/contentModel.xml 13 | 14 | # Sensitive or high-churn files 15 | .idea/**/dataSources/ 16 | .idea/**/dataSources.ids 17 | .idea/**/dataSources.local.xml 18 | .idea/**/sqlDataSources.xml 19 | .idea/**/dynamic.xml 20 | .idea/**/uiDesigner.xml 21 | .idea/**/dbnavigator.xml 22 | 23 | # Gradle 24 | .idea/**/gradle.xml 25 | .idea/**/libraries 26 | 27 | # Gradle and Maven with auto-import 28 | # When using Gradle or Maven with auto-import, you should exclude module files, 29 | # since they will be recreated, and may cause churn. Uncomment if using 30 | # auto-import. 31 | .idea/modules.xml 32 | .idea/*.iml 33 | .idea/modules 34 | 35 | # IntelliJ 36 | out/ 37 | 38 | # Crashlytics plugin (for Android Studio and IntelliJ) 39 | com_crashlytics_export_strings.xml 40 | crashlytics.properties 41 | crashlytics-build.properties 42 | fabric.properties 43 | 44 | # Editor-based Rest Client 45 | .idea/httpRequests 46 | 47 | .gradle/ 48 | *.zip 49 | *.ps1 50 | target/ 51 | build/ 52 | 53 | # Scala compiler user settings 54 | .idea/hydra.xml 55 | 56 | .idea/sonarlint/ 57 | 58 | intellij-bsl/src/test/resources/parser/.idea/ 59 | 60 | gen/ 61 | out/ 62 | 63 | # Crashlytics plugin (for Android Studio and IntelliJ) 64 | com_crashlytics_export_strings.xml 65 | crashlytics.properties 66 | crashlytics-build.properties 67 | fabric.properties 68 | 69 | \.idea/sonarlint-state\.xml 70 | 71 | \.idea/sonarlint\.xml 72 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | intellij-bsl -------------------------------------------------------------------------------- /.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 26 | 27 | 28 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 52 | 53 | 57 | 58 | 59 | 60 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - openjdk11 5 | 6 | addons: 7 | sonarcloud: true 8 | 9 | git: 10 | depth: false 11 | 12 | after_script: 13 | - ./gradlew sonarqube 14 | 15 | before_cache: 16 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 17 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ 18 | cache: 19 | directories: 20 | - $HOME/.gradle/caches/ 21 | - $HOME/.gradle/wrapper/ 22 | -------------------------------------------------------------------------------- /COPYING.LESSER.md: -------------------------------------------------------------------------------- 1 | GNU Lesser General Public License 2 | ================================= 3 | 4 | _Version 3, 29 June 2007_ 5 | _Copyright © 2007 Free Software Foundation, Inc. <>_ 6 | 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | 10 | 11 | This version of the GNU Lesser General Public License incorporates 12 | the terms and conditions of version 3 of the GNU General Public 13 | License, supplemented by the additional permissions listed below. 14 | 15 | ### 0. Additional Definitions 16 | 17 | As used herein, “this License” refers to version 3 of the GNU Lesser 18 | General Public License, and the “GNU GPL” refers to version 3 of the GNU 19 | General Public License. 20 | 21 | “The Library” refers to a covered work governed by this License, 22 | other than an Application or a Combined Work as defined below. 23 | 24 | An “Application” is any work that makes use of an interface provided 25 | by the Library, but which is not otherwise based on the Library. 26 | Defining a subclass of a class defined by the Library is deemed a mode 27 | of using an interface provided by the Library. 28 | 29 | A “Combined Work” is a work produced by combining or linking an 30 | Application with the Library. The particular version of the Library 31 | with which the Combined Work was made is also called the “Linked 32 | Version”. 33 | 34 | The “Minimal Corresponding Source” for a Combined Work means the 35 | Corresponding Source for the Combined Work, excluding any source code 36 | for portions of the Combined Work that, considered in isolation, are 37 | based on the Application, and not on the Linked Version. 38 | 39 | The “Corresponding Application Code” for a Combined Work means the 40 | object code and/or source code for the Application, including any data 41 | and utility programs needed for reproducing the Combined Work from the 42 | Application, but excluding the System Libraries of the Combined Work. 43 | 44 | ### 1. Exception to Section 3 of the GNU GPL 45 | 46 | You may convey a covered work under sections 3 and 4 of this License 47 | without being bound by section 3 of the GNU GPL. 48 | 49 | ### 2. Conveying Modified Versions 50 | 51 | If you modify a copy of the Library, and, in your modifications, a 52 | facility refers to a function or data to be supplied by an Application 53 | that uses the facility (other than as an argument passed when the 54 | facility is invoked), then you may convey a copy of the modified 55 | version: 56 | 57 | * **a)** under this License, provided that you make a good faith effort to 58 | ensure that, in the event an Application does not supply the 59 | function or data, the facility still operates, and performs 60 | whatever part of its purpose remains meaningful, or 61 | 62 | * **b)** under the GNU GPL, with none of the additional permissions of 63 | this License applicable to that copy. 64 | 65 | ### 3. Object Code Incorporating Material from Library Header Files 66 | 67 | The object code form of an Application may incorporate material from 68 | a header file that is part of the Library. You may convey such object 69 | code under terms of your choice, provided that, if the incorporated 70 | material is not limited to numerical parameters, data structure 71 | layouts and accessors, or small macros, inline functions and templates 72 | (ten or fewer lines in length), you do both of the following: 73 | 74 | * **a)** Give prominent notice with each copy of the object code that the 75 | Library is used in it and that the Library and its use are 76 | covered by this License. 77 | * **b)** Accompany the object code with a copy of the GNU GPL and this license 78 | document. 79 | 80 | ### 4. Combined Works 81 | 82 | You may convey a Combined Work under terms of your choice that, 83 | taken together, effectively do not restrict modification of the 84 | portions of the Library contained in the Combined Work and reverse 85 | engineering for debugging such modifications, if you also do each of 86 | the following: 87 | 88 | * **a)** Give prominent notice with each copy of the Combined Work that 89 | the Library is used in it and that the Library and its use are 90 | covered by this License. 91 | 92 | * **b)** Accompany the Combined Work with a copy of the GNU GPL and this license 93 | document. 94 | 95 | * **c)** For a Combined Work that displays copyright notices during 96 | execution, include the copyright notice for the Library among 97 | these notices, as well as a reference directing the user to the 98 | copies of the GNU GPL and this license document. 99 | 100 | * **d)** Do one of the following: 101 | - **0)** Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | - **1)** Use a suitable shared library mechanism for linking with the 109 | Library. A suitable mechanism is one that **(a)** uses at run time 110 | a copy of the Library already present on the user's computer 111 | system, and **(b)** will operate properly with a modified version 112 | of the Library that is interface-compatible with the Linked 113 | Version. 114 | 115 | * **e)** Provide Installation Information, but only if you would otherwise 116 | be required to provide such information under section 6 of the 117 | GNU GPL, and only to the extent that such information is 118 | necessary to install and execute a modified version of the 119 | Combined Work produced by recombining or relinking the 120 | Application with a modified version of the Linked Version. (If 121 | you use option **4d0**, the Installation Information must accompany 122 | the Minimal Corresponding Source and Corresponding Application 123 | Code. If you use option **4d1**, you must provide the Installation 124 | Information in the manner specified by section 6 of the GNU GPL 125 | for conveying Corresponding Source.) 126 | 127 | ### 5. Combined Libraries 128 | 129 | You may place library facilities that are a work based on the 130 | Library side by side in a single library together with other library 131 | facilities that are not Applications and are not covered by this 132 | License, and convey such a combined library under terms of your 133 | choice, if you do both of the following: 134 | 135 | * **a)** Accompany the combined library with a copy of the same work based 136 | on the Library, uncombined with any other library facilities, 137 | conveyed under the terms of this License. 138 | * **b)** Give prominent notice with the combined library that part of it 139 | is a work based on the Library, and explaining where to find the 140 | accompanying uncombined form of the same work. 141 | 142 | ### 6. Revised Versions of the GNU Lesser General Public License 143 | 144 | The Free Software Foundation may publish revised and/or new versions 145 | of the GNU Lesser General Public License from time to time. Such new 146 | versions will be similar in spirit to the present version, but may 147 | differ in detail to address new problems or concerns. 148 | 149 | Each version is given a distinguishing version number. If the 150 | Library as you received it specifies that a certain numbered version 151 | of the GNU Lesser General Public License “or any later version” 152 | applies to it, you have the option of following the terms and 153 | conditions either of that published version or of any later version 154 | published by the Free Software Foundation. If the Library as you 155 | received it does not specify a version number of the GNU Lesser 156 | General Public License, you may choose any version of the GNU Lesser 157 | General Public License ever published by the Free Software Foundation. 158 | 159 | If the Library as you received it specifies that a proxy can decide 160 | whether future versions of the GNU Lesser General Public License shall 161 | apply, that proxy's public statement of acceptance of any version is 162 | permanent authorization for you to choose that version for the 163 | Library. 164 | -------------------------------------------------------------------------------- /COPYING.md: -------------------------------------------------------------------------------- 1 | GNU General Public License 2 | ========================== 3 | 4 | _Version 3, 29 June 2007_ 5 | _Copyright © 2007 Free Software Foundation, Inc. <>_ 6 | 7 | Everyone is permitted to copy and distribute verbatim copies of this license 8 | document, but changing it is not allowed. 9 | 10 | ## Preamble 11 | 12 | The GNU General Public License is a free, copyleft license for software and other 13 | kinds of works. 14 | 15 | The licenses for most software and other practical works are designed to take away 16 | your freedom to share and change the works. By contrast, the GNU General Public 17 | License is intended to guarantee your freedom to share and change all versions of a 18 | program--to make sure it remains free software for all its users. We, the Free 19 | Software Foundation, use the GNU General Public License for most of our software; it 20 | applies also to any other work released this way by its authors. You can apply it to 21 | your programs, too. 22 | 23 | When we speak of free software, we are referring to freedom, not price. Our General 24 | Public Licenses are designed to make sure that you have the freedom to distribute 25 | copies of free software (and charge for them if you wish), that you receive source 26 | code or can get it if you want it, that you can change the software or use pieces of 27 | it in new free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you these rights or 30 | asking you to surrender the rights. Therefore, you have certain responsibilities if 31 | you distribute copies of the software, or if you modify it: responsibilities to 32 | respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether gratis or for a fee, 35 | you must pass on to the recipients the same freedoms that you received. You must make 36 | sure that they, too, receive or can get the source code. And you must show them these 37 | terms so they know their rights. 38 | 39 | Developers that use the GNU GPL protect your rights with two steps: **(1)** assert 40 | copyright on the software, and **(2)** offer you this License giving you legal permission 41 | to copy, distribute and/or modify it. 42 | 43 | For the developers' and authors' protection, the GPL clearly explains that there is 44 | no warranty for this free software. For both users' and authors' sake, the GPL 45 | requires that modified versions be marked as changed, so that their problems will not 46 | be attributed erroneously to authors of previous versions. 47 | 48 | Some devices are designed to deny users access to install or run modified versions of 49 | the software inside them, although the manufacturer can do so. This is fundamentally 50 | incompatible with the aim of protecting users' freedom to change the software. The 51 | systematic pattern of such abuse occurs in the area of products for individuals to 52 | use, which is precisely where it is most unacceptable. Therefore, we have designed 53 | this version of the GPL to prohibit the practice for those products. If such problems 54 | arise substantially in other domains, we stand ready to extend this provision to 55 | those domains in future versions of the GPL, as needed to protect the freedom of 56 | users. 57 | 58 | Finally, every program is threatened constantly by software patents. States should 59 | not allow patents to restrict development and use of software on general-purpose 60 | computers, but in those that do, we wish to avoid the special danger that patents 61 | applied to a free program could make it effectively proprietary. To prevent this, the 62 | GPL assures that patents cannot be used to render the program non-free. 63 | 64 | The precise terms and conditions for copying, distribution and modification follow. 65 | 66 | ## TERMS AND CONDITIONS 67 | 68 | ### 0. Definitions 69 | 70 | “This License” refers to version 3 of the GNU General Public License. 71 | 72 | “Copyright” also means copyright-like laws that apply to other kinds of 73 | works, such as semiconductor masks. 74 | 75 | “The Program” refers to any copyrightable work licensed under this 76 | License. Each licensee is addressed as “you”. “Licensees” and 77 | “recipients” may be individuals or organizations. 78 | 79 | To “modify” a work means to copy from or adapt all or part of the work in 80 | a fashion requiring copyright permission, other than the making of an exact copy. The 81 | resulting work is called a “modified version” of the earlier work or a 82 | work “based on” the earlier work. 83 | 84 | A “covered work” means either the unmodified Program or a work based on 85 | the Program. 86 | 87 | To “propagate” a work means to do anything with it that, without 88 | permission, would make you directly or secondarily liable for infringement under 89 | applicable copyright law, except executing it on a computer or modifying a private 90 | copy. Propagation includes copying, distribution (with or without modification), 91 | making available to the public, and in some countries other activities as well. 92 | 93 | To “convey” a work means any kind of propagation that enables other 94 | parties to make or receive copies. Mere interaction with a user through a computer 95 | network, with no transfer of a copy, is not conveying. 96 | 97 | An interactive user interface displays “Appropriate Legal Notices” to the 98 | extent that it includes a convenient and prominently visible feature that **(1)** 99 | displays an appropriate copyright notice, and **(2)** tells the user that there is no 100 | warranty for the work (except to the extent that warranties are provided), that 101 | licensees may convey the work under this License, and how to view a copy of this 102 | License. If the interface presents a list of user commands or options, such as a 103 | menu, a prominent item in the list meets this criterion. 104 | 105 | ### 1. Source Code 106 | 107 | The “source code” for a work means the preferred form of the work for 108 | making modifications to it. “Object code” means any non-source form of a 109 | work. 110 | 111 | A “Standard Interface” means an interface that either is an official 112 | standard defined by a recognized standards body, or, in the case of interfaces 113 | specified for a particular programming language, one that is widely used among 114 | developers working in that language. 115 | 116 | The “System Libraries” of an executable work include anything, other than 117 | the work as a whole, that **(a)** is included in the normal form of packaging a Major 118 | Component, but which is not part of that Major Component, and **(b)** serves only to 119 | enable use of the work with that Major Component, or to implement a Standard 120 | Interface for which an implementation is available to the public in source code form. 121 | A “Major Component”, in this context, means a major essential component 122 | (kernel, window system, and so on) of the specific operating system (if any) on which 123 | the executable work runs, or a compiler used to produce the work, or an object code 124 | interpreter used to run it. 125 | 126 | The “Corresponding Source” for a work in object code form means all the 127 | source code needed to generate, install, and (for an executable work) run the object 128 | code and to modify the work, including scripts to control those activities. However, 129 | it does not include the work's System Libraries, or general-purpose tools or 130 | generally available free programs which are used unmodified in performing those 131 | activities but which are not part of the work. For example, Corresponding Source 132 | includes interface definition files associated with source files for the work, and 133 | the source code for shared libraries and dynamically linked subprograms that the work 134 | is specifically designed to require, such as by intimate data communication or 135 | control flow between those subprograms and other parts of the work. 136 | 137 | The Corresponding Source need not include anything that users can regenerate 138 | automatically from other parts of the Corresponding Source. 139 | 140 | The Corresponding Source for a work in source code form is that same work. 141 | 142 | ### 2. Basic Permissions 143 | 144 | All rights granted under this License are granted for the term of copyright on the 145 | Program, and are irrevocable provided the stated conditions are met. This License 146 | explicitly affirms your unlimited permission to run the unmodified Program. The 147 | output from running a covered work is covered by this License only if the output, 148 | given its content, constitutes a covered work. This License acknowledges your rights 149 | of fair use or other equivalent, as provided by copyright law. 150 | 151 | You may make, run and propagate covered works that you do not convey, without 152 | conditions so long as your license otherwise remains in force. You may convey covered 153 | works to others for the sole purpose of having them make modifications exclusively 154 | for you, or provide you with facilities for running those works, provided that you 155 | comply with the terms of this License in conveying all material for which you do not 156 | control copyright. Those thus making or running the covered works for you must do so 157 | exclusively on your behalf, under your direction and control, on terms that prohibit 158 | them from making any copies of your copyrighted material outside their relationship 159 | with you. 160 | 161 | Conveying under any other circumstances is permitted solely under the conditions 162 | stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 163 | 164 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law 165 | 166 | No covered work shall be deemed part of an effective technological measure under any 167 | applicable law fulfilling obligations under article 11 of the WIPO copyright treaty 168 | adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention 169 | of such measures. 170 | 171 | When you convey a covered work, you waive any legal power to forbid circumvention of 172 | technological measures to the extent such circumvention is effected by exercising 173 | rights under this License with respect to the covered work, and you disclaim any 174 | intention to limit operation or modification of the work as a means of enforcing, 175 | against the work's users, your or third parties' legal rights to forbid circumvention 176 | of technological measures. 177 | 178 | ### 4. Conveying Verbatim Copies 179 | 180 | You may convey verbatim copies of the Program's source code as you receive it, in any 181 | medium, provided that you conspicuously and appropriately publish on each copy an 182 | appropriate copyright notice; keep intact all notices stating that this License and 183 | any non-permissive terms added in accord with section 7 apply to the code; keep 184 | intact all notices of the absence of any warranty; and give all recipients a copy of 185 | this License along with the Program. 186 | 187 | You may charge any price or no price for each copy that you convey, and you may offer 188 | support or warranty protection for a fee. 189 | 190 | ### 5. Conveying Modified Source Versions 191 | 192 | You may convey a work based on the Program, or the modifications to produce it from 193 | the Program, in the form of source code under the terms of section 4, provided that 194 | you also meet all of these conditions: 195 | 196 | * **a)** The work must carry prominent notices stating that you modified it, and giving a 197 | relevant date. 198 | * **b)** The work must carry prominent notices stating that it is released under this 199 | License and any conditions added under section 7. This requirement modifies the 200 | requirement in section 4 to “keep intact all notices”. 201 | * **c)** You must license the entire work, as a whole, under this License to anyone who 202 | comes into possession of a copy. This License will therefore apply, along with any 203 | applicable section 7 additional terms, to the whole of the work, and all its parts, 204 | regardless of how they are packaged. This License gives no permission to license the 205 | work in any other way, but it does not invalidate such permission if you have 206 | separately received it. 207 | * **d)** If the work has interactive user interfaces, each must display Appropriate Legal 208 | Notices; however, if the Program has interactive interfaces that do not display 209 | Appropriate Legal Notices, your work need not make them do so. 210 | 211 | A compilation of a covered work with other separate and independent works, which are 212 | not by their nature extensions of the covered work, and which are not combined with 213 | it such as to form a larger program, in or on a volume of a storage or distribution 214 | medium, is called an “aggregate” if the compilation and its resulting 215 | copyright are not used to limit the access or legal rights of the compilation's users 216 | beyond what the individual works permit. Inclusion of a covered work in an aggregate 217 | does not cause this License to apply to the other parts of the aggregate. 218 | 219 | ### 6. Conveying Non-Source Forms 220 | 221 | You may convey a covered work in object code form under the terms of sections 4 and 222 | 5, provided that you also convey the machine-readable Corresponding Source under the 223 | terms of this License, in one of these ways: 224 | 225 | * **a)** Convey the object code in, or embodied in, a physical product (including a 226 | physical distribution medium), accompanied by the Corresponding Source fixed on a 227 | durable physical medium customarily used for software interchange. 228 | * **b)** Convey the object code in, or embodied in, a physical product (including a 229 | physical distribution medium), accompanied by a written offer, valid for at least 230 | three years and valid for as long as you offer spare parts or customer support for 231 | that product model, to give anyone who possesses the object code either **(1)** a copy of 232 | the Corresponding Source for all the software in the product that is covered by this 233 | License, on a durable physical medium customarily used for software interchange, for 234 | a price no more than your reasonable cost of physically performing this conveying of 235 | source, or **(2)** access to copy the Corresponding Source from a network server at no 236 | charge. 237 | * **c)** Convey individual copies of the object code with a copy of the written offer to 238 | provide the Corresponding Source. This alternative is allowed only occasionally and 239 | noncommercially, and only if you received the object code with such an offer, in 240 | accord with subsection 6b. 241 | * **d)** Convey the object code by offering access from a designated place (gratis or for 242 | a charge), and offer equivalent access to the Corresponding Source in the same way 243 | through the same place at no further charge. You need not require recipients to copy 244 | the Corresponding Source along with the object code. If the place to copy the object 245 | code is a network server, the Corresponding Source may be on a different server 246 | (operated by you or a third party) that supports equivalent copying facilities, 247 | provided you maintain clear directions next to the object code saying where to find 248 | the Corresponding Source. Regardless of what server hosts the Corresponding Source, 249 | you remain obligated to ensure that it is available for as long as needed to satisfy 250 | these requirements. 251 | * **e)** Convey the object code using peer-to-peer transmission, provided you inform 252 | other peers where the object code and Corresponding Source of the work are being 253 | offered to the general public at no charge under subsection 6d. 254 | 255 | A separable portion of the object code, whose source code is excluded from the 256 | Corresponding Source as a System Library, need not be included in conveying the 257 | object code work. 258 | 259 | A “User Product” is either **(1)** a “consumer product”, which 260 | means any tangible personal property which is normally used for personal, family, or 261 | household purposes, or **(2)** anything designed or sold for incorporation into a 262 | dwelling. In determining whether a product is a consumer product, doubtful cases 263 | shall be resolved in favor of coverage. For a particular product received by a 264 | particular user, “normally used” refers to a typical or common use of 265 | that class of product, regardless of the status of the particular user or of the way 266 | in which the particular user actually uses, or expects or is expected to use, the 267 | product. A product is a consumer product regardless of whether the product has 268 | substantial commercial, industrial or non-consumer uses, unless such uses represent 269 | the only significant mode of use of the product. 270 | 271 | “Installation Information” for a User Product means any methods, 272 | procedures, authorization keys, or other information required to install and execute 273 | modified versions of a covered work in that User Product from a modified version of 274 | its Corresponding Source. The information must suffice to ensure that the continued 275 | functioning of the modified object code is in no case prevented or interfered with 276 | solely because modification has been made. 277 | 278 | If you convey an object code work under this section in, or with, or specifically for 279 | use in, a User Product, and the conveying occurs as part of a transaction in which 280 | the right of possession and use of the User Product is transferred to the recipient 281 | in perpetuity or for a fixed term (regardless of how the transaction is 282 | characterized), the Corresponding Source conveyed under this section must be 283 | accompanied by the Installation Information. But this requirement does not apply if 284 | neither you nor any third party retains the ability to install modified object code 285 | on the User Product (for example, the work has been installed in ROM). 286 | 287 | The requirement to provide Installation Information does not include a requirement to 288 | continue to provide support service, warranty, or updates for a work that has been 289 | modified or installed by the recipient, or for the User Product in which it has been 290 | modified or installed. Access to a network may be denied when the modification itself 291 | materially and adversely affects the operation of the network or violates the rules 292 | and protocols for communication across the network. 293 | 294 | Corresponding Source conveyed, and Installation Information provided, in accord with 295 | this section must be in a format that is publicly documented (and with an 296 | implementation available to the public in source code form), and must require no 297 | special password or key for unpacking, reading or copying. 298 | 299 | ### 7. Additional Terms 300 | 301 | “Additional permissions” are terms that supplement the terms of this 302 | License by making exceptions from one or more of its conditions. Additional 303 | permissions that are applicable to the entire Program shall be treated as though they 304 | were included in this License, to the extent that they are valid under applicable 305 | law. If additional permissions apply only to part of the Program, that part may be 306 | used separately under those permissions, but the entire Program remains governed by 307 | this License without regard to the additional permissions. 308 | 309 | When you convey a copy of a covered work, you may at your option remove any 310 | additional permissions from that copy, or from any part of it. (Additional 311 | permissions may be written to require their own removal in certain cases when you 312 | modify the work.) You may place additional permissions on material, added by you to a 313 | covered work, for which you have or can give appropriate copyright permission. 314 | 315 | Notwithstanding any other provision of this License, for material you add to a 316 | covered work, you may (if authorized by the copyright holders of that material) 317 | supplement the terms of this License with terms: 318 | 319 | * **a)** Disclaiming warranty or limiting liability differently from the terms of 320 | sections 15 and 16 of this License; or 321 | * **b)** Requiring preservation of specified reasonable legal notices or author 322 | attributions in that material or in the Appropriate Legal Notices displayed by works 323 | containing it; or 324 | * **c)** Prohibiting misrepresentation of the origin of that material, or requiring that 325 | modified versions of such material be marked in reasonable ways as different from the 326 | original version; or 327 | * **d)** Limiting the use for publicity purposes of names of licensors or authors of the 328 | material; or 329 | * **e)** Declining to grant rights under trademark law for use of some trade names, 330 | trademarks, or service marks; or 331 | * **f)** Requiring indemnification of licensors and authors of that material by anyone 332 | who conveys the material (or modified versions of it) with contractual assumptions of 333 | liability to the recipient, for any liability that these contractual assumptions 334 | directly impose on those licensors and authors. 335 | 336 | All other non-permissive additional terms are considered “further 337 | restrictions” within the meaning of section 10. If the Program as you received 338 | it, or any part of it, contains a notice stating that it is governed by this License 339 | along with a term that is a further restriction, you may remove that term. If a 340 | license document contains a further restriction but permits relicensing or conveying 341 | under this License, you may add to a covered work material governed by the terms of 342 | that license document, provided that the further restriction does not survive such 343 | relicensing or conveying. 344 | 345 | If you add terms to a covered work in accord with this section, you must place, in 346 | the relevant source files, a statement of the additional terms that apply to those 347 | files, or a notice indicating where to find the applicable terms. 348 | 349 | Additional terms, permissive or non-permissive, may be stated in the form of a 350 | separately written license, or stated as exceptions; the above requirements apply 351 | either way. 352 | 353 | ### 8. Termination 354 | 355 | You may not propagate or modify a covered work except as expressly provided under 356 | this License. Any attempt otherwise to propagate or modify it is void, and will 357 | automatically terminate your rights under this License (including any patent licenses 358 | granted under the third paragraph of section 11). 359 | 360 | However, if you cease all violation of this License, then your license from a 361 | particular copyright holder is reinstated **(a)** provisionally, unless and until the 362 | copyright holder explicitly and finally terminates your license, and **(b)** permanently, 363 | if the copyright holder fails to notify you of the violation by some reasonable means 364 | prior to 60 days after the cessation. 365 | 366 | Moreover, your license from a particular copyright holder is reinstated permanently 367 | if the copyright holder notifies you of the violation by some reasonable means, this 368 | is the first time you have received notice of violation of this License (for any 369 | work) from that copyright holder, and you cure the violation prior to 30 days after 370 | your receipt of the notice. 371 | 372 | Termination of your rights under this section does not terminate the licenses of 373 | parties who have received copies or rights from you under this License. If your 374 | rights have been terminated and not permanently reinstated, you do not qualify to 375 | receive new licenses for the same material under section 10. 376 | 377 | ### 9. Acceptance Not Required for Having Copies 378 | 379 | You are not required to accept this License in order to receive or run a copy of the 380 | Program. Ancillary propagation of a covered work occurring solely as a consequence of 381 | using peer-to-peer transmission to receive a copy likewise does not require 382 | acceptance. However, nothing other than this License grants you permission to 383 | propagate or modify any covered work. These actions infringe copyright if you do not 384 | accept this License. Therefore, by modifying or propagating a covered work, you 385 | indicate your acceptance of this License to do so. 386 | 387 | ### 10. Automatic Licensing of Downstream Recipients 388 | 389 | Each time you convey a covered work, the recipient automatically receives a license 390 | from the original licensors, to run, modify and propagate that work, subject to this 391 | License. You are not responsible for enforcing compliance by third parties with this 392 | License. 393 | 394 | An “entity transaction” is a transaction transferring control of an 395 | organization, or substantially all assets of one, or subdividing an organization, or 396 | merging organizations. If propagation of a covered work results from an entity 397 | transaction, each party to that transaction who receives a copy of the work also 398 | receives whatever licenses to the work the party's predecessor in interest had or 399 | could give under the previous paragraph, plus a right to possession of the 400 | Corresponding Source of the work from the predecessor in interest, if the predecessor 401 | has it or can get it with reasonable efforts. 402 | 403 | You may not impose any further restrictions on the exercise of the rights granted or 404 | affirmed under this License. For example, you may not impose a license fee, royalty, 405 | or other charge for exercise of rights granted under this License, and you may not 406 | initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging 407 | that any patent claim is infringed by making, using, selling, offering for sale, or 408 | importing the Program or any portion of it. 409 | 410 | ### 11. Patents 411 | 412 | A “contributor” is a copyright holder who authorizes use under this 413 | License of the Program or a work on which the Program is based. The work thus 414 | licensed is called the contributor's “contributor version”. 415 | 416 | A contributor's “essential patent claims” are all patent claims owned or 417 | controlled by the contributor, whether already acquired or hereafter acquired, that 418 | would be infringed by some manner, permitted by this License, of making, using, or 419 | selling its contributor version, but do not include claims that would be infringed 420 | only as a consequence of further modification of the contributor version. For 421 | purposes of this definition, “control” includes the right to grant patent 422 | sublicenses in a manner consistent with the requirements of this License. 423 | 424 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license 425 | under the contributor's essential patent claims, to make, use, sell, offer for sale, 426 | import and otherwise run, modify and propagate the contents of its contributor 427 | version. 428 | 429 | In the following three paragraphs, a “patent license” is any express 430 | agreement or commitment, however denominated, not to enforce a patent (such as an 431 | express permission to practice a patent or covenant not to sue for patent 432 | infringement). To “grant” such a patent license to a party means to make 433 | such an agreement or commitment not to enforce a patent against the party. 434 | 435 | If you convey a covered work, knowingly relying on a patent license, and the 436 | Corresponding Source of the work is not available for anyone to copy, free of charge 437 | and under the terms of this License, through a publicly available network server or 438 | other readily accessible means, then you must either **(1)** cause the Corresponding 439 | Source to be so available, or **(2)** arrange to deprive yourself of the benefit of the 440 | patent license for this particular work, or **(3)** arrange, in a manner consistent with 441 | the requirements of this License, to extend the patent license to downstream 442 | recipients. “Knowingly relying” means you have actual knowledge that, but 443 | for the patent license, your conveying the covered work in a country, or your 444 | recipient's use of the covered work in a country, would infringe one or more 445 | identifiable patents in that country that you have reason to believe are valid. 446 | 447 | If, pursuant to or in connection with a single transaction or arrangement, you 448 | convey, or propagate by procuring conveyance of, a covered work, and grant a patent 449 | license to some of the parties receiving the covered work authorizing them to use, 450 | propagate, modify or convey a specific copy of the covered work, then the patent 451 | license you grant is automatically extended to all recipients of the covered work and 452 | works based on it. 453 | 454 | A patent license is “discriminatory” if it does not include within the 455 | scope of its coverage, prohibits the exercise of, or is conditioned on the 456 | non-exercise of one or more of the rights that are specifically granted under this 457 | License. You may not convey a covered work if you are a party to an arrangement with 458 | a third party that is in the business of distributing software, under which you make 459 | payment to the third party based on the extent of your activity of conveying the 460 | work, and under which the third party grants, to any of the parties who would receive 461 | the covered work from you, a discriminatory patent license **(a)** in connection with 462 | copies of the covered work conveyed by you (or copies made from those copies), or **(b)** 463 | primarily for and in connection with specific products or compilations that contain 464 | the covered work, unless you entered into that arrangement, or that patent license 465 | was granted, prior to 28 March 2007. 466 | 467 | Nothing in this License shall be construed as excluding or limiting any implied 468 | license or other defenses to infringement that may otherwise be available to you 469 | under applicable patent law. 470 | 471 | ### 12. No Surrender of Others' Freedom 472 | 473 | If conditions are imposed on you (whether by court order, agreement or otherwise) 474 | that contradict the conditions of this License, they do not excuse you from the 475 | conditions of this License. If you cannot convey a covered work so as to satisfy 476 | simultaneously your obligations under this License and any other pertinent 477 | obligations, then as a consequence you may not convey it at all. For example, if you 478 | agree to terms that obligate you to collect a royalty for further conveying from 479 | those to whom you convey the Program, the only way you could satisfy both those terms 480 | and this License would be to refrain entirely from conveying the Program. 481 | 482 | ### 13. Use with the GNU Affero General Public License 483 | 484 | Notwithstanding any other provision of this License, you have permission to link or 485 | combine any covered work with a work licensed under version 3 of the GNU Affero 486 | General Public License into a single combined work, and to convey the resulting work. 487 | The terms of this License will continue to apply to the part which is the covered 488 | work, but the special requirements of the GNU Affero General Public License, section 489 | 13, concerning interaction through a network will apply to the combination as such. 490 | 491 | ### 14. Revised Versions of this License 492 | 493 | The Free Software Foundation may publish revised and/or new versions of the GNU 494 | General Public License from time to time. Such new versions will be similar in spirit 495 | to the present version, but may differ in detail to address new problems or concerns. 496 | 497 | Each version is given a distinguishing version number. If the Program specifies that 498 | a certain numbered version of the GNU General Public License “or any later 499 | version” applies to it, you have the option of following the terms and 500 | conditions either of that numbered version or of any later version published by the 501 | Free Software Foundation. If the Program does not specify a version number of the GNU 502 | General Public License, you may choose any version ever published by the Free 503 | Software Foundation. 504 | 505 | If the Program specifies that a proxy can decide which future versions of the GNU 506 | General Public License can be used, that proxy's public statement of acceptance of a 507 | version permanently authorizes you to choose that version for the Program. 508 | 509 | Later license versions may give you additional or different permissions. However, no 510 | additional obligations are imposed on any author or copyright holder as a result of 511 | your choosing to follow a later version. 512 | 513 | ### 15. Disclaimer of Warranty 514 | 515 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 516 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 517 | PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER 518 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 519 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE 520 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 521 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 522 | 523 | ### 16. Limitation of Liability 524 | 525 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY 526 | COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS 527 | PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 528 | INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 529 | PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE 530 | OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE 531 | WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 532 | POSSIBILITY OF SUCH DAMAGES. 533 | 534 | ### 17. Interpretation of Sections 15 and 16 535 | 536 | If the disclaimer of warranty and limitation of liability provided above cannot be 537 | given local legal effect according to their terms, reviewing courts shall apply local 538 | law that most closely approximates an absolute waiver of all civil liability in 539 | connection with the Program, unless a warranty or assumption of liability accompanies 540 | a copy of the Program in return for a fee. 541 | 542 | _END OF TERMS AND CONDITIONS_ 543 | 544 | ## How to Apply These Terms to Your New Programs 545 | 546 | If you develop a new program, and you want it to be of the greatest possible use to 547 | the public, the best way to achieve this is to make it free software which everyone 548 | can redistribute and change under these terms. 549 | 550 | To do so, attach the following notices to the program. It is safest to attach them 551 | to the start of each source file to most effectively state the exclusion of warranty; 552 | and each file should have at least the “copyright” line and a pointer to 553 | where the full notice is found. 554 | 555 | 556 | Copyright (C) 557 | 558 | This program is free software: you can redistribute it and/or modify 559 | it under the terms of the GNU General Public License as published by 560 | the Free Software Foundation, either version 3 of the License, or 561 | (at your option) any later version. 562 | 563 | This program is distributed in the hope that it will be useful, 564 | but WITHOUT ANY WARRANTY; without even the implied warranty of 565 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 566 | GNU General Public License for more details. 567 | 568 | You should have received a copy of the GNU General Public License 569 | along with this program. If not, see . 570 | 571 | Also add information on how to contact you by electronic and paper mail. 572 | 573 | If the program does terminal interaction, make it output a short notice like this 574 | when it starts in an interactive mode: 575 | 576 | Copyright (C) 577 | This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 578 | This is free software, and you are welcome to redistribute it 579 | under certain conditions; type 'show c' for details. 580 | 581 | The hypothetical commands `show w` and `show c` should show the appropriate parts of 582 | the General Public License. Of course, your program's commands might be different; 583 | for a GUI interface, you would use an “about box”. 584 | 585 | You should also get your employer (if you work as a programmer) or school, if any, to 586 | sign a “copyright disclaimer” for the program, if necessary. For more 587 | information on this, and how to apply and follow the GNU GPL, see 588 | <>. 589 | 590 | The GNU General Public License does not permit incorporating your program into 591 | proprietary programs. If your program is a subroutine library, you may consider it 592 | more useful to permit linking proprietary applications with the library. If this is 593 | what you want to do, use the GNU Lesser General Public License instead of this 594 | License. But first, please read 595 | <>. 596 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # intellij-language-1c-bsl 2 | 3 | [![Build Status](https://travis-ci.org/1c-syntax/intellij-language-1c-bsl.svg?branch=master)](https://travis-ci.org/1c-syntax/intellij-language-1c-bsl) 4 | [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_intellij-language-1c-bsl&metric=alert_status)](https://sonarcloud.io/dashboard?id=1c-syntax_intellij-language-1c-bsl) 5 | [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_intellij-language-1c-bsl&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=1c-syntax_intellij-language-1c-bsl) 6 | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_intellij-language-1c-bsl&metric=coverage)](https://sonarcloud.io/dashboard?id=1c-syntax_intellij-language-1c-bsl) 7 | 8 | Плагин для семейства редакторов JetBrains IntelliJ (IntelliJ IDEA, Rider, WebStorm, etc) для поддержики языка 1C (BSL) - языка 1С:Предприятие 8 и [OneScript](http://oscript.io). 9 | 10 | Основные языковые функции заложены в [BSL Language Server](https://github.com/1c-syntax/bsl-language-server). 11 | Подсветка языка реализована с помощью [BSL Parser](https://github.com/1c-syntax/bsl-parser). 12 | 13 | ## License 14 | 15 | Все файлы исходных кодов распространяются на условиях [GNU LGPL v3.0](./COPYING.LESSER.md) 16 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | import java.net.URI 2 | import java.util.* 3 | 4 | plugins { 5 | jacoco 6 | idea 7 | java 8 | id("org.jetbrains.intellij") version "0.6.5" 9 | id("com.github.hierynomus.license") version "0.15.0" 10 | id("org.sonarqube") version "3.1.1" 11 | id("com.github.ben-manes.versions") version "0.36.0" 12 | } 13 | 14 | repositories { 15 | mavenCentral() 16 | maven { 17 | url = URI("https://dl.bintray.com/jetbrains/intellij-plugin-service") 18 | } 19 | maven { 20 | url = URI("https://dl.bintray.com/antlr/maven/") 21 | } 22 | maven { 23 | url = URI("https://jitpack.io") 24 | } 25 | } 26 | 27 | group = "com.github.1c-syntax" 28 | version = "0.3.0" // Plugin version 29 | 30 | dependencies { 31 | //compile("com.github.1c-syntax", "bsl-parser", "0.7.1") 32 | implementation("com.github.1c-syntax", "bsl-language-server", "127eb34db65c70ebcf6553785472b4723111d590") 33 | implementation("com.github.ballerina-platform", "lsp4intellij", "8ee2b55267da684fb55d2866ad3293e8a0a21977") 34 | 35 | implementation("org.antlr:antlr4-jetbrains-adapter:3.0.alpha.2") { 36 | exclude(group = "com.jetbrains") 37 | } 38 | } 39 | 40 | intellij { 41 | version = "IC-2020.1" //Corresponds to 201.6668.121 from plugin.xml; for a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases 42 | pluginName = "Language 1C (BSL)" 43 | updateSinceUntilBuild = true 44 | } 45 | 46 | tasks.runPluginVerifier { 47 | ideVersions(listOf("2020.1.4")) 48 | } 49 | 50 | tasks.patchPluginXml { 51 | setUntilBuild("300.*") 52 | } 53 | 54 | tasks.jacocoTestReport { 55 | reports { 56 | xml.isEnabled = true 57 | } 58 | } 59 | 60 | license { 61 | header = rootProject.file("license/HEADER.txt") 62 | ext["year"] = "2018-" + Calendar.getInstance().get(Calendar.YEAR) 63 | ext["name"] = "Alexey Sosnoviy , Nikita Gryzlov " 64 | ext["project"] = "IntelliJ Language 1C (BSL) Plugin" 65 | strictCheck = true 66 | exclude("**/*.png") 67 | exclude("**/*.txt") 68 | exclude("**/*.xml") 69 | mapping("java", "SLASHSTAR_STYLE") 70 | } 71 | 72 | tasks.withType { 73 | options.encoding = "UTF-8" 74 | } 75 | 76 | java { 77 | sourceCompatibility = JavaVersion.VERSION_11 78 | targetCompatibility = JavaVersion.VERSION_11 79 | } 80 | 81 | tasks.runIde { 82 | val property = properties.getOrDefault("sandboxDirectory", "") as Any 83 | systemProperty("idea.plugins.path", property) 84 | jvmArgs("-Xmx1g") 85 | } 86 | 87 | sonarqube { 88 | properties { 89 | property("sonar.sourceEncoding", "UTF-8") 90 | property("sonar.host.url", "https://sonarcloud.io") 91 | property("sonar.organization", "1c-syntax") 92 | property("sonar.projectKey", "1c-syntax_intellij-language-1c-bsl") 93 | property("sonar.projectName", "IntelliJ Language 1C (BSL) Plugin") 94 | property("sonar.exclusions", "**/vendor/**/*.*, **/gen/**/*.*") 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1c-syntax/intellij-language-1c-bsl/14dad13232b0800025e03544bce1c614055b1e15/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /license/HEADER.txt: -------------------------------------------------------------------------------- 1 | This file is a part of ${project}. 2 | 3 | Copyright © ${year} 4 | ${name} 5 | 6 | SPDX-License-Identifier: LGPL-3.0-or-later 7 | 8 | ${project} is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 3.0 of the License, or (at your option) any later version. 12 | 13 | ${project} is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with ${project}. -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "intellij-bsl" 2 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLCommenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.intellij.lang.Commenter; 25 | import org.jetbrains.annotations.Nullable; 26 | 27 | public class BSLCommenter implements Commenter { 28 | 29 | @Nullable 30 | @Override 31 | public String getLineCommentPrefix() { 32 | return "//"; 33 | } 34 | 35 | @Nullable 36 | @Override 37 | public String getBlockCommentPrefix() { 38 | return null; 39 | } 40 | 41 | @Nullable 42 | @Override 43 | public String getBlockCommentSuffix() { 44 | return null; 45 | } 46 | 47 | @Nullable 48 | @Override 49 | public String getCommentedBlockCommentPrefix() { 50 | return "//"; 51 | } 52 | 53 | @Nullable 54 | @Override 55 | public String getCommentedBlockCommentSuffix() { 56 | return null; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLIcons.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.intellij.openapi.util.IconLoader; 25 | 26 | import javax.swing.Icon; 27 | 28 | public final class BSLIcons { 29 | public static final Icon BSL_FILE = IconLoader.getIcon("/com/github/_1c_syntax/bsl/intellij/icons/bsl.png"); 30 | public static final Icon OS_FILE = IconLoader.getIcon("/com/github/_1c_syntax/bsl/intellij/icons/os.png"); 31 | 32 | private BSLIcons() {} 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLLanguage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.intellij.lang.Language; 25 | 26 | public final class BSLLanguage extends Language { 27 | 28 | public static final BSLLanguage INSTANCE = new BSLLanguage(); 29 | 30 | private BSLLanguage() { 31 | super("BSL"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLPairedBraceMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.github._1c_syntax.bsl.parser.BSLLexer; 25 | import com.intellij.lang.BracePair; 26 | import com.intellij.lang.PairedBraceMatcher; 27 | import com.intellij.psi.PsiFile; 28 | import com.intellij.psi.tree.IElementType; 29 | import org.antlr.jetbrains.adapter.lexer.PsiElementTypeFactory; 30 | import org.antlr.jetbrains.adapter.lexer.TokenIElementType; 31 | import org.jetbrains.annotations.NotNull; 32 | import org.jetbrains.annotations.Nullable; 33 | 34 | import java.util.List; 35 | 36 | public class BSLPairedBraceMatcher implements PairedBraceMatcher { 37 | 38 | @NotNull 39 | @Override 40 | public BracePair[] getPairs() { 41 | PsiElementTypeFactory psiElementTypeFactory = BSLSyntaxHighlighter.getPsiElementTypeFactory(); 42 | List tokenTypes = psiElementTypeFactory.getTokenIElementTypes(); 43 | 44 | return new BracePair[]{ 45 | new BracePair(tokenTypes.get(BSLLexer.LPAREN), tokenTypes.get(BSLLexer.RPAREN), true), 46 | new BracePair(tokenTypes.get(BSLLexer.LBRACK), tokenTypes.get(BSLLexer.RBRACK), false), 47 | new BracePair(tokenTypes.get(BSLLexer.IF_KEYWORD), tokenTypes.get(BSLLexer.ENDIF_KEYWORD), true), 48 | new BracePair(tokenTypes.get(BSLLexer.WHILE_KEYWORD), tokenTypes.get(BSLLexer.ENDDO_KEYWORD), true), 49 | new BracePair(tokenTypes.get(BSLLexer.FOR_KEYWORD), tokenTypes.get(BSLLexer.ENDDO_KEYWORD), true), 50 | new BracePair(tokenTypes.get(BSLLexer.TRY_KEYWORD), tokenTypes.get(BSLLexer.ENDTRY_KEYWORD), true), 51 | }; 52 | } 53 | 54 | @Override 55 | public boolean isPairedBracesAllowedBeforeType(@NotNull IElementType lBraceType, @Nullable IElementType contextType) { 56 | return true; 57 | } 58 | 59 | @Override 60 | public int getCodeConstructStart(PsiFile file, int openingBraceOffset) { 61 | return 0; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLParserDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.github._1c_syntax.bsl.intellij.psi.BSLFile; 25 | import com.github._1c_syntax.bsl.parser.BSLLexer; 26 | import com.github._1c_syntax.bsl.parser.BSLParser; 27 | import com.github._1c_syntax.bsl.parser.CaseChangingCharStream; 28 | import com.intellij.lang.ASTNode; 29 | import com.intellij.lang.ParserDefinition; 30 | import com.intellij.lang.PsiBuilder; 31 | import com.intellij.lang.PsiParser; 32 | import com.intellij.lexer.Lexer; 33 | import com.intellij.openapi.project.Project; 34 | import com.intellij.psi.FileViewProvider; 35 | import com.intellij.psi.PsiElement; 36 | import com.intellij.psi.PsiFile; 37 | import com.intellij.psi.tree.IElementType; 38 | import com.intellij.psi.tree.IFileElementType; 39 | import com.intellij.psi.tree.TokenSet; 40 | import org.antlr.jetbrains.adapter.lexer.AntlrLexerAdapter; 41 | import org.antlr.jetbrains.adapter.lexer.AntlrLexerState; 42 | import org.antlr.jetbrains.adapter.lexer.PsiElementTypeFactory; 43 | import org.antlr.jetbrains.adapter.parser.AntlrParserAdapter; 44 | import org.antlr.jetbrains.adapter.psi.AntlrPsiNode; 45 | import org.antlr.v4.runtime.CharStream; 46 | import org.antlr.v4.runtime.Parser; 47 | import org.antlr.v4.runtime.tree.ParseTree; 48 | import org.jetbrains.annotations.NotNull; 49 | 50 | public class BSLParserDefinition implements ParserDefinition { 51 | 52 | private static final PsiElementTypeFactory psiElementTypeFactory = PsiElementTypeFactory.create(BSLLanguage.INSTANCE, new BSLParser(null)); 53 | 54 | private static final IFileElementType FILE = 55 | new IFileElementType(BSLLanguage.INSTANCE); 56 | 57 | private static final TokenSet COMMENTS = 58 | psiElementTypeFactory.createTokenSet(BSLLexer.LINE_COMMENT); 59 | 60 | private static final TokenSet WHITESPACE = 61 | psiElementTypeFactory.createTokenSet( 62 | BSLLexer.WHITE_SPACE, 63 | BSLLexer.PREPROC_WHITE_SPACE, 64 | BSLLexer.PREPROC_NEWLINE, 65 | BSLLexer.ANNOTATION_WHITE_SPACE 66 | ); 67 | 68 | private static final TokenSet STRINGS = 69 | psiElementTypeFactory.createTokenSet( 70 | BSLLexer.STRING, 71 | BSLLexer.STRINGPART, 72 | BSLLexer.STRINGSTART, 73 | BSLLexer.STRINGTAIL 74 | ); 75 | 76 | @NotNull 77 | @Override 78 | public Lexer createLexer(Project project) { 79 | BSLLexer lexer = new BSLLexer(null); 80 | return new AntlrLexerAdapter(BSLLanguage.INSTANCE, lexer, psiElementTypeFactory) { 81 | @Override 82 | protected void applyLexerState(CharStream input, AntlrLexerState state) { 83 | var inputStream = new CaseChangingCharStream(input, true); 84 | lexer.setInputStream(inputStream); 85 | state.apply(lexer); 86 | } 87 | }; 88 | } 89 | 90 | @NotNull 91 | @Override 92 | public PsiParser createParser(final Project project) { 93 | final BSLParser parser = new BSLParser(null); 94 | return new AntlrParserAdapter(BSLLanguage.INSTANCE, parser, psiElementTypeFactory) { 95 | @Override 96 | protected ParseTree parse(Parser parser, IElementType root) { 97 | // start rule depends on root passed in; sometimes we want to create an ID node etc... 98 | if ( root instanceof IFileElementType ) { 99 | return ((BSLParser) parser).file(); 100 | } 101 | // let's hope it's an ID as needed by "rename function" 102 | return ((BSLParser) parser).complexIdentifier(); 103 | } 104 | }; 105 | } 106 | 107 | /** "Tokens of those types are automatically skipped by PsiBuilder." */ 108 | @Override 109 | @NotNull 110 | public TokenSet getWhitespaceTokens() { 111 | return WHITESPACE; 112 | } 113 | 114 | @NotNull 115 | @Override 116 | public TokenSet getCommentTokens() { 117 | return COMMENTS; 118 | } 119 | 120 | @NotNull 121 | @Override 122 | public TokenSet getStringLiteralElements() { 123 | return STRINGS; 124 | } 125 | 126 | @Override 127 | public SpaceRequirements spaceExistenceTypeBetweenTokens(ASTNode left, ASTNode right) { 128 | return SpaceRequirements.MAY; 129 | } 130 | 131 | /** What is the IFileElementType of the root parse tree node? It 132 | * is called from {@link #createFile(FileViewProvider)} at least. 133 | */ 134 | @Override 135 | public IFileElementType getFileNodeType() { 136 | return FILE; 137 | } 138 | 139 | /** Create the root of your PSI tree (a PsiFile). 140 | * 141 | * From IntelliJ IDEA Architectural Overview: 142 | * "A PSI (Program Structure Interface) file is the root of a structure 143 | * representing the contents of a file as a hierarchy of elements 144 | * in a particular programming language." 145 | * 146 | * PsiFile is to be distinguished from a FileASTNode, which is a parse 147 | * tree node that eventually becomes a PsiFile. From PsiFile, we can get 148 | * it back via: {@link PsiFile#getNode}. 149 | */ 150 | @Override 151 | public PsiFile createFile(FileViewProvider viewProvider) { 152 | return new BSLFile(viewProvider); 153 | } 154 | 155 | /** Convert from *NON-LEAF* parse node (AST they call it) 156 | * to PSI node. Leaves are created in the AST factory. 157 | * Rename re-factoring can cause this to be 158 | * called on a TokenIElementType since we want to rename ID nodes. 159 | * In that case, this method is called to create the root node 160 | * but with ID type. Kind of strange, but we can simply create a 161 | * ASTWrapperPsiElement to make everything work correctly. 162 | * 163 | * RuleIElementType. Ah! It's that ID is the root 164 | * IElementType requested to parse, which means that the root 165 | * node returned from parsetree->PSI conversion. But, it 166 | * must be a CompositeElement! The adaptor calls 167 | * rootMarker.done(root) to finish off the PSI conversion. 168 | * See {@link AntlrParserAdapter#parse(IElementType root, 169 | * PsiBuilder)} 170 | * 171 | * If you don't care to distinguish PSI nodes by type, it is 172 | * sufficient to create a {@link AntlrPsiNode} around 173 | * the parse tree node 174 | */ 175 | @NotNull 176 | @Override 177 | public PsiElement createElement(ASTNode node) { 178 | return new AntlrPsiNode(node); 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLPreloadingActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.github._1c_syntax.bsl.intellij.files.BSLFileType; 25 | import com.github._1c_syntax.bsl.intellij.files.OSFileType; 26 | import com.github._1c_syntax.bsl.intellij.settings.LanguageServerSettingsState; 27 | import com.intellij.notification.Notification; 28 | import com.intellij.notification.NotificationType; 29 | import com.intellij.notification.Notifications; 30 | import com.intellij.openapi.application.PathManager; 31 | import com.intellij.openapi.application.PreloadingActivity; 32 | import com.intellij.openapi.components.ServiceManager; 33 | import com.intellij.openapi.progress.ProgressIndicator; 34 | import org.jetbrains.annotations.NotNull; 35 | import org.wso2.lsp4intellij.IntellijLanguageClient; 36 | import org.wso2.lsp4intellij.client.languageserver.serverdefinition.ProcessBuilderServerDefinition; 37 | 38 | import java.io.File; 39 | import java.nio.file.Path; 40 | import java.nio.file.Paths; 41 | import java.util.ArrayList; 42 | import java.util.List; 43 | import java.util.Map; 44 | 45 | import static org.wso2.lsp4intellij.client.languageserver.serverdefinition.LanguageServerDefinition.SPLIT_CHAR; 46 | 47 | public class BSLPreloadingActivity extends PreloadingActivity { 48 | 49 | @Override 50 | public void preload(@NotNull ProgressIndicator indicator) { 51 | 52 | LanguageServerSettingsState languageServerSettings = ServiceManager.getService(LanguageServerSettingsState.class); 53 | 54 | if (!languageServerSettings.enabled) { 55 | return; 56 | } 57 | 58 | Path languageServer; 59 | 60 | if (!languageServerSettings.path.equals("")) { 61 | languageServer = Paths.get(languageServerSettings.path).toAbsolutePath(); 62 | } else { 63 | String pluginsPath = PathManager.getPluginsPath(); 64 | 65 | File libDir = Paths.get(pluginsPath, "Language 1C (BSL)", "lib").toFile(); 66 | File[] files = libDir.listFiles( 67 | (File dir, String name) -> name.startsWith("bsl-language-server-") && name.endsWith(".jar") 68 | ); 69 | if (files == null || files.length == 0) { 70 | Notification notification = new Notification( 71 | "Language 1C (BSL)", 72 | "BSL Language server is not found", 73 | String.format("Check %s dir. Is plugin installed correctly?", libDir.getAbsolutePath()), 74 | NotificationType.ERROR 75 | ); 76 | Notifications.Bus.notify(notification); 77 | return; 78 | } 79 | 80 | languageServer = files[0].toPath().toAbsolutePath(); 81 | } 82 | 83 | List args = new ArrayList<>(); 84 | args.add("java"); 85 | args.add("-jar"); 86 | args.add(languageServer.toString()); 87 | 88 | String extensions = BSLFileType.INSTANCE.getDefaultExtension() + SPLIT_CHAR + OSFileType.INSTANCE.getDefaultExtension(); 89 | ProcessBuilder process = new ProcessBuilder(args); 90 | IntellijLanguageClient.addServerDefinition( 91 | new ProcessBuilderServerDefinition(extensions, Map.of("bsl", "bsl,os"), process) 92 | ); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLSyntaxHighlighter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.github._1c_syntax.bsl.parser.BSLLexer; 25 | import com.github._1c_syntax.bsl.parser.BSLParser; 26 | import com.github._1c_syntax.bsl.parser.CaseChangingCharStream; 27 | import com.intellij.lexer.Lexer; 28 | import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; 29 | import com.intellij.openapi.editor.HighlighterColors; 30 | import com.intellij.openapi.editor.colors.TextAttributesKey; 31 | import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; 32 | import com.intellij.psi.tree.IElementType; 33 | import org.antlr.jetbrains.adapter.lexer.AntlrLexerAdapter; 34 | import org.antlr.jetbrains.adapter.lexer.AntlrLexerState; 35 | import org.antlr.jetbrains.adapter.lexer.PsiElementTypeFactory; 36 | import org.antlr.jetbrains.adapter.lexer.TokenIElementType; 37 | import org.antlr.v4.runtime.CharStream; 38 | import org.jetbrains.annotations.NotNull; 39 | 40 | public class BSLSyntaxHighlighter extends SyntaxHighlighterBase { 41 | 42 | private static final PsiElementTypeFactory psiElementTypeFactory = PsiElementTypeFactory.create(BSLLanguage.INSTANCE, new BSLParser(null)); 43 | private static final TextAttributesKey[] EMPTY_KEYS = new TextAttributesKey[0]; 44 | 45 | private static final TextAttributesKey COMMENT = 46 | TextAttributesKey.createTextAttributesKey("BSL_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT); 47 | private static final TextAttributesKey BAD_CHARACTER = 48 | TextAttributesKey.createTextAttributesKey("BSL_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); 49 | private static final TextAttributesKey KEYWORDS = 50 | TextAttributesKey.createTextAttributesKey("BSL_KEYWORD", DefaultLanguageHighlighterColors.KEYWORD); 51 | 52 | private static final TextAttributesKey STRING = 53 | TextAttributesKey.createTextAttributesKey("BSL_STRING", DefaultLanguageHighlighterColors.STRING); 54 | 55 | private static final TextAttributesKey DATETIME = 56 | TextAttributesKey.createTextAttributesKey("BSL_DATETIME", DefaultLanguageHighlighterColors.STRING); 57 | 58 | private static final TextAttributesKey NUMBER = 59 | TextAttributesKey.createTextAttributesKey("BSL_NUMBER", DefaultLanguageHighlighterColors.NUMBER); 60 | 61 | private static final TextAttributesKey DOT = 62 | TextAttributesKey.createTextAttributesKey("BSL_DOT", DefaultLanguageHighlighterColors.DOT); 63 | 64 | private static final TextAttributesKey SEMICOLON = 65 | TextAttributesKey.createTextAttributesKey("BSL_SEMICOLON", DefaultLanguageHighlighterColors.SEMICOLON); 66 | 67 | private static final TextAttributesKey COMMA = 68 | TextAttributesKey.createTextAttributesKey("BSL_COMMA", DefaultLanguageHighlighterColors.COMMA); 69 | 70 | private static final TextAttributesKey PARENTHESES = 71 | TextAttributesKey.createTextAttributesKey("BSL_PARENTHESES", DefaultLanguageHighlighterColors.PARENTHESES); 72 | 73 | private static final TextAttributesKey BRACKETS = 74 | TextAttributesKey.createTextAttributesKey("BSL_BRACKETS", DefaultLanguageHighlighterColors.BRACKETS); 75 | 76 | private static final TextAttributesKey LITERAL_CONSTANT = 77 | TextAttributesKey.createTextAttributesKey("BSL_LITERAL_CONSTANT", DefaultLanguageHighlighterColors.CONSTANT); 78 | 79 | private static final TextAttributesKey COMPILER_DIRECTIVE = 80 | TextAttributesKey.createTextAttributesKey("BSL_COMPILER_DIRECTIVE", DefaultLanguageHighlighterColors.METADATA); 81 | 82 | private static final TextAttributesKey ANNOTATIONS = 83 | TextAttributesKey.createTextAttributesKey("BSL_ANNOTATIONS", DefaultLanguageHighlighterColors.METADATA); 84 | 85 | private static final TextAttributesKey PREPROCESSOR_INSTRUCTION = 86 | TextAttributesKey.createTextAttributesKey("BSL_PREPROCESSOR_INSTRUCTION", DefaultLanguageHighlighterColors.METADATA); 87 | 88 | private static final TextAttributesKey[] BAD_CHAR_KEYS = new TextAttributesKey[]{BAD_CHARACTER}; 89 | 90 | @NotNull 91 | @Override 92 | public Lexer getHighlightingLexer() { 93 | BSLLexer lexer = new BSLLexer(null); 94 | return new AntlrLexerAdapter(BSLLanguage.INSTANCE, lexer, psiElementTypeFactory) { 95 | @Override 96 | protected void applyLexerState(CharStream input, AntlrLexerState state) { 97 | var inputStream = new CaseChangingCharStream(input, true); 98 | lexer.setInputStream(inputStream); 99 | state.apply(lexer); 100 | } 101 | }; 102 | } 103 | 104 | @NotNull 105 | @Override 106 | public TextAttributesKey[] getTokenHighlights(IElementType tokenType) { 107 | if (!(tokenType instanceof TokenIElementType)) { 108 | return EMPTY_KEYS; 109 | } 110 | TokenIElementType myType = (TokenIElementType) tokenType; 111 | int antlrTokenType = myType.getAntlrTokenType(); 112 | TextAttributesKey attrKey; 113 | 114 | switch (antlrTokenType) { 115 | case BSLLexer.PROCEDURE_KEYWORD: 116 | case BSLLexer.FUNCTION_KEYWORD: 117 | case BSLLexer.ENDPROCEDURE_KEYWORD: 118 | case BSLLexer.ENDFUNCTION_KEYWORD: 119 | case BSLLexer.EXPORT_KEYWORD: 120 | case BSLLexer.VAL_KEYWORD: 121 | case BSLLexer.ENDIF_KEYWORD: 122 | case BSLLexer.ENDDO_KEYWORD: 123 | case BSLLexer.IF_KEYWORD: 124 | case BSLLexer.ELSIF_KEYWORD: 125 | case BSLLexer.ELSE_KEYWORD: 126 | case BSLLexer.THEN_KEYWORD: 127 | case BSLLexer.WHILE_KEYWORD: 128 | case BSLLexer.DO_KEYWORD: 129 | case BSLLexer.FOR_KEYWORD: 130 | case BSLLexer.TO_KEYWORD: 131 | case BSLLexer.EACH_KEYWORD: 132 | case BSLLexer.IN_KEYWORD: 133 | case BSLLexer.TRY_KEYWORD: 134 | case BSLLexer.EXCEPT_KEYWORD: 135 | case BSLLexer.ENDTRY_KEYWORD: 136 | case BSLLexer.RETURN_KEYWORD: 137 | case BSLLexer.CONTINUE_KEYWORD: 138 | case BSLLexer.RAISE_KEYWORD: 139 | case BSLLexer.VAR_KEYWORD: 140 | case BSLLexer.NOT_KEYWORD: 141 | case BSLLexer.OR_KEYWORD: 142 | case BSLLexer.AND_KEYWORD: 143 | case BSLLexer.NEW_KEYWORD: 144 | case BSLLexer.GOTO_KEYWORD: 145 | case BSLLexer.BREAK_KEYWORD: 146 | case BSLLexer.EXECUTE_KEYWORD: 147 | attrKey = KEYWORDS; 148 | break; 149 | case BSLLexer.TRUE: 150 | case BSLLexer.FALSE: 151 | case BSLLexer.UNDEFINED: 152 | case BSLLexer.NULL: 153 | attrKey = LITERAL_CONSTANT; 154 | break; 155 | case BSLLexer.DECIMAL: 156 | case BSLLexer.FLOAT: 157 | attrKey = NUMBER; 158 | break; 159 | case BSLLexer.STRING: 160 | case BSLLexer.STRINGSTART: 161 | case BSLLexer.STRINGPART: 162 | case BSLLexer.STRINGTAIL: 163 | case BSLLexer.PREPROC_STRING: 164 | attrKey = STRING; 165 | break; 166 | case BSLLexer.DATETIME: 167 | attrKey = DATETIME; 168 | break; 169 | case BSLLexer.LINE_COMMENT: 170 | attrKey = COMMENT; 171 | break; 172 | case BSLLexer.HASH: 173 | case BSLLexer.PREPROC_USE_KEYWORD: 174 | case BSLLexer.PREPROC_REGION: 175 | case BSLLexer.PREPROC_END_REGION: 176 | case BSLLexer.PREPROC_AND_KEYWORD: 177 | case BSLLexer.PREPROC_OR_KEYWORD: 178 | case BSLLexer.PREPROC_NOT_KEYWORD: 179 | case BSLLexer.PREPROC_IF_KEYWORD: 180 | case BSLLexer.PREPROC_THEN_KEYWORD: 181 | case BSLLexer.PREPROC_ELSIF_KEYWORD: 182 | case BSLLexer.PREPROC_ELSE_KEYWORD: 183 | case BSLLexer.PREPROC_ENDIF_KEYWORD: 184 | attrKey = PREPROCESSOR_INSTRUCTION; 185 | break; 186 | case BSLLexer.AMPERSAND: 187 | case BSLLexer.ANNOTATION_ATCLIENT_SYMBOL: 188 | case BSLLexer.ANNOTATION_ATCLIENTATSERVER_SYMBOL: 189 | case BSLLexer.ANNOTATION_ATCLIENTATSERVERNOCONTEXT_SYMBOL: 190 | case BSLLexer.ANNOTATION_ATSERVER_SYMBOL: 191 | case BSLLexer.ANNOTATION_ATSERVERNOCONTEXT_SYMBOL: 192 | case BSLLexer.ANNOTATION_CUSTOM_SYMBOL: 193 | attrKey = ANNOTATIONS; 194 | break; 195 | case BSLLexer.DOT: 196 | attrKey = DOT; 197 | break; 198 | case BSLLexer.SEMICOLON: 199 | attrKey = SEMICOLON; 200 | break; 201 | case BSLLexer.COMMA: 202 | attrKey = COMMA; 203 | break; 204 | case BSLLexer.LPAREN: 205 | case BSLLexer.RPAREN: 206 | attrKey = PARENTHESES; 207 | break; 208 | case BSLLexer.LBRACK: 209 | case BSLLexer.RBRACK: 210 | attrKey = BRACKETS; 211 | break; 212 | default: 213 | return EMPTY_KEYS; 214 | } 215 | return new TextAttributesKey[]{attrKey}; 216 | 217 | // } else if (tokenType.equals(TokenType.BAD_CHARACTER)) { 218 | // return BAD_CHAR_KEYS; 219 | // } 220 | } 221 | 222 | public static PsiElementTypeFactory getPsiElementTypeFactory() { 223 | return psiElementTypeFactory; 224 | } 225 | 226 | } 227 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/BSLSyntaxHighlighterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.intellij.openapi.fileTypes.SyntaxHighlighter; 25 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory; 26 | import com.intellij.openapi.project.Project; 27 | import com.intellij.openapi.vfs.VirtualFile; 28 | import org.jetbrains.annotations.NotNull; 29 | import org.jetbrains.annotations.Nullable; 30 | 31 | public class BSLSyntaxHighlighterFactory extends SyntaxHighlighterFactory { 32 | @NotNull 33 | @Override 34 | public SyntaxHighlighter getSyntaxHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile) { 35 | return new BSLSyntaxHighlighter(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/files/BSLFileType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.files; 23 | 24 | import com.github._1c_syntax.bsl.intellij.BSLIcons; 25 | import com.github._1c_syntax.bsl.intellij.BSLLanguage; 26 | import com.intellij.openapi.fileTypes.LanguageFileType; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | import javax.swing.Icon; 30 | 31 | public final class BSLFileType extends LanguageFileType { 32 | 33 | public static final BSLFileType INSTANCE = new BSLFileType(); 34 | 35 | private BSLFileType() { 36 | super(BSLLanguage.INSTANCE); 37 | } 38 | 39 | @NotNull 40 | @Override 41 | public String getName() { 42 | return "BSL File"; 43 | } 44 | 45 | @NotNull 46 | @Override 47 | public String getDescription() { 48 | return "1C (BSL) language file"; 49 | } 50 | 51 | @NotNull 52 | @Override 53 | public String getDefaultExtension() { 54 | return "bsl"; 55 | } 56 | 57 | @Override 58 | public Icon getIcon() { 59 | return BSLIcons.BSL_FILE; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/files/OSFileType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.files; 23 | 24 | import com.github._1c_syntax.bsl.intellij.BSLIcons; 25 | import com.github._1c_syntax.bsl.intellij.BSLLanguage; 26 | import com.intellij.openapi.fileTypes.LanguageFileType; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | import javax.swing.Icon; 30 | 31 | public final class OSFileType extends LanguageFileType { 32 | 33 | public static final OSFileType INSTANCE = new OSFileType(); 34 | 35 | private OSFileType() { 36 | super(BSLLanguage.INSTANCE); 37 | } 38 | 39 | @NotNull 40 | @Override 41 | public String getName() { 42 | return "OneScript File"; 43 | } 44 | 45 | @NotNull 46 | @Override 47 | public String getDescription() { 48 | return "OneScript language file"; 49 | } 50 | 51 | @NotNull 52 | @Override 53 | public String getDefaultExtension() { 54 | return "os"; 55 | } 56 | 57 | @Override 58 | public Icon getIcon() { 59 | return BSLIcons.OS_FILE; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/psi/BSLFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.psi; 23 | 24 | import com.github._1c_syntax.bsl.intellij.BSLLanguage; 25 | import com.github._1c_syntax.bsl.intellij.files.BSLFileType; 26 | import com.intellij.extapi.psi.PsiFileBase; 27 | import com.intellij.openapi.fileTypes.FileType; 28 | import com.intellij.psi.FileViewProvider; 29 | import org.jetbrains.annotations.NotNull; 30 | import org.jetbrains.annotations.Nullable; 31 | 32 | import javax.swing.Icon; 33 | 34 | public class BSLFile extends PsiFileBase { 35 | 36 | public BSLFile(@NotNull FileViewProvider viewProvider) { 37 | super(viewProvider, BSLLanguage.INSTANCE); 38 | } 39 | 40 | @NotNull 41 | @Override 42 | public FileType getFileType() { 43 | return BSLFileType.INSTANCE; 44 | } 45 | 46 | @Override 47 | public String toString() { 48 | return "BSL File"; 49 | } 50 | 51 | @Nullable 52 | @Override 53 | public Icon getIcon(int flags) { 54 | return super.getIcon(flags); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/settings/BSLConfigurable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.settings; 23 | 24 | import com.intellij.openapi.options.Configurable; 25 | import org.jetbrains.annotations.Nls; 26 | import org.jetbrains.annotations.Nullable; 27 | 28 | import javax.swing.JComponent; 29 | 30 | public class BSLConfigurable implements Configurable { 31 | 32 | private BSLConfigurableGUI form; 33 | private LanguageServerSettingsState state = LanguageServerSettingsState.getInstance(); 34 | 35 | @Nls(capitalization = Nls.Capitalization.Title) 36 | @Override 37 | public String getDisplayName() { 38 | return "1C (BSL)"; 39 | } 40 | 41 | @Nullable 42 | @Override 43 | public JComponent createComponent() { 44 | return getForm().getRootPanel(); 45 | } 46 | 47 | @Override 48 | public void disposeUIResources() { 49 | form = null; 50 | } 51 | 52 | @Override 53 | public boolean isModified() { 54 | return state.enabled != getEnabled() 55 | || state.diagnosticLanguage != getDiagnosticLanguage() 56 | || !state.path.equals(getPath()); 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | state.enabled = getEnabled(); 62 | state.diagnosticLanguage = getDiagnosticLanguage(); 63 | state.path = getPath(); 64 | } 65 | 66 | @Override 67 | public void reset() { 68 | setEnabled(); 69 | setDiagnosticLanguage(); 70 | setPath(); 71 | } 72 | 73 | private BSLConfigurableGUI getForm() { 74 | if (form == null) { 75 | form = new BSLConfigurableGUI(); 76 | } 77 | return form; 78 | } 79 | 80 | private DiagnosticLanguage getDiagnosticLanguage() { 81 | DiagnosticLanguage diagnosticLanguage; 82 | if (getForm().getDiagnosticLanguageRu().isSelected()) { 83 | diagnosticLanguage = DiagnosticLanguage.RU; 84 | } else { 85 | diagnosticLanguage = DiagnosticLanguage.EN; 86 | } 87 | 88 | return diagnosticLanguage; 89 | } 90 | 91 | private boolean getEnabled() { 92 | return getForm().getEnabled().isSelected(); 93 | } 94 | 95 | private String getPath() { 96 | return getForm().getPath().getText(); 97 | } 98 | 99 | private void setDiagnosticLanguage() { 100 | getForm().getDiagnosticLanguageEn().setSelected(state.diagnosticLanguage == DiagnosticLanguage.EN); 101 | getForm().getDiagnosticLanguageRu().setSelected(state.diagnosticLanguage == DiagnosticLanguage.RU); 102 | } 103 | 104 | private void setEnabled() { 105 | getForm().getEnabled().setSelected(state.enabled); 106 | } 107 | 108 | private void setPath() { 109 | getForm().getPath().setText(state.path); 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/settings/BSLConfigurableGUI.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 |
90 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/settings/BSLConfigurableGUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.settings; 23 | 24 | import javax.swing.JCheckBox; 25 | import javax.swing.JPanel; 26 | import javax.swing.JRadioButton; 27 | import javax.swing.JTextField; 28 | 29 | public class BSLConfigurableGUI { 30 | private JRadioButton diagnosticLanguageEn; 31 | private JRadioButton diagnosticLanguageRu; 32 | private JPanel rootPanel; 33 | private JCheckBox enabled; 34 | private JTextField path; 35 | 36 | public JPanel getRootPanel() { 37 | return rootPanel; 38 | } 39 | 40 | public JRadioButton getDiagnosticLanguageEn() { 41 | return diagnosticLanguageEn; 42 | } 43 | 44 | public JRadioButton getDiagnosticLanguageRu() { 45 | return diagnosticLanguageRu; 46 | } 47 | 48 | public JCheckBox getEnabled() { 49 | return enabled; 50 | } 51 | 52 | public JTextField getPath() { 53 | return path; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/settings/DiagnosticLanguage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.settings; 23 | 24 | public enum DiagnosticLanguage { 25 | RU("ru"), 26 | EN("en"); 27 | 28 | private final String languageCode; 29 | 30 | DiagnosticLanguage(String languageCode) { 31 | this.languageCode = languageCode; 32 | } 33 | 34 | public String getLanguageCode() { 35 | return languageCode; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/github/_1c_syntax/bsl/intellij/settings/LanguageServerSettingsState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.settings; 23 | 24 | import com.intellij.openapi.components.PersistentStateComponent; 25 | import com.intellij.openapi.components.ServiceManager; 26 | import com.intellij.openapi.components.State; 27 | import com.intellij.openapi.components.Storage; 28 | import com.intellij.util.xmlb.XmlSerializerUtil; 29 | import org.jetbrains.annotations.NotNull; 30 | import org.jetbrains.annotations.Nullable; 31 | 32 | @State( 33 | name = "LanguageServerSettingsState", 34 | storages = @Storage("intellij-bsl.xml") 35 | ) 36 | public class LanguageServerSettingsState implements PersistentStateComponent { 37 | 38 | public Boolean enabled = Boolean.TRUE; 39 | public DiagnosticLanguage diagnosticLanguage = DiagnosticLanguage.EN; 40 | public String path = ""; 41 | 42 | public static LanguageServerSettingsState getInstance() { 43 | return ServiceManager.getService(LanguageServerSettingsState.class); 44 | } 45 | 46 | @Nullable 47 | @Override 48 | public LanguageServerSettingsState getState() { 49 | return this; 50 | } 51 | 52 | @Override 53 | public void loadState(@NotNull LanguageServerSettingsState state) { 54 | XmlSerializerUtil.copyBean(state, this); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | org.1c-syntax.intellij.language-1c-bsl 26 | Language 1C (BSL) 27 | 1c-syntax GitHub.com organization 28 | 29 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | com.intellij.modules.lang 44 | 45 | 46 | 47 | 50 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 63 | 65 | 66 | 67 | 68 | 69 | org.wso2.lsp4intellij.IntellijLanguageClient 70 | 71 | 72 | 73 | 74 | 76 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/main/resources/com/github/_1c_syntax/bsl/intellij/icons/bsl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1c-syntax/intellij-language-1c-bsl/14dad13232b0800025e03544bce1c614055b1e15/src/main/resources/com/github/_1c_syntax/bsl/intellij/icons/bsl.png -------------------------------------------------------------------------------- /src/main/resources/com/github/_1c_syntax/bsl/intellij/icons/os.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1c-syntax/intellij-language-1c-bsl/14dad13232b0800025e03544bce1c614055b1e15/src/main/resources/com/github/_1c_syntax/bsl/intellij/icons/os.png -------------------------------------------------------------------------------- /src/test/java/com/github/_1c_syntax/bsl/intellij/BSLParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij; 23 | 24 | import com.intellij.testFramework.ParsingTestCase; 25 | import com.github._1c_syntax.bsl.intellij.util.TestUtils; 26 | 27 | public class BSLParserTest extends ParsingTestCase { 28 | 29 | public BSLParserTest() { 30 | super("parser", "bsl", new BSLParserDefinition()); 31 | } 32 | 33 | public void testHello() { 34 | doTest(true); 35 | } 36 | 37 | @Override 38 | protected String getTestDataPath() { 39 | return TestUtils.BASE_TEST_DATA_PATH; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/com/github/_1c_syntax/bsl/intellij/util/TestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of IntelliJ Language 1C (BSL) Plugin. 3 | * 4 | * Copyright © 2018-2021 5 | * Alexey Sosnoviy , Nikita Gryzlov 6 | * 7 | * SPDX-License-Identifier: LGPL-3.0-or-later 8 | * 9 | * IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3.0 of the License, or (at your option) any later version. 13 | * 14 | * IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with IntelliJ Language 1C (BSL) Plugin. 21 | */ 22 | package com.github._1c_syntax.bsl.intellij.util; 23 | 24 | import java.io.File; 25 | 26 | public class TestUtils { 27 | /** 28 | * The root of the test data directory 29 | */ 30 | public static final String BASE_TEST_DATA_PATH = new File("src/test/resources").getAbsolutePath(); 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/parser/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/parser/.idea/parser.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/parser/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 40 | 45 | 46 | 47 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |