Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
7842a54d
Commit
7842a54d
authored
7 years ago
by
Sergey Simonchik
Browse files
Options
Download
Email Patches
Plain Diff
make NORMAL_OUTPUT default; NotNull
parent
6a32004d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
platform/platform-api/src/com/intellij/execution/ui/ConsoleViewContentType.java
+4
-3
...src/com/intellij/execution/ui/ConsoleViewContentType.java
platform/platform-impl/src/com/intellij/execution/impl/ConsoleViewUtil.java
+7
-2
...impl/src/com/intellij/execution/impl/ConsoleViewUtil.java
with
11 additions
and
5 deletions
+11
-5
platform/platform-api/src/com/intellij/execution/ui/ConsoleViewContentType.java
+
4
-
3
View file @
7842a54d
...
...
@@ -21,11 +21,11 @@ import com.intellij.openapi.editor.colors.EditorColorsManager;
import
com.intellij.openapi.editor.colors.TextAttributesKey
;
import
com.intellij.openapi.editor.markup.TextAttributes
;
import
com.intellij.openapi.util.Key
;
import
java.util.HashMap
;
import
org.jetbrains.annotations.NonNls
;
import
org.jetbrains.annotations.NotNull
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
...
...
@@ -101,8 +101,9 @@ public class ConsoleViewContentType {
ourRegisteredTypes
.
put
(
processOutputType
,
attributes
);
}
public
static
synchronized
ConsoleViewContentType
getConsoleViewType
(
final
Key
processOutputType
)
{
return
ourRegisteredTypes
.
getOrDefault
(
processOutputType
,
SYSTEM_OUTPUT
);
@NotNull
public
static
synchronized
ConsoleViewContentType
getConsoleViewType
(
@NotNull
Key
processOutputType
)
{
return
ourRegisteredTypes
.
getOrDefault
(
processOutputType
,
NORMAL_OUTPUT
);
}
public
static
synchronized
Collection
<
ConsoleViewContentType
>
getRegisteredTypes
()
{
...
...
This diff is collapsed.
Click to expand it.
platform/platform-impl/src/com/intellij/execution/impl/ConsoleViewUtil.java
+
7
-
2
View file @
7842a54d
...
...
@@ -15,6 +15,7 @@
*/
package
com.intellij.execution.impl
;
import
com.intellij.execution.process.ProcessOutputTypes
;
import
com.intellij.execution.ui.ConsoleView
;
import
com.intellij.execution.ui.ConsoleViewContentType
;
import
com.intellij.ide.ui.LafManager
;
...
...
@@ -36,6 +37,7 @@ import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Key
;
import
com.intellij.psi.tree.IElementType
;
import
com.intellij.util.ObjectUtils
;
import
com.intellij.util.containers.ConcurrentFactoryMap
;
import
com.intellij.util.containers.ContainerUtil
;
import
com.intellij.util.text.StringTokenizer
;
...
...
@@ -236,8 +238,11 @@ public class ConsoleViewUtil {
@NotNull
public
static
ConsoleViewContentType
getContentTypeForToken
(
@NotNull
IElementType
tokenType
,
@NotNull
SyntaxHighlighter
highlighter
)
{
TextAttributesKey
[]
keys
=
highlighter
.
getTokenHighlights
(
tokenType
);
return
keys
.
length
==
0
?
ConsoleViewContentType
.
NORMAL_OUTPUT
:
ConsoleViewContentType
.
getConsoleViewType
(
ColorCache
.
keys
.
get
(
Arrays
.
asList
(
keys
)));
if
(
keys
.
length
==
0
)
{
return
ConsoleViewContentType
.
NORMAL_OUTPUT
;
}
Key
key
=
ColorCache
.
keys
.
get
(
Arrays
.
asList
(
keys
));
return
ConsoleViewContentType
.
getConsoleViewType
(
ObjectUtils
.
notNull
(
key
,
ProcessOutputTypes
.
STDOUT
));
}
public
static
void
printAsFileType
(
@NotNull
ConsoleView
console
,
@NotNull
String
text
,
@NotNull
FileType
fileType
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment