本文整理汇总了Java中com.intellij.codeHighlighting.TextEditorHighlightingPass类的典型用法代码示例。如果您正苦于以下问题:Java TextEditorHighlightingPass类的具体用法?Java TextEditorHighlightingPass怎么用?Java TextEditorHighlightingPass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextEditorHighlightingPass类属于com.intellij.codeHighlighting包,在下文中一共展示了TextEditorHighlightingPass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPasses
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@NotNull
List<TextEditorHighlightingPass> getPasses(@NotNull int[] passesToIgnore) {
if (myProject.isDisposed()) return Collections.emptyList();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
renewFile();
if (myFile == null) return Collections.emptyList();
if (myCompiled) {
passesToIgnore = EXCEPT_OVERRIDDEN;
}
else if (!DaemonCodeAnalyzer.getInstance(myProject).isHighlightingAvailable(myFile)) {
return Collections.emptyList();
}
TextEditorHighlightingPassRegistrarEx passRegistrar = TextEditorHighlightingPassRegistrarEx.getInstanceEx(myProject);
return passRegistrar.instantiatePasses(myFile, myEditor, passesToIgnore);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TextEditorBackgroundHighlighter.java
示例2: findOrCreatePredecessorPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
private ScheduledPass findOrCreatePredecessorPass(@NotNull FileEditor fileEditor,
@NotNull Map<Pair<FileEditor, Integer>, ScheduledPass> toBeSubmitted,
@NotNull List<TextEditorHighlightingPass> textEditorHighlightingPasses,
@NotNull List<ScheduledPass> freePasses,
@NotNull List<ScheduledPass> dependentPasses,
@NotNull DaemonProgressIndicator updateProgress,
@NotNull AtomicInteger myThreadsToStartCountdown,
final int predecessorId) {
Pair<FileEditor, Integer> predKey = Pair.create(fileEditor, predecessorId);
ScheduledPass predecessor = toBeSubmitted.get(predKey);
if (predecessor == null) {
TextEditorHighlightingPass textEditorPass = findPassById(predecessorId, textEditorHighlightingPasses);
predecessor = textEditorPass == null ? null : createScheduledPass(fileEditor, textEditorPass, toBeSubmitted, textEditorHighlightingPasses, freePasses,
dependentPasses, updateProgress, myThreadsToStartCountdown);
}
return predecessor;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PassExecutorService.java
示例3: log
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
static void log(ProgressIndicator progressIndicator, TextEditorHighlightingPass pass, @NonNls @NotNull Object... info) {
if (LOG.isDebugEnabled()) {
CharSequence docText = pass == null ? "" : StringUtil.first(pass.getDocument().getCharsSequence(), 10, true);
synchronized (PassExecutorService.class) {
StringBuilder s = new StringBuilder();
for (Object o : info) {
s.append(o).append(" ");
}
String message = StringUtil.repeatSymbol(' ', getThreadNum() * 4)
+ " " + pass + " "
+ s
+ "; progress=" + (progressIndicator == null ? null : progressIndicator.hashCode())
+ " " + (progressIndicator == null ? "?" : progressIndicator.isCanceled() ? "X" : "V")
+ " : '" + docText + "'";
LOG.debug(message);
//System.out.println(message);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PassExecutorService.java
示例4: getPasses
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
public List<TextEditorHighlightingPass> getPasses(@NotNull int[] passesToIgnore) {
if (myProject.isDisposed()) return Collections.emptyList();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
renewFile();
if (myFile == null) return Collections.emptyList();
if (myCompiled) {
passesToIgnore = EXCEPT_OVERRIDDEN;
}
else if (!DaemonCodeAnalyzer.getInstance(myProject).isHighlightingAvailable(myFile)) {
return Collections.emptyList();
}
TextEditorHighlightingPassRegistrarEx passRegistrar = TextEditorHighlightingPassRegistrarEx.getInstanceEx(myProject);
return passRegistrar.instantiatePasses(myFile, myEditor, passesToIgnore);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:TextEditorBackgroundHighlighter.java
示例5: cancelAndRestartDaemonLater
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
static void cancelAndRestartDaemonLater(@NotNull ProgressIndicator progress,
@NotNull final Project project,
@NotNull TextEditorHighlightingPass passCalledFrom) throws ProcessCanceledException {
PassExecutorService.log(progress, passCalledFrom, "Cancel and restart");
progress.cancel();
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(new Random().nextInt(100));
}
catch (InterruptedException e) {
LOG.error(e);
}
DaemonCodeAnalyzer.getInstance(project).restart();
}
}, project.getDisposed());
throw new ProcessCanceledException();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:GeneralHighlightingPass.java
示例6: findOrCreatePredecessorPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
private ScheduledPass findOrCreatePredecessorPass(@NotNull List<FileEditor> fileEditors,
Document document,
@NotNull Map<Pair<Document, Integer>, ScheduledPass> toBeSubmitted,
@NotNull List<TextEditorHighlightingPass> textEditorHighlightingPasses,
@NotNull List<ScheduledPass> freePasses,
@NotNull List<ScheduledPass> dependentPasses,
@NotNull DaemonProgressIndicator updateProgress,
@NotNull AtomicInteger myThreadsToStartCountdown,
final int jobPriority,
final int predecessorId) {
Pair<Document, Integer> predKey = Pair.create(document, predecessorId);
ScheduledPass predecessor = toBeSubmitted.get(predKey);
if (predecessor == null) {
TextEditorHighlightingPass textEditorPass = findPassById(predecessorId, textEditorHighlightingPasses);
predecessor = textEditorPass == null ? null : createScheduledPass(fileEditors, textEditorPass, toBeSubmitted, textEditorHighlightingPasses, freePasses,
dependentPasses, updateProgress, myThreadsToStartCountdown, jobPriority);
}
return predecessor;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:PassExecutorService.java
示例7: getAllSubmittedPasses
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@NotNull
public List<TextEditorHighlightingPass> getAllSubmittedPasses() {
List<TextEditorHighlightingPass> result = new ArrayList<TextEditorHighlightingPass>(mySubmittedPasses.size());
for (ScheduledPass scheduledPass : mySubmittedPasses.keySet()) {
if (!scheduledPass.myUpdateProgress.isCanceled()) {
result.add(scheduledPass.myPass);
}
}
ContainerUtil.quickSort(result, new Comparator<TextEditorHighlightingPass>() {
@Override
public int compare(TextEditorHighlightingPass o1, TextEditorHighlightingPass o2) {
return o1.getId() - o2.getId();
}
});
return result;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:PassExecutorService.java
示例8: log
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
public static void log(ProgressIndicator progressIndicator, TextEditorHighlightingPass pass, @NonNls Object... info) {
if (LOG.isDebugEnabled()) {
String docText = pass == null ? "" : StringUtil.first(pass.getDocument().getText(), 10, true);
synchronized (PassExecutorService.class) {
StringBuilder s = new StringBuilder();
for (Object o : info) {
s.append(o.toString()).append(" ");
}
String message = StringUtil.repeatSymbol(' ', getThreadNum() * 4)
+ " " + pass + " "
+ s
+ "; progress=" + (progressIndicator == null ? null : progressIndicator.hashCode())
+ " " + (progressIndicator == null ? "?" : progressIndicator.isCanceled() ? "X" : "V")
+ " : '" + docText + "'";
LOG.debug(message);
//System.out.println(message);
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:PassExecutorService.java
示例9: getPasses
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Nonnull
List<TextEditorHighlightingPass> getPasses(@Nonnull int[] passesToIgnore) {
if (myProject.isDisposed()) return Collections.emptyList();
Document[] uncommitted = PsiDocumentManager.getInstance(myProject).getUncommittedDocuments();
LOG.assertTrue(uncommitted.length == 0, "Uncommitted documents: " + Arrays.asList(uncommitted));
renewFile();
PsiFile file = myFile;
if (file == null) return Collections.emptyList();
boolean compiled = file instanceof PsiCompiledFile;
if (compiled) {
file = ((PsiCompiledFile)file).getDecompiledPsiFile();
}
if (compiled) {
passesToIgnore = EXCEPT_OVERRIDDEN;
}
else if (!DaemonCodeAnalyzer.getInstance(myProject).isHighlightingAvailable(file)) {
return Collections.emptyList();
}
TextEditorHighlightingPassRegistrarEx passRegistrar = TextEditorHighlightingPassRegistrarEx.getInstanceEx(myProject);
return passRegistrar.instantiatePasses(file, myEditor, passesToIgnore);
}
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:TextEditorBackgroundHighlighter.java
示例10: findOrCreatePredecessorPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
private ScheduledPass findOrCreatePredecessorPass(@Nonnull FileEditor fileEditor,
@Nonnull Map<Pair<FileEditor, Integer>, ScheduledPass> toBeSubmitted,
@Nonnull List<TextEditorHighlightingPass> textEditorHighlightingPasses,
@Nonnull List<ScheduledPass> freePasses,
@Nonnull List<ScheduledPass> dependentPasses,
@Nonnull DaemonProgressIndicator updateProgress,
@Nonnull AtomicInteger myThreadsToStartCountdown,
final int predecessorId) {
Pair<FileEditor, Integer> predKey = Pair.create(fileEditor, predecessorId);
ScheduledPass predecessor = toBeSubmitted.get(predKey);
if (predecessor == null) {
TextEditorHighlightingPass textEditorPass = findPassById(predecessorId, textEditorHighlightingPasses);
predecessor = textEditorPass == null ? null : createScheduledPass(fileEditor, textEditorPass, toBeSubmitted, textEditorHighlightingPasses, freePasses,
dependentPasses, updateProgress, myThreadsToStartCountdown);
}
return predecessor;
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:PassExecutorService.java
示例11: log
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
static void log(ProgressIndicator progressIndicator, TextEditorHighlightingPass pass, @NonNls @Nonnull Object... info) {
if (LOG.isDebugEnabled()) {
CharSequence docText = pass == null || pass.getDocument() == null ? "" : ": '" + StringUtil.first(pass.getDocument().getCharsSequence(), 10, true)+ "'";
synchronized (PassExecutorService.class) {
String infos = StringUtil.join(info, Functions.TO_STRING(), " ");
String message = StringUtil.repeatSymbol(' ', getThreadNum() * 4)
+ " " + pass + " "
+ infos
+ "; progress=" + (progressIndicator == null ? null : progressIndicator.hashCode())
+ " " + (progressIndicator == null ? "?" : progressIndicator.isCanceled() ? "X" : "V")
+ docText;
LOG.debug(message);
//System.out.println(message);
}
}
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:PassExecutorService.java
示例12: createHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
public TextEditorHighlightingPass createHighlightingPass(@NotNull final PsiFile file, @NotNull final Editor editor)
{
if(editor.isOneLineMode())
{
return null;
}
if(!XmlTagTreeHighlightingUtil.isTagTreeHighlightingActive(file))
{
return null;
}
if(!(editor instanceof EditorEx))
{
return null;
}
return new XmlTagTreeHighlightingPass(file, (EditorEx) editor);
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:20,代码来源:XmlTagTreeHighlightingPassFactory.java
示例13: createHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
@Nullable
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
TextRange textRange = FileStatusMap.getDirtyTextRange(editor, Pass.UPDATE_ALL);
if (textRange == null) return new ProgressableTextEditorHighlightingPass.EmptyPass(myProject, editor.getDocument());
ProperTextRange visibleRange = VisibleHighlightingPassFactory.calculateVisibleRange(editor);
return new InjectedGeneralHighlightingPass(myProject, file, editor.getDocument(), textRange.getStartOffset(), textRange.getEndOffset(), true, visibleRange, editor,
new DefaultHighlightInfoProcessor());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:InjectedGeneralHighlightingPassFactory.java
示例14: createMainHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
public TextEditorHighlightingPass createMainHighlightingPass(@NotNull PsiFile file,
@NotNull Document document,
@NotNull HighlightInfoProcessor highlightInfoProcessor) {
return new InjectedGeneralHighlightingPass(myProject, file, document, 0, document.getTextLength(), true, new ProperTextRange(0,document.getTextLength()), null,
highlightInfoProcessor);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:InjectedGeneralHighlightingPassFactory.java
示例15: createHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
@Nullable
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
TextRange textRange = calculateRangeToProcess(editor);
if (textRange == null || !InspectionProjectProfileManager.getInstance(file.getProject()).isProfileLoaded()){
return new ProgressableTextEditorHighlightingPass.EmptyPass(myProject, editor.getDocument());
}
TextRange visibleRange = VisibleHighlightingPassFactory.calculateVisibleRange(editor);
return new MyLocalInspectionsPass(file, editor.getDocument(), textRange, visibleRange, new DefaultHighlightInfoProcessor());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:LocalInspectionsPassFactory.java
示例16: createMainHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
public TextEditorHighlightingPass createMainHighlightingPass(@NotNull PsiFile file,
@NotNull Document document,
@NotNull HighlightInfoProcessor highlightInfoProcessor) {
final TextRange textRange = file.getTextRange();
LOG.assertTrue(textRange != null, "textRange is null for " + file + " (" + PsiUtilCore.getVirtualFile(file) + ")");
return new MyLocalInspectionsPass(file, document, textRange, LocalInspectionsPass.EMPTY_PRIORITY_RANGE, highlightInfoProcessor);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LocalInspectionsPassFactory.java
示例17: createHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
@Nullable
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
final long psiModificationCount = PsiManager.getInstance(myProject).getModificationTracker().getModificationCount();
if (psiModificationCount == myPsiModificationCount) {
return null; //optimization
}
return new WolfHighlightingPass(myProject, editor.getDocument(), file){
@Override
protected void applyInformationWithProgress() {
super.applyInformationWithProgress();
myPsiModificationCount = psiModificationCount;
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:WolfPassFactory.java
示例18: createHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
@Nullable
public TextEditorHighlightingPass createHighlightingPass(@NotNull final PsiFile file, @NotNull final Editor editor) {
TextRange textRange = FileStatusMap.getDirtyTextRange(editor, Pass.LOCAL_INSPECTIONS);
if (textRange == null ||
!InspectionProjectProfileManager.getInstance(file.getProject()).isProfileLoaded() ||
myFileTools.containsKey(file) && !myFileTools.get(file)) {
return null;
}
return new LocalInspectionsPass(file, editor.getDocument(), 0, file.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true,
new DefaultHighlightInfoProcessor()) {
@NotNull
@Override
List<LocalInspectionToolWrapper> getInspectionTools(@NotNull InspectionProfileWrapper profile) {
List<LocalInspectionToolWrapper> tools = super.getInspectionTools(profile);
List<LocalInspectionToolWrapper> result = new ArrayList<LocalInspectionToolWrapper>(tools.size());
for (LocalInspectionToolWrapper tool : tools) {
if (tool.runForWholeFile()) result.add(tool);
}
myFileTools.put(file, !result.isEmpty());
return result;
}
@Override
protected String getPresentableName() {
return DaemonBundle.message("pass.whole.inspections");
}
@Override
void inspectInjectedPsi(@NotNull List<PsiElement> elements,
boolean onTheFly,
@NotNull ProgressIndicator indicator,
@NotNull InspectionManager iManager,
boolean inVisibleRange,
@NotNull List<LocalInspectionToolWrapper> wrappers) {
// already inspected in LIP
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:WholeFileLocalInspectionsPassFactory.java
示例19: createHighlightingPass
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@Override
@Nullable
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
TextRange textRange = calculateRangeToProcess(editor);
if (textRange == null) return null;
return new LineMarkersPass(file.getProject(), file, editor, editor.getDocument(), textRange);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:VisibleLineMarkersPassFactory.java
示例20: getPassesToShowProgressFor
import com.intellij.codeHighlighting.TextEditorHighlightingPass; //导入依赖的package包/类
@NotNull
List<TextEditorHighlightingPass> getPassesToShowProgressFor(Document document) {
List<TextEditorHighlightingPass> allPasses = myPassExecutorService.getAllSubmittedPasses();
List<TextEditorHighlightingPass> result = new ArrayList<TextEditorHighlightingPass>(allPasses.size());
for (TextEditorHighlightingPass pass : allPasses) {
if (pass.getDocument() == document || pass.getDocument() == null) {
result.add(pass);
}
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DaemonCodeAnalyzerImpl.java
注:本文中的com.intellij.codeHighlighting.TextEditorHighlightingPass类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论