-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial support for build.gradle.kts
- Loading branch information
Showing
7 changed files
with
120 additions
and
23 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
plugin/src/main/java/org/jetbrains/plugins/gradle/kotlin/KotlinScriptGradleFileType.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,38 @@ | ||
package org.jetbrains.plugins.gradle.kotlin; | ||
|
||
import consulo.gradle.icon.GradleIconGroup; | ||
import consulo.language.file.LanguageFileType; | ||
import consulo.language.plain.PlainTextLanguage; | ||
import consulo.localize.LocalizeValue; | ||
import consulo.ui.image.Image; | ||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* @author VISTALL | ||
* @since 2024-12-24 | ||
*/ | ||
public class KotlinScriptGradleFileType extends LanguageFileType { | ||
public static final KotlinScriptGradleFileType INSTANCE = new KotlinScriptGradleFileType(); | ||
|
||
public KotlinScriptGradleFileType() { | ||
super(PlainTextLanguage.INSTANCE); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getId() { | ||
return "KOTLIN_GRADLE"; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public LocalizeValue getDescription() { | ||
return LocalizeValue.of("Kotlin Gradle File"); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Image getIcon() { | ||
return GradleIconGroup.kotlingradlescript(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../src/main/java/org/jetbrains/plugins/gradle/kotlin/KotlinScriptGradleFileTypeFactory.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,29 @@ | ||
package org.jetbrains.plugins.gradle.kotlin; | ||
|
||
import consulo.annotation.component.ExtensionImpl; | ||
import consulo.gradle.GradleConstants; | ||
import consulo.virtualFileSystem.fileType.FileNameMatcherFactory; | ||
import consulo.virtualFileSystem.fileType.FileTypeConsumer; | ||
import consulo.virtualFileSystem.fileType.FileTypeFactory; | ||
import jakarta.annotation.Nonnull; | ||
import jakarta.inject.Inject; | ||
|
||
/** | ||
* @author VISTALL | ||
* @since 2024-12-24 | ||
*/ | ||
@ExtensionImpl | ||
public class KotlinScriptGradleFileTypeFactory extends FileTypeFactory { | ||
private final FileNameMatcherFactory myFileNameMatcherFactory; | ||
|
||
@Inject | ||
public KotlinScriptGradleFileTypeFactory(FileNameMatcherFactory fileNameMatcherFactory) { | ||
myFileNameMatcherFactory = fileNameMatcherFactory; | ||
} | ||
|
||
@Override | ||
public void createFileTypes(@Nonnull FileTypeConsumer fileTypeConsumer) { | ||
fileTypeConsumer.consume(KotlinScriptGradleFileType.INSTANCE, | ||
myFileNameMatcherFactory.createExactFileNameMatcher(GradleConstants.KOTLIN_DSL_SCRIPT_NAME)); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
...n/resources/ICON-LIB/dark/consulo.gradle.GradleIconGroup/kotlinGradleScript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
.../resources/ICON-LIB/light/consulo.gradle.GradleIconGroup/kotlinGradleScript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.