Skip to content

Commit 3136981

Browse files
committed
Штатный комментер
1 parent ed7c8e4 commit 3136981

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* This file is a part of IntelliJ Language 1C (BSL) Plugin.
3+
*
4+
* Copyright © 2018
5+
* Alexey Sosnoviy <labotamy@yandex.ru>, Nikita Gryzlov <nixel2007@gmail.com>
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* IntelliJ Language 1C (BSL) Plugin is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* IntelliJ Language 1C (BSL) Plugin is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with IntelliJ Language 1C (BSL) Plugin.
21+
*/
22+
package org.github._1c_syntax.intellij.bsl;
23+
24+
import com.intellij.lang.Commenter;
25+
import org.jetbrains.annotations.Nullable;
26+
27+
public class BSLCommenter implements Commenter {
28+
29+
@Nullable
30+
@Override
31+
public String getLineCommentPrefix() {
32+
return "//";
33+
}
34+
35+
@Nullable
36+
@Override
37+
public String getBlockCommentPrefix() {
38+
return null;
39+
}
40+
41+
@Nullable
42+
@Override
43+
public String getBlockCommentSuffix() {
44+
return null;
45+
}
46+
47+
@Nullable
48+
@Override
49+
public String getCommentedBlockCommentPrefix() {
50+
return "//";
51+
}
52+
53+
@Nullable
54+
@Override
55+
public String getCommentedBlockCommentSuffix() {
56+
return null;
57+
}
58+
}

intellij-bsl/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<fileTypeFactory implementation="org.github._1c_syntax.intellij.bsl.files.BSLFileTypeFactory"/>
5252
<lang.parserDefinition language="BSL" implementationClass="org.github._1c_syntax.intellij.bsl.BSLParserDefinition"/>
5353
<lang.syntaxHighlighterFactory language="BSL" implementationClass="org.github._1c_syntax.intellij.bsl.BSLSyntaxHighlighterFactory"/>
54+
<lang.commenter language="BSL" implementationClass="org.github._1c_syntax.intellij.bsl.BSLCommenter"/>
5455
<applicationConfigurable groupId="language" displayName="1C (BSL)" id="BSLConfigurable" instance="org.github._1c_syntax.intellij.bsl.settings.BSLConfigurable"/>
5556
<applicationService serviceImplementation="org.github._1c_syntax.intellij.bsl.settings.LanguageServerSettingsState"/>
5657
</extensions>

0 commit comments

Comments
 (0)