Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ab5e98b2
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab5e98b2
编写于
1月 21, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
tslint
上级
5be404dd
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
38 addition
and
33 deletion
+38
-33
src/vs/base/common/json.ts
src/vs/base/common/json.ts
+1
-1
src/vs/editor/contrib/referenceSearch/browser/referenceSearchWidget.ts
.../contrib/referenceSearch/browser/referenceSearchWidget.ts
+2
-3
src/vs/languages/css/common/parser/cssScanner.ts
src/vs/languages/css/common/parser/cssScanner.ts
+7
-5
src/vs/languages/css/common/parser/cssSymbols.ts
src/vs/languages/css/common/parser/cssSymbols.ts
+18
-16
src/vs/languages/css/common/services/lint.ts
src/vs/languages/css/common/services/lint.ts
+3
-3
src/vs/languages/json/common/features/tokenization.ts
src/vs/languages/json/common/features/tokenization.ts
+1
-1
src/vs/languages/razor/common/csharpTokenization.ts
src/vs/languages/razor/common/csharpTokenization.ts
+6
-4
未找到文件。
src/vs/base/common/json.ts
浏览文件 @
ab5e98b2
...
...
@@ -198,7 +198,7 @@ export function createScanner(text:string, ignoreTrivia:boolean = false):JSONSca
function
scanNext
():
SyntaxKind
{
value
=
''
;
scanError
=
ScanError
.
None
,
scanError
=
ScanError
.
None
;
tokenOffset
=
pos
;
...
...
src/vs/editor/contrib/referenceSearch/browser/referenceSearchWidget.ts
浏览文件 @
ab5e98b2
...
...
@@ -330,10 +330,9 @@ class Renderer extends treeDefaults.LegacyRenderer {
var
fileReferences
=
<
model
.
FileReferences
>
element
,
fileReferencesContainer
=
builder
.
$
(
'
.reference-file
'
);
new
leftRightWidget
.
LeftRightWidget
(
fileReferencesContainer
,
(
left
:
HTMLElement
)
=>
{
let
lrwidget
=
new
leftRightWidget
.
LeftRightWidget
(
fileReferencesContainer
,
(
left
:
HTMLElement
)
=>
{
var
resource
=
fileReferences
.
resource
;
new
fileLabel
.
FileLabel
(
left
,
resource
,
this
.
_contextService
);
let
label
=
new
fileLabel
.
FileLabel
(
left
,
resource
,
this
.
_contextService
);
return
<
lifecycle
.
IDisposable
>
null
;
...
...
src/vs/languages/css/common/parser/cssScanner.ts
浏览文件 @
ab5e98b2
...
...
@@ -277,6 +277,8 @@ export class Scanner {
}
}
let
tokenType
:
TokenType
=
void
0
;
// Comment - CSS
if
(
this
.
_comment
())
{
if
(
!
this
.
ignoreComment
)
{
...
...
@@ -302,7 +304,7 @@ export class Scanner {
}
// URL
var
tokenType
=
this
.
_url
();
tokenType
=
this
.
_url
();
if
(
tokenType
!==
null
)
{
return
this
.
finishToken
(
result
,
tokenType
);
}
...
...
@@ -349,8 +351,8 @@ export class Scanner {
// Percentage 43%
return
this
.
finishToken
(
result
,
TokenType
.
Percentage
);
}
else
if
(
this
.
ident
(
content
))
{
var
dim
=
this
.
stream
.
substring
(
pos
).
toLowerCase
();
var
tokenType
=
<
TokenType
>
staticUnitTable
[
dim
];
let
dim
=
this
.
stream
.
substring
(
pos
).
toLowerCase
();
tokenType
=
<
TokenType
>
staticUnitTable
[
dim
];
if
(
typeof
tokenType
!==
'
undefined
'
)
{
// Known dimension 43px
return
this
.
finishToken
(
result
,
tokenType
,
content
.
join
(
''
));
...
...
@@ -365,13 +367,13 @@ export class Scanner {
// String, BadString
content
=
[];
var
tokenType
=
this
.
_string
(
content
);
tokenType
=
this
.
_string
(
content
);
if
(
tokenType
!==
null
)
{
return
this
.
finishToken
(
result
,
tokenType
,
content
.
join
(
''
));
}
// single character tokens
var
tokenType
=
<
TokenType
>
staticTokenTable
[
this
.
stream
.
peekChar
()];
tokenType
=
<
TokenType
>
staticTokenTable
[
this
.
stream
.
peekChar
()];
if
(
typeof
tokenType
!==
'
undefined
'
)
{
this
.
stream
.
advance
(
1
);
return
this
.
finishToken
(
result
,
tokenType
);
...
...
src/vs/languages/css/common/parser/cssSymbols.ts
浏览文件 @
ab5e98b2
...
...
@@ -40,7 +40,7 @@ export class Scope {
return
this
.
findInScope
(
offset
,
length
);
}
return
null
;
}
}
private
findInScope
(
offset
:
number
,
length
:
number
=
0
):
Scope
{
// find the first scope child that has an offset larger than offset + length
...
...
@@ -67,7 +67,7 @@ export class Scope {
var
symbol
=
this
.
symbols
[
index
];
if
(
symbol
.
name
===
name
&&
symbol
.
type
===
type
)
{
return
symbol
;
}
}
}
return
null
;
}
...
...
@@ -141,33 +141,35 @@ export class ScopeBuilder implements nodes.IVisitor {
return
true
;
case
nodes
.
NodeType
.
VariableDeclaration
:
this
.
addSymbol
(
node
,
(
<
nodes
.
VariableDeclaration
>
node
).
getName
(),
nodes
.
ReferenceType
.
Variable
);
return
true
;
return
true
;
case
nodes
.
NodeType
.
Ruleset
:
return
this
.
visitRuleSet
(
<
nodes
.
RuleSet
>
node
);
case
nodes
.
NodeType
.
MixinDeclaration
:
this
.
addSymbol
(
node
,
(
<
nodes
.
MixinDeclaration
>
node
).
getName
(),
nodes
.
ReferenceType
.
Mixin
);
return
true
;
return
true
;
case
nodes
.
NodeType
.
FunctionDeclaration
:
this
.
addSymbol
(
node
,
(
<
nodes
.
FunctionDeclaration
>
node
).
getName
(),
nodes
.
ReferenceType
.
Function
);
return
true
;
case
nodes
.
NodeType
.
FunctionParameter
:
return
true
;
case
nodes
.
NodeType
.
FunctionParameter
:
{
// parameters are part of the body scope
var
scopeNode
=
(
<
nodes
.
BodyDeclaration
>
node
.
getParent
()).
getDeclarations
();
let
scopeNode
=
(
<
nodes
.
BodyDeclaration
>
node
.
getParent
()).
getDeclarations
();
if
(
scopeNode
)
{
this
.
addSymbolToChildScope
(
scopeNode
,
node
,
(
<
nodes
.
FunctionParameter
>
node
).
getName
(),
nodes
.
ReferenceType
.
Variable
);
}
return
true
;
return
true
;
}
case
nodes
.
NodeType
.
Declarations
:
this
.
addScope
(
node
);
return
true
;
case
nodes
.
NodeType
.
For
:
case
nodes
.
NodeType
.
Each
:
case
nodes
.
NodeType
.
Each
:
{
var
forOrEachNode
=
<
nodes
.
ForStatement
|
nodes
.
EachStatement
>
node
;
var
scopeNode
=
forOrEachNode
.
getDeclarations
();
let
scopeNode
=
forOrEachNode
.
getDeclarations
();
if
(
scopeNode
)
{
this
.
addSymbolToChildScope
(
scopeNode
,
forOrEachNode
.
variable
,
forOrEachNode
.
variable
.
getName
(),
nodes
.
ReferenceType
.
Variable
);
}
return
true
;
return
true
;
}
}
return
true
;
}
...
...
@@ -245,7 +247,7 @@ export class Symbols {
return
null
;
}
private
evaluateReferenceTypes
(
node
:
nodes
.
Node
)
:
nodes
.
ReferenceType
[]
{
private
evaluateReferenceTypes
(
node
:
nodes
.
Node
)
:
nodes
.
ReferenceType
[]
{
if
(
node
instanceof
nodes
.
Identifier
)
{
var
referenceTypes
=
(
<
nodes
.
Identifier
>
node
).
referenceTypes
;
if
(
referenceTypes
)
{
...
...
@@ -258,7 +260,7 @@ export class Symbols {
if
((
propertyName
===
'
animation
'
||
propertyName
===
'
animation-name
'
)
&&
decl
.
getValue
()
&&
decl
.
getValue
().
offset
===
node
.
offset
)
{
return
[
nodes
.
ReferenceType
.
Keyframe
];
}
}
}
}
}
else
if
(
node
instanceof
nodes
.
Variable
)
{
...
...
@@ -285,7 +287,7 @@ export class Symbols {
var
referenceTypes
=
this
.
evaluateReferenceTypes
(
node
);
if
(
referenceTypes
)
{
return
this
.
internalFindSymbol
(
node
,
referenceTypes
);
return
this
.
internalFindSymbol
(
node
,
referenceTypes
);
}
return
null
;
}
...
...
@@ -299,7 +301,7 @@ export class Symbols {
}
if
(
symbol
.
name
.
length
!==
node
.
length
||
symbol
.
name
!==
node
.
getText
())
{
return
false
;
}
}
var
referenceTypes
=
this
.
evaluateReferenceTypes
(
node
);
if
(
!
referenceTypes
||
referenceTypes
.
indexOf
(
symbol
.
type
)
===
-
1
)
{
...
...
@@ -320,6 +322,6 @@ export class Symbols {
}
scope
=
scope
.
parent
;
}
return
null
;
return
null
;
}
}
src/vs/languages/css/common/services/lint.ts
浏览文件 @
ab5e98b2
...
...
@@ -287,7 +287,7 @@ export class LintVisitor implements nodes.IVisitor {
/////////////////////////////////////////////////////////////
// With 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect
var
displayElems
=
this
.
fetchWithValue
(
propertyTable
,
'
display
'
,
'
inline
'
);
let
displayElems
=
this
.
fetchWithValue
(
propertyTable
,
'
display
'
,
'
inline
'
);
if
(
displayElems
.
length
>
0
)
{
[
'
width
'
,
'
height
'
,
'
margin-top
'
,
'
margin-bottom
'
,
'
float
'
].
forEach
(
function
(
prop
)
{
var
elem
=
self
.
fetch
(
propertyTable
,
prop
);
...
...
@@ -298,7 +298,7 @@ export class LintVisitor implements nodes.IVisitor {
}
// With 'display: inline-block', 'float' has no effect
var
displayElems
=
this
.
fetchWithValue
(
propertyTable
,
'
display
'
,
'
inline-block
'
);
displayElems
=
this
.
fetchWithValue
(
propertyTable
,
'
display
'
,
'
inline-block
'
);
if
(
displayElems
.
length
>
0
)
{
var
elem
=
this
.
fetch
(
propertyTable
,
'
float
'
);
for
(
var
index
=
0
;
index
<
elem
.
length
;
index
++
)
{
...
...
@@ -307,7 +307,7 @@ export class LintVisitor implements nodes.IVisitor {
}
// With 'display: block', 'vertical-align' has no effect
var
displayElems
=
this
.
fetchWithValue
(
propertyTable
,
'
display
'
,
'
block
'
);
displayElems
=
this
.
fetchWithValue
(
propertyTable
,
'
display
'
,
'
block
'
);
if
(
displayElems
.
length
>
0
)
{
var
elem
=
this
.
fetch
(
propertyTable
,
'
vertical-align
'
);
for
(
var
index
=
0
;
index
<
elem
.
length
;
index
++
)
{
...
...
src/vs/languages/json/common/features/tokenization.ts
浏览文件 @
ab5e98b2
...
...
@@ -157,7 +157,7 @@ function tokenize(mode:Modes.IMode, comments:boolean, line:string, state:JSONSta
lastWasColon
=
false
;
break
;
case
json
.
SyntaxKind
.
StringLiteral
:
type
=
lastWasColon
?
jsonTokenTypes
.
TOKEN_VALUE_STRING
:
jsonTokenTypes
.
TOKEN_PROPERTY_NAME
,
type
=
lastWasColon
?
jsonTokenTypes
.
TOKEN_VALUE_STRING
:
jsonTokenTypes
.
TOKEN_PROPERTY_NAME
;
lastWasColon
=
false
;
break
;
case
json
.
SyntaxKind
.
NumericLiteral
:
...
...
src/vs/languages/razor/common/csharpTokenization.ts
浏览文件 @
ab5e98b2
...
...
@@ -535,8 +535,8 @@ class CSSimpleHTML extends CSState {
this
.
state
=
htmlMode
.
States
.
OpeningStartTag
;
return
{
type
:
htmlTokenTypes
.
DELIM_START
,
bracket
:
Modes
.
Bracket
.
Open
};
case
htmlMode
.
States
.
OpeningEndTag
:
var
tagName
=
this
.
nextName
(
stream
);
case
htmlMode
.
States
.
OpeningEndTag
:
{
let
tagName
=
this
.
nextName
(
stream
);
if
(
tagName
.
length
>
0
)
{
return
{
type
:
htmlTokenTypes
.
getTag
(
tagName
),
...
...
@@ -549,9 +549,10 @@ class CSSimpleHTML extends CSState {
}
stream
.
advanceUntil
(
'
>
'
,
false
);
return
{
type
:
''
};
}
case
htmlMode
.
States
.
OpeningStartTag
:
var
tagName
=
this
.
nextName
(
stream
);
case
htmlMode
.
States
.
OpeningStartTag
:
{
let
tagName
=
this
.
nextName
(
stream
);
if
(
tagName
.
length
>
0
)
{
this
.
state
=
htmlMode
.
States
.
WithinTag
;
return
{
...
...
@@ -560,6 +561,7 @@ class CSSimpleHTML extends CSState {
};
}
break
;
}
case
htmlMode
.
States
.
WithinTag
:
if
(
stream
.
skipWhitespace
().
length
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录