本文整理汇总了Java中com.intellij.codeHighlighting.TextEditorHighlightingPass类的典型用法代码示例。如果您正苦于以下问题:Java TextEditorHighlightingPass类的具体用法?Java TextEditorHighlightingPass怎么用?Java TextEditorHighlightingPass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextEditorHighlightingPass类属于com.intellij.codeHighlighting包,在下文中一共展示了TextEditorHighlightingPass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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);
}
}
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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);
}
示例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());
}
示例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);
}
示例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());
}