Git Product home page Git Product logo

kotlin-function-arguments-helper's People

Contributors

actions-user avatar antohaby avatar bentemple avatar dependabot[bot] avatar github-actions[bot] avatar jirokun avatar naofumi-fujii avatar shiraji avatar suusan2go avatar t-kameyama avatar toefel18 avatar workingdevel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kotlin-function-arguments-helper's Issues

Feature: Add/Respect option to use trailing comma

Kotlin 1.4 supports trailing commas. They can be enabled in Idea's Settings->Editor->Code Style->Kotlin->Other.

It would be great if the plugin would respect the setting and generate trailing comma, so instead:

User(
  name = "",
  phone = "",
  address = ""
)

it would generate

User(
  name = "",
  phone = "",
  address = "",
)

Fill secondary constructor `this()` arguments from sec constructor parameters

data class OrderStatus(
    val occurredAt: OffsetDateTime,
    /** one of SalesOrderStatus||ShipmentStatus */
    val status: String,
    val orderNumber: OrderNumber,
    val items: List<OrderItem>,
    /** just in ShipmentStatus */
    val shipmentNumber: String?,
    /** just in SalesOrderStatus */
    val payments: List<Payment>?
) {
    // for a sales order
    constructor(
        occurredAt: OffsetDateTime,
        status: SalesOrderStatus,
        orderNumber: OrderNumber,
        items: List<OrderItem>,
        payments: List<Payment>
    ) : this( // the following arguments should be generated by the plugin
        occurredAt = occurredAt,
        orderNumber = orderNumber,
        status = status.name, // type mismatch should be ignored, just match names
        items = items,
        shipmentNumber = null, // if not found in parameter list, just add not the argument, <null> it or add no value add all, just name it
        payments = payments
    )
}

Could not find correct module information

java.lang.Throwable: Could not find correct module information.
Reason: Should not analyze element: val x =
de.bringmeister.connect.imageservice.imagestorage.datocms.UploadRequestResponse2(id = "",type = "",attributes = de.bringmeister.connect.imageservice.imagestorage.datocms.UploadRequestResponse2Attributes(url =)) in file dummy.kt
This file was created by KtPsiFactory and should not be analyzed
Use createAnalyzableFile to create file that can be analyzed

	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at org.jetbrains.kotlin.idea.caches.project.ModuleInfoCollector$NotNullTakeFirst$2.invoke(getModuleInfo.kt:94)
	at org.jetbrains.kotlin.idea.caches.project.ModuleInfoCollector$NotNullTakeFirst$2.invoke(getModuleInfo.kt:91)
	at org.jetbrains.kotlin.idea.caches.project.GetModuleInfoKt.collectInfos(getModuleInfo.kt:163)
	at org.jetbrains.kotlin.idea.caches.project.GetModuleInfoKt.getModuleInfo(getModuleInfo.kt:35)
	at org.jetbrains.kotlin.idea.caches.resolve.KotlinCacheServiceImpl.getFacadeToAnalyzeFile(KotlinCacheServiceImpl.kt:465)
	at org.jetbrains.kotlin.idea.caches.resolve.KotlinCacheServiceImpl.access$getFacadeToAnalyzeFile(KotlinCacheServiceImpl.kt:76)
	at org.jetbrains.kotlin.idea.caches.resolve.KotlinCacheServiceImpl$getResolutionFacade$1.compute(KotlinCacheServiceImpl.kt:87)
	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
	at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
	at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114)
	at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:44)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
	at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
	at org.jetbrains.kotlin.idea.caches.resolve.KotlinCacheServiceImpl.getResolutionFacade(KotlinCacheServiceImpl.kt:85)
	at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.getResolutionFacade(resolutionApi.kt:26)
	at org.jetbrains.kotlin.idea.core.ShortenReferences$ShorteningProcessor.<init>(ShortenReferences.kt:351)
	at org.jetbrains.kotlin.idea.core.ShortenReferences$ShortenTypesProcessor.<init>(ShortenReferences.kt:447)
	at org.jetbrains.kotlin.idea.core.ShortenReferences$shortenReferencesInFile$$inlined$runReadAction$1.compute(actions.kt:61)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:852)
	at org.jetbrains.kotlin.idea.core.ShortenReferences.shortenReferencesInFile(ShortenReferences.kt:828)
	at org.jetbrains.kotlin.idea.core.ShortenReferences.process(ShortenReferences.kt:183)
	at org.jetbrains.kotlin.idea.core.ShortenReferences.process(ShortenReferences.kt:105)
	at org.jetbrains.kotlin.idea.core.ShortenReferences.process(ShortenReferences.kt:113)
	at org.jetbrains.kotlin.idea.core.ShortenReferences.process$default(ShortenReferences.kt:111)
	at com.github.developerutils.kotlinfunctionargumentshelper.AddArgumentsQuickFix.fillArguments(AddArgumentsQuickFix.kt:53)
	at com.github.developerutils.kotlinfunctionargumentshelper.AddArgumentsQuickFix.createDefaultValueArgument(AddArgumentsQuickFix.kt:84)
	at com.github.developerutils.kotlinfunctionargumentshelper.AddArgumentsQuickFix.fillArguments(AddArgumentsQuickFix.kt:50)
	at com.github.developerutils.kotlinfunctionargumentshelper.AddArgumentsQuickFix.applyFix(AddArgumentsQuickFix.kt:39)
	at com.github.developerutils.kotlinfunctionargumentshelper.AddArgumentsQuickFix.applyFix(AddArgumentsQuickFix.kt:26)
	at com.intellij.codeInspection.ex.QuickFixWrapper.invoke(QuickFixWrapper.java:74)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.lambda$invoke$0(IntentionActionWithTextCaching.java:229)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:147)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:229)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java:263)
	at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:86)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:935)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:961)
	at com.intellij.openapi.application.WriteAction.run(WriteAction.java:85)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:263)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:239)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:238)
	at com.intellij.codeInsight.intention.impl.IntentionListStep.chooseActionAndInvoke(IntentionListStep.java:134)
	at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$3(IntentionListStep.java:126)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
	at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1508)
	at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101)
	at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:186)
	at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:175)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36)
	at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1505)
	at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:164)
	at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326)
	at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:136)
	at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:166)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:169)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:157)
	at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:268)
	at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:433)
	at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:405)
	at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:356)
	at com.intellij.ui.popup.list.ListPopupImpl$1.actionPerformed(ListPopupImpl.java:270)
	at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:380)
	at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:356)
	at com.intellij.ui.popup.PopupDispatcher.dispatchKeyEvent(PopupDispatcher.java:112)
	at com.intellij.ui.popup.PopupDispatcher.dispatch(PopupDispatcher.java:148)
	at com.intellij.ide.IdePopupManager.dispatch(IdePopupManager.java:101)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:724)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Add arguments here:

return UploadRequestResponse(
            data = UploadRequestResponse2(
                id = "",
                type = "",
                attributes = UploadRequestResponse2Attributes(url = URL("http://localhost"))
            )
        )
data class UploadRequestResponse(
    val data: UploadRequestResponse2
)

data class UploadRequestResponse2(
    val id: String,
    val type: String,
    val attributes: UploadRequestResponse2Attributes
)

data class UploadRequestResponse2Attributes(
    val url: URL
)

"Put arguments on separate lines" toggle

Please could you make it possible to toggle the behaviour so that arguments could be, by default, on separate lines?

(Thanks for your great plugin, I use it many times a day)

Add support for IJ 2021.1 EAP

Plugin stopped working after upgrading to the latest EAP

IntelliJ IDEA 2021.1 EAP (Ultimate Edition)
Build #IU-211.4961.30, built on January 26, 2021
Runtime version: 11.0.9.1+11-b1257.1 x86_64
macOS 10.15.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.