mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make sure ChunkExtractor won't be called for binary files
This commit is contained in:
@@ -116,6 +116,7 @@ public class ChunkExtractor {
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -520,13 +520,12 @@ public class UsageInfo2UsageAdapter implements UsageInModule,
|
||||
PsiFile file = getPsiFile();
|
||||
|
||||
if (file != null) {
|
||||
ChunkExtractor extractor = ChunkExtractor.getExtractor(file);
|
||||
Segment segment = getFirstSegment();
|
||||
|
||||
if (segment != null) {
|
||||
Document document = PsiDocumentManager.getInstance(getProject()).getDocument(file);
|
||||
|
||||
if (document != null) {
|
||||
ChunkExtractor extractor = ChunkExtractor.getExtractor(file);
|
||||
SmartList<TextChunk> chunks = new SmartList<TextChunk>();
|
||||
extractor.createTextChunks(
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user