├── .gitignore ├── README.md ├── lib ├── asm-all.jar ├── idea-formatter.jar ├── intellij-core.jar ├── kotlin-converter.jar ├── kotlin-formatter.jar ├── kotlin-ide-common.jar └── openapi-formatter.jar ├── license.txt ├── licenseheader.txt ├── pom.xml └── src ├── main ├── java │ ├── com │ │ └── intellij │ │ │ ├── codeInsight │ │ │ ├── CodeInsightBundle.java │ │ │ ├── actions │ │ │ │ └── ReformatCodeProcessor.java │ │ │ └── generation │ │ │ │ └── GenerateEqualsHelper.java │ │ │ ├── formatting │ │ │ ├── DependantSpacingImpl.java │ │ │ ├── KotlinLanguageCodeStyleSettingsProvider.java │ │ │ └── KotlinSettingsProvider.java │ │ │ ├── openapi │ │ │ ├── editor │ │ │ │ └── Editor.java │ │ │ ├── extensions │ │ │ │ └── ExtensionException.java │ │ │ └── fileTypes │ │ │ │ └── StdFileTypes.java │ │ │ └── util │ │ │ ├── SequentialModalProgressTask.java │ │ │ ├── SequentialTask.java │ │ │ └── containers │ │ │ └── MultiMap.java │ └── org │ │ ├── jetbrains │ │ └── kotlin │ │ │ ├── builder │ │ │ └── KotlinPsiManager.kt │ │ │ ├── bundledcompiler │ │ │ └── BundledCompiler.java │ │ │ ├── completion │ │ │ ├── KeywordCompletionProposal.kt │ │ │ ├── KotlinCodeCompletionHandler.kt │ │ │ ├── KotlinCodeCompletionResult.kt │ │ │ ├── KotlinCompletionProposal.kt │ │ │ ├── KotlinKeywordCompletion.kt │ │ │ ├── completionUtils.kt │ │ │ ├── filterPositionUtils.kt │ │ │ ├── nonImportedCompletion.kt │ │ │ └── positionFilters.kt │ │ │ ├── debugger │ │ │ ├── KotlinDebugUtils.java │ │ │ ├── KotlinSourcePathProvider.java │ │ │ ├── KotlinToggleBreakpointAction.java │ │ │ └── KotlinToggleBreakpointActionProvider.java │ │ │ ├── diagnostics │ │ │ └── netbeans │ │ │ │ ├── bracesmatcher │ │ │ │ └── KotlinBracesMatcherFactory.java │ │ │ │ ├── parser │ │ │ │ ├── KotlinParser.kt │ │ │ │ ├── KotlinParserResult.kt │ │ │ │ └── kotlinErrors.kt │ │ │ │ └── textinterceptor │ │ │ │ └── KotlinKeystrokeHandler.kt │ │ │ ├── file │ │ │ ├── KtDataObject.java │ │ │ ├── KtVisualElement.form │ │ │ ├── KtVisualElement.java │ │ │ └── templates │ │ │ │ ├── KtClassWizardIterator.java │ │ │ │ ├── KtEnumWizardIterator.java │ │ │ │ ├── KtInterfaceWizardIterator.java │ │ │ │ ├── KtObjectWizardIterator.java │ │ │ │ ├── KtWizardIterator.java │ │ │ │ ├── defaultwizard │ │ │ │ ├── KtDefaultWizardIterator.java │ │ │ │ ├── KtVisualPanel1.form │ │ │ │ └── KtVisualPanel1.java │ │ │ │ └── packagechooser │ │ │ │ ├── PackageChooser.java │ │ │ │ ├── TargetChooserPanel.java │ │ │ │ ├── TargetChooserPanelGUI.java │ │ │ │ └── Type.java │ │ │ ├── filesystem │ │ │ ├── JavaStubGenerator.kt │ │ │ ├── KotlinLightClassManager.kt │ │ │ ├── KotlinVirtualSourceProvider.java │ │ │ ├── lightclasses │ │ │ │ ├── BinaryClassWriter.kt │ │ │ │ ├── KotlinLightClassGeneration.kt │ │ │ │ ├── LightClassBuilderFactory.kt │ │ │ │ └── LightClassFile.java │ │ │ └── virtualSourceUtils.kt │ │ │ ├── formatting │ │ │ ├── AbstractBlock.java │ │ │ ├── AlignmentPerTypeStrategy.java │ │ │ ├── AlignmentStrategy.java │ │ │ ├── IndenterUtil.java │ │ │ ├── KotlinAlignmentStrategy.java │ │ │ ├── KotlinBlock.java │ │ │ ├── KotlinFormatter.java │ │ │ ├── KotlinFormatterUtils.java │ │ │ ├── KotlinIndentStrategy.java │ │ │ ├── NetBeansDocumentFormattingModel.java │ │ │ ├── NetBeansFormattingModel.java │ │ │ └── NodeAlignmentStrategy.java │ │ │ ├── highlighter │ │ │ ├── KotlinTokenScanner.kt │ │ │ ├── KotlinTokensFactory.kt │ │ │ ├── TokenType.kt │ │ │ ├── netbeans │ │ │ │ ├── KotlinLexerProxy.kt │ │ │ │ ├── KotlinToken.kt │ │ │ │ └── KotlinTokenId.kt │ │ │ ├── occurrences │ │ │ │ ├── KotlinOccurrencesFinder.kt │ │ │ │ ├── occurrencesUtils.kt │ │ │ │ └── searchFilters.kt │ │ │ └── semanticanalyzer │ │ │ │ ├── KotlinHighlightingAttributes.kt │ │ │ │ ├── KotlinSemanticAnalyzer.kt │ │ │ │ └── KotlinSemanticHighlightingVisitor.kt │ │ │ ├── hints │ │ │ ├── KotlinHintsComputer.kt │ │ │ ├── KotlinHintsProvider.kt │ │ │ ├── KotlinRule.kt │ │ │ ├── UnusedImportsComputer.kt │ │ │ ├── fixes │ │ │ │ ├── AutoImportFix.kt │ │ │ │ ├── ImplementMembersFix.kt │ │ │ │ ├── KotlinQuickFix.kt │ │ │ │ ├── RemoveUnnecessarySafeCallFix.kt │ │ │ │ ├── RemoveUselessCastFix.kt │ │ │ │ └── RemoveUselessElvisFix.kt │ │ │ ├── intentions │ │ │ │ ├── AddValToConstructorParameterIntention.kt │ │ │ │ ├── ApplicableIntention.kt │ │ │ │ ├── ChangeReturnTypeIntention.kt │ │ │ │ ├── ConvertEnumToSealedClassIntention.kt │ │ │ │ ├── ConvertForEachToForLoopIntention.kt │ │ │ │ ├── ConvertPropertyInitializerToGetterIntention.kt │ │ │ │ ├── ConvertToBlockBodyIntention.kt │ │ │ │ ├── ConvertToConcatenatedStringIntention.kt │ │ │ │ ├── ConvertToExpressionBodyIntention.kt │ │ │ │ ├── ConvertToStringTemplateIntention.kt │ │ │ │ ├── ConvertTryFinallyToUseCallIntention.kt │ │ │ │ ├── ConvertTwoComparisonsToRangeCheckIntention.kt │ │ │ │ ├── MergeIfsIntention.kt │ │ │ │ ├── RemoveBracesIntention.kt │ │ │ │ ├── RemoveEmptyClassBodyIntention.kt │ │ │ │ ├── RemoveEmptyParenthesesFromLambdaCallIntention.kt │ │ │ │ ├── RemoveEmptyPrimaryConstructorIntention.kt │ │ │ │ ├── RemoveEmptySecondaryConstructorIntention.kt │ │ │ │ ├── RemoveExplicitTypeIntention.kt │ │ │ │ ├── ReplaceSizeCheckWithIsNotEmptyIntention.kt │ │ │ │ ├── SpecifyTypeIntention.kt │ │ │ │ ├── SplitIfIntention.kt │ │ │ │ └── ToInfixIntention.kt │ │ │ └── smartCastsChecker.kt │ │ │ ├── indentation │ │ │ ├── KotlinIndentTask.kt │ │ │ └── KotlinIndentTaskFactory.java │ │ │ ├── indexer │ │ │ ├── KotlinIndexer.java │ │ │ └── KotlinIndexerFactory.kt │ │ │ ├── installer │ │ │ ├── KotlinInstaller.kt │ │ │ ├── KotlinUpdater.kt │ │ │ └── Yenta.java │ │ │ ├── j2k │ │ │ ├── ConvertToKotlinAction.java │ │ │ └── Java2KotlinConverter.java │ │ │ ├── language │ │ │ ├── KotlinLanguage.java │ │ │ ├── KotlinLanguageHierarchy.kt │ │ │ └── priorities.kt │ │ │ ├── log │ │ │ └── KotlinLogger.java │ │ │ ├── model │ │ │ ├── KotlinEnvironment.kt │ │ │ ├── KotlinLightVirtualFile.kt │ │ │ └── KotlinNullableNotNullManager.kt │ │ │ ├── navigation │ │ │ ├── jarNavigationUtil.kt │ │ │ ├── navigationUtil.kt │ │ │ ├── netbeans │ │ │ │ ├── JavaHyperlinkProvider.java │ │ │ │ ├── KotlinHyperlinkProvider.java │ │ │ │ ├── fromJavaToKotlinNavigationUtils.kt │ │ │ │ ├── hoverUtils.kt │ │ │ │ └── openDeclaration.kt │ │ │ └── references │ │ │ │ ├── KotlinReference.kt │ │ │ │ └── referenceUtils.kt │ │ │ ├── project │ │ │ ├── KotlinProjectConstants.kt │ │ │ └── KotlinSources.kt │ │ │ ├── projectsextensions │ │ │ ├── ClassPathExtender.kt │ │ │ ├── KotlinPrivilegedTemplates.kt │ │ │ ├── KotlinProjectHelper.kt │ │ │ ├── gradle │ │ │ │ ├── GradleProjectOpenedHook.kt │ │ │ │ ├── classpath │ │ │ │ │ └── GradleExtendedClassPath.kt │ │ │ │ └── lookup │ │ │ │ │ └── GradleProjectLookupProviderExtension.java │ │ │ ├── j2se │ │ │ │ ├── J2SEProjectOpenedHook.java │ │ │ │ ├── J2SEProjectPropertiesModifier.java │ │ │ │ ├── buildextender │ │ │ │ │ └── KotlinBuildExtender.java │ │ │ │ ├── classpath │ │ │ │ │ ├── BootClassPathImplementation.java │ │ │ │ │ ├── J2SEExtendedClassPathProvider.java │ │ │ │ │ └── SourcePathImplementation.java │ │ │ │ └── lookup │ │ │ │ │ └── J2SEProjectLookupProviderExtension.java │ │ │ └── maven │ │ │ │ ├── MavenHelper.java │ │ │ │ ├── MavenProjectOpenedHook.java │ │ │ │ ├── buildextender │ │ │ │ └── PomXmlModifier.java │ │ │ │ ├── classpath │ │ │ │ └── MavenExtendedClassPath.java │ │ │ │ ├── lookup │ │ │ │ └── MavenProjectLookupProviderExtension.java │ │ │ │ ├── output │ │ │ │ ├── KotlinMavenOutputProcessor.kt │ │ │ │ └── KotlinMavenOutputProcessorFactory.java │ │ │ │ └── utils.kt │ │ │ ├── refactorings │ │ │ └── rename │ │ │ │ ├── KotlinActionsImplementationProvider.java │ │ │ │ ├── KotlinInstantRenamer.kt │ │ │ │ ├── KotlinRefactoringElement.java │ │ │ │ ├── KotlinRefactoringsFactory.java │ │ │ │ ├── KotlinRenamePanel.java │ │ │ │ ├── KotlinRenameRefactoring.kt │ │ │ │ ├── KotlinRenameRefactoringUI.java │ │ │ │ ├── TypeUsagesSearcher.kt │ │ │ │ └── renameUtils.kt │ │ │ ├── reformatting │ │ │ ├── KotlinReformatTask.kt │ │ │ ├── KotlinReformatTaskFactory.java │ │ │ └── formatUtils.kt │ │ │ ├── resolve │ │ │ ├── AnalysisResultWithProvider.kt │ │ │ ├── BuiltInsReferenceResolver.java │ │ │ ├── DeserializedDescriptorUtils.kt │ │ │ ├── KotlinAnalyzer.kt │ │ │ ├── KotlinCacheServiceImpl.kt │ │ │ ├── KotlinPackagePartProvider.kt │ │ │ ├── KotlinResolutionFacade.kt │ │ │ ├── KotlinSourceIndex.kt │ │ │ ├── NetBeansAnalyzerFacadeForJVM.kt │ │ │ ├── NetBeansDescriptorUtils.java │ │ │ ├── injection.kt │ │ │ └── lang │ │ │ │ ├── java │ │ │ │ ├── ElemHandle.java │ │ │ │ ├── NetBeansJavaClassFinder.kt │ │ │ │ ├── annotationSearchers.kt │ │ │ │ ├── classSearchers.kt │ │ │ │ ├── executableSearchers.kt │ │ │ │ ├── memberSearchers.kt │ │ │ │ ├── nbAnnotationUtils.kt │ │ │ │ ├── nbClassUtils.kt │ │ │ │ ├── nbElementUtils.kt │ │ │ │ ├── nbExecutableUtils.kt │ │ │ │ ├── nbMemberUtils.kt │ │ │ │ ├── nbPackageUtils.kt │ │ │ │ ├── nbParameterUtils.kt │ │ │ │ ├── nbTypeUtils.kt │ │ │ │ ├── packageSearchers.kt │ │ │ │ ├── parameterSearchers.kt │ │ │ │ ├── resolver │ │ │ │ │ ├── NetBeansExternalAnnotationResolver.kt │ │ │ │ │ ├── NetBeansJavaSourceElement.kt │ │ │ │ │ ├── NetBeansJavaSourceElementFactory.kt │ │ │ │ │ └── NetBeansTraceBasedJavaResolverCache.kt │ │ │ │ ├── searchers.kt │ │ │ │ ├── structure │ │ │ │ │ ├── NetBeansJavaAnnotation.kt │ │ │ │ │ ├── NetBeansJavaAnnotationArgument.kt │ │ │ │ │ ├── NetBeansJavaAnnotationAsAnnotationArgument.kt │ │ │ │ │ ├── NetBeansJavaArrayAnnotationArgument.kt │ │ │ │ │ ├── NetBeansJavaArrayType.kt │ │ │ │ │ ├── NetBeansJavaClass.kt │ │ │ │ │ ├── NetBeansJavaClassObjectAnnotationArgument.kt │ │ │ │ │ ├── NetBeansJavaClassifier.kt │ │ │ │ │ ├── NetBeansJavaClassifierType.kt │ │ │ │ │ ├── NetBeansJavaConstructor.kt │ │ │ │ │ ├── NetBeansJavaElement.kt │ │ │ │ │ ├── NetBeansJavaField.kt │ │ │ │ │ ├── NetBeansJavaLiteralAnnotationArgument.kt │ │ │ │ │ ├── NetBeansJavaMember.kt │ │ │ │ │ ├── NetBeansJavaMethod.kt │ │ │ │ │ ├── NetBeansJavaPackage.kt │ │ │ │ │ ├── NetBeansJavaPrimitiveType.kt │ │ │ │ │ ├── NetBeansJavaPropertyInitializerEvaluator.kt │ │ │ │ │ ├── NetBeansJavaReferenceAnnotationArgument.kt │ │ │ │ │ ├── NetBeansJavaType.kt │ │ │ │ │ ├── NetBeansJavaTypeParameter.kt │ │ │ │ │ ├── NetBeansJavaValueParameter.kt │ │ │ │ │ └── NetBeansJavaWildcardType.kt │ │ │ │ └── typeSearchers.kt │ │ │ │ └── kotlin │ │ │ │ └── NetBeansVirtualFileFinder.kt │ │ │ ├── search │ │ │ ├── GoToKotlinTypeProvider.kt │ │ │ ├── KotlinTypeSearcher.kt │ │ │ └── PublicFunctionsVisitor.kt │ │ │ ├── structurescanner │ │ │ ├── KotlinClassStructureItem.kt │ │ │ ├── KotlinFoldingVisitor.kt │ │ │ ├── KotlinFunctionStructureItem.kt │ │ │ ├── KotlinPropertyStructureItem.kt │ │ │ └── KotlinStructureScanner.kt │ │ │ └── utils │ │ │ ├── KotlinClasspath.kt │ │ │ ├── KotlinImageProvider.kt │ │ │ ├── KotlinMockProject.kt │ │ │ ├── LineEndUtil.java │ │ │ ├── ProjectUtils.java │ │ │ ├── findMain.kt │ │ │ └── importUtils.kt │ │ └── netbeans │ │ └── modules │ │ └── maven │ │ └── kotlin │ │ └── KotlinActionProvider.java ├── nbm │ └── manifest.mf └── resources │ └── org │ └── jetbrains │ └── kotlin │ ├── Bundle.properties │ ├── FontAndColors.xml │ ├── KtTemplate.kt │ ├── completionIcons │ ├── annotation.png │ ├── class.png │ ├── constructor.png │ ├── enum.png │ ├── field.png │ ├── field_package_private.png │ ├── field_private.png │ ├── field_protected.png │ ├── field_static.png │ ├── field_static_package_private.png │ ├── field_static_private.png │ ├── interface.png │ ├── localVariable.png │ ├── method.png │ ├── method_package_private.png │ ├── method_private.png │ ├── method_protected.png │ ├── method_static.png │ ├── method_static_package_private.png │ ├── method_static_private.png │ ├── method_static_protected.png │ └── package.png │ ├── debugger │ └── Bundle.properties │ ├── file │ ├── KotlinFileDescription.html │ ├── KtTemplate.kt │ ├── content.kt │ ├── content.kt.template │ └── templates │ │ ├── class.kt │ │ ├── content.kt │ │ ├── enum.kt │ │ ├── interface.kt │ │ ├── kt.html │ │ ├── ktClass.html │ │ ├── ktEnum.html │ │ ├── ktInterface.html │ │ ├── ktObject.html │ │ ├── object.kt │ │ └── packagechooser │ │ ├── Bundle.properties │ │ └── resources │ │ ├── AnnotationType.html │ │ ├── AnnotationType.java.template │ │ ├── Applet.html │ │ ├── Applet.java.template │ │ ├── Class.html │ │ ├── Class.java.template │ │ ├── Classes.html │ │ ├── Empty.html │ │ ├── Empty.java.template │ │ ├── Enum.html │ │ ├── Enum.java.template │ │ ├── Exception.html │ │ ├── Exception.java.template │ │ ├── Interface.html │ │ ├── Interface.java.template │ │ ├── JApplet.html │ │ ├── JApplet.java.template │ │ ├── Main.html │ │ ├── Main.java.template │ │ ├── Package.html │ │ ├── Singleton.html │ │ ├── Singleton.java.template │ │ ├── broken-reference.gif │ │ ├── jar.gif │ │ ├── libraries.gif │ │ ├── main-class.png │ │ ├── package-info.html │ │ ├── package-info.java.template │ │ └── resolved-reference.gif │ ├── important_files.png │ ├── kotlin.png │ ├── kotlinc │ └── kotlinc.zip │ ├── kt.png │ ├── layer.xml │ ├── lib.png │ ├── navigation │ ├── Bundle.properties │ ├── edit_parameters.png │ ├── find.png │ ├── layer.xml │ ├── unknown.gif │ ├── wait.gif │ └── warning.png │ ├── org-jetbrains-kotlin-debugger-KotlinToggleBreakpointAction.shadow │ ├── src_packages.png │ └── wizards │ └── java │ └── javaFile.html └── test ├── java ├── completion │ └── CompletionTest.kt ├── diagnostics │ └── DiagnosticsTest.kt ├── formatting │ └── FormattingTest.kt ├── highlighting │ └── HighlightingTest.kt ├── indentation │ └── IndentationTest.kt ├── intentions │ └── IntentionsTest.kt ├── j2k │ └── J2KTest.kt ├── javaproject │ ├── JavaAntBasedProjectType.java │ ├── JavaProject.kt │ ├── JavaProjectUnzipper.java │ └── mockservices │ │ ├── MockActiveDocumentProvider.java │ │ ├── MockEditorMimeTypesImpl.java │ │ ├── MockKotlinParserFactory.kt │ │ ├── MockOpenProjectsTrampoline.kt │ │ ├── MockParser.kt │ │ ├── MockParserFactory.java │ │ └── TestEnvironmentFactory.java ├── javastubgen │ └── JavaStubGeneratorTest.kt ├── navigation │ └── NavigationTest.kt ├── quickfixes │ └── QuickFixesTest.kt ├── rename │ └── RenameTest.kt ├── semantic │ └── SemanticAnalyzerTest.kt ├── structurescanner │ ├── FoldingTest.kt │ └── StructureScannerTest.kt └── utils │ ├── KotlinTestCase.kt │ └── testUtils.kt └── resources └── projForTest ├── build.xml ├── manifest.mf ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── private │ ├── private.properties │ └── private.xml ├── project.properties └── project.xml └── src ├── completion ├── checkAutoCastAfterIf.kt ├── checkAutoCastAfterIfMethod.kt ├── checkAutoCastForThis.kt ├── checkAutoCastInWhen.kt ├── checkBasicAny.kt ├── checkBasicInt.kt ├── checkCompanion.kt ├── checkCompletionBeforeDotInCall.kt ├── checkExtendClass.kt ├── checkImport.kt ├── checkInCallExpression.kt ├── checkInClassInit.kt ├── checkInClassPropertyAccessor.kt ├── checkInImport.kt ├── checkInParameterType.kt ├── checkLocalLambda.kt ├── checkNonImportedPrivate.kt ├── checkStringCompletion.kt ├── checkUnimported.kt ├── checkUpperAndLowerCases.kt └── pack │ └── functions.kt ├── diagnostics ├── SomeClass.java ├── checkCastIsNeverSucceed.kt ├── checkNoTypeMismatch.kt ├── checkNoValuePassed.kt ├── checkNullPointer.kt ├── checkReassignValue.kt ├── checkTypeMismatch.kt ├── checkTypeParameterOfCollectionDeclaredInJava.kt ├── checkWrongImport.kt ├── expectingATopLevelDeclaration.kt └── parameterIsNeverUsed.kt ├── folding ├── class.kt ├── function.kt ├── functionWithBody.kt └── licenseHeader.kt ├── formatting ├── blockCommentBeforeDeclaration.after ├── blockCommentBeforeDeclaration.kt ├── classesAndPropertiesFormatTest.after ├── classesAndPropertiesFormatTest.kt ├── commentOnTheLastLineOfLambda.after ├── commentOnTheLastLineOfLambda.kt ├── indentInDoWhile.after ├── indentInDoWhile.kt ├── indentInIfExpressionBlock.after ├── indentInIfExpressionBlock.kt ├── indentInPropertyAccessor.after ├── indentInPropertyAccessor.kt ├── indentInWhenEntry.after ├── indentInWhenEntry.kt ├── initIndent.after ├── initIndent.kt ├── lambdaInBlock.after ├── lambdaInBlock.kt ├── newLineAfterImportsAndPackage.after ├── newLineAfterImportsAndPackage.kt ├── objectsAndLocalFunctionsFormatTest.after ├── objectsAndLocalFunctionsFormatTest.kt ├── packageFunctionsFormatTest.after ├── packageFunctionsFormatTest.kt ├── withBlockComments.after ├── withBlockComments.kt ├── withJavaDoc.after ├── withJavaDoc.kt ├── withLineComments.after ├── withLineComments.kt ├── withMutableVariable.after ├── withMutableVariable.kt ├── withWhitespaceBeforeBrace.after ├── withWhitespaceBeforeBrace.kt ├── withoutComments.after └── withoutComments.kt ├── highlighting ├── blockComment.kt ├── companionObject.kt ├── forKeyword.kt ├── function.kt ├── getterSetter.kt ├── importKeyword.kt ├── inKeyword.kt ├── interfaceKeyword.kt ├── keywordWithText.kt ├── openKeyword.kt ├── singleLineComment.kt ├── softImportKeyword.kt ├── softKeywords.kt ├── stringInterpolation.kt ├── stringToken.kt └── textWithTokenInside.kt ├── indentation ├── afterEquals.after ├── afterEquals.kt ├── afterOneOpenBrace.after ├── afterOneOpenBrace.kt ├── afterOpenBraceWithShift.after ├── afterOpenBraceWithShift.kt ├── afterOperatorIfWithoutBraces.after ├── afterOperatorIfWithoutBraces.kt ├── afterOperatorWhileWithoutBraces.after ├── afterOperatorWhileWithoutBraces.kt ├── beforeCloseBrace.after ├── beforeCloseBrace.kt ├── beforeFunctionStart.after ├── beforeFunctionStart.kt ├── beforeNestedCloseBrace.after ├── beforeNestedCloseBrace.kt ├── beforeTwiceNestedCloseBrace.after ├── beforeTwiceNestedCloseBrace.kt ├── betweenBracesOnDifferentLine.after ├── betweenBracesOnDifferentLine.kt ├── betweenBracesOnOneLine.after ├── betweenBracesOnOneLine.kt ├── betweenBracesOnOneLine2.after ├── betweenBracesOnOneLine2.kt ├── breakLineAfterIfWithoutBraces.after ├── breakLineAfterIfWithoutBraces.kt ├── continuationAfterDotCall.after ├── continuationAfterDotCall.kt ├── continuationBeforeFunName.after ├── continuationBeforeFunName.kt ├── continuationInMultiLineExpression.after ├── continuationInMultiLineExpression.kt ├── indentBeforeWhile.after ├── indentBeforeWhile.kt ├── lineBreakSaveIndent.after ├── lineBreakSaveIndent.kt ├── nestedOperatorsWithBraces.after ├── nestedOperatorsWithBraces.kt ├── nestedOperatorsWithoutBraces.after ├── nestedOperatorsWithoutBraces.kt ├── newLineInParameters.after ├── newLineInParameters.kt ├── newLineWhenCaretAtPosition0.after └── newLineWhenCaretAtPosition0.kt ├── intentions ├── addValToConstructorParameter.after ├── addValToConstructorParameter.caret ├── addValToConstructorParameter.kt ├── changeReturnType.after ├── changeReturnType.caret ├── changeReturnType.kt ├── convertPropertyInitializerToGetter.after ├── convertPropertyInitializerToGetter.caret ├── convertPropertyInitializerToGetter.kt ├── convertToBlockBody.after ├── convertToBlockBody.caret ├── convertToBlockBody.kt ├── convertToConcatenatedString.after ├── convertToConcatenatedString.caret ├── convertToConcatenatedString.kt ├── convertToExpressionBody.after ├── convertToExpressionBody.caret ├── convertToExpressionBody.kt ├── convertToSealedClass.after ├── convertToSealedClass.caret ├── convertToSealedClass.kt ├── convertToStringTemplate.after ├── convertToStringTemplate.caret ├── convertToStringTemplate.kt ├── convertTwoComparisons.after ├── convertTwoComparisons.caret ├── convertTwoComparisons.kt ├── mergeIfs.after ├── mergeIfs.caret ├── mergeIfs.kt ├── removeBraces.after ├── removeBraces.caret ├── removeBraces.kt ├── removeEmptyClassBody.after ├── removeEmptyClassBody.caret ├── removeEmptyClassBody.kt ├── removeEmptyPrimaryConstructor.after ├── removeEmptyPrimaryConstructor.caret ├── removeEmptyPrimaryConstructor.kt ├── removeEmptySecondaryConstructor.after ├── removeEmptySecondaryConstructor.caret ├── removeEmptySecondaryConstructor.kt ├── removeExplicitType.after ├── removeExplicitType.caret ├── removeExplicitType.kt ├── removeParenthesesFromLambdaCall.after ├── removeParenthesesFromLambdaCall.caret ├── removeParenthesesFromLambdaCall.kt ├── replaceSizeCheckWithIsNotEmpty.after ├── replaceSizeCheckWithIsNotEmpty.caret ├── replaceSizeCheckWithIsNotEmpty.kt ├── specifyType.after ├── specifyType.caret ├── specifyType.kt ├── splitIf.after ├── splitIf.caret ├── splitIf.kt ├── toInfix.after ├── toInfix.caret └── toInfix.kt ├── j2k ├── interface.after ├── interface.java ├── mixed.after ├── mixed.java ├── simple.after ├── simple.java ├── withInnerClass.after ├── withInnerClass.java ├── withStaticMethod.after └── withStaticMethod.java ├── main └── main.kt ├── navigation ├── JavaClass.caret ├── JavaClass.java ├── KotlinClass.caret ├── KotlinClass.kt ├── checkNavigationToClass.kt ├── checkNavigationToFunction.kt ├── checkNavigationToJavaClass.kt ├── checkNavigationToVariable.caret ├── checkNavigationToVariable.kt ├── functionToNavigate.caret └── functionToNavigate.kt ├── quickfixes ├── implementMembers.after ├── implementMembers.kt ├── removeUnnecessaryCall.after ├── removeUnnecessaryCall.kt ├── removeUselessCast.after ├── removeUselessCast.kt ├── removeUselessElvis.after └── removeUselessElvis.kt ├── rename ├── classbyconstructor │ ├── file.after │ ├── file.caret │ └── file.kt ├── classrename │ ├── file.after │ ├── file.caret │ ├── file.kt │ ├── file2.after │ └── file2.kt ├── forloop │ ├── file.after │ ├── file.caret │ └── file.kt ├── forloop2 │ ├── file.after │ ├── file.caret │ └── file.kt ├── function │ ├── file.after │ ├── file.caret │ └── file.kt ├── functionparameter │ ├── file.after │ ├── file.caret │ └── file.kt ├── methodrename │ ├── file.after │ ├── file.caret │ ├── file.kt │ ├── file2.after │ └── file2.kt ├── properties │ ├── file.after │ ├── file.caret │ └── file.kt ├── simple │ ├── file.after │ ├── file.caret │ └── file.kt └── simplesec │ ├── file.after │ ├── file.caret │ └── file.kt ├── semantic ├── annotation.caret ├── annotation.kt ├── class.caret ├── class.kt ├── deprecated.caret ├── deprecated.kt ├── empty.caret ├── empty.kt ├── functionWithLocalVariables.caret ├── functionWithLocalVariables.kt ├── simpleClass.caret ├── simpleClass.kt ├── smartCast.caret └── smartCast.kt ├── structureScanner ├── classWithSeveralMembers.kt ├── empty.kt ├── object.kt ├── severalClasses.kt ├── severalFunctions.kt └── simple.kt └── stubGen ├── FirstClass.after ├── SecondClass.after ├── abstractClass.after ├── abstractClass.kt ├── classWithTypeParameter.after ├── classWithTypeParameter.kt ├── classWithVal.after ├── classWithVal.kt ├── classWithVar.after ├── classWithVar.kt ├── enum.after ├── enum.kt ├── implementsInterface.kt ├── implementsInterface1.after ├── implementsInterface2.after ├── interface.after ├── interface.kt ├── object.after ├── object.kt ├── openClass.after ├── openClass.kt ├── severalArguments.after ├── severalArguments.kt ├── severalClassesInOneFile.kt ├── simple.after ├── simple.kt ├── withCompanion.after ├── withCompanion.kt ├── withNestedClass.after ├── withNestedClass.kt ├── withSeveralMethods.after ├── withSeveralMethods.kt ├── withoutClass.after └── withoutClass.kt /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /src/test/resources/projForTest/nbproject/private/ 3 | nb-configuration.xml 4 | nbactions.xml 5 | .DS_Store 6 | -------------------------------------------------------------------------------- /lib/asm-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/asm-all.jar -------------------------------------------------------------------------------- /lib/idea-formatter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/idea-formatter.jar -------------------------------------------------------------------------------- /lib/intellij-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/intellij-core.jar -------------------------------------------------------------------------------- /lib/kotlin-converter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/kotlin-converter.jar -------------------------------------------------------------------------------- /lib/kotlin-formatter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/kotlin-formatter.jar -------------------------------------------------------------------------------- /lib/kotlin-ide-common.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/kotlin-ide-common.jar -------------------------------------------------------------------------------- /lib/openapi-formatter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/lib/openapi-formatter.jar -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2017 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | -------------------------------------------------------------------------------- /licenseheader.txt: -------------------------------------------------------------------------------- 1 | <#if licenseFirst??> 2 | ${licenseFirst} 3 | 4 | ${licensePrefix}Copyright 2000-${date?date?string("yyyy")} JetBrains s.r.o. 5 | ${licensePrefix?replace(" +$", "", "r")} 6 | ${licensePrefix}Licensed under the Apache License, Version 2.0 (the "License"); 7 | ${licensePrefix}you may not use this file except in compliance with the License. 8 | ${licensePrefix}You may obtain a copy of the License at 9 | ${licensePrefix?replace(" +$", "", "r")} 10 | ${licensePrefix} http://www.apache.org/licenses/LICENSE-2.0 11 | ${licensePrefix?replace(" +$", "", "r")} 12 | ${licensePrefix}Unless required by applicable law or agreed to in writing, software 13 | ${licensePrefix}distributed under the License is distributed on an "AS IS" BASIS, 14 | ${licensePrefix}WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ${licensePrefix}See the License for the specific language governing permissions and 16 | ${licensePrefix}limitations under the License. 17 | <#if licenseLast??> 18 | ${licenseLast} 19 | -------------------------------------------------------------------------------- /src/main/java/com/intellij/codeInsight/CodeInsightBundle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package com.intellij.codeInsight; 20 | 21 | public class CodeInsightBundle { 22 | public static String message(String key, Object... params) { 23 | return key; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/intellij/codeInsight/actions/ReformatCodeProcessor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package com.intellij.codeInsight.actions; 20 | 21 | public class ReformatCodeProcessor { 22 | public static final String COMMAND_NAME = "dummy"; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/intellij/openapi/editor/Editor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package com.intellij.openapi.editor; 20 | 21 | public class Editor { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/intellij/openapi/extensions/ExtensionException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package com.intellij.openapi.extensions; 20 | 21 | /** 22 | * 23 | * @author Alexander.Baratynski 24 | */ 25 | public class ExtensionException extends RuntimeException { 26 | 27 | public ExtensionException(Class extensionClass) { 28 | super(extensionClass.getCanonicalName()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/intellij/openapi/fileTypes/StdFileTypes.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package com.intellij.openapi.fileTypes; 20 | 21 | public class StdFileTypes { 22 | public static final LanguageFileType JAVA = null; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/intellij/util/SequentialTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package com.intellij.util; 20 | 21 | public interface SequentialTask { 22 | 23 | /** 24 | * Callback method that is assumed to be called before the processing. 25 | */ 26 | void prepare(); 27 | 28 | /** 29 | * @return true if the processing is complete; 30 | * false otherwise 31 | */ 32 | boolean isDone(); 33 | 34 | /** 35 | * Asks current task to perform one more processing iteration. 36 | * 37 | * @return true if the processing is done; false 38 | * otherwise 39 | */ 40 | boolean iteration(); 41 | 42 | /** 43 | * Asks current task to stop the processing (if any). 44 | */ 45 | void stop(); 46 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/completion/filterPositionUtils.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.completion 18 | 19 | import com.intellij.psi.PsiComment 20 | import com.intellij.psi.PsiElement 21 | import com.intellij.psi.TokenType 22 | import com.intellij.psi.impl.source.tree.TreeUtil 23 | 24 | fun PsiElement.searchNonSpaceNonCommentBack(strict: Boolean): PsiElement? { 25 | if (node == null) return null 26 | 27 | var leftNeighbour = TreeUtil.prevLeaf(node) 28 | if (!strict) { 29 | while (leftNeighbour != null && (leftNeighbour.elementType == TokenType.WHITE_SPACE 30 | || leftNeighbour.psi is PsiComment)) { 31 | leftNeighbour = TreeUtil.prevLeaf(leftNeighbour) 32 | } 33 | } 34 | 35 | return if (leftNeighbour != null) leftNeighbour.psi else null 36 | } 37 | 38 | fun PsiElement.searchNonSpaceNonCommentBack() = searchNonSpaceNonCommentBack(false) -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/diagnostics/netbeans/bracesmatcher/KotlinBracesMatcherFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package org.jetbrains.kotlin.diagnostics.netbeans.bracesmatcher; 20 | 21 | import org.netbeans.api.editor.mimelookup.MimeRegistration; 22 | import org.netbeans.spi.editor.bracesmatching.BracesMatcher; 23 | import org.netbeans.spi.editor.bracesmatching.BracesMatcherFactory; 24 | import org.netbeans.spi.editor.bracesmatching.MatcherContext; 25 | import org.netbeans.spi.editor.bracesmatching.support.BracesMatcherSupport; 26 | 27 | @MimeRegistration(mimeType="text/x-kt",service=BracesMatcherFactory.class) 28 | public class KotlinBracesMatcherFactory implements BracesMatcherFactory { 29 | 30 | @Override 31 | public BracesMatcher createMatcher(MatcherContext context) { 32 | return BracesMatcherSupport.defaultMatcher(context, -1, -1); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/KtVisualElement.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 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/KtClassWizardIterator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.file.templates; 18 | 19 | import org.jetbrains.kotlin.file.templates.defaultwizard.KtDefaultWizardIterator; 20 | import org.netbeans.api.templates.TemplateRegistration; 21 | 22 | @TemplateRegistration(folder = "Kotlin", 23 | displayName = "Kotlin class", 24 | content = "class.kt", 25 | iconBase = "org/jetbrains/kotlin/kt.png", 26 | description = "ktClass.html", 27 | scriptEngine="freemarker") 28 | public final class KtClassWizardIterator extends KtDefaultWizardIterator { 29 | public KtClassWizardIterator() { 30 | super("Class"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/KtEnumWizardIterator.java: -------------------------------------------------------------------------------- 1 | /** ***************************************************************************** 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | ****************************************************************************** */ 17 | package org.jetbrains.kotlin.file.templates; 18 | 19 | import org.jetbrains.kotlin.file.templates.defaultwizard.KtDefaultWizardIterator; 20 | import org.netbeans.api.templates.TemplateRegistration; 21 | 22 | @TemplateRegistration(folder = "Kotlin", 23 | displayName = "Kotlin enum", 24 | content = "enum.kt", 25 | iconBase = "org/jetbrains/kotlin/kt.png", 26 | description = "ktEnum.html", 27 | scriptEngine="freemarker") 28 | public class KtEnumWizardIterator extends KtDefaultWizardIterator { 29 | public KtEnumWizardIterator() { 30 | super("Enum"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/KtInterfaceWizardIterator.java: -------------------------------------------------------------------------------- 1 | /** ***************************************************************************** 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | ****************************************************************************** */ 17 | package org.jetbrains.kotlin.file.templates; 18 | 19 | import org.jetbrains.kotlin.file.templates.defaultwizard.KtDefaultWizardIterator; 20 | import org.netbeans.api.templates.TemplateRegistration; 21 | 22 | @TemplateRegistration(folder = "Kotlin", 23 | displayName = "Kotlin interface", 24 | content = "interface.kt", 25 | iconBase = "org/jetbrains/kotlin/kt.png", 26 | description = "ktInterface.html", 27 | scriptEngine="freemarker") 28 | public class KtInterfaceWizardIterator extends KtDefaultWizardIterator { 29 | public KtInterfaceWizardIterator() { 30 | super("Interface"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/KtObjectWizardIterator.java: -------------------------------------------------------------------------------- 1 | /** ***************************************************************************** 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | ****************************************************************************** */ 17 | package org.jetbrains.kotlin.file.templates; 18 | 19 | import org.jetbrains.kotlin.file.templates.defaultwizard.KtDefaultWizardIterator; 20 | import org.netbeans.api.templates.TemplateRegistration; 21 | 22 | @TemplateRegistration(folder = "Kotlin", 23 | displayName = "Kotlin object", 24 | content = "object.kt", 25 | iconBase = "org/jetbrains/kotlin/kt.png", 26 | description = "ktObject.html", 27 | scriptEngine="freemarker") 28 | public class KtObjectWizardIterator extends KtDefaultWizardIterator { 29 | public KtObjectWizardIterator() { 30 | super("Object"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/KtWizardIterator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.file.templates; 18 | 19 | import org.jetbrains.kotlin.file.templates.defaultwizard.KtDefaultWizardIterator; 20 | import org.netbeans.api.templates.TemplateRegistration; 21 | import org.openide.util.NbBundle.Messages; 22 | 23 | @TemplateRegistration(folder = "Kotlin", 24 | displayName = "Kotlin file", 25 | content = "content.kt", 26 | iconBase = "org/jetbrains/kotlin/kt.png", 27 | description = "kt.html", 28 | scriptEngine="freemarker") 29 | @Messages("KtWizardIterator_displayName=Simple Kotlin File") 30 | public final class KtWizardIterator extends KtDefaultWizardIterator { 31 | public KtWizardIterator() { 32 | super("File"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/defaultwizard/KtVisualPanel1.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 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/packagechooser/PackageChooser.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.file.templates.packagechooser; 18 | 19 | import org.netbeans.api.project.Project; 20 | import org.netbeans.api.project.SourceGroup; 21 | import org.openide.WizardDescriptor; 22 | 23 | /** 24 | * 25 | * @author Alexander.Baratynski 26 | */ 27 | public class PackageChooser { 28 | 29 | public static String pack = null; 30 | 31 | public static TargetChooserPanel createPackageChooser(Project project, SourceGroup[] folders, 32 | WizardDescriptor.Panel bottomPanel, String type) { 33 | if (folders.length == 0) { 34 | throw new IllegalArgumentException("No folders selected"); 35 | } 36 | return new TargetChooserPanel(project, folders, bottomPanel, Type.FILE, false, type); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/file/templates/packagechooser/Type.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.file.templates.packagechooser; 18 | 19 | /** 20 | * 21 | * @author Alexander.Baratynski 22 | */ 23 | public enum Type {FILE, PACKAGE, PKG_INFO} 24 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/filesystem/lightclasses/BinaryClassWriter.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.filesystem.lightclasses 18 | 19 | import org.jetbrains.org.objectweb.asm.ClassWriter 20 | 21 | class BinaryClassWriter : ClassWriter(ClassWriter.COMPUTE_FRAMES or ClassWriter.COMPUTE_MAXS) { 22 | 23 | override fun getCommonSuperClass(type1: String, type2: String): String { 24 | return try { 25 | super.getCommonSuperClass(type1, type2) 26 | } catch (t: Throwable) { 27 | "java/lang/Object" 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/filesystem/lightclasses/LightClassFile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.filesystem.lightclasses; 18 | 19 | import java.io.File; 20 | import org.jetbrains.kotlin.utils.ProjectUtils; 21 | import org.jetbrains.annotations.NotNull; 22 | import org.netbeans.api.project.Project; 23 | 24 | public final class LightClassFile { 25 | private final File file; 26 | 27 | public LightClassFile(Project project, String path){ 28 | file = new File(project.getProjectDirectory().getPath() + ProjectUtils.FILE_SEPARATOR + path); 29 | } 30 | @NotNull 31 | public File asFile(){ 32 | return file; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/highlighter/TokenType.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.highlighter 18 | 19 | enum class TokenType { 20 | KEYWORD, IDENTIFIER, STRING, SINGLE_LINE_COMMENT, 21 | MULTI_LINE_COMMENT, KDOC_TAG_NAME, WHITESPACE, 22 | ANNOTATION, KDOC_LINK, UNDEFINED, EOF; 23 | 24 | fun getId() = when(this) { 25 | KEYWORD -> 0 26 | IDENTIFIER -> 1 27 | STRING -> 2 28 | SINGLE_LINE_COMMENT -> 3 29 | MULTI_LINE_COMMENT -> 4 30 | KDOC_TAG_NAME -> 5 31 | WHITESPACE -> 6 32 | ANNOTATION -> 8 33 | KDOC_LINK -> 9 34 | else -> 7 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/highlighter/netbeans/KotlinToken.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.highlighter.netbeans 18 | 19 | import org.jetbrains.kotlin.highlighter.TokenType 20 | import org.netbeans.api.lexer.TokenId 21 | 22 | class KotlinToken(val value: T, val text: String, val type: TokenType) { 23 | 24 | fun id() = value as KotlinTokenId 25 | fun text() = text 26 | fun length() = text.length 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/highlighter/netbeans/KotlinTokenId.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.highlighter.netbeans 18 | 19 | import org.jetbrains.kotlin.language.KotlinLanguageHierarchy 20 | import org.netbeans.api.lexer.Language 21 | import org.netbeans.api.lexer.TokenId 22 | 23 | class KotlinTokenId(private val tokenName: String, private val category: String, val id: Int) : TokenId { 24 | 25 | companion object { 26 | fun getLanguage(): Language = KotlinLanguageHierarchy().language() 27 | } 28 | 29 | override fun name() = tokenName 30 | override fun ordinal() = id 31 | override fun primaryCategory() = category 32 | 33 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/hints/KotlinRule.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.hints 18 | 19 | import org.netbeans.modules.csl.api.HintSeverity 20 | import org.netbeans.modules.csl.api.Rule 21 | import org.netbeans.modules.csl.api.RuleContext 22 | 23 | class KotlinRule(private val severity: HintSeverity) : Rule { 24 | 25 | override fun appliesTo(context: RuleContext) = context is KotlinRuleContext 26 | override fun getDisplayName() = "" 27 | override fun showInTasklist() = false 28 | override fun getDefaultSeverity() = severity 29 | } 30 | 31 | class KotlinRuleContext : RuleContext() -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/indentation/KotlinIndentTask.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.indentation 18 | 19 | import org.jetbrains.kotlin.formatting.KotlinIndentStrategy 20 | import org.netbeans.modules.editor.indent.spi.Context 21 | import org.netbeans.modules.editor.indent.spi.IndentTask 22 | 23 | class KotlinIndentTask(val context: Context) : IndentTask { 24 | 25 | override fun reindent() { 26 | KotlinIndentStrategy(context).addIndent() 27 | } 28 | 29 | override fun indentLock() = null 30 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/indentation/KotlinIndentTaskFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.indentation; 18 | 19 | import org.netbeans.api.editor.mimelookup.MimeRegistration; 20 | import org.netbeans.modules.editor.indent.spi.Context; 21 | import org.netbeans.modules.editor.indent.spi.IndentTask; 22 | 23 | @MimeRegistration(mimeType="text/x-kt",service=IndentTask.Factory.class) 24 | public class KotlinIndentTaskFactory implements IndentTask.Factory { 25 | 26 | @Override 27 | public IndentTask createTask(Context context) { 28 | return new KotlinIndentTask(context); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/indexer/KotlinIndexer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package org.jetbrains.kotlin.indexer; 20 | 21 | import org.netbeans.modules.parsing.spi.Parser; 22 | import org.netbeans.modules.parsing.spi.indexing.Context; 23 | import org.netbeans.modules.parsing.spi.indexing.EmbeddingIndexer; 24 | import org.netbeans.modules.parsing.spi.indexing.Indexable; 25 | 26 | /** 27 | * 28 | * @author Alexander.Baratynski 29 | */ 30 | public class KotlinIndexer extends EmbeddingIndexer { 31 | 32 | @Override 33 | protected void index(Indexable indexable, Parser.Result parserResult, Context context) { 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/indexer/KotlinIndexerFactory.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.indexer 18 | 19 | import org.netbeans.modules.parsing.api.Snapshot 20 | import org.netbeans.modules.parsing.spi.indexing.Context 21 | import org.netbeans.modules.parsing.spi.indexing.EmbeddingIndexerFactory 22 | import org.netbeans.modules.parsing.spi.indexing.Indexable 23 | 24 | /* 25 | 26 | @author Alexander.Baratynski 27 | Created on Sep 9, 2016 28 | */ 29 | 30 | class KotlinIndexerFactory : EmbeddingIndexerFactory() { 31 | 32 | override fun createIndexer(indexable: Indexable, snapshot: Snapshot) = KotlinIndexer() 33 | 34 | override fun filesDeleted(deleted: Iterable, context: Context) { 35 | } 36 | 37 | override fun filesDirty(dirty: Iterable, context: Context) { 38 | } 39 | 40 | override fun getIndexerName() = "Kotlin Indexer" 41 | override fun getIndexVersion() = 1 42 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/language/priorities.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2017 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.language 18 | 19 | object Priorities { 20 | val HINT_PRIORITY = 10 21 | val SEMANTIC_ANALYZER_PRIORITY = 999 22 | val OCCURRENCES_FINDER_PRIORITY = 1000 23 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/model/KotlinLightVirtualFile.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.model 18 | 19 | import com.intellij.testFramework.LightVirtualFile 20 | import org.jetbrains.kotlin.idea.KotlinLanguage 21 | import org.openide.filesystems.FileObject 22 | 23 | class KotlinLightVirtualFile(val fo: FileObject, text: String) : 24 | LightVirtualFile(fo.name, KotlinLanguage.INSTANCE, text) { 25 | 26 | override fun getPath(): String = fo.path 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/project/KotlinProjectConstants.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.project 18 | 19 | enum class KotlinProjectConstants { 20 | KOTLIN_SOURCE, JAVA_SOURCE, JAR 21 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/projectsextensions/ClassPathExtender.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.projectsextensions 18 | 19 | import org.netbeans.api.java.classpath.ClassPath 20 | 21 | /* 22 | 23 | @author baratynskiy 24 | Created on Jan 11, 2017 25 | */ 26 | 27 | interface ClassPathExtender { 28 | fun getProjectSourcesClassPath(type: String): ClassPath 29 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/projectsextensions/KotlinPrivilegedTemplates.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.projectsextensions 18 | 19 | import org.netbeans.spi.project.ui.PrivilegedTemplates 20 | 21 | /* 22 | 23 | @author baratynskiy 24 | Created on Jan 11, 2017 25 | */ 26 | 27 | class KotlinPrivilegedTemplates : PrivilegedTemplates { 28 | 29 | override fun getPrivilegedTemplates() = arrayOf( 30 | "Templates/Kotlin/class.kt", 31 | "Templates/Kotlin/interface.kt", 32 | "Templates/Kotlin/content.kt", 33 | "Templates/Kotlin/enum.kt", 34 | "Templates/Kotlin/object.kt", 35 | "Templates/Classes/Class.java", 36 | "Templates/Classes/Package", 37 | "Templates/Classes/Interface.java", 38 | "Templates/GUIForms/JPanel.java", 39 | "Templates/GUIForms/JFrame.java" 40 | ) 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/reformatting/KotlinReformatTask.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.reformatting 18 | 19 | import org.netbeans.modules.editor.indent.spi.Context 20 | import org.netbeans.modules.editor.indent.spi.ReformatTask 21 | 22 | 23 | /* 24 | 25 | @author Alexander.Baratynski 26 | Created on Sep 9, 2016 27 | */ 28 | 29 | class KotlinReformatTask(val context : Context) : ReformatTask { 30 | 31 | override fun reformat() = format(context.document(), context.caretOffset()) 32 | 33 | override fun reformatLock() = null 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/reformatting/KotlinReformatTaskFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.reformatting; 18 | 19 | import org.netbeans.api.editor.mimelookup.MimeRegistration; 20 | import org.netbeans.modules.editor.indent.spi.Context; 21 | import org.netbeans.modules.editor.indent.spi.ReformatTask; 22 | 23 | @MimeRegistration(mimeType="text/x-kt",service=ReformatTask.Factory.class) 24 | public class KotlinReformatTaskFactory implements ReformatTask.Factory { 25 | 26 | @Override 27 | public ReformatTask createTask(Context context) { 28 | return new KotlinReformatTask(context); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/AnalysisResultWithProvider.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve 18 | 19 | import org.jetbrains.kotlin.analyzer.AnalysisResult 20 | import org.jetbrains.kotlin.container.ComponentProvider 21 | 22 | data class AnalysisResultWithProvider(val analysisResult: AnalysisResult, 23 | val componentProvider: ComponentProvider) -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/DeserializedDescriptorUtils.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.kotlin.resolve 2 | 3 | import org.jetbrains.kotlin.descriptors.DeclarationDescriptor 4 | import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor 5 | import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor 6 | import org.jetbrains.kotlin.resolve.descriptorUtil.parentsWithSelf 7 | import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor 8 | import org.jetbrains.kotlin.descriptors.ClassDescriptor 9 | 10 | fun isDeserialized(descriptor: DeclarationDescriptor) = 11 | descriptor is DeserializedCallableMemberDescriptor || descriptor is DeserializedClassDescriptor 12 | 13 | fun getContainingClassOrPackage(descriptor: DeclarationDescriptor) = 14 | descriptor.parentsWithSelf.firstOrNull() { 15 | (it is ClassDescriptor && DescriptorUtils.isTopLevelDeclaration(it)) || 16 | it is PackageFragmentDescriptor 17 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/KotlinSourceIndex.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve 18 | 19 | /* 20 | 21 | @author Alexander.Baratynski 22 | Created on Sep 9, 2016 23 | */ 24 | 25 | class KotlinSourceIndex -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/nbAnnotationUtils.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java 18 | 19 | import org.jetbrains.kotlin.name.FqName 20 | import org.netbeans.api.java.source.TypeMirrorHandle 21 | import org.netbeans.api.project.Project 22 | 23 | fun ElemHandle<*>.getAnnotations(project: Project) = 24 | AnnotationsSearcher(this, project).execute(project).annotations 25 | 26 | fun ElemHandle<*>.getAnnotation(project: Project, fqName: FqName) = 27 | AnnotationSearcher(this, project, fqName).execute(project).annotation 28 | 29 | fun TypeMirrorHandle<*>.getAnnotations(project: Project) = 30 | AnnotationsForTypeMirrorHandleSearcher(this, project).execute(project).annotations 31 | 32 | fun TypeMirrorHandle<*>.getAnnotation(project: Project, fqName: FqName) = 33 | AnnotationForTypeMirrorHandleSearcher(this, project, fqName).execute(project).annotation -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/nbPackageUtils.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java 18 | 19 | import javax.lang.model.element.PackageElement 20 | import org.jetbrains.kotlin.load.java.structure.JavaPackage 21 | import org.jetbrains.kotlin.name.Name 22 | import org.netbeans.api.project.Project 23 | 24 | fun JavaPackage.getSubPackages(project: Project) = 25 | SubPackagesSearcher(project, this).execute(project).subPackages 26 | 27 | fun List>.getClasses(project: Project, nameFilter: (Name) -> Boolean) = 28 | ClassesSearcher(this, project, nameFilter).execute(project).classes 29 | 30 | fun ElemHandle.getFqName(project: Project) = 31 | FqNameSearcher(this).execute(project).fqName -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/resolver/NetBeansExternalAnnotationResolver.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.resolver 18 | 19 | import org.jetbrains.kotlin.load.java.components.ExternalAnnotationResolver 20 | import org.jetbrains.kotlin.load.java.structure.JavaAnnotationOwner 21 | import org.jetbrains.kotlin.name.FqName 22 | 23 | /* 24 | 25 | @author Alexander.Baratynski 26 | Created on Aug 26, 2016 27 | */ 28 | 29 | class NetBeansExternalAnnotationResolver : ExternalAnnotationResolver { 30 | 31 | override fun findExternalAnnotation(owner: JavaAnnotationOwner, fqName: FqName) = null 32 | 33 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/resolver/NetBeansJavaSourceElement.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.resolver 18 | 19 | import org.jetbrains.kotlin.resolve.lang.java.structure.NetBeansJavaElement 20 | import org.jetbrains.kotlin.descriptors.SourceFile 21 | import org.jetbrains.kotlin.load.java.sources.JavaSourceElement 22 | import org.jetbrains.kotlin.load.java.structure.JavaElement 23 | 24 | /* 25 | 26 | @author Alexander.Baratynski 27 | Created on Aug 26, 2016 28 | */ 29 | 30 | class NetBeansJavaSourceElement(override val javaElement: JavaElement) : JavaSourceElement { 31 | 32 | override fun getContainingFile(): SourceFile = SourceFile.NO_SOURCE_FILE 33 | 34 | fun getElementBinding() = (javaElement as NetBeansJavaElement<*>).elementHandle 35 | 36 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/resolver/NetBeansJavaSourceElementFactory.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.resolver 18 | 19 | import org.jetbrains.kotlin.load.java.sources.JavaSourceElementFactory 20 | import org.jetbrains.kotlin.load.java.structure.JavaElement 21 | 22 | /* 23 | 24 | @author Alexander.Baratynski 25 | Created on Aug 26, 2016 26 | */ 27 | 28 | class NetBeansJavaSourceElementFactory : JavaSourceElementFactory { 29 | 30 | override fun source(javaElement: JavaElement) = NetBeansJavaSourceElement(javaElement) 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaAnnotationArgument.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.load.java.structure.JavaAnnotationArgument 20 | import org.jetbrains.kotlin.load.java.structure.JavaElement 21 | import org.jetbrains.kotlin.name.FqName 22 | import org.jetbrains.kotlin.name.Name 23 | 24 | /* 25 | 26 | @author Alexander.Baratynski 27 | Created on Sep 7, 2016 28 | */ 29 | 30 | open class NetBeansJavaAnnotationArgument(private val fqName: FqName) : JavaAnnotationArgument, JavaElement { 31 | override val name 32 | get() = Name.identifier(fqName.shortName().asString()) 33 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaArrayAnnotationArgument.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.load.java.structure.JavaAnnotationArgument 20 | import org.jetbrains.kotlin.load.java.structure.JavaArrayAnnotationArgument 21 | import org.jetbrains.kotlin.name.Name 22 | 23 | /* 24 | 25 | @author Alexander.Baratynski 26 | Created on Sep 7, 2016 27 | */ 28 | 29 | class NetBeansJavaArrayAnnotationArgument(val args: List, override val name: Name) : JavaArrayAnnotationArgument { 30 | override fun getElements() = args 31 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaArrayType.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.load.java.structure.JavaArrayType 20 | import org.jetbrains.kotlin.resolve.lang.java.* 21 | import org.netbeans.api.java.source.TypeMirrorHandle 22 | import org.netbeans.api.project.Project 23 | 24 | /* 25 | 26 | @author Alexander.Baratynski 27 | Created on Sep 7, 2016 28 | */ 29 | 30 | class NetBeansJavaArrayType(handle: TypeMirrorHandle<*>, project: Project) : 31 | NetBeansJavaType(handle, project), JavaArrayType { 32 | override val componentType 33 | get() = handle.getComponentType(project) 34 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaElement.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.load.java.structure.JavaElement 20 | import org.netbeans.api.project.Project 21 | import org.jetbrains.kotlin.resolve.lang.java.* 22 | import javax.lang.model.element.Element 23 | 24 | /* 25 | 26 | @author Alexander.Baratynski 27 | Created on Aug 29, 2016 28 | */ 29 | 30 | abstract class NetBeansJavaElement(val elementHandle: ElemHandle, 31 | val project: Project) : JavaElement { 32 | 33 | override fun hashCode() = elementHandle.hashCode() 34 | 35 | override fun equals(other: Any?) = (other as? NetBeansJavaElement<*>)?.elementHandle == elementHandle 36 | 37 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaLiteralAnnotationArgument.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.load.java.structure.JavaLiteralAnnotationArgument 20 | import org.jetbrains.kotlin.name.Name 21 | 22 | /* 23 | 24 | @author Alexander.Baratynski 25 | Created on Sep 7, 2016 26 | */ 27 | 28 | class NetBeansJavaLiteralAnnotationArgument(override val value: Any, 29 | override val name: Name) : JavaLiteralAnnotationArgument -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaPropertyInitializerEvaluator.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.descriptors.PropertyDescriptor 20 | import org.jetbrains.kotlin.load.java.structure.JavaField 21 | import org.jetbrains.kotlin.load.java.components.JavaPropertyInitializerEvaluator 22 | import org.jetbrains.kotlin.resolve.constants.ConstantValue 23 | 24 | /* 25 | 26 | @author Alexander.Baratynski 27 | Created on Sep 7, 2016 28 | */ 29 | 30 | class NetBeansJavaPropertyInitializerEvaluator : JavaPropertyInitializerEvaluator { 31 | 32 | override fun getInitializerConstant(field: JavaField, descriptor: PropertyDescriptor): ConstantValue<*>? = null 33 | override fun isNotNullCompileTimeConstant(field: JavaField): Boolean = false 34 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/resolve/lang/java/structure/NetBeansJavaWildcardType.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.resolve.lang.java.structure 18 | 19 | import org.jetbrains.kotlin.load.java.structure.JavaType 20 | import org.jetbrains.kotlin.load.java.structure.JavaWildcardType 21 | import org.jetbrains.kotlin.resolve.lang.java.* 22 | import org.netbeans.api.java.source.TypeMirrorHandle 23 | import org.netbeans.api.project.Project 24 | 25 | /* 26 | 27 | @author Alexander.Baratynski 28 | Created on Sep 7, 2016 29 | */ 30 | 31 | class NetBeansJavaWildcardType(handle: TypeMirrorHandle<*>, project: Project) : NetBeansJavaType(handle, project), JavaWildcardType { 32 | 33 | override val bound: JavaType? 34 | get() = handle.getBound(project) 35 | 36 | override val isExtends 37 | get() = handle.isExtends(project) 38 | 39 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/search/PublicFunctionsVisitor.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.search 18 | 19 | import org.jetbrains.kotlin.psi.* 20 | 21 | class PublicFunctionsVisitor(private val predicate: (String) -> Boolean) : KtVisitorVoid() { 22 | 23 | val publicFunctions = hashSetOf() 24 | 25 | override fun visitNamedFunction(function: KtNamedFunction) { 26 | val functionName = function.name ?: return 27 | val fqName = function.fqName?.asString() ?: return 28 | 29 | if (predicate(functionName) && function.modifierList == null) { 30 | publicFunctions.add(fqName) 31 | } 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/org/jetbrains/kotlin/utils/KotlinClasspath.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2016 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package org.jetbrains.kotlin.utils 18 | 19 | object KotlinClasspath { 20 | 21 | private val LIB_RUNTIME_NAME = "kotlin-runtime.jar" 22 | 23 | val kotlinBootClasspath = "${ProjectUtils.KT_HOME}lib\\$LIB_RUNTIME_NAME" 24 | 25 | } -------------------------------------------------------------------------------- /src/main/nbm/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | OpenIDE-Module-Install: org/jetbrains/kotlin/installer/KotlinInstaller.class 3 | OpenIDE-Module-Layer: org/jetbrains/kotlin/layer.xml 4 | OpenIDE-Module-Localizing-Bundle: org/jetbrains/kotlin/Bundle.properties 5 | OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/Bundle.properties: -------------------------------------------------------------------------------- 1 | #Localized module labels. Defaults taken from POM (, , ) if unset. 2 | #OpenIDE-Module-Name= 3 | #OpenIDE-Module-Short-Description= 4 | #OpenIDE-Module-Long-Description= 5 | #OpenIDE-Module-Display-Category= 6 | #Mon Sep 21 20:40:16 MSK 2015 7 | 8 | #OpenIDE-Module-Name=AntProjectFactorySample 9 | #Templates/Project/Samples/DemoProject.zip=Demo 10 | 11 | QuickSearch/Navigate/org-jetbrains-kotlin-search-GoToKotlinTypeProvider.instance=Navigate 12 | text/x-kt=Kotlin 13 | identifier=Identifier 14 | keyword=Keyword 15 | comment=Comment 16 | string=String 17 | whitespace=Whitespace 18 | annotation=Annotation -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/KtTemplate.kt: -------------------------------------------------------------------------------- 1 | /* Block comment */ 2 | package hello 3 | import kotlin.util.* // line comment 4 | 5 | /** 6 | * Doc comment here for `SomeClass` 7 | * @see Iterator#next() 8 | */ 9 | @Deprecated("Deprecated class") 10 | public class MyClass>(var prop1 : Int) 11 | fun foo(nullable : String?, r : Runnable, f : () -> Int, fl : FunctionLike, dyn: dynamic) { 12 | println("length\nis ${nullable?.length} \e") 13 | val ints = java.util.ArrayList(2) 14 | ints[0] = 102 + f() + fl() 15 | val myFun = { -> "" }; 16 | var ref = ints.size() 17 | if (!ints.empty) { 18 | ints.forEach lit@ { 19 | if (it == null) return@lit 20 | println(it + ref) 21 | } 22 | } 23 | dyn.dynamicCall() 24 | dyn.dynamicProp = 5 25 | } 26 | } 27 | 28 | fun Int?.bar() { 29 | if (this != null) { 30 | println(toString()) 31 | } 32 | else { 33 | println(this.toString()) 34 | } 35 | } 36 | 37 | var globalCounter : Int = 5 38 | get() { 39 | return field 40 | } 41 | 42 | public abstract class Abstract { 43 | } 44 | 45 | object Obj 46 | 47 | enum class E { A } 48 | Bad character: \n 49 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/annotation.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/class.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/constructor.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/enum.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field_package_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field_package_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field_protected.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field_static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field_static.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field_static_package_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field_static_package_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/field_static_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/field_static_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/interface.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/localVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/localVariable.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_package_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_package_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_protected.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_static.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_static_package_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_static_package_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_static_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_static_private.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/method_static_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/method_static_protected.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/completionIcons/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/completionIcons/package.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/KotlinFileDescription.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | Creates a new Kotlin file. 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/KtTemplate.kt: -------------------------------------------------------------------------------- 1 | <#if package?? && package != ""> 2 | package ${package} 3 | 4 | 5 | /** 6 | * 7 | * @author ${user} 8 | * Created on ${date} 9 | */ 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/content.kt: -------------------------------------------------------------------------------- 1 | <#if package?? && package != ""> 2 | package ${package} 3 | 4 | 5 | /** 6 | * 7 | * @author ${user} 8 | * Created on ${date} 9 | */ 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/content.kt.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package} 8 | 9 | 10 | /* 11 | 12 | @author ${user} 13 | Created on ${date} 14 | */ -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/class.kt: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | <#if package?? && package != ""> 6 | package ${package} 7 | 8 | /* 9 | 10 | @author ${user} 11 | Created on ${date} 12 | */ 13 | 14 | class ${name} { 15 | 16 | } -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/content.kt: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | <#if package?? && package != ""> 6 | package ${package} 7 | 8 | /* 9 | 10 | @author ${user} 11 | Created on ${date} 12 | */ -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/enum.kt: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | <#if package?? && package != ""> 6 | package ${package} 7 | 8 | /* 9 | 10 | @author ${user} 11 | Created on ${date} 12 | */ 13 | 14 | enum class ${name} { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/interface.kt: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | <#if package?? && package != ""> 6 | package ${package} 7 | 8 | /* 9 | 10 | @author ${user} 11 | Created on ${date} 12 | */ 13 | 14 | interface ${name} { 15 | 16 | } -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/kt.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | Simple Kotlin file 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/ktClass.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | Kotlin class 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/ktEnum.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | Creates a new Kotlin enum. 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/ktInterface.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | Kotlin interface 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/ktObject.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | Kotlin object 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/object.kt: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | <#if package?? && package != ""> 6 | package ${package} 7 | 8 | /* 9 | 10 | @author ${user} 11 | Created on ${date} 12 | */ 13 | 14 | object ${name} { 15 | 16 | } -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/AnnotationType.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public @interface ${name} { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Applet.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | import java.applet.Applet; 11 | 12 | /** 13 | * 14 | * @author ${user} 15 | */ 16 | public class ${name} extends Applet { 17 | 18 | /** 19 | * Initialization method that will be called after the applet is loaded 20 | * into the browser. 21 | */ 22 | public void init() { 23 | // TODO start asynchronous download of heavy resources 24 | } 25 | 26 | // TODO overwrite start(), stop() and destroy() methods 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Class.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public class ${name} { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Empty.java.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Empty.java.template -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Enum.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public enum ${name} { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Exception.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public class ${name} extends Exception { 15 | 16 | /** 17 | * Creates a new instance of ${name} without detail message. 18 | */ 19 | public ${name}() { 20 | } 21 | 22 | 23 | /** 24 | * Constructs an instance of ${name} with the specified detail message. 25 | * @param msg the detail message. 26 | */ 27 | public ${name}(String msg) { 28 | super(msg); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Interface.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public interface ${name} { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/JApplet.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | import javax.swing.JApplet; 11 | 12 | /** 13 | * 14 | * @author ${user} 15 | */ 16 | public class ${name} extends JApplet { 17 | 18 | /** 19 | * Initialization method that will be called after the applet is loaded 20 | * into the browser. 21 | */ 22 | public void init() { 23 | // TODO start asynchronous download of heavy resources 24 | } 25 | 26 | // TODO overwrite start(), stop() and destroy() methods 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Main.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public class ${name} { 15 | 16 | /** 17 | * @param args the command line arguments 18 | */ 19 | public static void main(String[] args) { 20 | // TODO code application logic here 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/Singleton.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | 10 | /** 11 | * 12 | * @author ${user} 13 | */ 14 | public class ${name} { 15 | 16 | private ${name}() { 17 | } 18 | 19 | public static ${name} getInstance() { 20 | return ${name}Holder.INSTANCE; 21 | } 22 | 23 | private static class ${name}Holder { 24 | private static final ${name} INSTANCE = new ${name}(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/broken-reference.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/broken-reference.gif -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/jar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/jar.gif -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/libraries.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/libraries.gif -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/main-class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/main-class.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/package-info.java.template: -------------------------------------------------------------------------------- 1 | <#assign licenseFirst = "/*"> 2 | <#assign licensePrefix = " * "> 3 | <#assign licenseLast = " */"> 4 | <#include "${project.licensePath}"> 5 | 6 | <#if package?? && package != ""> 7 | package ${package}; 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/resolved-reference.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/file/templates/packagechooser/resources/resolved-reference.gif -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/important_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/important_files.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/kotlin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/kotlin.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/kotlinc/kotlinc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/kotlinc/kotlinc.zip -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/kt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/kt.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/lib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/lib.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/navigation/edit_parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/navigation/edit_parameters.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/navigation/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/navigation/find.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/navigation/unknown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/navigation/unknown.gif -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/navigation/wait.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/navigation/wait.gif -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/navigation/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/navigation/warning.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/org-jetbrains-kotlin-debugger-KotlinToggleBreakpointAction.shadow: -------------------------------------------------------------------------------- 1 | file:/UNKNOWN -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/src_packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/kotlin-netbeans/cf29d64f0cc5ef14f926e23b476cb324e0ff72ee/src/main/resources/org/jetbrains/kotlin/src_packages.png -------------------------------------------------------------------------------- /src/main/resources/org/jetbrains/kotlin/wizards/java/javaFile.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/java/javaproject/JavaAntBasedProjectType.java: -------------------------------------------------------------------------------- 1 | package javaproject; 2 | 3 | import java.io.IOException; 4 | import org.netbeans.api.project.Project; 5 | import org.netbeans.spi.project.support.ant.AntBasedProjectType; 6 | import org.netbeans.spi.project.support.ant.AntProjectHelper; 7 | 8 | /** 9 | * 10 | * @author Alexander.Baratynski 11 | */ 12 | @org.openide.util.lookup.ServiceProvider(service = AntBasedProjectType.class, position = 1) 13 | public class JavaAntBasedProjectType implements AntBasedProjectType{ 14 | 15 | public static final String TYPE = "org.netbeans.modules.java.j2seproject"; 16 | static final String PROJECT_CONFIGURATION_NAME = "data"; 17 | public static final String PROJECT_CONFIGURATION_NAMESPACE = "http://www.netbeans.org/ns/j2se-project/3"; 18 | static final String PRIVATE_CONFIGURATION_NAME = "data"; 19 | static final String PRIVATE_CONFIGURATION_NAMESPACE = "http://www.netbeans.org/ns/j2se-project-private/1"; 20 | 21 | @Override 22 | public String getType() { 23 | return TYPE; 24 | } 25 | 26 | @Override 27 | public Project createProject(AntProjectHelper helper) throws IOException { 28 | return new org.netbeans.modules.java.j2seproject.J2SEProject(helper); 29 | } 30 | 31 | @Override 32 | public String getPrimaryConfigurationDataElementName(boolean shared) { 33 | return shared ? PROJECT_CONFIGURATION_NAME : PRIVATE_CONFIGURATION_NAME; 34 | } 35 | 36 | @Override 37 | public String getPrimaryConfigurationDataElementNamespace(boolean shared) { 38 | return shared ? PROJECT_CONFIGURATION_NAMESPACE : PRIVATE_CONFIGURATION_NAMESPACE; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/javaproject/mockservices/MockKotlinParserFactory.kt: -------------------------------------------------------------------------------- 1 | package javaproject.mockservices 2 | 3 | import org.jetbrains.kotlin.diagnostics.netbeans.parser.KotlinParser 4 | import org.netbeans.modules.parsing.api.Snapshot 5 | import org.netbeans.modules.parsing.spi.Parser 6 | import org.netbeans.modules.parsing.spi.ParserFactory 7 | 8 | 9 | class MockKotlinParserFactory : ParserFactory() { 10 | override fun createParser(snapshots: Collection?) = KotlinParser() 11 | } -------------------------------------------------------------------------------- /src/test/java/javaproject/mockservices/MockParser.kt: -------------------------------------------------------------------------------- 1 | package javaproject.mockservices 2 | 3 | import javax.swing.event.ChangeListener 4 | import org.netbeans.modules.parsing.api.Snapshot 5 | import org.netbeans.modules.parsing.api.Task 6 | import org.netbeans.modules.parsing.spi.ParseException 7 | import org.netbeans.modules.parsing.spi.Parser 8 | import org.netbeans.modules.parsing.spi.SourceModificationEvent 9 | 10 | class MockParser : Parser() { 11 | override fun parse(snapshot: Snapshot?, task: Task?, event: SourceModificationEvent?) {} 12 | 13 | override fun getResult(task: Task?) = object : Result(null) { 14 | override fun invalidate() {} 15 | } 16 | 17 | override fun addChangeListener(changeListener: ChangeListener?) { 18 | } 19 | 20 | override fun removeChangeListener(changeListener: ChangeListener?) { 21 | } 22 | } -------------------------------------------------------------------------------- /src/test/java/javaproject/mockservices/MockParserFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ***************************************************************************** 3 | * Copyright 2000-2016 JetBrains s.r.o. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | ****************************************************************************** 18 | */ 19 | package javaproject.mockservices; 20 | 21 | import java.util.Collection; 22 | import org.netbeans.api.editor.mimelookup.MimeRegistration; 23 | import org.netbeans.modules.java.source.parsing.JavacParserFactory; 24 | import org.netbeans.modules.parsing.api.Snapshot; 25 | import org.netbeans.modules.parsing.spi.Parser; 26 | import org.netbeans.modules.parsing.spi.ParserFactory; 27 | 28 | /** 29 | * 30 | * @author Alexander.Baratynski 31 | */ 32 | @MimeRegistration(mimeType = "text/x-java", service = ParserFactory.class) 33 | public class MockParserFactory extends ParserFactory { 34 | 35 | @Override 36 | public Parser createParser(Collection snapshots) { 37 | return new JavacParserFactory().createParser(snapshots); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/utils/KotlinTestCase.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2000-2017 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *******************************************************************************/ 17 | package utils 18 | 19 | import javaproject.JavaProject 20 | import org.netbeans.api.project.Project 21 | import org.netbeans.junit.NbTestCase 22 | import org.openide.filesystems.FileObject 23 | 24 | abstract class KotlinTestCase(name: String, dirName: String) : NbTestCase(name) { 25 | 26 | val project: Project 27 | val dir: FileObject 28 | 29 | init { 30 | project = JavaProject.javaProject 31 | dir = project.projectDirectory.getFileObject("src").getFileObject(dirName) 32 | } 33 | 34 | fun testProjectCreation() { 35 | assertNotNull(project) 36 | assertNotNull(dir) 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=d1879bfe 2 | build.xml.script.CRC32=305052e2 3 | build.xml.stylesheet.CRC32=8064a381@1.79.1.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=d1879bfe 7 | nbproject/build-impl.xml.script.CRC32=f422c90e 8 | nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Thu Sep 08 18:10:23 MSK 2016 3 | compile.on.save=false 4 | user.properties.file=C\:\\Users\\Alexander.Baratynski\\Documents\\NetBeansProjects\\nbkotlin\\kotlin-netbeans\\build.properties 5 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/C:/Users/Alexander.Baratynski/Documents/NetBeansProjects/projForTest/src/main/main.kt 7 | file:/C:/Users/Alexander.Baratynski/Documents/NetBeansProjects/projForTest/src/diagnostics/expectingATopLevelDeclaration.kt 8 | file:/C:/Users/Alexander.Baratynski/Documents/NetBeansProjects/projForTest/src/diagnostics/parameterIsNeverUsed.kt 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | projForTest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkAutoCastAfterIf.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class Num(val value : Int) 4 | 5 | fun checkAutoCastAfterIf(obj : Any) { 6 | if (obj is Num) { 7 | return obj. 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkAutoCastAfterIfMethod.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class Smth { 4 | fun test() {} 5 | } 6 | 7 | fun eval(obj : Any) { 8 | if (obj is Smth) { 9 | return obj.() 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkAutoCastForThis.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | interface Monster { 4 | 5 | public fun test() { 6 | if (this is Beholder) { 7 | this. 8 | } 9 | } 10 | 11 | } 12 | 13 | class Beholder : Monster { 14 | 15 | fun destroy(){} 16 | 17 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkAutoCastInWhen.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class Sum(val left : Any, val right : Any) 4 | 5 | fun checkAutoCastInWhen(obj : Any) : Any = when (obj) { 6 | is Sum -> obj. 7 | else -> 0 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkBasicAny.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun checkBasicAny() { 4 | var any : A 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkBasicInt.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun checkBasicInt(){ 4 | var int : In 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkCompanion.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class ClassWithCompanion { 4 | companion object { 5 | val companionVal = "companion" 6 | 7 | fun companionFun = companionVal 8 | } 9 | 10 | fun checkCompanion() { 11 | val check = co 12 | } 13 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkCompletionBeforeDotInCall.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun testTop() { 4 | 5 | } 6 | 7 | class TestSample() { 8 | fun main(args : Array) { 9 | val testVar = "" 10 | test.testFun() 11 | } 12 | 13 | fun testFun() { 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkExtendClass.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | open class MySecondClass() { 4 | } 5 | 6 | open class MyFirstClass { 7 | 8 | } 9 | 10 | class A() : My { 11 | public fun test() { 12 | } 13 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkImport.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | import diagnostics.* 4 | 5 | fun checkImport() { 6 | val obj = Pr 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkInCallExpression.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class Temp { 4 | fun func(){} 5 | 6 | fun checkInCallExpression(){ 7 | fu 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkInClassInit.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | val valExternal = "external" 4 | 5 | class Some() { 6 | private val myVal : Int 7 | 8 | init { 9 | val valInternal = 12 10 | myVal = va 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkInClassPropertyAccessor.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class T(val testParam : Int) { 4 | val x : Int get() { 5 | val test = 12 6 | return te 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkInImport.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | import diagnostics. -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkInParameterType.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun checkInParameterType(a : In){} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkLocalLambda.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | class SomeClass { 4 | public fun test() {} 5 | } 6 | 7 | fun checkLocalLambda() { 8 | val lambda = { int : Int -> SomeClass() } 9 | lambda(0). 10 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkNonImportedPrivate.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun checkNonImportedPrivate() { 4 | priv 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkStringCompletion.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun checkStringCompletion() { 4 | "String".tost 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkUnimported.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun unimportedCompletion() { 4 | fu 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/checkUpperAndLowerCases.kt: -------------------------------------------------------------------------------- 1 | package completion 2 | 3 | fun method() {} 4 | 5 | fun upper() { 6 | MET 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/completion/pack/functions.kt: -------------------------------------------------------------------------------- 1 | package completion.pack 2 | 3 | fun function1() = 42 4 | 5 | fun function2() = 42 6 | 7 | private fun privateFunction() = "private" 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/SomeClass.java: -------------------------------------------------------------------------------- 1 | package diagnostics; 2 | 3 | import java.util.LinkedHashSet; 4 | import java.util.Set; 5 | 6 | public class SomeClass { 7 | public final Set roots = new LinkedHashSet(); 8 | public SomeClass getSomeClass() { return new SomeClass(); } 9 | 10 | public class JavaClass { public String str = "some string"; } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkCastIsNeverSucceed.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | fun checkErrors() { 4 | val str : String = "smth" 5 | val arg : Int = str as Int 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkNoTypeMismatch.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | interface Base {} 4 | 5 | class Proxy(t: T) : Base{ 6 | val value = t 7 | } 8 | 9 | fun checkNoTypeMismatch() { 10 | val base : Base = Proxy(5) 11 | base.toString() 12 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkNoValuePassed.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | fun str(arg : String) = arg 4 | 5 | fun noValuePassed() { 6 | str() 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkNullPointer.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | fun returnNull(str : String) = str 4 | 5 | fun checkNull() = returnNull(null) 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkReassignValue.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | fun changeVal() { 4 | val value = 0 5 | value += 1 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkTypeMismatch.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | interface Base1 {} 4 | 5 | class Proxy1(t: T) : Base1{ 6 | val value = t 7 | } 8 | 9 | fun checkTypeMismatch() { 10 | val base : Base1 = Proxy1("str") 11 | base.toString() 12 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkTypeParameterOfCollectionDeclaredInJava.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | fun checkTypeParam() { 4 | SomeClass().someClass.roots.map{ it.str } 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/checkWrongImport.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | import smth -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/expectingATopLevelDeclaration.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | syntax_err 4 | 5 | fun func(){ 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/diagnostics/parameterIsNeverUsed.kt: -------------------------------------------------------------------------------- 1 | package diagnostics 2 | 3 | fun func(str : String) {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/folding/class.kt: -------------------------------------------------------------------------------- 1 | package folding 2 | 3 | 4 | // Some class 5 | class SomeClass { 6 | 7 | init { 8 | 9 | } 10 | 11 | /* comment */ 12 | fun doNothing() { 13 | 14 | } 15 | 16 | fun someFun() { 17 | 18 | for (i in 0..10) { 19 | for (j in 10..20) { 20 | doNothing() 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/folding/function.kt: -------------------------------------------------------------------------------- 1 | package folding 2 | 3 | fun function(): Int { 4 | return 42 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/folding/functionWithBody.kt: -------------------------------------------------------------------------------- 1 | package folding 2 | 3 | fun functionWithBody() { 4 | 5 | listOf(1,2,3,4,5).forEach { 6 | println(it) 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/folding/licenseHeader.kt: -------------------------------------------------------------------------------- 1 | package folding 2 | 3 | /******************************************************************************* 4 | * Copyright 2000-2017 JetBrains s.r.o. 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 | * http://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 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/blockCommentBeforeDeclaration.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Cls { 4 | /* 5 | */ 6 | fun test() { 7 | } 8 | 9 | /* 10 | */ 11 | val vls = 1 12 | 13 | /* 14 | */ 15 | companion object {} 16 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/blockCommentBeforeDeclaration.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Cls{ 4 | /* 5 | */ 6 | fun test() {} 7 | 8 | /* 9 | */ 10 | val vls = 1 11 | 12 | /* 13 | */ 14 | companion object {} 15 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/classesAndPropertiesFormatTest.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Foo { 4 | fun foo() { 5 | } 6 | 7 | val f: String? = null 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/classesAndPropertiesFormatTest.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Foo { 4 | fun foo() { 5 | } 6 | 7 | val f: String? = null 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/commentOnTheLastLineOfLambda.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun main(args: Array) { 4 | listOf("A").map { 5 | null 6 | // Can't add newlines in 'map' lambda if this is the last/only line in the lambda 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/commentOnTheLastLineOfLambda.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun main(args: Array) { 4 | listOf("A").map { 5 | null 6 | // Can't add newlines in 'map' lambda if this is the last/only line in the lambda 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInDoWhile.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun aa() { 4 | do { 5 | println("some") 6 | } while (true) 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInDoWhile.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun aa() { 4 | do { 5 | println("some") 6 | } while (true) 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInIfExpressionBlock.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun sm() { 4 | val aa = if (true) { 5 | 1 6 | } else { 7 | 2 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInIfExpressionBlock.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun sm() { 4 | val aa = if (true) { 5 | 1 6 | } else { 7 | 2 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInPropertyAccessor.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class C { 4 | var someProp: Int 5 | get() = throw UnsupportedOperationException() 6 | set(value) { 7 | println("10") 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInPropertyAccessor.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class C { 4 | var someProp: Int 5 | get() = throw UnsupportedOperationException() 6 | set(value) { 7 | println("10") 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInWhenEntry.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun a() { 4 | when (1) { 5 | is Int { 6 | println() 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/indentInWhenEntry.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun a() { 4 | when (1) { 5 | is Int { 6 | println() 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/initIndent.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Test { 4 | init { 5 | val a = 1 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/initIndent.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Test { 4 | init { 5 | val a = 1 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/lambdaInBlock.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun test() { 4 | listOf(1, 2).forEach { number -> 5 | println(number) 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/lambdaInBlock.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun test() { 4 | listOf(1, 2).forEach { number -> 5 | println(number) 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/newLineAfterImportsAndPackage.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | import completion 4 | import diagnostics 5 | 6 | fun func() {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/newLineAfterImportsAndPackage.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | import completion 3 | import diagnostics 4 | fun func() {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/objectsAndLocalFunctionsFormatTest.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | object Fooo { 4 | fun foo() { 5 | fun localFoo() { 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/objectsAndLocalFunctionsFormatTest.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | object Fooo { 4 | fun foo() { 5 | fun localFoo() { 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/packageFunctionsFormatTest.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun foo() { 4 | val s = "" 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/packageFunctionsFormatTest.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | fun foo() { 4 | val s = "" 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withBlockComments.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Hello { 4 | /* 5 | class classInComment { 6 | fun someFun { 7 | } 8 | } 9 | */ 10 | fun someFun() { 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withBlockComments.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Hello { 4 | /* 5 | class classInComment { 6 | fun someFun { 7 | } 8 | } 9 | */ 10 | fun someFun() { 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withJavaDoc.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | /** 4 | * 5 | * 6 | */ 7 | class SomeTest { 8 | /** 9 | * 10 | * @param x 11 | */ 12 | fun someFun(x: Int) { 13 | } 14 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withJavaDoc.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | /** 4 | * 5 | * 6 | */ 7 | class SomeTest { 8 | /** 9 | * 10 | * @param x 11 | */ 12 | fun someFun(x: Int) { 13 | } 14 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withLineComments.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | // Hello 4 | // Some 5 | class SomeCls { 6 | // Test 7 | // Test1 8 | // Test2 9 | fun function() { 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withLineComments.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | // Hello 4 | // Some 5 | class SomeCls { 6 | // Test 7 | // Test1 8 | // Test2 9 | fun function() { 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withMutableVariable.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Cl { 4 | var someProp: Int 5 | get() = throw UnsupportedOperationException() 6 | set(value) { 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withMutableVariable.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Cl { 4 | var someProp: Int 5 | get() = throw UnsupportedOperationException() 6 | set(value) { 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withWhitespaceBeforeBrace.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Some { 4 | 5 | init { 6 | 7 | } 8 | 9 | fun some() { 10 | 11 | } 12 | 13 | fun some2() { 14 | if (true) { 15 | 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withWhitespaceBeforeBrace.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class Some{ 4 | 5 | init{ 6 | 7 | } 8 | 9 | fun some(){ 10 | 11 | } 12 | 13 | fun some2() { 14 | if (true){ 15 | 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withoutComments.after: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class SimpleTest 4 | 5 | fun topLevelFun() { 6 | fun localFun() { 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/formatting/withoutComments.kt: -------------------------------------------------------------------------------- 1 | package formatting 2 | 3 | class SimpleTest 4 | 5 | fun topLevelFun() { 6 | fun localFun() { 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/blockComment.kt: -------------------------------------------------------------------------------- 1 | /* test 2 | test 3 | */ -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/companionObject.kt: -------------------------------------------------------------------------------- 1 | class C { 2 | companion object { 3 | } 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/forKeyword.kt: -------------------------------------------------------------------------------- 1 | for -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/function.kt: -------------------------------------------------------------------------------- 1 | fun foo(){ 2 | fun innerFun(){} 3 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/getterSetter.kt: -------------------------------------------------------------------------------- 1 | class Cl { 2 | var x: Int = 1 3 | set() = 2 4 | get() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/importKeyword.kt: -------------------------------------------------------------------------------- 1 | import smth -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/inKeyword.kt: -------------------------------------------------------------------------------- 1 | in -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/interfaceKeyword.kt: -------------------------------------------------------------------------------- 1 | interface Interf { 2 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/keywordWithText.kt: -------------------------------------------------------------------------------- 1 | in some -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/openKeyword.kt: -------------------------------------------------------------------------------- 1 | open class MyClass -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/singleLineComment.kt: -------------------------------------------------------------------------------- 1 | //single line comment -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/softImportKeyword.kt: -------------------------------------------------------------------------------- 1 | class some { 2 | import 3 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/softKeywords.kt: -------------------------------------------------------------------------------- 1 | import some 2 | 3 | open abstract class Cls { 4 | import 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/stringInterpolation.kt: -------------------------------------------------------------------------------- 1 | val xyz = 10 2 | "test: $xyz" -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/stringToken.kt: -------------------------------------------------------------------------------- 1 | "something" -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/highlighting/textWithTokenInside.kt: -------------------------------------------------------------------------------- 1 | kotlin -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterEquals.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun contains(p: Point): Boolean = 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterEquals.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun contains(p: Point): Boolean = -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOneOpenBrace.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt(){ 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOneOpenBrace.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt(){ -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOpenBraceWithShift.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | data class User( 4 | val name: String) { 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOpenBraceWithShift.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | data class User( 4 | val name: String) {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOperatorIfWithoutBraces.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOperatorIfWithoutBraces.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOperatorWhileWithoutBraces.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | while (true) 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/afterOperatorWhileWithoutBraces.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | while (true) 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeCloseBrace.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeCloseBrace.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeFunctionStart.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | 4 | fun tt() { 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeFunctionStart.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeNestedCloseBrace.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun someFunc() { 4 | if (10 > 9) { 5 | 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeNestedCloseBrace.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun someFunc() { 4 | if (10 > 9) { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeTwiceNestedCloseBrace.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun newFunc() { 4 | if (5 == 5) { 5 | if (10 < 15) { 6 | 7 | 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/beforeTwiceNestedCloseBrace.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun newFunc() { 4 | if (5 == 5) { 5 | if (10 < 15) { 6 | 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/betweenBracesOnDifferentLine.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/betweenBracesOnDifferentLine.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/betweenBracesOnOneLine.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/betweenBracesOnOneLine.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/betweenBracesOnOneLine2.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun indTest() { 4 | > 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/betweenBracesOnOneLine2.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun indTest() { } 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/breakLineAfterIfWithoutBraces.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) 5 | true 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/breakLineAfterIfWithoutBraces.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) 5 | true 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/continuationAfterDotCall.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun some() { 4 | listOf(1, 2). 5 | map { it >= 2 } 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/continuationAfterDotCall.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun some() { 4 | listOf(1, 2).map { it >= 2 } 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/continuationBeforeFunName.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun 4 | test() {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/continuationBeforeFunName.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun test() {} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/continuationInMultiLineExpression.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun foo() { 4 | "longstring".substring( 5 | 1, 6 | ) 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/continuationInMultiLineExpression.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun foo() { 4 | "longstring".substring( 5 | 1,) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/indentBeforeWhile.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun test() { 4 | val some = 1 5 | 6 | while (true) {} 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/indentBeforeWhile.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun test() { 4 | val some = 1 5 | while (true) {} 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/lineBreakSaveIndent.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/lineBreakSaveIndent.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/nestedOperatorsWithBraces.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) { 5 | if (true) { 6 | 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/nestedOperatorsWithBraces.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) { 5 | if (true) { 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/nestedOperatorsWithoutBraces.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) 5 | if (true) 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/nestedOperatorsWithoutBraces.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun tt() { 4 | if (true) 5 | if (true) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/newLineInParameters.after: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun test() { 4 | fun some(a: Int, b: Int) {} 5 | some( 6 | 12, 3) 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/newLineInParameters.kt: -------------------------------------------------------------------------------- 1 | package indentation 2 | 3 | fun test() { 4 | fun some(a: Int, b: Int) {} 5 | some(12, 3) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/newLineWhenCaretAtPosition0.after: -------------------------------------------------------------------------------- 1 | 2 | package indentation -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/indentation/newLineWhenCaretAtPosition0.kt: -------------------------------------------------------------------------------- 1 | package indentation -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/addValToConstructorParameter.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class AddValToParameter(val par: String) 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/addValToConstructorParameter.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class AddValToParameter(par: String) 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/addValToConstructorParameter.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class AddValToParameter(par: String) 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/changeReturnType.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun changeReturnType(): Int = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/changeReturnType.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun changeReturnType(): String = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/changeReturnType.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun changeReturnType(): String = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertPropertyInitializerToGetter.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class ConvertPropertyInitToGetter { 4 | 5 | val property: Int 6 | get() = 42 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertPropertyInitializerToGetter.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class ConvertPropertyInitToGetter { 4 | 5 | val property = 42 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertPropertyInitializerToGetter.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class ConvertPropertyInitToGetter { 4 | 5 | val property = 42 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToBlockBody.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToBlockBodyTest(): Int { 4 | return 42 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToBlockBody.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToBlockBodyTest() = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToBlockBody.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToBlockBodyTest() = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToConcatenatedString.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToConcatenatedString(s: String) { 4 | val str = "Hello, " + s 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToConcatenatedString.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToConcatenatedString(s: String) { 4 | val str = "Hello, $s" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToConcatenatedString.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToConcatenatedString(s: String) { 4 | val str = "Hello, $s" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToExpressionBody.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToExpressionBody(): Int = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToExpressionBody.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToExpressionBody(): Int { 4 | return 42 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToExpressionBody.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertToExpressionBody(): Int { 4 | return 42 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToSealedClass.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | sealed class ProtocolState { 4 | object WAITING : ProtocolState() { 5 | override fun signal() = TALKING 6 | } 7 | 8 | object TALKING : ProtocolState() { 9 | override fun signal() = WAITING 10 | } 11 | 12 | abstract fun signal(): ProtocolState 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToSealedClass.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | enum class ProtocolState { 4 | WAITING { 5 | override fun signal() = TALKING 6 | }, 7 | 8 | TALKING { 9 | override fun signal() = WAITING 10 | }; 11 | 12 | abstract fun signal(): ProtocolState 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToSealedClass.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | enum class ProtocolState { 4 | WAITING { 5 | override fun signal() = TALKING 6 | }, 7 | 8 | TALKING { 9 | override fun signal() = WAITING 10 | }; 11 | 12 | abstract fun signal(): ProtocolState 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToStringTemplate.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertTotringTemplate() = "1214" 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToStringTemplate.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertTotringTemplate() = "12" + "14" 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertToStringTemplate.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertTotringTemplate() = "12" + "14" 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertTwoComparisons.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertTwoComparisons() { 4 | val integer = 5 5 | if (integer in 4..6) { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertTwoComparisons.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertTwoComparisons() { 4 | val integer = 5 5 | if (integer > 3 && integer < 7) { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/convertTwoComparisons.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun convertTwoComparisons() { 4 | val integer = 5 5 | if (integer > 3 && integer < 7) { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/mergeIfs.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun mergeIfs() { 4 | val integer = 5 5 | if (integer > 3 && integer < 7) { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/mergeIfs.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun mergeIfs() { 4 | val integer = 5 5 | if (integer > 3) { 6 | if (integer < 7) { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/mergeIfs.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun mergeIfs() { 4 | val integer = 5 5 | if (integer > 3) { 6 | if (integer < 7) { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeBraces.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun removeBraces() { 4 | if (42 > 3) return 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeBraces.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun removeBraces() { 4 | if (42 > 3) { 5 | return 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeBraces.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun removeBraces() { 4 | if (42 > 3) { 5 | return 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptyClassBody.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class RemoveBraces 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptyClassBody.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class RemoveBraces { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptyClassBody.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class RemoveBraces { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptyPrimaryConstructor.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class EmptyPrimary 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptyPrimaryConstructor.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class EmptyPrimary() 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptyPrimaryConstructor.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class EmptyPrimary() 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptySecondaryConstructor.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class SecondaryConstructor { 4 | constructor() 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptySecondaryConstructor.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class SecondaryConstructor { 4 | constructor() {} 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeEmptySecondaryConstructor.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | class SecondaryConstructor { 4 | constructor() {} 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeExplicitType.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun explicit() = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeExplicitType.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun explicit(): Int = 42 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeExplicitType.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun explicit(): Int = 42 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeParenthesesFromLambdaCall.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun removeEmptyParenthesesFromLambdaCall(strs: Array) = strs.map {} 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeParenthesesFromLambdaCall.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun removeEmptyParenthesesFromLambdaCall(strs: Array) = strs.map() {} 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/removeParenthesesFromLambdaCall.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun removeEmptyParenthesesFromLambdaCall(strs: Array) = strs.map() {} 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/replaceSizeCheckWithIsNotEmpty.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun replaceSizeCheckWithIsNotEmpty(strs: Array) { 4 | if (strs.isNotEmpty()) { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/replaceSizeCheckWithIsNotEmpty.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun replaceSizeCheckWithIsNotEmpty(strs: Array) { 4 | if (strs.size > 0) { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/replaceSizeCheckWithIsNotEmpty.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun replaceSizeCheckWithIsNotEmpty(strs: Array) { 4 | if (strs.size > 0) { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/specifyType.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun specifyType(): String = "str" 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/specifyType.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun specifyType() = "str" 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/specifyType.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun specifyType() = "str" 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/splitIf.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun splitIf() { 4 | val integer = 5 5 | if (integer > 3) { 6 | if (integer != 5) {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/splitIf.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun splitIf() { 4 | val integer = 5 5 | if (integer > 3 && integer != 5) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/splitIf.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | fun splitIf() { 4 | val integer = 5 5 | if (integer > 3 && integer != 5) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/toInfix.after: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | infix fun Int.inf(p: Int) = this + p 4 | 5 | fun toInfix() { 6 | val res = 42 inf 42 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/toInfix.caret: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | infix fun Int.inf(p: Int) = this + p 4 | 5 | fun toInfix() { 6 | val res = 42.inf(42) 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/intentions/toInfix.kt: -------------------------------------------------------------------------------- 1 | package intentions 2 | 3 | infix fun Int.inf(p: Int) = this + p 4 | 5 | fun toInfix() { 6 | val res = 42.inf(42) 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/interface.after: -------------------------------------------------------------------------------- 1 | package j2k 2 | 3 | interface SomeInterface { 4 | fun hello() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/interface.java: -------------------------------------------------------------------------------- 1 | package j2k; 2 | 3 | public interface SomeInterface { 4 | public void hello(); 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/mixed.after: -------------------------------------------------------------------------------- 1 | package j2k 2 | 3 | class MixedClass { 4 | fun hello() { 5 | System.out.println("hello") 6 | } 7 | 8 | companion object { 9 | fun staticMethod() {} 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/mixed.java: -------------------------------------------------------------------------------- 1 | package j2k; 2 | 3 | public class MixedClass { 4 | public void hello() { 5 | System.out.println("hello"); 6 | } 7 | 8 | public static void staticMethod() {} 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/simple.after: -------------------------------------------------------------------------------- 1 | package j2k 2 | 3 | class SimpleClass { 4 | fun hello() { 5 | System.out.println("hello") 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/simple.java: -------------------------------------------------------------------------------- 1 | package j2k; 2 | 3 | public class SimpleClass { 4 | public void hello() { 5 | System.out.println("hello"); 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/withInnerClass.after: -------------------------------------------------------------------------------- 1 | package j2k 2 | 3 | class SimpleClass { 4 | internal inner class InnerClass { 5 | fun doNothing() {} 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/withInnerClass.java: -------------------------------------------------------------------------------- 1 | package j2k; 2 | 3 | public class SimpleClass { 4 | class InnerClass { 5 | void doNothing(){ 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/withStaticMethod.after: -------------------------------------------------------------------------------- 1 | package j2k 2 | 3 | object WithStaticClass { 4 | fun hello() { 5 | System.out.println("hello") 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/j2k/withStaticMethod.java: -------------------------------------------------------------------------------- 1 | package j2k; 2 | 3 | public class WithStaticClass { 4 | public static void hello() { 5 | System.out.println("hello"); 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/main/main.kt: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /* 4 | 5 | @author Alexander.Baratynski 6 | Created on Jul 22, 2016 7 | */ 8 | 9 | fun main(args : Array) { 10 | 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/JavaClass.caret: -------------------------------------------------------------------------------- 1 | package navigation; 2 | 3 | public class JavaClass { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/JavaClass.java: -------------------------------------------------------------------------------- 1 | package navigation; 2 | 3 | public class JavaClass { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/KotlinClass.caret: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | class KotlinClass { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/KotlinClass.kt: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | class KotlinClass { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/checkNavigationToClass.kt: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | fun navigateToClass(){ 4 | KotlinClass() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/checkNavigationToFunction.kt: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | fun checkNavigationToFunction(){ 4 | function() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/checkNavigationToJavaClass.kt: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | fun getJavaClass() { 4 | JavaClass() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/checkNavigationToVariable.caret: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | class SomeKotlinClass { 4 | 5 | val str = "String" 6 | 7 | fun navigate(){ 8 | str 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/checkNavigationToVariable.kt: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | class SomeKotlinClass { 4 | 5 | val str = "String" 6 | 7 | fun navigate(){ 8 | str 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/functionToNavigate.caret: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | fun function(){} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/navigation/functionToNavigate.kt: -------------------------------------------------------------------------------- 1 | package navigation 2 | 3 | fun function(){} -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/implementMembers.after: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | class InterfaceImpl : Interface { 4 | override fun someFunc(): Int { 5 | throw UnsupportedOperationException() 6 | } 7 | 8 | } 9 | 10 | interface Interface { 11 | fun someFunc(): Int 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/implementMembers.kt: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | class InterfaceImpl : Interface 4 | 5 | interface Interface { 6 | fun someFunc(): Int 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/removeUnnecessaryCall.after: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | fun removeUnnecessarySafeCall() { 4 | val integer = 42 5 | integer.toString() 6 | } 7 | 8 | private fun useOfRemoveUnnecessarySafeCall() = removeUnnecessarySafeCall() 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/removeUnnecessaryCall.kt: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | fun removeUnnecessarySafeCall() { 4 | val integer = 42 5 | integer?.toString() 6 | } 7 | 8 | private fun useOfRemoveUnnecessarySafeCall() = removeUnnecessarySafeCall() 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/removeUselessCast.after: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | fun removeUselessCast(integer: Int) { 4 | println((integer).toString()) 5 | } 6 | 7 | fun useRemoveUselessCast() = removeUselessCast(1) 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/removeUselessCast.kt: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | fun removeUselessCast(integer: Int) { 4 | println((integer as Int).toString()) 5 | } 6 | 7 | fun useRemoveUselessCast() = removeUselessCast(1) 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/removeUselessElvis.after: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | fun removeUselessElvis(a: Int) { 4 | a 5 | } 6 | 7 | fun useRemoveUselessElvis() = removeUselessElvis(1) 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/quickfixes/removeUselessElvis.kt: -------------------------------------------------------------------------------- 1 | package quickfixes 2 | 3 | fun removeUselessElvis(a: Int) { 4 | a ?: return 5 | } 6 | 7 | fun useRemoveUselessElvis() = removeUselessElvis(1) 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classbyconstructor/file.after: -------------------------------------------------------------------------------- 1 | package rename.classbyconstructor 2 | 3 | class KotlinRules 4 | 5 | fun main(args: Array) { 6 | KotlinRules() 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classbyconstructor/file.caret: -------------------------------------------------------------------------------- 1 | package rename.classbyconstructor 2 | 3 | class Kotlin 4 | 5 | fun main(args: Array) { 6 | Kotlin() 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classbyconstructor/file.kt: -------------------------------------------------------------------------------- 1 | package rename.classbyconstructor 2 | 3 | class Kotlin 4 | 5 | fun main(args: Array) { 6 | Kotlin() 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classrename/file.after: -------------------------------------------------------------------------------- 1 | package rename.classrename 2 | class NewName 3 | 4 | fun main(args : Array) { 5 | println(NewName().hashCode()) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classrename/file.caret: -------------------------------------------------------------------------------- 1 | package rename.classrename 2 | class ClassToRename 3 | 4 | fun main(args : Array) { 5 | println(ClassToRename().hashCode()) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classrename/file.kt: -------------------------------------------------------------------------------- 1 | package rename.classrename 2 | class ClassToRename 3 | 4 | fun main(args : Array) { 5 | println(ClassToRename().hashCode()) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classrename/file2.after: -------------------------------------------------------------------------------- 1 | package rename.classrename 2 | 3 | fun someFunc() = NewName().hashCode() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/classrename/file2.kt: -------------------------------------------------------------------------------- 1 | package rename.classrename 2 | 3 | fun someFunc() = ClassToRename().hashCode() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/forloop/file.after: -------------------------------------------------------------------------------- 1 | package rename.forloop 2 | 3 | fun main(args: Array) { 4 | for (arg1 in args) { 5 | println(arg1) 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/forloop/file.caret: -------------------------------------------------------------------------------- 1 | package rename.forloop 2 | 3 | fun main(args: Array) { 4 | for (arg in args) { 5 | println(arg) 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/forloop/file.kt: -------------------------------------------------------------------------------- 1 | package rename.forloop 2 | 3 | fun main(args: Array) { 4 | for (arg in args) { 5 | println(arg) 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/forloop2/file.after: -------------------------------------------------------------------------------- 1 | package rename.forloop2 2 | 3 | val arg = 42 4 | 5 | fun main(args: Array) { 6 | for (arg1 in args) { 7 | println(arg1) 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/forloop2/file.caret: -------------------------------------------------------------------------------- 1 | package rename.forloop2 2 | 3 | val arg = 42 4 | 5 | fun main(args: Array) { 6 | for (arg in args) { 7 | println(arg) 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/forloop2/file.kt: -------------------------------------------------------------------------------- 1 | package rename.forloop2 2 | 3 | val arg = 42 4 | 5 | fun main(args: Array) { 6 | for (arg in args) { 7 | println(arg) 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/function/file.after: -------------------------------------------------------------------------------- 1 | package rename.function 2 | 3 | class Bar { 4 | fun fooFunc() = println("bar") 5 | } 6 | 7 | fun main(args: Array) = Bar().fooFunc() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/function/file.caret: -------------------------------------------------------------------------------- 1 | package rename.function 2 | 3 | class Bar { 4 | fun barFunc() = println("bar") 5 | } 6 | 7 | fun main(args: Array) = Bar().barFunc() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/function/file.kt: -------------------------------------------------------------------------------- 1 | package rename.function 2 | 3 | class Bar { 4 | fun barFunc() = println("bar") 5 | } 6 | 7 | fun main(args: Array) = Bar().barFunc() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/functionparameter/file.after: -------------------------------------------------------------------------------- 1 | package rename.functionparameter 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) 10 | 11 | fun anotherFun2(someValue: Int) = println(someValue) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/functionparameter/file.caret: -------------------------------------------------------------------------------- 1 | package rename.functionparameter 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) 10 | 11 | fun anotherFun2(someVal: Int) = println(someVal) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/functionparameter/file.kt: -------------------------------------------------------------------------------- 1 | package rename.functionparameter 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) 10 | 11 | fun anotherFun2(someVal: Int) = println(someVal) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/methodrename/file.after: -------------------------------------------------------------------------------- 1 | package rename.methodrename 2 | 3 | class ClassWithMethod { 4 | fun notSoCoolFun() = println() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/methodrename/file.caret: -------------------------------------------------------------------------------- 1 | package rename.methodrename 2 | 3 | class ClassWithMethod { 4 | fun coolFun() = println() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/methodrename/file.kt: -------------------------------------------------------------------------------- 1 | package rename.methodrename 2 | 3 | class ClassWithMethod { 4 | fun coolFun() = println() 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/methodrename/file2.after: -------------------------------------------------------------------------------- 1 | package rename.methodrename 2 | 3 | fun someFunc() = ClassWithMethod().notSoCoolFun() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/methodrename/file2.kt: -------------------------------------------------------------------------------- 1 | package rename.methodrename 2 | 3 | fun someFunc() = ClassWithMethod().coolFun() -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/properties/file.after: -------------------------------------------------------------------------------- 1 | package rename.properties 2 | 3 | val someValue = 5 4 | 5 | fun main(args : Array) { 6 | println(someValue) 7 | } 8 | 9 | fun anotherFun() = println(someValue) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/properties/file.caret: -------------------------------------------------------------------------------- 1 | package rename.properties 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) 10 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/properties/file.kt: -------------------------------------------------------------------------------- 1 | package rename.properties 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/simple/file.after: -------------------------------------------------------------------------------- 1 | package rename.simple 2 | class NewName 3 | 4 | fun main(args : Array) { 5 | println(NewName().hashCode()) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/simple/file.caret: -------------------------------------------------------------------------------- 1 | package rename.simple 2 | class ClassToRename 3 | 4 | fun main(args : Array) { 5 | println(ClassToRename().hashCode()) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/simple/file.kt: -------------------------------------------------------------------------------- 1 | package rename.simple 2 | class ClassToRename 3 | 4 | fun main(args : Array) { 5 | println(ClassToRename().hashCode()) 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/simplesec/file.after: -------------------------------------------------------------------------------- 1 | package rename.simplesec 2 | 3 | val someValue = 5 4 | 5 | fun main(args : Array) { 6 | println(someValue) 7 | } 8 | 9 | fun anotherFun() = println(someValue) 10 | 11 | fun anotherFun2(someVal: Int) = println(someVal) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/simplesec/file.caret: -------------------------------------------------------------------------------- 1 | package rename.simplesec 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) 10 | 11 | fun anotherFun2(someVal: Int) = println(someVal) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/rename/simplesec/file.kt: -------------------------------------------------------------------------------- 1 | package rename.simplesec 2 | 3 | val someVal = 5 4 | 5 | fun main(args : Array) { 6 | println(someVal) 7 | } 8 | 9 | fun anotherFun() = println(someVal) 10 | 11 | fun anotherFun2(someVal: Int) = println(someVal) -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/annotation.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | @Deprecated("deprecated") 4 | fun deprecatedFun() = 42 5 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/annotation.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | @Deprecated("deprecated") 4 | fun deprecatedFun() = 42 5 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/class.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | class SomeClass { 4 | 5 | val value = 42 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/class.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | class SomeClass { 4 | 5 | val value = 42 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/deprecated.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | fun useDeprecated() = deprecatedFun() 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/deprecated.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | fun useDeprecated() = deprecatedFun() 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/empty.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/empty.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/functionWithLocalVariables.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | fun functionWithLocalVariables() { 4 | val value = 0 5 | var variable = 0 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/functionWithLocalVariables.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | fun functionWithLocalVariables() { 4 | val value = 0 5 | var variable = 0 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/simpleClass.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | class SemClass { 4 | 5 | } 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/simpleClass.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | class SemClass { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/smartCast.caret: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | private fun getNumber(bool: Boolean): Int? = if (bool) 42 else null 4 | 5 | fun testSmartCastHighlighting() { 6 | val value = getNumber(false) 7 | if (value != null) value + 1 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/semantic/smartCast.kt: -------------------------------------------------------------------------------- 1 | package semantic 2 | 3 | private fun getNumber(bool: Boolean): Int? = if (bool) 42 else null 4 | 5 | fun testSmartCastHighlighting() { 6 | val value = getNumber(false) 7 | if (value != null) value + 1 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/structureScanner/classWithSeveralMembers.kt: -------------------------------------------------------------------------------- 1 | package structureScanner 2 | 3 | class ClassWithSeveralMembers { 4 | 5 | private val member = 42 6 | 7 | fun member() = 42 8 | 9 | class InnerClass 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/structureScanner/empty.kt: -------------------------------------------------------------------------------- 1 | package structureScanner 2 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/structureScanner/object.kt: -------------------------------------------------------------------------------- 1 | package structureScanner 2 | 3 | object Obj { 4 | fun hello() = "Hello" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/structureScanner/severalClasses.kt: -------------------------------------------------------------------------------- 1 | package structureScanner 2 | 3 | class FirstClass { 4 | 5 | private val prop = 42 6 | 7 | private val prop2 = 1 8 | 9 | private fun method() = prop + prop2 10 | 11 | class InnerClass { 12 | 13 | fun hi() = "hi" 14 | 15 | class InnerInnerClass { 16 | 17 | private val INNER = 42 18 | 19 | } 20 | 21 | } 22 | 23 | } 24 | 25 | object SecondObject { 26 | 27 | fun ft() = 42 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/structureScanner/severalFunctions.kt: -------------------------------------------------------------------------------- 1 | package structureScanner 2 | 3 | fun first() = 42 4 | 5 | fun second() = 42 6 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/structureScanner/simple.kt: -------------------------------------------------------------------------------- 1 | package structureScanner 2 | 3 | fun simple() = 1 4 | -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/FirstClass.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class FirstClass extends java.lang.Object { 3 | public FirstClass(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/SecondClass.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class SecondClass extends java.lang.Object { 3 | public SecondClass(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/abstractClass.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public abstract class SimpleAbstractClass extends java.lang.Object { 3 | public SimpleAbstractClass(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/abstractClass.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | abstract class SimpleAbstractClass { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/classWithTypeParameter.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class ClassWithTypeParameter { 3 | public ClassWithTypeParameter(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/classWithTypeParameter.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class ClassWithTypeParameter { 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/classWithVal.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class ClassWithVal extends java.lang.Object { 3 | private final java.lang.String prop; 4 | public final java.lang.String getProp(){} 5 | public ClassWithVal(){} 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/classWithVal.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class ClassWithVal { 4 | val prop = "str" 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/classWithVar.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class ClassWithVar extends java.lang.Object { 3 | private java.lang.String prop; 4 | public final java.lang.String getProp(){} 5 | public final void setProp(java.lang.String a0){} 6 | public ClassWithVar(){} 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/classWithVar.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class ClassWithVar { 4 | var prop = "str" 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/enum.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public enum SimpleEnum extends java.lang.Enum{ ONE, TWO, THREE;protected SimpleEnum(){} 3 | public static stubGen.SimpleEnum[] values(){} 4 | public static stubGen.SimpleEnum valueOf(java.lang.String a0){} 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/enum.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | enum class SimpleEnum { 4 | ONE, TWO, THREE 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/implementsInterface.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | interface Interface 4 | 5 | class SimpleImplements : Interface { 6 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/implementsInterface1.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public interface Interface { 3 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/implementsInterface2.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class SimpleImplements extends java.lang.Object implements stubGen.Interface { 3 | public SimpleImplements(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/interface.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public interface SimpleInterface { 3 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/interface.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | interface SimpleInterface { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/object.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class SimpleObject extends java.lang.Object { 3 | public final static stubGen.SimpleObject INSTANCE; 4 | private SimpleObject(){} 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/object.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | object SimpleObject { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/openClass.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public class SimpleOpenClass extends java.lang.Object { 3 | public SimpleOpenClass(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/openClass.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | open class SimpleOpenClass { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/severalArguments.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class SeveralArguments extends java.lang.Object { 3 | public final void func(java.lang.String a0, java.lang.String a1){} 4 | public SeveralArguments(){} 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/severalArguments.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class SeveralArguments { 4 | 5 | fun func(a0: String, a1: String){} 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/severalClassesInOneFile.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class FirstClass { 4 | } 5 | 6 | class SecondClass { 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/simple.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class Simple extends java.lang.Object { 3 | public Simple(){} 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/simple.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class Simple { 4 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withCompanion.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class WithCompanion extends java.lang.Object { 3 | public final static stubGen.WithCompanion.Companion Companion; 4 | public WithCompanion(){} 5 | public final static class Companion extends java.lang.Object { 6 | public final java.lang.String hello(){} 7 | private Companion(){} 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withCompanion.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class WithCompanion { 4 | 5 | companion object { 6 | fun hello() = "hello" 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withNestedClass.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class ClassWithNestedClass extends java.lang.Object { 3 | public ClassWithNestedClass(){} 4 | 5 | public final static class Nested extends java.lang.Object { 6 | public Nested(){} 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withNestedClass.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class ClassWithNestedClass { 4 | 5 | class Nested { 6 | } 7 | 8 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withSeveralMethods.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class ClassWithSeveralMethods extends java.lang.Object { 3 | public final void firstMethod(){} 4 | public final void secondMethod(){} 5 | public final void thirdMethod(){} 6 | public ClassWithSeveralMethods(){} 7 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withSeveralMethods.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | class ClassWithSeveralMethods { 4 | 5 | fun firstMethod(){} 6 | fun secondMethod(){} 7 | fun thirdMethod(){} 8 | 9 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withoutClass.after: -------------------------------------------------------------------------------- 1 | package stubGen; 2 | public final class WithoutClassKt extends java.lang.Object { 3 | public final static void hello() {} 4 | 5 | } -------------------------------------------------------------------------------- /src/test/resources/projForTest/src/stubGen/withoutClass.kt: -------------------------------------------------------------------------------- 1 | package stubGen 2 | 3 | fun hello() = println("Hello") --------------------------------------------------------------------------------