Skip to content

Commit 29e4726

Browse files
0.9.3
- Fix parsing of tsconfig.app.json - Stop trying to remove /* */ comments - Update Kotlin Fixes #66
1 parent 27e59f0 commit 29e4726

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212

1313
## [Unreleased]
1414

15+
### Changed
16+
17+
- No longer try to remove `/* */` comments from the `tsconfig.json`/`jsconfig.json` files as they can break parsing (#66)
18+
19+
### Fixed
20+
21+
- [Vue] Fix parsing of `tsconfig.app.json` files (#66)
22+
1523
## [0.9.2] - 2024-09-24
1624

1725
### Added

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = com.github.warningimhack3r.intellijshadcnplugin
44
pluginName = intellij-shadcn-plugin
55
pluginRepositoryUrl = https://github.com/WarningImHack3r/intellij-shadcn-plugin
66
# SemVer format -> https://semver.org
7-
pluginVersion = 0.9.2
7+
pluginVersion = 0.9.3
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 223

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ serialization = "1.7.3"
66
# plugins
77
changelog = "2.2.1"
88
intellijPlatform = "2.1.0"
9-
kotlin = "2.0.20"
9+
kotlin = "2.0.21"
1010
kover = "0.8.3"
1111
qodana = "2024.2.3"
1212

src/main/kotlin/com/github/warningimhack3r/intellijshadcnplugin/backend/sources/Source.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ abstract class Source<C : Config>(val project: Project, private val serializer:
108108
protected fun parseTsConfig(config: String, fileName: String = "tsconfig.json"): JsonElement {
109109
// Temporary workaround until kotlinx.serialization is upgraded
110110
val cleanConfig = config
111-
// Remove /* */ comments
112-
.replace(Regex("/\\*.*?\\*/", RegexOption.DOT_MATCHES_ALL), "")
113111
.split("\n").joinToString("\n") { line ->
114112
// Remove // comments
115113
line.substringBefore("//").trim()

src/main/kotlin/com/github/warningimhack3r/intellijshadcnplugin/backend/sources/impl/VueSource.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ open class VueSource(project: Project) : Source<VueConfig>(project, VueConfig.se
5555
val tsConfig = FileManager.getInstance(project).getFileContentsAtPath(tsConfigLocation)
5656
?: throw NoSuchFileException("$tsConfigLocation not found")
5757
val aliasPath = (resolvePath(tsConfig, tsConfigLocation) ?: if (config.typescript) {
58-
resolvePath("tsconfig.app.json", "tsconfig.app.json")
58+
val tsConfigAppLocation = "tsconfig.app.json"
59+
val tsConfigApp = FileManager.getInstance(project).getFileContentsAtPath(tsConfigAppLocation)
60+
?: throw NoSuchFileException("$tsConfigAppLocation not found")
61+
resolvePath(tsConfigApp, tsConfigAppLocation)
5962
} else null) ?: throw Exception("Cannot find alias $alias in $tsConfig")
6063
return aliasPath.replace(Regex("^\\.+/"), "")
6164
.replace(Regex("\\*$"), alias.substringAfter("/")).also {

0 commit comments

Comments
 (0)