From e0d6a06f80fa409924556b67d48b9902f8ded67a Mon Sep 17 00:00:00 2001 From: jenkins Date: Sat, 27 Apr 2024 16:38:24 +0000 Subject: [PATCH 1/6] chore(release): v1.0.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bfaae82..b97bd097 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radix-simple-react", - "version": "0.1.0", + "version": "1.0.17", "private": true, "dependencies": { "axios": "^0.21.1", From 6256f554dc0d2d6529ed966b78a98d6204827e5d Mon Sep 17 00:00:00 2001 From: jenkins Date: Sat, 27 Apr 2024 17:51:13 +0000 Subject: [PATCH 2/6] chore(release): v1.0.31 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b97bd097..eba3f060 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radix-simple-react", - "version": "1.0.17", + "version": "1.0.31", "private": true, "dependencies": { "axios": "^0.21.1", From 7ce94196fc265f64d36b91386b4dfd1aea9a80d5 Mon Sep 17 00:00:00 2001 From: "quang.tt" Date: Wed, 1 May 2024 21:56:47 +0700 Subject: [PATCH 3/6] add redi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2fae463b..ee3d62cb 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file +sấnlnfaslnfakn \ No newline at end of file From 622eb7807c567ea734561cb60adaafdee6c81811 Mon Sep 17 00:00:00 2001 From: "quang.tt" Date: Wed, 1 May 2024 22:03:13 +0700 Subject: [PATCH 4/6] add redi --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee3d62cb..3aefc828 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file -sấnlnfaslnfakn \ No newline at end of file +sấnlnfaslnfakn +iiiii \ No newline at end of file From a5d99c1239e124c0139de38587553f2f401ed7bb Mon Sep 17 00:00:00 2001 From: "quang.tt" Date: Fri, 3 May 2024 13:54:35 +0700 Subject: [PATCH 5/6] update ram bitbucket --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3aefc828..c02618d3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ $ docker -v Docker version 18.03.1-ce, build 9ee9f40 ``` - +đâsdasdasdas ### Installing ``` From 8a061ec207b7ca86131e9a561a495a0e98bcadd6 Mon Sep 17 00:00:00 2001 From: "quang.tt" Date: Fri, 3 May 2024 23:59:14 +0700 Subject: [PATCH 6/6] update ram bitbucket --- .gitattributes | 2 - .gitignore | 29 +- Dockerfile | 17 - LICENSE | 21 - LICENSE.md | 202 +++++ README.md | 355 ++++++++- build.gradle.kts | 125 +++ dev/images/cpt-icon.svg | 101 +++ dev/images/cpt-icon_2.svg | 87 +++ dev/images/cpt-icon_3.svg | 106 +++ dev/images/cpt-icon_3_opt.svg | 19 + .../language/parser/CptParser.java | 340 ++++++++ .../language/psi/CptEscape.java | 8 + .../language/psi/CptMapping.java | 28 + .../language/psi/CptMappings.java | 13 + .../language/psi/CptReplacement.java | 19 + .../language/psi/CptTemplate.java | 26 + .../language/psi/CptTemplateCodeG.java | 10 + .../language/psi/CptTemplateVariable.java | 19 + .../psi/CptTemplateVariableExpressionG.java | 10 + .../psi/CptTemplateVariableNameG.java | 10 + .../psi/CptTemplateVariableValueG.java | 10 + .../language/psi/CptTypes.java | 75 ++ .../language/psi/CptVisitor.java | 58 ++ .../language/psi/impl/CptEscapeImpl.java | 26 + .../language/psi/impl/CptMappingImpl.java | 62 ++ .../language/psi/impl/CptMappingsImpl.java | 35 + .../language/psi/impl/CptReplacementImpl.java | 47 ++ .../psi/impl/CptTemplateCodeGImpl.java | 29 + .../language/psi/impl/CptTemplateImpl.java | 59 ++ .../CptTemplateVariableExpressionGImpl.java | 29 + .../psi/impl/CptTemplateVariableImpl.java | 47 ++ .../impl/CptTemplateVariableNameGImpl.java | 29 + .../impl/CptTemplateVariableValueGImpl.java | 29 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 56172 bytes gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 172 ++++ gradlew.bat | 84 ++ images/screenshot.png | Bin 111246 -> 0 bytes package.json | 19 - public/favicon.ico | Bin 3870 -> 0 bytes public/index.html | 42 - public/manifest.json | 15 - resources/META-INF/plugin.xml | 736 ++++++++++++++++++ resources/META-INF/pluginIcon.svg | 19 + resources/META-INF/pluginIcon_dark.svg | 19 + resources/META-INF/withDartModule.xml | 6 + resources/META-INF/withDatabaseModule.xml | 6 + resources/META-INF/withGoModule.xml | 6 + resources/META-INF/withGroovyModule.xml | 6 + resources/META-INF/withJavaModule.xml | 8 + resources/META-INF/withJavaScriptModule.xml | 6 + resources/META-INF/withKotlinModule.xml | 6 + resources/META-INF/withLatexModule.xml | 6 + resources/META-INF/withPhpModule.xml | 6 + resources/META-INF/withPythonModule.xml | 6 + resources/META-INF/withRiderModule.xml | 4 + resources/META-INF/withRubyModule.xml | 6 + resources/META-INF/withScalaModule.xml | 6 + resources/META-INF/withSwiftModule.xml | 6 + .../bundle/PostfixTemplatesBundle.properties | 7 + .../idea/postfixtemplates/icons/cpt-icon.png | Bin 0 -> 780 bytes .../defaulttemplates/dart.postfixTemplates | 3 + .../defaulttemplates/example.postfixTemplates | 3 + .../defaulttemplates/java.postfixTemplates | 421 ++++++++++ .../javascript.postfixTemplates | 3 + .../defaulttemplates/kotlin.postfixTemplates | 3 + .../defaulttemplates/scala.postfixTemplates | 94 +++ .../language/templatemapping/emptyLambda.txt | 1 + .../language/templatemapping/varLambda.txt | 8 + .../description.html | 5 + .../liveTemplates/CustomPostfixTemplates.xml | 13 + .../after.java.template | 2 + .../before.java.template | 2 + .../CombinedPostfixTemplate/description.html | 6 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + .../after.java.template | 2 + .../before.java.template | 2 + .../description.html | 21 + settings.gradle.kts | 8 + src/App.css | 22 - src/App.js | 22 - src/App.test.js | 9 - src/components/card.js | 51 -- src/components/footer.js | 34 - src/components/main-container.js | 78 -- src/components/nav.js | 19 - .../ApplicationInterface.java | 7 + .../postfixtemplates/MyPostStartupActivity.kt | 16 + .../postfixtemplates/SentryErrorReporter.java | 116 +++ .../actions/EditorTypedHandlerDelegate.java | 254 ++++++ .../actions/OpenSettingsAction.java | 22 + .../actions/OpenTemplatesAction.java | 125 +++ .../bundle/PostfixTemplatesBundle.java | 34 + .../OverrideTemplateRuleIntention.java | 68 ++ .../idea/postfixtemplates/language/Cpt.bnf | 52 ++ .../idea/postfixtemplates/language/Cpt.flex | 106 +++ .../language/CptAnnotator.java | 37 + .../postfixtemplates/language/CptBlock.java | 88 +++ .../language/CptChooseByNameContributor.java | 34 + .../language/CptCodeStyleMainPanel.java | 23 + .../CptCodeStyleSettingsProvider.java | 35 + .../language/CptColorSettingsPage.java | 64 ++ .../language/CptCommenter.java | 36 + .../language/CptCompletionContributor.java | 81 ++ .../language/CptCompletionUtil.java | 125 +++ .../postfixtemplates/language/CptContext.java | 21 + .../language/CptFileType.java | 45 ++ .../language/CptFilterLexer.java | 19 + .../language/CptFormattingModelBuilder.java | 27 + .../postfixtemplates/language/CptIcons.java | 19 + .../postfixtemplates/language/CptIndexer.java | 19 + .../postfixtemplates/language/CptLang.java | 59 ++ .../language/CptLangAnnotator.java | 19 + .../language/CptLanguage.java | 18 + .../CptLanguageCodeStyleSettingsProvider.java | 52 ++ .../postfixtemplates/language/CptLexer.java | 636 +++++++++++++++ .../language/CptLexerAdapter.java | 11 + .../language/CptLookupActionProvider.java | 45 ++ .../language/CptParserDefinition.java | 65 ++ .../language/CptReference.java | 58 ++ .../language/CptReferenceContributor.java | 31 + .../language/CptStructureViewElement.java | 74 ++ .../language/CptStructureViewFactory.java | 24 + .../language/CptStructureViewModel.java | 33 + .../language/CptSyntaxHighlighter.java | 82 ++ .../language/CptSyntaxHighlighterFactory.java | 15 + .../language/CptTodoIndexer.java | 13 + .../postfixtemplates/language/CptUtil.java | 542 +++++++++++++ .../language/psi/CptElementFactory.java | 25 + .../language/psi/CptElementType.java | 12 + .../language/psi/CptFile.java | 26 + .../language/psi/CptNamedElement.java | 6 + .../language/psi/CptTokenType.java | 17 + .../psi/impl/CptNamedElementImpl.java | 12 + .../language/psi/impl/CptPsiImplUtil.java | 147 ++++ .../languages/SupportedLanguages.java | 81 ++ .../languages/csharp/CsharpAnnotator.java | 35 + .../languages/csharp/CsharpLang.java | 16 + .../csharp/CsharpPostfixTemplateProvider.java | 27 + .../CsharpStringPostfixTemplateCreator.java | 19 + .../CustomCsharpStringPostfixTemplate.java | 43 + .../dart/CustomDartStringPostfixTemplate.java | 32 + .../languages/dart/DartAnnotator.java | 35 + .../languages/dart/DartLang.java | 16 + .../dart/DartPostfixTemplateProvider.java | 28 + .../dart/DartPostfixTemplatesUtils.java | 10 + .../DartStringPostfixTemplateCreator.java | 17 + .../go/CustomGoStringPostfixTemplate.java | 118 +++ .../languages/go/GoAnnotator.java | 39 + .../postfixtemplates/languages/go/GoLang.java | 16 + .../go/GoPostfixTemplateProvider.java | 27 + .../languages/go/GoPostfixTemplatesUtils.java | 120 +++ .../languages/go/GoSpecialType.java | 13 + .../CustomGroovyStringPostfixTemplate.java | 170 ++++ .../languages/groovy/GroovyAnnotator.java | 47 ++ .../languages/groovy/GroovyLang.java | 16 + .../groovy/GroovyPostfixTemplateProvider.java | 27 + .../groovy/GroovyPostfixTemplatesUtils.java | 136 ++++ .../GroovyStringPostfixTemplateCreator.java | 17 + .../languages/groovy/GroovyType.java | 18 + .../java/CustomJavaStringPostfixTemplate.java | 291 +++++++ .../languages/java/JavaAnnotator.java | 48 ++ .../languages/java/JavaLang.java | 16 + .../java/JavaPostfixTemplateProvider.java | 35 + .../java/MyJavaPostfixTemplatesUtils.java | 125 +++ ...CustomJavaScriptStringPostfixTemplate.java | 23 + .../javascript/JavaScriptAnnotator.java | 35 + .../languages/javascript/JavaScriptLang.java | 16 + .../JavaScriptPostfixTemplateProvider.java | 27 + .../CustomKotlinStringPostfixTemplate.java | 112 +++ .../languages/kotlin/KotlinAnnotator.java | 35 + .../languages/kotlin/KotlinLang.java | 16 + .../kotlin/KotlinPostfixTemplateProvider.java | 35 + .../KotlinStringPostfixTemplateCreator.java | 17 + .../CustomLatexStringPostfixTemplate.java | 18 + .../languages/latex/LatexAnnotator.java | 46 ++ .../languages/latex/LatexLang.java | 15 + .../latex/LatexPostfixTemplateProvider.java | 40 + .../php/CustomPhpStringPostfixTemplate.java | 71 ++ .../languages/php/PhpAnnotator.java | 49 ++ .../languages/php/PhpLang.java | 16 + .../php/PhpPostfixTemplateProvider.java | 27 + .../php/PhpPostfixTemplatesUtils.java | 59 ++ .../php/PhpStringPostfixTemplateCreator.java | 17 + .../CustomPythonStringPostfixTemplate.java | 58 ++ .../languages/python/PythonAnnotator.java | 41 + .../languages/python/PythonLang.java | 16 + .../python/PythonPostfixTemplateProvider.java | 27 + .../python/PythonPostfixTemplatesUtils.java | 57 ++ .../PythonStringPostfixTemplateCreator.java | 17 + .../ruby/CustomRubyStringPostfixTemplate.java | 33 + .../languages/ruby/RubyAnnotator.java | 36 + .../languages/ruby/RubyLang.java | 16 + .../ruby/RubyPostfixTemplateProvider.java | 27 + .../RubyStringPostfixTemplateCreator.java | 17 + .../CustomScalaStringPostfixTemplate.java | 191 +++++ .../languages/scala/ScalaAnnotator.java | 63 ++ .../languages/scala/ScalaLang.java | 16 + .../scala/ScalaPostfixTemplateProvider.java | 50 ++ .../scala/ScalaPostfixTemplatesUtils.java | 38 + .../ScalaStringPostfixTemplateCreator.java | 17 + .../sql/CustomSqlStringPostfixTemplate.java | 46 ++ .../languages/sql/SqlAnnotator.java | 41 + .../languages/sql/SqlLang.java | 16 + .../sql/SqlPostfixTemplateProvider.java | 27 + .../sql/SqlPostfixTemplatesUtils.java | 32 + .../sql/SqlStringPostfixTemplateCreator.java | 17 + .../CustomSwiftStringPostfixTemplate.java | 23 + .../languages/swift/SwiftAnnotator.java | 35 + .../languages/swift/SwiftLang.java | 16 + .../swift/SwiftPostfixTemplateProvider.java | 27 + .../swift/SwiftPostfixTemplatesUtils.java | 32 + .../settings/AddTemplateFileDialog.form | 71 ++ .../settings/AddTemplateFileDialog.java | 211 +++++ .../settings/CptApplicationSettings.java | 150 ++++ .../settings/CptFileType.java | 20 + .../settings/CptManagementTree.java | 569 ++++++++++++++ .../settings/CptPluginConfigurable.java | 83 ++ .../settings/CptPluginSettings.java | 125 +++ .../settings/CptPluginSettingsForm.form | 146 ++++ .../settings/CptPluginSettingsForm.java | 367 +++++++++ .../settings/CptVirtualFile.java | 91 +++ .../settings/CustomPostfixTemplates.java | 22 + .../settings/FileTreeNode.java | 42 + .../settings/SettingsHelpDialog.form | 21 + .../settings/SettingsHelpDialog.java | 30 + .../settings/WebTemplateFile.java | 21 + .../settings/WebTemplateFileLoader.java | 21 + .../templates/CombinedPostfixTemplate.java | 79 ++ .../CustomPostfixTemplateProvider.java | 262 +++++++ .../templates/CustomPostfixTemplateUtils.java | 160 ++++ .../templates/MyVariable.java | 58 ++ .../templates/NavigatablePostfixTemplate.java | 7 + .../templates/NavigatableTemplate.java | 33 + .../SimpleStringBasedPostfixTemplate.java | 201 +++++ .../templates/SpecialType.java | 20 + .../macro/SuggestShortVariableNameMacro.java | 113 +++ .../utils/CollectionUtils.java | 38 + .../utils/CptUpdateUtils.java | 162 ++++ .../FailedToCopyLocalTemplatesException.java | 13 + .../postfixtemplates/utils/MyNotifier.java | 27 + .../postfixtemplates/utils/StringUtils.java | 20 + .../idea/postfixtemplates/utils/Tuple2.java | 20 + src/index.css | 6 - src/index.js | 8 - src/logo.svg | 7 - src/registerServiceWorker.js | 117 --- .../templates/typeMapping.txt | 36 + test/src-test/JavaTest.java | 9 + test/src-test/KtTest.kt | 9 + .../languages/java/JavaTemplatesTest.java | 90 +++ .../CustomScalaStringPostfixTemplateTest.java | 29 + .../CustomStringPostfixTemplateTest.java | 141 ++++ .../templates/TemplateExtractionTestApp.java | 87 +++ .../templates/TemplatesTestTemplate.java | 76 ++ test/src/yaml/User.java | 15 + test/src/yaml/UserYamlTesting.java | 20 + .../yaml/WebTemplateFileParsingTestApp.java | 21 + test/src/yaml/user.yaml | 12 + videos/vid1/vid1.png | Bin 0 -> 3486580 bytes 302 files changed, 14646 insertions(+), 545 deletions(-) delete mode 100644 .gitattributes delete mode 100644 Dockerfile delete mode 100644 LICENSE create mode 100644 LICENSE.md create mode 100644 build.gradle.kts create mode 100644 dev/images/cpt-icon.svg create mode 100644 dev/images/cpt-icon_2.svg create mode 100644 dev/images/cpt-icon_3.svg create mode 100644 dev/images/cpt-icon_3_opt.svg create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/parser/CptParser.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptEscape.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptMapping.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptMappings.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptReplacement.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTemplate.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTemplateCodeG.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTemplateVariable.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTemplateVariableExpressionG.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTemplateVariableNameG.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTemplateVariableValueG.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptTypes.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/CptVisitor.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptEscapeImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptMappingImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptMappingsImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptReplacementImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptTemplateCodeGImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptTemplateImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptTemplateVariableExpressionGImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptTemplateVariableImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptTemplateVariableNameGImpl.java create mode 100644 gen/de/endrullis/idea/postfixtemplates/language/psi/impl/CptTemplateVariableValueGImpl.java create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat delete mode 100644 images/screenshot.png delete mode 100644 package.json delete mode 100644 public/favicon.ico delete mode 100644 public/index.html delete mode 100644 public/manifest.json create mode 100755 resources/META-INF/plugin.xml create mode 100644 resources/META-INF/pluginIcon.svg create mode 100644 resources/META-INF/pluginIcon_dark.svg create mode 100644 resources/META-INF/withDartModule.xml create mode 100644 resources/META-INF/withDatabaseModule.xml create mode 100644 resources/META-INF/withGoModule.xml create mode 100644 resources/META-INF/withGroovyModule.xml create mode 100644 resources/META-INF/withJavaModule.xml create mode 100644 resources/META-INF/withJavaScriptModule.xml create mode 100644 resources/META-INF/withKotlinModule.xml create mode 100644 resources/META-INF/withLatexModule.xml create mode 100644 resources/META-INF/withPhpModule.xml create mode 100644 resources/META-INF/withPythonModule.xml create mode 100644 resources/META-INF/withRiderModule.xml create mode 100644 resources/META-INF/withRubyModule.xml create mode 100644 resources/META-INF/withScalaModule.xml create mode 100644 resources/META-INF/withSwiftModule.xml create mode 100644 resources/de/endrullis/idea/postfixtemplates/bundle/PostfixTemplatesBundle.properties create mode 100644 resources/de/endrullis/idea/postfixtemplates/icons/cpt-icon.png create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/defaulttemplates/dart.postfixTemplates create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/defaulttemplates/example.postfixTemplates create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/defaulttemplates/java.postfixTemplates create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/defaulttemplates/javascript.postfixTemplates create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/defaulttemplates/kotlin.postfixTemplates create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/defaulttemplates/scala.postfixTemplates create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/templatemapping/emptyLambda.txt create mode 100644 resources/de/endrullis/idea/postfixtemplates/language/templatemapping/varLambda.txt create mode 100644 resources/intentionDescriptions/OverrideTemplateRuleIntention/description.html create mode 100644 resources/liveTemplates/CustomPostfixTemplates.xml create mode 100644 resources/postfixTemplates/CombinedPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CombinedPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CombinedPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomCsharpStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomCsharpStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomCsharpStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomDartStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomDartStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomDartStringPostfixTemplate/description.html create mode 100755 resources/postfixTemplates/CustomGoStringPostfixTemplate/after.java.template create mode 100755 resources/postfixTemplates/CustomGoStringPostfixTemplate/before.java.template create mode 100755 resources/postfixTemplates/CustomGoStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomGroovyStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomGroovyStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomGroovyStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomJavaScriptStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomJavaScriptStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomJavaScriptStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomJavaStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomJavaStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomJavaStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomKotlinStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomKotlinStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomKotlinStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomLatexStringPostfixTempalte/after.java.template create mode 100644 resources/postfixTemplates/CustomLatexStringPostfixTempalte/before.java.template create mode 100644 resources/postfixTemplates/CustomLatexStringPostfixTempalte/description.html create mode 100644 resources/postfixTemplates/CustomPhpStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomPhpStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomPhpStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomPythonStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomPythonStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomPythonStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomRubyStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomRubyStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomRubyStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomRustStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomRustStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomRustStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomScalaStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomScalaStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomScalaStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomSqlStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomSqlStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomSqlStringPostfixTemplate/description.html create mode 100644 resources/postfixTemplates/CustomSwiftStringPostfixTemplate/after.java.template create mode 100644 resources/postfixTemplates/CustomSwiftStringPostfixTemplate/before.java.template create mode 100644 resources/postfixTemplates/CustomSwiftStringPostfixTemplate/description.html create mode 100644 settings.gradle.kts delete mode 100644 src/App.css delete mode 100644 src/App.js delete mode 100644 src/App.test.js delete mode 100644 src/components/card.js delete mode 100644 src/components/footer.js delete mode 100644 src/components/main-container.js delete mode 100644 src/components/nav.js create mode 100644 src/de/endrullis/idea/postfixtemplates/ApplicationInterface.java create mode 100644 src/de/endrullis/idea/postfixtemplates/MyPostStartupActivity.kt create mode 100644 src/de/endrullis/idea/postfixtemplates/SentryErrorReporter.java create mode 100644 src/de/endrullis/idea/postfixtemplates/actions/EditorTypedHandlerDelegate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/actions/OpenSettingsAction.java create mode 100644 src/de/endrullis/idea/postfixtemplates/actions/OpenTemplatesAction.java create mode 100644 src/de/endrullis/idea/postfixtemplates/bundle/PostfixTemplatesBundle.java create mode 100644 src/de/endrullis/idea/postfixtemplates/intention/OverrideTemplateRuleIntention.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/Cpt.bnf create mode 100644 src/de/endrullis/idea/postfixtemplates/language/Cpt.flex create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptBlock.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptChooseByNameContributor.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptCodeStyleMainPanel.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptCodeStyleSettingsProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptColorSettingsPage.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptCommenter.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptCompletionContributor.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptCompletionUtil.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptContext.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptFileType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptFilterLexer.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptFormattingModelBuilder.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptIcons.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptIndexer.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLangAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLanguage.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLanguageCodeStyleSettingsProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLexer.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLexerAdapter.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptLookupActionProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptParserDefinition.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptReference.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptReferenceContributor.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptStructureViewElement.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptStructureViewFactory.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptStructureViewModel.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptSyntaxHighlighter.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptSyntaxHighlighterFactory.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptTodoIndexer.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/CptUtil.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/CptElementFactory.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/CptElementType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/CptFile.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/CptNamedElement.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/CptTokenType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/impl/CptNamedElementImpl.java create mode 100644 src/de/endrullis/idea/postfixtemplates/language/psi/impl/CptPsiImplUtil.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/SupportedLanguages.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/csharp/CsharpAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/csharp/CsharpLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/csharp/CsharpPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/csharp/CsharpStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/csharp/CustomCsharpStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/dart/CustomDartStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/dart/DartAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/dart/DartLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/dart/DartPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/dart/DartPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/dart/DartStringPostfixTemplateCreator.java create mode 100755 src/de/endrullis/idea/postfixtemplates/languages/go/CustomGoStringPostfixTemplate.java create mode 100755 src/de/endrullis/idea/postfixtemplates/languages/go/GoAnnotator.java create mode 100755 src/de/endrullis/idea/postfixtemplates/languages/go/GoLang.java create mode 100755 src/de/endrullis/idea/postfixtemplates/languages/go/GoPostfixTemplateProvider.java create mode 100755 src/de/endrullis/idea/postfixtemplates/languages/go/GoPostfixTemplatesUtils.java create mode 100755 src/de/endrullis/idea/postfixtemplates/languages/go/GoSpecialType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/CustomGroovyStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/GroovyAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/GroovyLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/GroovyPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/GroovyPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/GroovyStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/groovy/GroovyType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/java/CustomJavaStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/java/JavaAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/java/JavaLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/java/JavaPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/java/MyJavaPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/javascript/CustomJavaScriptStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/javascript/JavaScriptAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/javascript/JavaScriptLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/javascript/JavaScriptPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/kotlin/CustomKotlinStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/kotlin/KotlinAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/kotlin/KotlinLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/kotlin/KotlinPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/kotlin/KotlinStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/latex/CustomLatexStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/latex/LatexAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/latex/LatexLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/latex/LatexPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/php/CustomPhpStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/php/PhpAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/php/PhpLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/php/PhpPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/php/PhpPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/php/PhpStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/python/CustomPythonStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/python/PythonAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/python/PythonLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/python/PythonPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/python/PythonPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/python/PythonStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/ruby/CustomRubyStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/ruby/RubyAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/ruby/RubyLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/ruby/RubyPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/ruby/RubyStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/scala/CustomScalaStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/scala/ScalaAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/scala/ScalaLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/scala/ScalaPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/scala/ScalaPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/scala/ScalaStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/sql/CustomSqlStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/sql/SqlAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/sql/SqlLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/sql/SqlPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/sql/SqlPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/sql/SqlStringPostfixTemplateCreator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/swift/CustomSwiftStringPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/swift/SwiftAnnotator.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/swift/SwiftLang.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/swift/SwiftPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/languages/swift/SwiftPostfixTemplatesUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/AddTemplateFileDialog.form create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/AddTemplateFileDialog.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptApplicationSettings.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptFileType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptManagementTree.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptPluginConfigurable.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptPluginSettings.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptPluginSettingsForm.form create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptPluginSettingsForm.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CptVirtualFile.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/CustomPostfixTemplates.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/FileTreeNode.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/SettingsHelpDialog.form create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/SettingsHelpDialog.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/WebTemplateFile.java create mode 100644 src/de/endrullis/idea/postfixtemplates/settings/WebTemplateFileLoader.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/CombinedPostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/CustomPostfixTemplateProvider.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/CustomPostfixTemplateUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/MyVariable.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/NavigatablePostfixTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/NavigatableTemplate.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/SimpleStringBasedPostfixTemplate.java create mode 100755 src/de/endrullis/idea/postfixtemplates/templates/SpecialType.java create mode 100644 src/de/endrullis/idea/postfixtemplates/templates/macro/SuggestShortVariableNameMacro.java create mode 100644 src/de/endrullis/idea/postfixtemplates/utils/CollectionUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/utils/CptUpdateUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/utils/FailedToCopyLocalTemplatesException.java create mode 100644 src/de/endrullis/idea/postfixtemplates/utils/MyNotifier.java create mode 100644 src/de/endrullis/idea/postfixtemplates/utils/StringUtils.java create mode 100644 src/de/endrullis/idea/postfixtemplates/utils/Tuple2.java delete mode 100644 src/index.css delete mode 100644 src/index.js delete mode 100644 src/logo.svg delete mode 100644 src/registerServiceWorker.js create mode 100644 test/resources/de/endrullis/idea/postfixtemplates/templates/typeMapping.txt create mode 100644 test/src-test/JavaTest.java create mode 100644 test/src-test/KtTest.kt create mode 100644 test/src/de/endrullis/idea/postfixtemplates/languages/java/JavaTemplatesTest.java create mode 100644 test/src/de/endrullis/idea/postfixtemplates/languages/scala/CustomScalaStringPostfixTemplateTest.java create mode 100644 test/src/de/endrullis/idea/postfixtemplates/templates/CustomStringPostfixTemplateTest.java create mode 100644 test/src/de/endrullis/idea/postfixtemplates/templates/TemplateExtractionTestApp.java create mode 100644 test/src/de/endrullis/idea/postfixtemplates/templates/TemplatesTestTemplate.java create mode 100644 test/src/yaml/User.java create mode 100644 test/src/yaml/UserYamlTesting.java create mode 100644 test/src/yaml/WebTemplateFileParsingTestApp.java create mode 100644 test/src/yaml/user.yaml create mode 100644 videos/vid1/vid1.png diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfe07704..00000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/.gitignore b/.gitignore index 130f7e96..a83e773d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,10 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +*.DS_Store -# dependencies -/node_modules +/.idea/ +*.iml +/out/ +/build/ -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -package-lock.json \ No newline at end of file +.gradle/ +gradle.properties +/.sandbox/ diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index e7e3f9ad..00000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# build environment -FROM node:9.6.1 as builder -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app -ENV PATH /usr/src/app/node_modules/.bin:$PATH -COPY package.json /usr/src/app/package.json -RUN npm install --silent -RUN npm install react-scripts@1.1.1 -g --silent -COPY . /usr/src/app -RUN npm run build - - -# production environment -FROM nginx:1.13.9-alpine -COPY --from=builder /usr/src/app/build /usr/share/nginx/html -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 6ce4e73d..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Jungwon Seo - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..e06d2081 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/README.md b/README.md index c02618d3..401d3ccf 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,351 @@ -# Simple React +# Custom Postfix Templates for Intellij IDEA -Sample React.js application for the Docker environment. +**Custom Postfix Templates** is an Intellij IDEA plugin that allows you to define your own custom [postfix completion templates](https://blog.jetbrains.com/idea/2014/03/postfix-completion/). +At the moment it supports the following programming languages with : Java, Scala, SQL, PHP, Go, Groovy, Python, LaTeX, Kotlin (untyped templates), Dart (untyped templates), JavaScript (untyped templates), and Rust (untyped templates). -## Getting Started -![Screen Shopt](images/screenshot.png?raw=true "Screen Shot") -App with one container. Reading from external open API. No storage. No secrets. Dynamic web page - including information from external API. +## So what is the difference to IDEA's postfix templates? -### Prerequisites +Since IDEA 2018 you are now able to define your own postfix templates in the settings UI (*Editor → General → Postfix Templates*). However, this is a pretty new feature and it's less functional than this plugin. Here are some of the **advantages of this plugin**: -Make sure you have already installed Docker Engine. -You don’t need to install Nginx or NPM, as both are provided by Docker images. +* You can **define different template rules for the same template name**, e.g. .toList should behave differently for arrays and for sets. +* You can **use template variables** (e.g. `$varName$`) which are filled by the user while applying the template. +* You can **use live template macros** to automatically fill some of the template variables (e.g. `$var:suggestVariableName()$`) as well as you can define default values. +* You can **restrict the availability of templates or template rules to the availability of certain classes or libraries** (e.g. expand `"test".val` to `val s = "test"` if Lombok is available). +* It allows you to **use static imports instead of class imports** (e.g. `array.toList` can be expanded to `asList(array)` instead of `Arrays.asList(array)` if you add `[USE_STATIC_IMPORTS]` to the rule). +* It **comes with more than 500 editable postfix templates** with more than 700 template rules, e.g. + * `string.toInt` → `Integer.parse(string)` + * `array.toList` → `Arrays.asList(array)` + * `file.lines` → `Files.readAllLines(file.toPath(), Charset.forName("UTF-8"))` + * `file.getName().val` → `final String name = file.getName();` +* The text based format for defining your templates allows you to **easily share** them via copy and paste. +## Screencast + +![Screen Cast](https://github.com/xylo/intellij-postfix-templates/blob/master/videos/vid1/vid1.png) + +## Download + +You can download the plugin **Custom Postfix Templates** via *Settings → Plugins → Browse Repositories*. + +## Usage + +The plugin comes with a predefined set of templates for Java and Scala (see below) which can be immediatly applied in Java/Scala files. +For instance, write + + "1".toInt + +in a Java file. If the completion popup does not automatically show up, press *Ctrl+SPACE*. +Select the `.toInt` template and see how it is expanded. + +And if you want to see the template definition, just press *Alt+ENTER* in the completiion popup and select *Edit '.toInt' template*. + +## Kinds of template files + +There are three different types of template files: +* User template files: use them to define your own templates and/or override local or web template rules +* Local template files: loaded from the local file system, read-only, and updated automatically when an IDEA project is opened +* Web template files: loaded from the web, read-only, and updated automatically once a day + +## Order of template files/rules + +Template rules are applied in a first-come-first-serve manner, i.e., more specific rules/files should be placed above more general rules/files. +Reorder files in the tree by selecting them and by using the up/down buttons. + +## Predefined web templates files + +The plugin comes with a set of so-called "web template files" which provide in total [more than 200 useful templates](https://github.com/xylo/intellij-postfix-templates/wiki). +While web template files are read-only and shall not be edited by the user because of automatic updates, you can still edit or deactivate templates of these files. + +To change or deactivate a predefined template you just have to start the template name completion with *Ctrl+Space* and then press *ALT+Enter* and select the third item (*Edit .TEMPLATE_NAME template*). The corresponding web template file is opened and you see the definition of the template rule. Since you cannot this template file directly you have to override the template rule by pressing *Alt+Enter* and selecting *Override template rule*. This overriding works in a way that your template rule needs to be loaded before the predefined template gets loaded. This is done by adding your rule to a user template file which is placed above the predefined web template file in the plugin settings. In case that you don't have a user template file which is loaded before, you are offered to create one. After you selected an existing user template or created a new one the template rule to override is automatically added to this file and you can start adapting it. To deactivate a template rule, replace the rigth side of the rule with *[SKIP]*. + +## Edit the templates + +Press *Shift+Alt+P* (or go to menu *Tools → Custom Postfix Templates → Edit Templates of Current Language*) +to open the custom postfix templates for the programming language in your current editor. +Here you can easily change, remove, or add new templates matching your needs. +Note that you have to save the template file explicitly (via *Ctrl+S*) in order to update the postfix templates in the IDE. + +### Template definitions + +The file may contain multiple template definitions of the form: ``` -$ docker -v -Docker version 18.03.1-ce, build 9ee9f40 +.TEMPLATE_NAME : TEMPLATE_DESCRIPTION + TEMPLATE_RULE1 + TEMPLATE_RULE2 + ... ``` +Each template definition consists of a template name, a template description and an arbitrary number of template rules. The template name is used as key in the code completion and the template description is shown as hint in the code completion popup. The template rules define on which types the template can be applied and how the application is performed. -đâsdasdasdas -### Installing +### Simple template rules +A simple template rule has the form ``` -git clone https://github.com/thejungwon/docker-reactjs.git -cd docker-reactjs -docker build -t docker-reactjs . -docker run -p 80:80 docker-reactjs - + MATCHING_TYPE → TEMPLATE_CODE ``` -Go to [http://localhost](http://localhost) +whereas +* *[`MATCHING_TYPE`](#matching_type)* defines the type the template can be applied to, and +* *[`TEMPLATE_CODE`](#template_code)* defines how the template is applied (how the expression is replaced). -## Running the tests +#### MATCHING_TYPE -TBD +The options for *MATCHING_TYPE* may differ from programming language to programming language: +* In **Java** the *MATCHING_TYPE* can be either a Java class name or one of the following special types: + * `ANY` - any expression + * `VOID` - any void expression + * `NON_VOID` - any non-void expression + * `ARRAY` - any Java array + * `BOOLEAN` - boxed or unboxed boolean expressions + * `ITERABLE_OR_ARRAY` - any iterable or array + * `NOT_PRIMITIVE` - any non-primitive value + * `NUMBER` - any boxed or unboxed number + * `BYTE` - a boxed or unboxed byte value + * `SHORT` - a boxed or unboxed short value + * `CHAR` - a boxed or unboxed char value + * `INT` - a boxed or unboxed int value + * `LONG` - a boxed or unboxed long value + * `FLOAT` - a boxed or unboxed float value + * `DOUBLE` - a boxed or unboxed double value + * `NUMBER_LITERAL` - any number literal + * `BYTE_LITERAL` - a byte literal + * `SHORT_LITERAL` - a short literal + * `CHAR_LITERAL` - a char literal + * `INT_LITERAL` - an int literal + * `LONG_LITERAL` - a long literal + * `FLOAT_LITERAL` - a float literal + * `DOUBLE_LITERAL` - a double literal + * `STRING_LITERAL` - a String literal + * `CLASS` - any class reference +* In **Scala** the *MATCHING_TYPE* can be either a Java class name or one of the following special types: + * `ANY` - any expression + * `VOID` - any void (Unit) expression + * `NON_VOID` - any non-void (non-Unit) expression + * `BOOLEAN` - scala.Boolean or java.lang.Boolean + * `NUMBER` - any Scala or Java number value + * `BYTE` - scala.Byte or java.lang.Byte + * `SHORT` - scala.Short or java.lang.Short + * `CHAR` - scala.Char or java.lang.Char + * `INT` - scala.Int or java.lang.Integer + * `LONG` - scala.Long or java.lang.Long + * `FLOAT` - scala.Float or java.lang.Float + * `DOUBLE` - scala.Double or java.lang.Double +* In **SQL** the *MATCHING_TYPE* can be either a Java class name or one of the following special types: + * `ANY` - any expression + * `UNKNOWN` - unknown expression + * `DEFAULT` - ? + * `INTEGER` - integer expression + * `REAL` - real expression + * `STRING` - string expression + * `BOOLEAN` - boolean expression + * `DATE_TIME` - date-time expression + * `DATE` - date expression + * `TIME` - time expression + * `TIMESTAMP` - timestamp expression + * `INTERVAL` - interval expression + * `BYTES` - bytes expression + * `REFERENCE` - ? + * `ARRAY` - array expression + * `COLLECTION` - collection expression + * `TABLE` - table reference + * `RECORD` - ? + * `SETO` - ? +* In **PHP** the *MATCHING_TYPE* can be either a PHP class name or one of the following special types: + * `ANY` - any expression + * `empty` + * `null` + * `string` + * `boolean` + * `int` + * `float` + * `object` + * `callable` + * `resource` + * `array` + * `iterable` + * `number` + * `void` + * `unset` + * `static` + * `\Closure` + * `\Exception` + * `\Throwable` +* In **Go** the *MATCHING_TYPE* can be one of the following special types: + * `ANY` - any expression + * `ARRAY` - any array + * `BOOLEAN` - any boolean expression + * `STRING` - any string expression + * `INT` - any integer expression + * `INT64` - any 64 bit integer expression + * `UINT` - any unsigned integer expression + * `FLOAT` - any floating point expression + * `FLOAT32` - any 32 bit floating point expression + * `FLOAT64` - any 64 bit floating point expression + * `BYTESLICE` - any byte slice expression + * `ERROR` - any error expression + * `COMPLEX` - ??? + * `NIL` - any expression of type Nil +* In **Groovy** the *MATCHING_TYPE* can be either a Java/Groovy class name or one of the following special types: + * `ANY` - any expression + * `ARRAY` - any Java array + * `BOOLEAN` - boxed or unboxed boolean expressions + * `ITERABLE_OR_ARRAY` - any iterable or array + * `NUMBER` - any boxed or unboxed number + * `BYTE` - a boxed or unboxed byte value + * `SHORT` - a boxed or unboxed short value + * `CHAR` - a boxed or unboxed char value + * `INT` - a boxed or unboxed int value + * `LONG` - a boxed or unboxed long value + * `FLOAT` - a boxed or unboxed float value + * `DOUBLE` - a boxed or unboxed double value + * `CLASS` - any class reference +* In **Python** the *MATCHING_TYPE* can be one of the following special types: + * `ANY` - any expression + * `object` + * `list` + * `dict` + * `set` + * `tuple` + * `int` + * `float` + * `complex` + * `str` + * `unicode` + * `bytes` + * `bool` + * `classmethod` + * `staticmethod` + * `type` +* In **Kotlin** the *MATCHING_TYPE* has to be `ANY`. +* In **Dart** the *MATCHING_TYPE* has to be `ANY`. +* In **JavaScript** the *MATCHING_TYPE* has to be `ANY`. +* In **Rust** the *MATCHING_TYPE* has to be `ANY` +* In **Latex** the *MATCHING_TYPE* can be one of the following types: + * `ANY` - any expression in any context + * `TEXT` - any expression that is *not* within a math environment + * `MATH` - any expression that *is* within a math environment -### Break down into end to end tests +#### TEMPLATE_CODE -TBD +The *TEMPLATE_CODE* can be any text which may also contain template variables used as placeholder. +* Simple template variables have the format `$NAME$`. +* The following template variables have a special meaning: + * `$expr$` - the expression the template shall be applied to + * `$END$` - the final cursor position after the template application +* All other variables will be replaced interactively during the template expansion. +* If you want to change the order of variables, set default values or use live template macros for filling the variables automatically, you can use the following variable format: + ``` + $NAME#NO:EXPRESSION:DEFAULT_VALUE$ + ``` + * *NAME* - name of the variable; use a `*` at the end of the name to skip user interaction + * *NO* (optional) - number of the variable (defining in which order the variables are expanded) + * *EXPRESSION* (optional) - a live template macro used to generate a replacement (e.g. `suggestVariableName()`) + * *DEFAULT_VALUE* (optional) - a default value that may be used by the macro +* If you want to create multi-line templates you can use a backslash (`\`) at the end of a line to indicate that the template code continues at the next line. -### And coding style tests +#### Template Examples -TBD +* Artificial example showing variable reordering, variable reusage, interaction skipping, macros, and default values: + ``` + .test : test + NON_VOID → "$user*#1:user()$: $second#3:className()$ + $first#2::"1st"$ + $first$" + $expr$ + ``` +* Real world example: Write a variable to the debug log, including the developer name, the class name, and method name: + ``` + .logd : log a variable + NON_VOID → Log.d("$user*:user():"MyTag"$", "$className*:className()$ :: $methodName*:methodName()$): $expr$="+$expr$); + ``` +* Multi-line template: + ``` + .for : iterate over ... + ITERABLE_OR_ARRAY → for ($ELEMENT_TYPE:iterableComponentType(expr):"java.lang.Object"$ $VAR:suggestVariableName()$ : $expr$) {\ + $END$\ + } + ``` +While writing the templates you can use the code completion for completing class names, variable names, template macros and arrows (→). -## Built With +### Advanced template rules -* [Nginx](https://nginx.org/en/) - Web server -* [React.js](https://reactjs.org/) - The front-end framework used -* [Docker](https://www.docker.com/) - Containerization -* [Materialize](https://materializecss.com/) - Front-end framework +In the chapter above some options have been omitted for simplicity. If you need more functionality here is the full format of template rules including two optional parameters: +``` + MATCHING_TYPE [REQUIRED_CLASS] → TEMPLATE_CODE [FLAG] +``` +* *REQUIRED_CLASS* (optional) is a name of a class that needs to be available in the module to activate the template rule (see next section for a detailed explaination) +* *FLAG* (optional) can be one of the following flags: + * [`SKIP`](#skip) - skips the rule + * [`USE_STATIC_IMPORTS`](#use_static_imports) - adds static method imports automatically if possible (Java only) + * [`IMPORT` ...](#import) - adds an import to the file header (Scala only) +#### Writing library specific template rules via REQUIRED_CLASS -## Authors +Sometimes you may want to write library specific template rules, i.e. rules that shall be only applied when a certain library is included in the project. For instance, take a look at the `.val` template provided with this plugin: +``` +.val : extract as value + NON_VOID [lombok.val] → val $var:suggestVariableName()$ = $expr$; + NON_VOID → final $type*:expressionType(expr))$ $var:suggestVariableName()$ = $expr$; +``` +It can be applied to any non-void expression and expands either to +``` +val myVar = myExpression; +``` +if lombok is available, or to +``` +final MyType myVar = myExpression; +``` +if you're using Java without lombok. + +In this exmaple template the `[lombok.val]` part after the matching type is used to restrict the rule appliction to those cases where the class `lombok.val` is available in the class path. -* **Jungwon Seo** - *Initial work* - [thejungwon](https://github.com/thejungwon) +In general you can use any class name between the square brackets you want to define a restriction on. +#### FLAGs + +##### SKIP + +You can use the `[SKIP]` flag for deactivating the template rule for a given matching type. + +Example: +``` +.sort : sort naturally + de.endrullis.lazyseq.LazySeq → [SKIP] + java.util.List → java.util.Collections.sort($expr$) +``` -## License +In this example a postfix template `.sort` is defined. +The first rule tells the plugin that there shall be no completition for expressions of type `LazySeq`. +The second rule defines how `List` expressions shall be completed. + +##### USE_STATIC_IMPORTS + +If you tag a template rule for Java with `[USE_STATIC_IMPORTS]` all static methods that are used will be automatically imported and your code gets more compact. For instance, lets take the following template rule: +``` +.toList : convert to List + ARRAY → java.util.Arrays.asList($expr$) [USE_STATIC_IMPORTS] +``` +Since the rule is tagged with `[USE_STATIC_IMPORTS]` expanding of `array.toList` does not lead to `Arrays.asList(array)` but to `asList(array)` and the following line is added to your import statements: +``` +import static java.util.Arrays.asList; +``` + +##### IMPORT + +If you tag a template rule for Scala with `[IMPORT FULLY_QUALIFIED_CLASSNAME]` the given class (or method) import is automatically added to the file header when the template gets applied: +``` +.printStream : get PrintStream + java.io.File → new PrintStream($expr$) [IMPORT java.io.PrintStream] +``` +Note that you can use the `IMPORT` flag multiple times. -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details +## Update templates and open plugin settings +Go to *Settings → Editor → Custom Postfix Templates* or *Tools → Custom Postfix Templates → Open Settings / Upgrade Templates*. There you can chose between two different lambda styles and check/uncheck the template files you want to enable/disable. +## Contribute +Any contributions are welcome. Just fork the project, make your changes and create a pull request. +Here are some guides: +* [Create a template file for a utility class/library](https://github.com/xylo/intellij-postfix-templates/wiki/Create-a-template-file-for-a-utility-class-library) +* [Add new language support](https://github.com/xylo/intellij-postfix-templates/wiki/Add-new-language-support) -sấnlnfaslnfakn -iiiii \ No newline at end of file +# See also +* [Feature request for custom postfix completion at jetbrains.com](https://youtrack.jetbrains.com/issue/IDEA-122443) diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..49ea8ab1 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,125 @@ +plugins { + // Java support + id("java") + // Kotlin support + //id("org.jetbrains.kotlin.jvm") version "1.7.10" + // Gradle Changelog Plugin + //id("org.jetbrains.changelog") version "1.3.1" + // Gradle Qodana Plugin + id("org.jetbrains.qodana") version "0.1.13" + // Gradle IntelliJ Plugin + id("org.jetbrains.intellij") version "1.14.2" + kotlin("jvm") version "1.9.10" +} + +group = "com.intellij" +version = "2.20.2.241" + +tasks.withType { + sourceCompatibility = "17" + targetCompatibility = "17" + options.encoding = "UTF-8" +} + +repositories { + mavenCentral() +} + + +dependencies { + implementation("commons-io:commons-io:2.11.0") + implementation("org.apache.commons:commons-lang3:3.13.0") + implementation("com.fasterxml.jackson.core:jackson-core:2.15.1") + implementation("com.fasterxml.jackson.core:jackson-databind:2.15.1") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.1") + implementation("io.sentry:sentry:6.9.0") { + exclude("org.slf4j") + } + // https://mvnrepository.com/artifact/org.projectlombok/lombok + + compileOnly("org.projectlombok:lombok:1.18.26") + annotationProcessor("org.projectlombok:lombok:1.18.26") + + testCompileOnly("org.projectlombok:lombok:1.18.26") + testAnnotationProcessor("org.projectlombok:lombok:1.18.26") + + testImplementation("junit:junit:4.13.2") + //implementation(kotlin("stdlib-jdk8")) +} + + + + +sourceSets { + main { + java.srcDirs("src", "gen") + resources.srcDir("resources") + } + + test { + java.srcDir("test/src") + resources.srcDir("test/resources") + } + +} + + +intellij { + // full list of IntelliJ IDEA releases at https://www.jetbrains.com/intellij-repository/releases + // full list of IntelliJ IDEA EAP releases at https://www.jetbrains.com/intellij-repository/snapshots + //version "IU-233.11799.6-EAP-SNAPSHOT" + type.set("IU") + //version.set("241.14024.14-EAP-SNAPSHOT") + version.set("241.14494.240") + + plugins.set( + listOf( + "java", + "Pythonid:241.14494.240", + "Kotlin", + "org.intellij.scala:2024.1.7", + "JavaScript", + //"CSS", + "Dart:241.15845", + "Groovy", + "properties", + "org.jetbrains.plugins.ruby:241.14494.240", + "com.jetbrains.php:241.14494.240", + "java-i18n", + "DatabaseTools", + "org.toml.lang", + "org.jetbrains.plugins.go:241.14494.240", + "nl.rubensten.texifyidea:0.9.4" + ) + ) + updateSinceUntilBuild.set(true) +} + +tasks { + // Avoid ClassNotFoundException: com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider + buildSearchableOptions { + // jvmArgs = ["-Djava.system.class.loader=com.intellij.util.lang.PathClassLoader"] + enabled = false + } + + runPluginVerifier { + //ideVersions.set(listOf(intellij.type.get() + "-" + intellij.version.get())) + //ideVersions("IU-222.3345.118") + //setFailureLevel(RunPluginVerifierTask.FailureLevel.ALL) + } + + publishPlugin { + token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken")) + } +} +/* +kotlin { + jvmToolchain(20) +} + */ +tasks.compileKotlin { + kotlinOptions { + jvmTarget = "17" + freeCompilerArgs = listOf("-Xjvm-default=all") + } +} diff --git a/dev/images/cpt-icon.svg b/dev/images/cpt-icon.svg new file mode 100644 index 00000000..43eceb96 --- /dev/null +++ b/dev/images/cpt-icon.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + p + + + + diff --git a/dev/images/cpt-icon_2.svg b/dev/images/cpt-icon_2.svg new file mode 100644 index 00000000..7eb19248 --- /dev/null +++ b/dev/images/cpt-icon_2.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/dev/images/cpt-icon_3.svg b/dev/images/cpt-icon_3.svg new file mode 100644 index 00000000..c416d3d2 --- /dev/null +++ b/dev/images/cpt-icon_3.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/dev/images/cpt-icon_3_opt.svg b/dev/images/cpt-icon_3_opt.svg new file mode 100644 index 00000000..95619097 --- /dev/null +++ b/dev/images/cpt-icon_3_opt.svg @@ -0,0 +1,19 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/gen/de/endrullis/idea/postfixtemplates/language/parser/CptParser.java b/gen/de/endrullis/idea/postfixtemplates/language/parser/CptParser.java new file mode 100644 index 00000000..2b0a9f73 --- /dev/null +++ b/gen/de/endrullis/idea/postfixtemplates/language/parser/CptParser.java @@ -0,0 +1,340 @@ +// This is a generated file. Not intended for manual editing. +package de.endrullis.idea.postfixtemplates.language.parser; + +import com.intellij.lang.PsiBuilder; +import com.intellij.lang.PsiBuilder.Marker; +import static de.endrullis.idea.postfixtemplates.language.psi.CptTypes.*; +import static com.intellij.lang.parser.GeneratedParserUtilBase.*; +import com.intellij.psi.tree.IElementType; +import com.intellij.lang.ASTNode; +import com.intellij.psi.tree.TokenSet; +import com.intellij.lang.PsiParser; +import com.intellij.lang.LightPsiParser; + +@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"}) +public class CptParser implements PsiParser, LightPsiParser { + + public ASTNode parse(IElementType t, PsiBuilder b) { + parseLight(t, b); + return b.getTreeBuilt(); + } + + public void parseLight(IElementType t, PsiBuilder b) { + boolean r; + b = adapt_builder_(t, b, this, null); + Marker m = enter_section_(b, 0, _COLLAPSE_, null); + if (t == ESCAPE) { + r = escape(b, 0); + } + else if (t == MAPPING) { + r = mapping(b, 0); + } + else if (t == MAPPINGS) { + r = mappings(b, 0); + } + else if (t == REPLACEMENT) { + r = replacement(b, 0); + } + else if (t == TEMPLATE) { + r = template(b, 0); + } + else if (t == TEMPLATE_CODE_G) { + r = templateCodeG(b, 0); + } + else if (t == TEMPLATE_VARIABLE) { + r = templateVariable(b, 0); + } + else if (t == TEMPLATE_VARIABLE_EXPRESSION_G) { + r = templateVariableExpressionG(b, 0); + } + else if (t == TEMPLATE_VARIABLE_NAME_G) { + r = templateVariableNameG(b, 0); + } + else if (t == TEMPLATE_VARIABLE_VALUE_G) { + r = templateVariableValueG(b, 0); + } + else { + r = parse_root_(t, b, 0); + } + exit_section_(b, 0, m, t, r, true, TRUE_CONDITION); + } + + protected boolean parse_root_(IElementType t, PsiBuilder b, int l) { + return CptFile(b, l + 1); + } + + /* ********************************************************** */ + // (template|COMMENT)* + static boolean CptFile(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "CptFile")) return false; + int c = current_position_(b); + while (true) { + if (!CptFile_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "CptFile", c)) break; + c = current_position_(b); + } + return true; + } + + // template|COMMENT + private static boolean CptFile_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "CptFile_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = template(b, l + 1); + if (!r) r = consumeToken(b, COMMENT); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // TEMPLATE_ESCAPE + public static boolean escape(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "escape")) return false; + if (!nextTokenIs(b, TEMPLATE_ESCAPE)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, TEMPLATE_ESCAPE); + exit_section_(b, m, ESCAPE, r); + return r; + } + + /* ********************************************************** */ + // CLASS_NAME (BRACKET_OPEN CLASS_NAME BRACKET_CLOSE)? MAP replacement + public static boolean mapping(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mapping")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, MAPPING, ""); + r = consumeToken(b, CLASS_NAME); + r = r && mapping_1(b, l + 1); + r = r && consumeToken(b, MAP); + r = r && replacement(b, l + 1); + exit_section_(b, l, m, r, false, recover_parser_parser_); + return r; + } + + // (BRACKET_OPEN CLASS_NAME BRACKET_CLOSE)? + private static boolean mapping_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mapping_1")) return false; + mapping_1_0(b, l + 1); + return true; + } + + // BRACKET_OPEN CLASS_NAME BRACKET_CLOSE + private static boolean mapping_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mapping_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, BRACKET_OPEN, CLASS_NAME, BRACKET_CLOSE); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // mapping* + public static boolean mappings(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mappings")) return false; + Marker m = enter_section_(b, l, _NONE_, MAPPINGS, ""); + int c = current_position_(b); + while (true) { + if (!mapping(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "mappings", c)) break; + c = current_position_(b); + } + exit_section_(b, l, m, true, false, null); + return true; + } + + /* ********************************************************** */ + // !(TEMPLATE_NAME|CLASS_NAME|COMMENT) + static boolean recover_parser(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "recover_parser")) return false; + boolean r; + Marker m = enter_section_(b, l, _NOT_); + r = !recover_parser_0(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // TEMPLATE_NAME|CLASS_NAME|COMMENT + private static boolean recover_parser_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "recover_parser_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, TEMPLATE_NAME); + if (!r) r = consumeToken(b, CLASS_NAME); + if (!r) r = consumeToken(b, COMMENT); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // (templateCodeG|escape|templateVariable)+ + public static boolean replacement(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "replacement")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, REPLACEMENT, ""); + r = replacement_0(b, l + 1); + int c = current_position_(b); + while (r) { + if (!replacement_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "replacement", c)) break; + c = current_position_(b); + } + exit_section_(b, l, m, r, false, null); + return r; + } + + // templateCodeG|escape|templateVariable + private static boolean replacement_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "replacement_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = templateCodeG(b, l + 1); + if (!r) r = escape(b, l + 1); + if (!r) r = templateVariable(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // (TEMPLATE_NAME SEPARATOR TEMPLATE_DESCRIPTION) mappings + public static boolean template(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "template")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, TEMPLATE, "