Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
1eae2829
F
fsharp
项目概览
dotNET Platform
/
fsharp
11 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1eae2829
编写于
4月 10, 2017
作者:
V
Vasily Kirichenko
提交者:
Kevin Ransom (msft)
4月 10, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix range with step operator coloring (#2826)
上级
d0be5fc5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
14 deletion
+42
-14
src/fsharp/vs/service.fs
src/fsharp/vs/service.fs
+2
-1
vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
+40
-13
未找到文件。
src/fsharp/vs/service.fs
浏览文件 @
1eae2829
...
...
@@ -1579,7 +1579,8 @@ type TypeCheckInfo
|
CNR
(_,
Item
.
Value
KeywordIntrinsicValue
,
ItemOccurence
.
Use
,
_,
_,
_,
m
)
->
Some
(
m
,
SemanticClassificationType
.
IntrinsicFunction
)
|
CNR
(_,
(
Item
.
Value
vref
),
_,
_,
_,
_,
m
)
when
isFunction
g
vref
.
Type
->
if
vref
.
DisplayName
=
"( .. )"
then
None
// the range operator
if
valRefEq
g
g
.
range_op_vref
vref
||
valRefEq
g
g
.
range_step_op_vref
vref
then
None
elif
vref
.
IsPropertyGetterMethod
||
vref
.
IsPropertySetterMethod
then
Some
(
m
,
SemanticClassificationType
.
Property
)
elif
IsOperatorName
vref
.
DisplayName
then
...
...
vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
浏览文件 @
1eae2829
...
...
@@ -288,21 +288,48 @@ module internal Tokenizer =
let
colorMap
=
Array
.
create
textLine
.
Span
.
Length
ClassificationTypeNames
.
Text
let
lineTokenizer
=
sourceTokenizer
.
CreateLineTokenizer
(
lineContents
)
let
tokens
=
ResizeArray
()
let
mutable
tokenInfoOption
=
None
let
previousLexState
=
ref
lexState
let
scanAndColorNextToken
(
lineTokenizer
:
FSharpLineTokenizer
,
lexState
:
Ref
<
FSharpTokenizerLexState
>)
:
Option
<
FSharpTokenInfo
>
=
let
tokenInfoOption
,
nextLexState
=
lineTokenizer
.
ScanToken
(
lexState
.
Value
)
lexState
.
Value
<-
nextLexState
if
tokenInfoOption
.
IsSome
then
let
classificationType
=
compilerTokenToRoslynToken
(
tokenInfoOption
.
Value
.
ColorClass
)
for
i
=
tokenInfoOption
.
Value
.
LeftColumn
to
tokenInfoOption
.
Value
.
RightColumn
do
Array
.
set
colorMap
i
classificationType
tokens
.
Add
tokenInfoOption
.
Value
tokenInfoOption
let
processToken
()
=
let
classificationType
=
compilerTokenToRoslynToken
(
tokenInfoOption
.
Value
.
ColorClass
)
for
i
=
tokenInfoOption
.
Value
.
LeftColumn
to
tokenInfoOption
.
Value
.
RightColumn
do
Array
.
set
colorMap
i
classificationType
tokens
.
Add
tokenInfoOption
.
Value
let
previousLexState
=
ref
lexState
let
mutable
tokenInfoOption
=
scanAndColorNextToken
(
lineTokenizer
,
previousLexState
)
while
tokenInfoOption
.
IsSome
do
tokenInfoOption
<-
scanAndColorNextToken
(
lineTokenizer
,
previousLexState
)
let
scanAndColorNextToken
()
=
let
info
,
nextLexState
=
lineTokenizer
.
ScanToken
(!
previousLexState
)
tokenInfoOption
<-
info
previousLexState
:=
nextLexState
match
info
with
|
Some
info
when
info
.
Tag
=
FSharpTokenTag
.
INT32_DOT_DOT
->
tokenInfoOption
<-
Some
{
LeftColumn
=
info
.
LeftColumn
RightColumn
=
info
.
RightColumn
-
2
ColorClass
=
FSharpTokenColorKind
.
Number
CharClass
=
FSharpTokenCharKind
.
Literal
FSharpTokenTriggerClass
=
info
.
FSharpTokenTriggerClass
Tag
=
info
.
Tag
TokenName
=
"INT32"
FullMatchedLength
=
info
.
FullMatchedLength
-
2
}
processToken
()
tokenInfoOption
<-
Some
{
LeftColumn
=
info
.
RightColumn
-
1
RightColumn
=
info
.
RightColumn
ColorClass
=
FSharpTokenColorKind
.
Operator
CharClass
=
FSharpTokenCharKind
.
Operator
FSharpTokenTriggerClass
=
info
.
FSharpTokenTriggerClass
Tag
=
FSharpTokenTag
.
DOT_DOT
TokenName
=
"DOT_DOT"
FullMatchedLength
=
2
}
processToken
()
|
Some
_
->
processToken
()
|
_
->
()
scanAndColorNextToken
()
while
tokenInfoOption
.
IsSome
do
scanAndColorNextToken
()
let
mutable
startPosition
=
0
let
mutable
endPosition
=
startPosition
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录