Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/main/kotlin/com/templ/templ/TemplCommenter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.templ.templ

import com.intellij.lang.Commenter
import org.jetbrains.annotations.Nullable


internal class TemplCommenter : Commenter {
override fun getLineCommentPrefix(): String {
return "//"
}

override fun getBlockCommentPrefix(): String {
return "/*"
}

@Nullable
override fun getBlockCommentSuffix(): String {
return "*/"
}

@Nullable
override fun getCommentedBlockCommentPrefix(): String? {
return null
}

@Nullable
override fun getCommentedBlockCommentSuffix(): String? {
return null
}
}
3 changes: 3 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<lang.parserDefinition
language="templ"
implementationClass="com.templ.templ.parsing.TemplParserDefinition"/>
<lang.commenter
language="templ"
implementationClass="com.templ.templ.TemplCommenter"/>
<lang.fileViewProviderFactory language="templ" implementationClass="com.templ.templ.file.TemplFileViewProviderFactory"/>
<editorHighlighterProvider filetype="templ" implementationClass="com.templ.templ.highlighting.TemplEditorHighlighterProvider"/>
<projectService serviceImplementation="com.templ.templ.TemplSettings"/>
Expand Down