本文整理汇总了Java中com.intellij.openapi.fileTypes.PlainSyntaxHighlighter类的典型用法代码示例。如果您正苦于以下问题:Java PlainSyntaxHighlighter类的具体用法?Java PlainSyntaxHighlighter怎么用?Java PlainSyntaxHighlighter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlainSyntaxHighlighter类属于com.intellij.openapi.fileTypes包,在下文中一共展示了PlainSyntaxHighlighter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ChunkExtractor
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
private ChunkExtractor(@NotNull PsiFile file) {
myColorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
Project project = file.getProject();
myDocument = PsiDocumentManager.getInstance(project).getDocument(file);
LOG.assertTrue(myDocument != null);
final FileType fileType = file.getFileType();
SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, file.getVirtualFile());
highlighter = highlighter == null ? new PlainSyntaxHighlighter() : highlighter;
myHighlighter = new SyntaxHighlighterOverEditorHighlighter(highlighter, file.getVirtualFile(), project);
myDocumentStamp = -1;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ChunkExtractor.java
示例2: getSyntaxHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@NotNull
@Override
public SyntaxHighlighter getSyntaxHighlighter(Project project, VirtualFile virtualFile) {
final boolean schema = virtualFile != null && virtualFile.getFileType() == JSGraphQLSchemaFileType.INSTANCE;
if(project == null) {
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
if(openProjects.length > 0) {
project = openProjects[0];
} else {
// can't syntax highlight GraphQL without a project to associate the language service instance to
return new PlainSyntaxHighlighter();
}
}
return new JSGraphQLSyntaxHighlighter(project, schema);
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:16,代码来源:JSGraphQLSyntaxHighlighterFactory.java
示例3: ChunkExtractor
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
private ChunkExtractor(@NotNull PsiFile file) {
myColorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
Project project = file.getProject();
myDocument = PsiDocumentManager.getInstance(project).getDocument(file);
LOG.assertTrue(myDocument != null);
final FileType fileType = file.getFileType();
final SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, file.getVirtualFile());
myHighlighter = highlighter == null ? new PlainSyntaxHighlighter() : highlighter;
myLexer = myHighlighter.getHighlightingLexer();
myLexer.start(myDocument.getCharsSequence());
myDocumentStamp = myDocument.getModificationStamp();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:ChunkExtractor.java
示例4: ChunkExtractor
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
private ChunkExtractor(@Nonnull PsiFile file) {
myColorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
Project project = file.getProject();
myDocument = PsiDocumentManager.getInstance(project).getDocument(file);
LOG.assertTrue(myDocument != null);
final FileType fileType = file.getFileType();
SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, file.getVirtualFile());
highlighter = highlighter == null ? new PlainSyntaxHighlighter() : highlighter;
myHighlighter = new SyntaxHighlighterOverEditorHighlighter(highlighter, file.getVirtualFile(), project);
myDocumentStamp = -1;
}
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:ChunkExtractor.java
示例5: isPlain
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
public boolean isPlain() {
return myHighlighter instanceof PlainSyntaxHighlighter;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:LexerEditorHighlighter.java
示例6: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@NotNull
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DebuggerColorsPage.java
示例7: setHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
private static void setHighlighter(EditorEx editor, @Nullable SyntaxHighlighter highlighter) {
EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
LayeredLexerEditorHighlighter layeredHighlighter = new LayeredLexerEditorHighlighter(new TemplateHighlighter(), editorColorsScheme);
layeredHighlighter.registerLayer(TemplateTokenType.TEXT, new LayerDescriptor(ObjectUtils.notNull(highlighter, new PlainSyntaxHighlighter()), ""));
editor.setHighlighter(layeredHighlighter);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:TemplateEditorUtil.java
示例8: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DefaultLanguageColorsPage.java
示例9: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@Override
@NotNull
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:GeneralColorsPage.java
示例10: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@Override
@NotNull
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ANSIColoredConsoleColorsPage.java
示例11: getSyntaxHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
/**
* Gets the syntax highlighter for the specified project and file.
*
* @param project The project.
* @param virtualFile The file.
* @return The syntax highlighter.
*/
@Override
public SyntaxHighlighter getSyntaxHighlighter(
final Project project,
final VirtualFile virtualFile) {
@Nullable ILanguageImpl implementation = null;
@Nullable final FileObject file = this.resourceService.resolve(virtualFile);
if (file != null) {
try {
implementation = this.identifierService.identify(file);
} catch (IllegalStateException ex) {
// Multiple possible languages identified
// (e.g. when different languages have the same extension,
// such as TypeScript and TS both having .ts extension)
// TODO: Better error message,
// but to do that the exception needs to have its own class (derived from IllegalStateException)
// that contains a list of languages.
Notification notification = NotificationUtils.METABORG_NOTIFICATIONS.createNotification(ex.getMessage(), NotificationType.ERROR);
NotificationUtils.INSTANCE.notify(project, notification);
implementation = null;
}
}
else if (virtualFile instanceof LightVirtualFile) {
final com.intellij.lang.Language ideaLanguage = ((LightVirtualFile)virtualFile).getLanguage();
if (ideaLanguage instanceof MetaborgIdeaLanguage) {
final ILanguage language = this.languageManager.getLanguage((MetaborgIdeaLanguage)ideaLanguage);
implementation = language.activeImpl();
}
}
if (implementation == null){
// We don't know the language, so
// let's return the plain syntax highlighter instead.
return new PlainSyntaxHighlighter();
}
@Nullable final IProject metaborgProject = null; // FIXME: Get IProject from Project
final SpoofaxTokenTypeManager tokenTypesManager =
this.bindingManager.getTokenTypeManager(implementation.belongsTo());
final Lexer lexer = this.highlightingLexerFactory
.create(file, metaborgProject, implementation, tokenTypesManager);
return new SpoofaxSyntaxHighlighter(lexer);
}
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:54,代码来源:SpoofaxSyntaxHighlighterFactory.java
示例12: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@NotNull
@Override
public SyntaxHighlighter getHighlighter()
{
return new PlainSyntaxHighlighter();
}
开发者ID:consulo,项目名称:consulo-play,代码行数:7,代码来源:PlayJavaColorSettingsPage.java
示例13: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:DebuggerColorsPage.java
示例14: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@Nonnull
@Override
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:DefaultLanguageColorsPage.java
示例15: getHighlighter
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter; //导入依赖的package包/类
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:ANSIColoredConsoleColorsPage.java
注:本文中的com.intellij.openapi.fileTypes.PlainSyntaxHighlighter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论