本文整理汇总了Java中com.intellij.lang.LanguageCommenters类的典型用法代码示例。如果您正苦于以下问题:Java LanguageCommenters类的具体用法?Java LanguageCommenters怎么用?Java LanguageCommenters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LanguageCommenters类属于com.intellij.lang包,在下文中一共展示了LanguageCommenters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkCodeTask
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
public static StudyCheckResult checkCodeTask(@NotNull Project project, @NotNull Task task, @NotNull StepicUser user) {
int attemptId = -1;
try {
attemptId = getAttemptId(task);
}
catch (IOException e) {
LOG.warn(e.getMessage());
}
if (attemptId != -1) {
Course course = task.getLesson().getCourse();
Language courseLanguage = course.getLanguageById();
final Editor editor = StudyUtils.getSelectedEditor(project);
if (editor != null) {
String commentPrefix = LanguageCommenters.INSTANCE.forLanguage(courseLanguage).getLineCommentPrefix();
final String answer = commentPrefix + PYCHARM_COMMENT + editor.getDocument().getText();
String defaultLanguage = EduPluginConfigurator.INSTANCE.forLanguage(courseLanguage).getStepikDefaultLanguage();
final StepicWrappers.SubmissionToPostWrapper submissionToPost =
new StepicWrappers.SubmissionToPostWrapper(String.valueOf(attemptId), defaultLanguage, answer);
return doAdaptiveCheck(submissionToPost, attemptId, user.getId());
}
}
else {
LOG.warn("Got an incorrect attempt id: " + attemptId);
}
return new StudyCheckResult(StudyStatus.Unchecked, StudyCheckAction.FAILED_CHECK_LAUNCH);
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:27,代码来源:EduAdaptiveStepicConnector.java
示例2: choiceTask
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@NotNull
private ChoiceTask choiceTask() {
ChoiceTask task = new ChoiceTask(myName);
task.setStepId(myStepId);
task.addTaskText(EduNames.TASK, myStep.text);
final StepicWrappers.AdaptiveAttemptWrapper.Attempt attempt = getAttemptForStep(myStepId, myUserId);
if (attempt != null) {
final StepicWrappers.AdaptiveAttemptWrapper.Dataset dataset = attempt.dataset;
if (dataset != null) {
task.setChoiceVariants(dataset.options);
task.setMultipleChoice(dataset.is_multiple_choice);
}
else {
LOG.warn("Dataset for step " + myStepId + " is null");
}
}
String commentPrefix = LanguageCommenters.INSTANCE.forLanguage(myLanguage).getLineCommentPrefix();
String taskFileName = getTaskFileName(myLanguage);
if (taskFileName != null) {
createMockTaskFile(task, commentPrefix + " you can experiment here, it won't be checked", taskFileName);
}
return task;
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:26,代码来源:EduAdaptiveStepicConnector.java
示例3: getElementsToSurround
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@NotNull
@Override
public PsiElement[] getElementsToSurround(PsiFile file, int startOffset, int endOffset) {
if (startOffset >= endOffset) return PsiElement.EMPTY_ARRAY;
Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(file.getLanguage());
if (commenter == null || commenter.getLineCommentPrefix() == null) return PsiElement.EMPTY_ARRAY;
PsiElement startElement = file.findElementAt(startOffset);
if (startElement instanceof PsiWhiteSpace) startElement = startElement.getNextSibling();
PsiElement endElement = file.findElementAt(endOffset - 1);
if (endElement instanceof PsiWhiteSpace) endElement = endElement.getPrevSibling();
if (startElement != null && endElement != null) {
startElement = findClosestParentAfterLineBreak(startElement);
if (startElement != null) {
endElement = findClosestParentBeforeLineBreak(endElement);
if (endElement != null) {
return adjustRange(startElement, endElement);
}
}
}
return PsiElement.EMPTY_ARRAY;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:CustomFoldingSurroundDescriptor.java
示例4: getCommenter
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Nullable
public static Commenter getCommenter(final PsiFile file, final Editor editor,
final Language lineStartLanguage, final Language lineEndLanguage) {
final FileViewProvider viewProvider = file.getViewProvider();
for (MultipleLangCommentProvider provider : MultipleLangCommentProvider.EP_NAME.getExtensions()) {
if (provider.canProcess(file, viewProvider)) {
return provider.getLineCommenter(file, editor, lineStartLanguage, lineEndLanguage);
}
}
final Language fileLanguage = file.getLanguage();
Language lang = lineStartLanguage == null || LanguageCommenters.INSTANCE.forLanguage(lineStartLanguage) == null ||
fileLanguage.getBaseLanguage() == lineStartLanguage // file language is a more specific dialect of the line language
? fileLanguage
: lineStartLanguage;
if (viewProvider instanceof TemplateLanguageFileViewProvider &&
lang == ((TemplateLanguageFileViewProvider)viewProvider).getTemplateDataLanguage()) {
lang = viewProvider.getBaseLanguage();
}
return LanguageCommenters.INSTANCE.forLanguage(lang);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:CommentByBlockCommentHandler.java
示例5: tryParseCommentContext
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
/**
* Analyzes position at the given offset at the given text and returns information about comments presence and kind there if any.
*
* @param file target file being edited (necessary for language recognition at target offset. Language is necessary
* to get information about specific comment syntax)
* @param chars target text
* @param offset target offset at the given text
* @param lineStartOffset start offset of the line that contains given offset
* @return object that encapsulates information about comments at the given offset at the given text
*/
@NotNull
public static CommentContext tryParseCommentContext(@NotNull PsiFile file, @NotNull CharSequence chars, int offset, int lineStartOffset) {
Commenter langCommenter = LanguageCommenters.INSTANCE.forLanguage(PsiUtilCore.getLanguageAtOffset(file, offset));
final boolean isInsideCommentLikeCode = langCommenter instanceof CodeDocumentationAwareCommenter;
if (!isInsideCommentLikeCode) {
return new CommentContext();
}
final CodeDocumentationAwareCommenter commenter = (CodeDocumentationAwareCommenter)langCommenter;
int commentStartOffset = CharArrayUtil.shiftForward(chars, lineStartOffset, " \t");
boolean docStart = commenter.getDocumentationCommentPrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getDocumentationCommentPrefix());
boolean cStyleStart = commenter.getBlockCommentPrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getBlockCommentPrefix());
boolean docAsterisk = commenter.getDocumentationCommentLinePrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getDocumentationCommentLinePrefix());
final int firstNonSpaceInLine = CharArrayUtil.shiftForward(chars, offset, " \t");
boolean slashSlash = commenter.getLineCommentPrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getLineCommentPrefix())
&& firstNonSpaceInLine < chars.length() && chars.charAt(firstNonSpaceInLine) != '\n';
return new CommentContext(commenter, docStart, cStyleStart, docAsterisk, slashSlash, commentStartOffset);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:CodeDocumentationUtil.java
示例6: tryConvertEndOfLineComment
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
private static void tryConvertEndOfLineComment(Document doc, PsiElement commentElement) {
Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(commentElement.getLanguage());
if (commenter instanceof CodeDocumentationAwareCommenter) {
CodeDocumentationAwareCommenter docCommenter = (CodeDocumentationAwareCommenter) commenter;
String lineCommentPrefix = commenter.getLineCommentPrefix();
String blockCommentPrefix = commenter.getBlockCommentPrefix();
String blockCommentSuffix = commenter.getBlockCommentSuffix();
if (commentElement.getNode().getElementType() == docCommenter.getLineCommentTokenType() &&
blockCommentPrefix != null && blockCommentSuffix != null && lineCommentPrefix != null) {
String commentText = StringUtil.trimStart(commentElement.getText(), lineCommentPrefix);
try {
Project project = commentElement.getProject();
PsiParserFacade parserFacade = PsiParserFacade.SERVICE.getInstance(project);
PsiComment newComment = parserFacade.createBlockCommentFromText(commentElement.getLanguage(), commentText);
commentElement.replace(newComment);
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(doc);
}
catch (IncorrectOperationException e) {
LOG.info("Failed to replace line comment with block comment", e);
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:JoinLinesHandler.java
示例7: getUncommentedText
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Nullable
private static String getUncommentedText(@NotNull final PsiComment comment) {
final PsiFile psiFile = comment.getContainingFile();
final Language language = psiFile.getViewProvider().getBaseLanguage();
final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(language);
if (commenter != null) {
String text = comment.getText();
final String prefix = commenter.getBlockCommentPrefix();
if (prefix != null && text.startsWith(prefix)) {
text = text.substring(prefix.length());
final String suffix = commenter.getBlockCommentSuffix();
if (suffix != null && text.length() > suffix.length()) {
return text.substring(0, text.length() - suffix.length()).trim();
}
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:XmlDeclareIdInCommentAction.java
示例8: getElementsToSurround
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@NotNull
@Override
public PsiElement[] getElementsToSurround(PsiFile file, int startOffset, int endOffset) {
if (startOffset >= endOffset - 1) return PsiElement.EMPTY_ARRAY;
Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(file.getLanguage());
if (commenter == null || commenter.getLineCommentPrefix() == null) return PsiElement.EMPTY_ARRAY;
PsiElement startElement = file.findElementAt(startOffset);
if (startElement instanceof PsiWhiteSpace) startElement = startElement.getNextSibling();
PsiElement endElement = file.findElementAt(endOffset - 1);
if (endElement instanceof PsiWhiteSpace) endElement = endElement.getPrevSibling();
if (startElement != null && endElement != null) {
if (startElement.getTextRange().getStartOffset() > endElement.getTextRange().getStartOffset()) return PsiElement.EMPTY_ARRAY;
startElement = findClosestParentAfterLineBreak(startElement);
if (startElement != null) {
endElement = findClosestParentBeforeLineBreak(endElement);
if (endElement != null) {
PsiElement commonParent = startElement.getParent();
if (endElement.getParent() == commonParent) {
if (startElement == endElement) return new PsiElement[] {startElement};
return new PsiElement[] {startElement, endElement};
}
}
}
}
return PsiElement.EMPTY_ARRAY;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:CustomFoldingSurroundDescriptor.java
示例9: tryParseCommentContext
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
/**
* Analyzes position at the given offset at the given text and returns information about comments presence and kind there if any.
*
* @param file target file being edited (necessary for language recognition at target offset. Language is necessary
* to get information about specific comment syntax)
* @param chars target text
* @param offset target offset at the given text
* @param lineStartOffset start offset of the line that contains given offset
* @return object that encapsulates information about comments at the given offset at the given text
*/
@NotNull
public static CommentContext tryParseCommentContext(@NotNull PsiFile file, @NotNull CharSequence chars, int offset, int lineStartOffset) {
Commenter langCommenter = LanguageCommenters.INSTANCE.forLanguage(PsiUtilBase.getLanguageAtOffset(file, offset));
final boolean isInsideCommentLikeCode = langCommenter instanceof CodeDocumentationAwareCommenter;
if (!isInsideCommentLikeCode) {
return new CommentContext();
}
final CodeDocumentationAwareCommenter commenter = (CodeDocumentationAwareCommenter)langCommenter;
int commentStartOffset = CharArrayUtil.shiftForward(chars, lineStartOffset, " \t");
boolean docStart = commenter.getDocumentationCommentPrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getDocumentationCommentPrefix());
boolean cStyleStart = commenter.getBlockCommentPrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getBlockCommentPrefix());
boolean docAsterisk = commenter.getDocumentationCommentLinePrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getDocumentationCommentLinePrefix());
final int firstNonSpaceInLine = CharArrayUtil.shiftForward(chars, offset, " \t");
boolean slashSlash = commenter.getLineCommentPrefix() != null
&& CharArrayUtil.regionMatches(chars, commentStartOffset, commenter.getLineCommentPrefix())
&& firstNonSpaceInLine < chars.length() && chars.charAt(firstNonSpaceInLine) != '\n';
return new CommentContext(commenter, docStart, cStyleStart, docAsterisk, slashSlash, commentStartOffset);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:CodeDocumentationUtil.java
示例10: isCommentToken
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
private boolean isCommentToken(PsiElement e, CharSequence token) {
final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(HaxeLanguage.INSTANCE);
assert(commenter instanceof HaxeCommenter);
final IElementType tokenType = e.getNode().getElementType();
if (tokenType == HaxeTokenTypeSets.DOC_COMMENT) {
// XXX: Should we be checking that the token is at the beginning or end of the element?
// Or, that the line prefix is actually the first thing on the line?
return ((HaxeCommenter)commenter).getDocumentationCommentLinePrefix().contentEquals(token)
|| ((HaxeCommenter)commenter).getDocumentationCommentPrefix().contentEquals(token)
|| ((HaxeCommenter)commenter).getDocumentationCommentSuffix().contentEquals(token)
// A lot of folks don't use the proper doc comment terminator "**/", and the compiler
// accepts a normal block comment terminator "*/".
|| commenter.getBlockCommentSuffix().contentEquals(token);
} else if (tokenType == HaxeTokenTypeSets.MML_COMMENT) {
return commenter.getBlockCommentPrefix().contentEquals(token)
|| commenter.getBlockCommentSuffix().contentEquals(token);
}
return commenter.getLineCommentPrefix().contentEquals(token);
}
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:25,代码来源:HaxeCommentSelectioner.java
示例11: getElementsToSurround
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Nonnull
@Override
public PsiElement[] getElementsToSurround(PsiFile file, int startOffset, int endOffset) {
if (startOffset >= endOffset - 1) return PsiElement.EMPTY_ARRAY;
Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(file.getLanguage());
if (commenter == null || commenter.getLineCommentPrefix() == null) return PsiElement.EMPTY_ARRAY;
PsiElement startElement = file.findElementAt(startOffset);
if (startElement instanceof PsiWhiteSpace) startElement = startElement.getNextSibling();
PsiElement endElement = file.findElementAt(endOffset - 1);
if (endElement instanceof PsiWhiteSpace) endElement = endElement.getPrevSibling();
if (startElement != null && endElement != null) {
if (startElement.getTextRange().getStartOffset() > endElement.getTextRange().getStartOffset()) return PsiElement.EMPTY_ARRAY;
startElement = findClosestParentAfterLineBreak(startElement);
if (startElement != null) {
endElement = findClosestParentBeforeLineBreak(endElement);
if (endElement != null) {
PsiElement commonParent = startElement.getParent();
if (endElement.getParent() == commonParent) {
if (startElement == endElement) return new PsiElement[] {startElement};
return new PsiElement[] {startElement, endElement};
}
}
}
}
return PsiElement.EMPTY_ARRAY;
}
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:CustomFoldingSurroundDescriptor.java
示例12: tryConvertEndOfLineComment
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
private static void tryConvertEndOfLineComment(Document doc, PsiElement commentElement) {
Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(commentElement.getLanguage());
if (commenter instanceof CodeDocumentationAwareCommenter) {
CodeDocumentationAwareCommenter docCommenter = (CodeDocumentationAwareCommenter) commenter;
String lineCommentPrefix = commenter.getLineCommentPrefix();
String blockCommentPrefix = commenter.getBlockCommentPrefix();
String blockCommentSuffix = commenter.getBlockCommentSuffix();
if (commentElement.getNode().getElementType() == docCommenter.getLineCommentTokenType() &&
blockCommentPrefix != null && blockCommentSuffix != null && lineCommentPrefix != null) {
String commentText = StringUtil.trimStart(commentElement.getText(), lineCommentPrefix);
try {
Project project = commentElement.getProject();
PsiParserFacade parserFacade = PsiParserFacade.SERVICE.getInstance(project);
PsiComment newComment = parserFacade.createBlockCommentFromText(commentElement.getLanguage(), commentText);
commentElement.replace(newComment);
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(doc);
}
catch (IncorrectOperationException e) {
LOG.info("Failed to replace line comment with block comment", e);
}
}
}
}
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:JoinLinesHandler.java
示例13: theoryTask
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@NotNull
private TheoryTask theoryTask() {
TheoryTask task = new TheoryTask(myName);
task.setStepId(myStepId);
task.addTaskText(EduNames.TASK, myStep.text);
String commentPrefix = LanguageCommenters.INSTANCE.forLanguage(myLanguage).getLineCommentPrefix();
String taskFileName = getTaskFileName(myLanguage);
if (taskFileName != null) {
createMockTaskFile(task, commentPrefix + " this is a theory task. You can use this editor as a playground", taskFileName);
}
return task;
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:14,代码来源:EduAdaptiveStepicConnector.java
示例14: getBlockPrefixSuffixPair
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Nullable
public static Couple<String> getBlockPrefixSuffixPair(@NotNull PsiElement comment) {
final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(comment.getLanguage());
if (commenter != null) {
final String prefix = commenter.getBlockCommentPrefix();
final String suffix = commenter.getBlockCommentSuffix();
if (prefix != null || suffix != null) {
return Couple.of(StringUtil.notNullize(prefix), StringUtil.notNullize(suffix));
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SuppressionUtil.java
示例15: isOneLine
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Override
public boolean isOneLine() {
final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(myHost.getLanguage());
if (commenter instanceof CodeDocumentationAwareCommenter) {
return myHost.getTokenType() == ((CodeDocumentationAwareCommenter) commenter).getLineCommentTokenType();
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CommentLiteralEscaper.java
示例16: isValidFor
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Override
protected boolean isValidFor(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull final PsiFile file) {
final FileType fileType = file.getFileType();
if (fileType instanceof AbstractFileType) {
return ((AbstractFileType)fileType).getCommenter() != null;
}
Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(file.getLanguage());
if (commenter == null) commenter = LanguageCommenters.INSTANCE.forLanguage(file.getViewProvider().getBaseLanguage());
if (commenter == null) return false;
return commenter.getBlockCommentPrefix() != null && commenter.getBlockCommentSuffix() != null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CommentByBlockCommentAction.java
示例17: isValidFor
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Override
protected boolean isValidFor(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull final PsiFile file) {
final FileType fileType = file.getFileType();
if (fileType instanceof AbstractFileType) {
return ((AbstractFileType)fileType).getCommenter() != null;
}
if (LanguageCommenters.INSTANCE.forLanguage(file.getLanguage()) != null ||
LanguageCommenters.INSTANCE.forLanguage(file.getViewProvider().getBaseLanguage()) != null) return true;
PsiElement host = InjectedLanguageManager.getInstance(project).getInjectionHost(file);
return host != null && LanguageCommenters.INSTANCE.forLanguage(host.getLanguage()) != null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CommentByLineCommentAction.java
示例18: canSelect
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
@Override
public boolean canSelect(PsiElement e) {
if (e instanceof PsiComment) {
final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(e.getLanguage());
if (!(commenter instanceof CodeDocumentationAwareCommenter)) return true;
return !((CodeDocumentationAwareCommenter) commenter).isDocumentationComment((PsiComment)e);
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:LineCommentSelectioner.java
示例19: ArrangementSectionRuleManager
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
private ArrangementSectionRuleManager(@NotNull Language language,
@NotNull ArrangementStandardSettingsManager settingsManager,
@NotNull ArrangementColorsProvider colorsProvider,
@NotNull ArrangementSectionRulesControl control) {
myCommenter = LanguageCommenters.INSTANCE.forLanguage(language);
myControl = control;
final List<CompositeArrangementSettingsToken> tokens = ContainerUtil.newArrayList();
tokens.add(new CompositeArrangementSettingsToken(TYPE, ContainerUtil.newArrayList(START_SECTION, END_SECTION)));
tokens.add(new CompositeArrangementSettingsToken(TEXT));
myEditor = new ArrangementMatchingRuleEditor(settingsManager, tokens, colorsProvider, control);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ArrangementSectionRuleManager.java
示例20: hasAnyDocAwareCommenters
import com.intellij.lang.LanguageCommenters; //导入依赖的package包/类
private static boolean hasAnyDocAwareCommenters() {
final Collection<Language> languages = Language.getRegisteredLanguages();
for (Language language : languages) {
final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(language);
if (commenter instanceof CodeDocumentationAwareCommenter) {
final CodeDocumentationAwareCommenter docCommenter = (CodeDocumentationAwareCommenter)commenter;
if (docCommenter.getDocumentationCommentLinePrefix() != null) {
return true;
}
}
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:EditorSmartKeysConfigurable.java
注:本文中的com.intellij.lang.LanguageCommenters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论