Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a7e5a795
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,发现更多精彩内容 >>
提交
a7e5a795
编写于
11月 09, 2017
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use Uri to identify file in Diagnostics manager
上级
9da3b7e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
19 deletion
+23
-19
extensions/typescript/src/features/diagnostics.ts
extensions/typescript/src/features/diagnostics.ts
+15
-11
extensions/typescript/src/typescriptMain.ts
extensions/typescript/src/typescriptMain.ts
+8
-8
未找到文件。
extensions/typescript/src/features/diagnostics.ts
浏览文件 @
a7e5a795
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Diagnostic
,
DiagnosticCollection
,
languages
}
from
'
vscode
'
;
import
{
Diagnostic
,
DiagnosticCollection
,
languages
,
Uri
}
from
'
vscode
'
;
import
{
ITypeScriptServiceClient
}
from
'
../typescriptService
'
;
export
default
class
DiagnosticsManager
{
...
...
@@ -42,31 +42,35 @@ export default class DiagnosticsManager {
}
}
public
syntaxDiagnosticsReceived
(
file
:
string
,
syntaxDiagnostics
:
Diagnostic
[]):
void
{
this
.
syntaxDiagnostics
[
file
]
=
syntaxDiagnostics
;
public
syntaxDiagnosticsReceived
(
file
:
Uri
,
syntaxDiagnostics
:
Diagnostic
[]):
void
{
this
.
syntaxDiagnostics
[
this
.
key
(
file
)
]
=
syntaxDiagnostics
;
this
.
updateCurrentDiagnostics
(
file
);
}
public
semanticDiagnosticsReceived
(
file
:
string
,
semanticDiagnostics
:
Diagnostic
[]):
void
{
this
.
semanticDiagnostics
[
file
]
=
semanticDiagnostics
;
public
semanticDiagnosticsReceived
(
file
:
Uri
,
semanticDiagnostics
:
Diagnostic
[]):
void
{
this
.
semanticDiagnostics
[
this
.
key
(
file
)
]
=
semanticDiagnostics
;
this
.
updateCurrentDiagnostics
(
file
);
}
public
configFileDiagnosticsReceived
(
file
:
string
,
diagnostics
:
Diagnostic
[]):
void
{
this
.
currentDiagnostics
.
set
(
this
.
client
.
asUrl
(
file
)
,
diagnostics
);
public
configFileDiagnosticsReceived
(
file
:
Uri
,
diagnostics
:
Diagnostic
[]):
void
{
this
.
currentDiagnostics
.
set
(
file
,
diagnostics
);
}
public
delete
(
file
:
string
):
void
{
this
.
currentDiagnostics
.
delete
(
this
.
client
.
asUrl
(
file
));
}
private
updateCurrentDiagnostics
(
file
:
string
)
{
private
key
(
file
:
Uri
):
string
{
return
file
.
toString
(
true
);
}
private
updateCurrentDiagnostics
(
file
:
Uri
)
{
if
(
!
this
.
_validate
)
{
return
;
}
const
semanticDiagnostics
=
this
.
semanticDiagnostics
[
file
]
||
[];
const
syntaxDiagnostics
=
this
.
syntaxDiagnostics
[
file
]
||
[];
this
.
currentDiagnostics
.
set
(
this
.
client
.
asUrl
(
file
)
,
semanticDiagnostics
.
concat
(
syntaxDiagnostics
));
const
semanticDiagnostics
=
this
.
semanticDiagnostics
[
this
.
key
(
file
)
]
||
[];
const
syntaxDiagnostics
=
this
.
syntaxDiagnostics
[
this
.
key
(
file
)
]
||
[];
this
.
currentDiagnostics
.
set
(
file
,
semanticDiagnostics
.
concat
(
syntaxDiagnostics
));
}
}
\ No newline at end of file
extensions/typescript/src/typescriptMain.ts
浏览文件 @
a7e5a795
...
...
@@ -403,15 +403,15 @@ class LanguageProvider {
this
.
bufferSyncSupport
.
requestAllDiagnostics
();
}
public
syntaxDiagnosticsReceived
(
file
:
string
,
syntaxDiagnostics
:
Diagnostic
[]):
void
{
public
syntaxDiagnosticsReceived
(
file
:
Uri
,
syntaxDiagnostics
:
Diagnostic
[]):
void
{
this
.
diagnosticsManager
.
syntaxDiagnosticsReceived
(
file
,
syntaxDiagnostics
);
}
public
semanticDiagnosticsReceived
(
file
:
string
,
semanticDiagnostics
:
Diagnostic
[]):
void
{
public
semanticDiagnosticsReceived
(
file
:
Uri
,
semanticDiagnostics
:
Diagnostic
[]):
void
{
this
.
diagnosticsManager
.
semanticDiagnosticsReceived
(
file
,
semanticDiagnostics
);
}
public
configFileDiagnosticsReceived
(
file
:
string
,
diagnostics
:
Diagnostic
[]):
void
{
public
configFileDiagnosticsReceived
(
file
:
Uri
,
diagnostics
:
Diagnostic
[]):
void
{
this
.
diagnosticsManager
.
configFileDiagnosticsReceived
(
file
,
diagnostics
);
}
}
...
...
@@ -631,7 +631,7 @@ class TypeScriptServiceClientHost implements ITypeScriptServiceClientHost {
if
(
body
&&
body
.
diagnostics
)
{
this
.
findLanguage
(
body
.
file
).
then
(
language
=>
{
if
(
language
)
{
language
.
syntaxDiagnosticsReceived
(
body
.
file
,
this
.
createMarkerDatas
(
body
.
diagnostics
,
language
.
diagnosticSource
));
language
.
syntaxDiagnosticsReceived
(
this
.
client
.
asUrl
(
body
.
file
)
,
this
.
createMarkerDatas
(
body
.
diagnostics
,
language
.
diagnosticSource
));
}
});
}
...
...
@@ -642,7 +642,7 @@ class TypeScriptServiceClientHost implements ITypeScriptServiceClientHost {
if
(
body
&&
body
.
diagnostics
)
{
this
.
findLanguage
(
body
.
file
).
then
(
language
=>
{
if
(
language
)
{
language
.
semanticDiagnosticsReceived
(
body
.
file
,
this
.
createMarkerDatas
(
body
.
diagnostics
,
language
.
diagnosticSource
));
language
.
semanticDiagnosticsReceived
(
this
.
client
.
asUrl
(
body
.
file
)
,
this
.
createMarkerDatas
(
body
.
diagnostics
,
language
.
diagnosticSource
));
}
});
}
...
...
@@ -660,7 +660,7 @@ class TypeScriptServiceClientHost implements ITypeScriptServiceClientHost {
return
;
}
if
(
body
.
diagnostics
.
length
===
0
)
{
language
.
configFileDiagnosticsReceived
(
body
.
configFile
,
[]);
language
.
configFileDiagnosticsReceived
(
this
.
client
.
asUrl
(
body
.
configFile
)
,
[]);
}
else
if
(
body
.
diagnostics
.
length
>=
1
)
{
workspace
.
openTextDocument
(
Uri
.
file
(
body
.
configFile
)).
then
((
document
)
=>
{
let
curly
:
[
number
,
number
,
number
]
|
undefined
=
undefined
;
...
...
@@ -690,10 +690,10 @@ class TypeScriptServiceClientHost implements ITypeScriptServiceClientHost {
}
if
(
diagnostic
)
{
diagnostic
.
source
=
language
.
diagnosticSource
;
language
.
configFileDiagnosticsReceived
(
body
.
configFile
,
[
diagnostic
]);
language
.
configFileDiagnosticsReceived
(
this
.
client
.
asUrl
(
body
.
configFile
)
,
[
diagnostic
]);
}
},
_error
=>
{
language
.
configFileDiagnosticsReceived
(
body
.
configFile
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
),
body
.
diagnostics
[
0
].
text
)]);
language
.
configFileDiagnosticsReceived
(
this
.
client
.
asUrl
(
body
.
configFile
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
),
body
.
diagnostics
[
0
].
text
)]);
});
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录