Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
ee24554e
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ee24554e
编写于
4月 08, 2012
作者:
E
Evgeny Gerashchenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed highlighting of builtin annotations (they were highlighted like keywords).
上级
05fd4600
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
7 deletion
+14
-7
idea/src/org/jetbrains/jet/plugin/highlighter/SoftKeywordsHighlightingVisitor.java
...t/plugin/highlighter/SoftKeywordsHighlightingVisitor.java
+9
-2
idea/testData/highlighter/Functions.kt
idea/testData/highlighter/Functions.kt
+2
-2
idea/testData/highlighter/TypesAndAnnotations.kt
idea/testData/highlighter/TypesAndAnnotations.kt
+3
-3
未找到文件。
idea/src/org/jetbrains/jet/plugin/highlighter/SoftKeywordsHighlightingVisitor.java
浏览文件 @
ee24554e
...
...
@@ -22,8 +22,10 @@ package org.jetbrains.jet.plugin.highlighter;
import
com.intellij.lang.ASTNode
;
import
com.intellij.lang.annotation.AnnotationHolder
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.editor.colors.TextAttributesKey
;
import
com.intellij.psi.PsiElement
;
import
com.intellij.psi.impl.source.tree.LeafPsiElement
;
import
com.intellij.psi.tree.IElementType
;
import
org.jetbrains.jet.lang.psi.*
;
import
org.jetbrains.jet.lexer.JetTokens
;
...
...
@@ -35,8 +37,13 @@ class SoftKeywordsHighlightingVisitor extends HighlightingVisitor {
@Override
public
void
visitElement
(
PsiElement
element
)
{
if
(
element
instanceof
LeafPsiElement
)
{
if
(
JetTokens
.
SOFT_KEYWORDS
.
contains
(((
LeafPsiElement
)
element
).
getElementType
()))
{
holder
.
createInfoAnnotation
(
element
,
null
).
setTextAttributes
(
JetHighlightingColors
.
KEYWORD
);
IElementType
elementType
=
((
LeafPsiElement
)
element
).
getElementType
();
if
(
JetTokens
.
SOFT_KEYWORDS
.
contains
(
elementType
))
{
TextAttributesKey
attributes
=
JetHighlightingColors
.
KEYWORD
;
if
(
JetTokens
.
MODIFIER_KEYWORDS
.
contains
(
elementType
))
{
attributes
=
JetHighlightingColors
.
BUILTIN_ANNOTATION
;
}
holder
.
createInfoAnnotation
(
element
,
null
).
setTextAttributes
(
attributes
);
}
}
}
...
...
idea/testData/highlighter/Functions.kt
浏览文件 @
ee24554e
...
...
@@ -8,8 +8,8 @@ fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">global</info>() {
fun
Int
.<
in
fo
text
AttributesKey
="
KOTLIN_FUNCTION_DECLARATION
"
>
ext
</
info
>()
{
}
<
info
textAttributesKey
=
"KOTLIN_
KEYWORD
"
>
open
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_CLASS"
>
Container
<
/
in
fo
>
{
<
info
textAttributesKey
=
"KOTLIN_
KEYWORD
"
>
open
</
info
>
fun
<
in
fo
text
AttributesKey
="
KOTLIN_FUNCTION_DECLARATION
"
>
member
</
info
>()
{
<
info
textAttributesKey
=
"KOTLIN_
BUILTIN_ANNOTATION
"
>
open
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_CLASS"
>
Container
<
/
in
fo
>
{
<
info
textAttributesKey
=
"KOTLIN_
BUILTIN_ANNOTATION
"
>
open
</
info
>
fun
<
in
fo
text
AttributesKey
="
KOTLIN_FUNCTION_DECLARATION
"
>
member
</
info
>()
{
<
info
textAttributesKey
=
"KOTLIN_NAMESPACE_FUNCTION_CALL"
>
global
</
info
>()
5
.<
info
textAttributesKey
=
"KOTLIN_EXTENSION_FUNCTION_CALL"
>
ext
</
info
>()
<
info
textAttributesKey
=
"KOTLIN_FUNCTION_CALL"
>
member
</
info
>()
...
...
idea/testData/highlighter/TypesAndAnnotations.kt
浏览文件 @
ee24554e
...
...
@@ -4,9 +4,9 @@ trait <info textAttributesKey="KOTLIN_TRAIT">TheTrait</info> {
class
<info text
AttributesKey
=
"KOTLIN_CLASS"
>
TheClass
<
/
in
fo
>
:
<
info
textAttributesKey
=
"KOTLIN_TRAIT"
>
TheTrait
<
/
in
fo
>
{
}
<
info
textAttributesKey
=
"KOTLIN_
KEYWORD
"
>
annotation
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_ANNOTATION"
>
magnificent
</
info
>
<
info
textAttributesKey
=
"KOTLIN_
KEYWORD
"
>
annotation
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_ANNOTATION"
>
deprecated
</
info
>
<
info
textAttributesKey
=
"KOTLIN_
BUILTIN_ANNOTATION
"
>
annotation
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_ANNOTATION"
>
magnificent
</
info
>
<
info
textAttributesKey
=
"KOTLIN_
BUILTIN_ANNOTATION
"
>
annotation
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_ANNOTATION"
>
deprecated
</
info
>
[<info textAttributesKey="KOTLIN_ANNOTATION">deprecated</info>]
<
info
textAttributesKey
=
"KOTLIN_ANNOTATION"
>
magnificent
</
info
>
<
info
textAttributesKey
=
"KOTLIN_
KEYWORD
"
>
abstract
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_ABSTRACT_CLASS"
>
AbstractClass
<
/
in
fo
><<
info
textAttributesKey
=
"KOTLIN_TYPE_PARAMETER"
>
T
<
/
in
fo
>>
{
<
info
textAttributesKey
=
"KOTLIN_ANNOTATION"
>
magnificent
</
info
>
<
info
textAttributesKey
=
"KOTLIN_
BUILTIN_ANNOTATION
"
>
abstract
</
info
>
class
<info text
AttributesKey
=
"KOTLIN_ABSTRACT_CLASS"
>
AbstractClass
<
/
in
fo
><<
info
textAttributesKey
=
"KOTLIN_TYPE_PARAMETER"
>
T
<
/
in
fo
>>
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录