I'm a backend developer that mainly uses Python... And secretly loves Kotlin, but don't tell anyone! I also
play around with Rust sometimes.
π Lately, I've been focused on
developing Python Inlay Params plugin.
- Russian π·πΊ
- English πΊπΈ
A PyCharm plugin that implements inlay parameter and type annotation hints for Python.
Home Page: https://plugins.jetbrains.com/plugin/19538
License: MIT License
I'm a backend developer that mainly uses Python... And secretly loves Kotlin, but don't tell anyone! I also
play around with Rust sometimes.
π Lately, I've been focused on
developing Python Inlay Params plugin.
I'm getting plugin exceptions when opening certain Python modules, in particular this one. Commenting out the highlighted line (a global var: set[SomeClass] = set()
assignment) and restarting doesn't produce an error.
java.lang.ClassCastException: class com.jetbrains.python.psi.types.PyClassTypeImpl cannot be cast to class com.jetbrains.python.psi.types.PyCollectionType (com.jetbrains.python.psi.types.PyClassTypeImpl and com.jetbrains.python.psi.types.PyCollectionType are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @7af406aa) at space.whitememory.pythoninlayparams.types.hints.HintResolver$SET_HINT.shouldShowTypeHint(HintResolver.kt:274) at space.whitememory.pythoninlayparams.types.hints.HintResolver$CLASS_HINT.shouldShowTypeHint(HintResolver.kt:181) at space.whitememory.pythoninlayparams.types.hints.HintResolver$CLASS_HINT.shouldShowTypeHint(HintResolver.kt:169) at space.whitememory.pythoninlayparams.types.hints.HintResolver$Companion.resolve(HintResolver.kt:379) at space.whitememory.pythoninlayparams.types.variables.PythonVariablesInlayTypeHintsCollector.collect(PythonVariablesInlayTypeHintsCollector.kt:29) at com.intellij.codeInsight.hints.CollectorWithSettings.collectHints(InlayHintsUtils.kt:92) at com.intellij.codeInsight.hints.InlayHintsPass.doCollectInformation$lambda$0(InlayHintsPass.kt:47) at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1086) at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:589) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:664) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:620) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:588) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104) at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:86) at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:60) at com.intellij.codeInsight.hints.InlayHintsPass.doCollectInformation(InlayHintsPass.kt:38) at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:379) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1086) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:371) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:589) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:664) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:620) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:588) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:370) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:346) at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:173) at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:344) at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
some_global: set[str] = set()
second = some_global.add('45')
java.lang.ClassCastException: class com.jetbrains.python.psi.types.PyNoneType cannot be cast to class com.jetbrains.python.psi.types.PyCollectionType (com.jetbrains.python.psi.types.PyNoneType and com.jetbrains.python.psi.types.PyCollectionType are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1cec1b35) at space.whitememory.pythoninlayparams.types.hints.HintResolver$SET_HINT.shouldShowTypeHint(HintResolver.kt:274) at space.whitememory.pythoninlayparams.types.hints.HintResolver$Companion.resolve(HintResolver.kt:379) at space.whitememory.pythoninlayparams.types.variables.PythonVariablesInlayTypeHintsCollector.collect(PythonVariablesInlayTypeHintsCollector.kt:29) at com.intellij.codeInsight.hints.CollectorWithSettings.collectHints(InlayHintsUtils.kt:92) at com.intellij.codeInsight.hints.InlayHintsPass.doCollectInformation$lambda$0(InlayHintsPass.kt:47) at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1086) at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:589) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:664) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:620) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:588) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104) at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:86) at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:60) at com.intellij.codeInsight.hints.InlayHintsPass.doCollectInformation(InlayHintsPass.kt:38) at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:379) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1086) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:371) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:589) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:664) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:620) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:588) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:370) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:346) at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:173) at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:344) at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Sometimes we get unexpected error when overflow recursion limit, need to research and catch this error
When we have code like
def __init__(self, value: List[str] = None):
value = value or []
In this case we get type hint List[str] | list | None
which is not valid expression
Current method of resolving built-in types is not well optimised. Need refactor
Hi!
Can please hint for single argument be added?
As for now only 2+ arguments are hinted.
Other IDE's (IntelliJ IDEA, Rider, etc) support for browsing of type by click on it by CMD\Control + Left Mouse Click combination. Need to recreate this functionality in this plugin
When we have code like
value = -1
We get type hint int
which is invalid, because we see that is explicit expression
Currently module don't work with async functions, because they are returned AsyncGenerator
since the last update of IntelliJ in 2023.3 (233.11799.241)
the plug-ins has stopped working.
IntelliJ IDEA 2023.3 (Ultimate Edition)
Build #IU-233.11799.241, built on December 2, 2023
Runtime version: 17.0.9+7-b1087.7 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.1.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Kotlin: 233.11799.241-IJ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.