-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(intellij): add freezed support (#3537)
- Loading branch information
1 parent
c353afb
commit acad4ed
Showing
39 changed files
with
251 additions
and
165 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...ator_plugin/src/main/java/com/bloc/intellij_generator_plugin/action/BlocTemplateType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.bloc.intellij_generator_plugin.action; | ||
|
||
public enum BlocTemplateType { | ||
BASIC, | ||
EQUATABLE, | ||
FREEZED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
...plugin/src/main/java/com/bloc/intellij_generator_plugin/generator/BlocGeneratorFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.bloc.intellij_generator_plugin.generator | ||
|
||
import com.bloc.intellij_generator_plugin.action.BlocTemplateType | ||
import com.bloc.intellij_generator_plugin.generator.components.BlocEventGenerator | ||
import com.bloc.intellij_generator_plugin.generator.components.BlocGenerator | ||
import com.bloc.intellij_generator_plugin.generator.components.BlocStateGenerator | ||
|
||
object BlocGeneratorFactory { | ||
fun getBlocGenerators(name: String, useEquatable: Boolean): List<com.bloc.intellij_generator_plugin.generator.BlocGenerator> { | ||
val bloc = BlocGenerator(name, useEquatable) | ||
val event = BlocEventGenerator(name, useEquatable) | ||
val state = BlocStateGenerator(name, useEquatable) | ||
fun getBlocGenerators(name: String, blocTemplateType: BlocTemplateType): List<com.bloc.intellij_generator_plugin.generator.BlocGenerator> { | ||
val bloc = BlocGenerator(name, blocTemplateType) | ||
val event = BlocEventGenerator(name, blocTemplateType) | ||
val state = BlocStateGenerator(name, blocTemplateType) | ||
return listOf(bloc, event, state) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
...lugin/src/main/java/com/bloc/intellij_generator_plugin/generator/CubitGeneratorFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package com.bloc.intellij_generator_plugin.generator | ||
|
||
import com.bloc.intellij_generator_plugin.action.BlocTemplateType | ||
import com.bloc.intellij_generator_plugin.generator.components.CubitGenerator | ||
import com.bloc.intellij_generator_plugin.generator.components.CubitStateGenerator | ||
|
||
object CubitGeneratorFactory { | ||
fun getCubitGenerators(name: String, useEquatable: Boolean): List<com.bloc.intellij_generator_plugin.generator.CubitGenerator> { | ||
val cubit = CubitGenerator(name, useEquatable) | ||
val state = CubitStateGenerator(name, useEquatable) | ||
fun getCubitGenerators(name: String, blocTemplateType: BlocTemplateType): List<com.bloc.intellij_generator_plugin.generator.CubitGenerator> { | ||
val cubit = CubitGenerator(name, blocTemplateType) | ||
val state = CubitStateGenerator(name, blocTemplateType) | ||
return listOf(cubit, state) | ||
} | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
...c/main/java/com/bloc/intellij_generator_plugin/generator/components/BlocEventGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package com.bloc.intellij_generator_plugin.generator.components | ||
|
||
import com.bloc.intellij_generator_plugin.action.BlocTemplateType | ||
import com.bloc.intellij_generator_plugin.generator.BlocGenerator | ||
|
||
class BlocEventGenerator( | ||
blocName: String, | ||
blocShouldUseEquatable: Boolean | ||
) : BlocGenerator(blocName, blocShouldUseEquatable, templateName = "bloc_event") { | ||
blocName: String, | ||
blocTemplateType: BlocTemplateType | ||
) : BlocGenerator(blocName, blocTemplateType, templateName = "bloc_event") { | ||
|
||
override fun fileName() = "${snakeCase()}_event.${fileExtension()}" | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
...in/src/main/java/com/bloc/intellij_generator_plugin/generator/components/BlocGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.bloc.intellij_generator_plugin.generator.components | ||
|
||
import com.bloc.intellij_generator_plugin.action.BlocTemplateType | ||
import com.bloc.intellij_generator_plugin.generator.BlocGenerator | ||
|
||
class BlocGenerator( | ||
name: String, | ||
useEquatable: Boolean | ||
) : BlocGenerator(name, useEquatable, templateName = "bloc") { | ||
name: String, | ||
blocTemplateType: BlocTemplateType | ||
) : BlocGenerator(name, blocTemplateType, templateName = "bloc") { | ||
override fun fileName() = "${snakeCase()}_bloc.${fileExtension()}" | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
...c/main/java/com/bloc/intellij_generator_plugin/generator/components/BlocStateGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.bloc.intellij_generator_plugin.generator.components | ||
|
||
import com.bloc.intellij_generator_plugin.action.BlocTemplateType | ||
import com.bloc.intellij_generator_plugin.generator.BlocGenerator | ||
|
||
class BlocStateGenerator( | ||
name: String, | ||
useEquatable: Boolean | ||
) : BlocGenerator(name, useEquatable, templateName = "bloc_state") { | ||
name: String, | ||
blocTemplateType: BlocTemplateType | ||
) : BlocGenerator(name, blocTemplateType, templateName = "bloc_state") { | ||
override fun fileName() = "${snakeCase()}_state.${fileExtension()}" | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
...n/src/main/java/com/bloc/intellij_generator_plugin/generator/components/CubitGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.bloc.intellij_generator_plugin.generator.components | ||
|
||
import com.bloc.intellij_generator_plugin.action.BlocTemplateType | ||
import com.bloc.intellij_generator_plugin.generator.CubitGenerator | ||
|
||
class CubitGenerator( | ||
name: String, | ||
useEquatable: Boolean | ||
) : CubitGenerator(name, useEquatable, templateName = "cubit") { | ||
name: String, | ||
blocTemplateType: BlocTemplateType | ||
) : CubitGenerator(name, blocTemplateType, templateName = "cubit") { | ||
override fun fileName() = "${snakeCase()}_cubit.${fileExtension()}" | ||
} | ||
} |
Oops, something went wrong.