Skip to content

Commit b7f712f

Browse files
committed
fix: signature generation of constructors
fix: CHANGELOG.md
1 parent 57b3bc7 commit b7f712f

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
# BDLH Changelog
44

55
## [Unreleased]
6+
### Fixed
7+
- Signature generation of constructor methods
68

79
## [0.3.0]
8-
### Added
9-
- Editor context menu action for copying signature
10+
### Added
11+
- Editor context menu action for copying signature
1012

11-
### Fixed
12-
- Support type erasure
13+
### Fixed
14+
- Support type erasure
1315

14-
### Changed
16+
### Changed
1517
- Change pluginIcon.svg
1618

1719
## [0.2.2]

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
pluginGroup = com.github.ceclin.bdlh
55
pluginName = BDLH
66
# SemVer format -> https://semver.org
7-
pluginVersion = 0.3.0
7+
pluginVersion = 0.3.1
88

99
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
# for insight into build numbers and IntelliJ Platform versions.

src/main/kotlin/com/github/ceclin/bdlh/action/CopySignatureAction.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class CopySignatureAction : AnAction("BDLH: Copy Signature") {
3232
is PsiMethod -> {
3333
val clazz = containingClass?.let { PsiTypesUtil.getClassType(it).jvmCanonicalText }
3434
val params = parameterList.parameters.joinToString(",") { it.type.jvmCanonicalText.toString() }
35-
"<$clazz: ${returnType?.jvmCanonicalText} $name($params)>"
35+
val type = if (isConstructor) "void" else returnType?.jvmCanonicalText
36+
val methodName = if (isConstructor) "<init>" else name
37+
"<$clazz: $type $methodName($params)>"
3638
}
3739
is PsiField -> {
3840
val clazz = containingClass?.let { PsiTypesUtil.getClassType(it).jvmCanonicalText }

0 commit comments

Comments
 (0)