Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
ced80aca
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ced80aca
编写于
5月 11, 2020
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address feedback
上级
424efa48
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
171 addition
and
23 deletion
+171
-23
src/VisualStudio/Core/Def/Implementation/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs
...tion/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs
+35
-23
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+6
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf
...VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf
+10
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf
...VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf
+10
-0
未找到文件。
src/VisualStudio/Core/Def/Implementation/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs
浏览文件 @
ced80aca
...
...
@@ -209,15 +209,20 @@ public void RunAnalyzers(IVsHierarchy? hierarchy)
var
asyncToken
=
_listener
.
BeginAsyncOperation
(
$"
{
nameof
(
VisualStudioDiagnosticAnalyzerService
)}
_
{
nameof
(
RunAnalyzers
)}
"
);
Task
.
Run
(
async
()
=>
{
var
onProjectAnalyzed
=
statusBarUpdater
!=
null
?
statusBarUpdater
.
OnProjectAnalyzed
:
(
Action
<
Project
>)((
Project
_
)
=>
{
});
await
_diagnosticService
.
ForceAnalyzeAsync
(
solution
,
onProjectAnalyzed
,
project
?.
Id
,
CancellationToken
.
None
).
ConfigureAwait
(
false
);
// If user has disabled live analyzer execution for any project(s), i.e. set RunAnalyzersDuringLiveAnalysis = false,
// then ForceAnalyzeAsync will not cause analyzers to execute.
// We explicitly fetch diagnostics for such projects and report these as "Host" diagnostics.
HandleProjectsWithDisabledAnalysis
();
try
{
var
onProjectAnalyzed
=
statusBarUpdater
!=
null
?
statusBarUpdater
.
OnProjectAnalyzed
:
(
Action
<
Project
>)((
Project
_
)
=>
{
});
await
_diagnosticService
.
ForceAnalyzeAsync
(
solution
,
onProjectAnalyzed
,
project
?.
Id
,
CancellationToken
.
None
).
ConfigureAwait
(
false
);
statusBarUpdater
?.
Dispose
();
// If user has disabled live analyzer execution for any project(s), i.e. set RunAnalyzersDuringLiveAnalysis = false,
// then ForceAnalyzeAsync will not cause analyzers to execute.
// We explicitly fetch diagnostics for such projects and report these as "Host" diagnostics.
HandleProjectsWithDisabledAnalysis
();
}
finally
{
statusBarUpdater
?.
Dispose
();
}
}).
CompletesAsyncOperation
(
asyncToken
);
return
;
...
...
@@ -352,6 +357,7 @@ private sealed class StatusBarUpdater : IDisposable
private
readonly
uint
_totalProjectCount
;
private
readonly
string
_statusMessageWhileRunning
;
private
readonly
string
_statusMesageOnCompleted
;
private
readonly
string
_statusMesageOnTerminated
;
private
readonly
Timer
_timer
;
private
int
_analyzedProjectCount
;
...
...
@@ -371,6 +377,9 @@ public StatusBarUpdater(IVsStatusbar statusBar, IThreadingContext threadingConte
_statusMesageOnCompleted
=
projectOrSolutionName
!=
null
?
string
.
Format
(
ServicesVSResources
.
Code_analysis_completed_for_0
,
projectOrSolutionName
)
:
ServicesVSResources
.
Code_analysis_completed_for_Solution
;
_statusMesageOnTerminated
=
projectOrSolutionName
!=
null
?
string
.
Format
(
ServicesVSResources
.
Code_analysis_terminated_before_completion_for_0
,
projectOrSolutionName
)
:
ServicesVSResources
.
Code_analysis_terminated_before_completion_for_Solution
;
// Set the initial status bar progress and text.
_statusBar
.
Progress
(
ref
_statusBarCookie
,
fInProgress
:
1
,
_statusMessageWhileRunning
,
nComplete
:
0
,
nTotal
:
totalProjectCount
);
...
...
@@ -383,45 +392,48 @@ public StatusBarUpdater(IVsStatusbar statusBar, IThreadingContext threadingConte
internal
void
OnProjectAnalyzed
(
Project
_
)
{
var
analyzedProjectCount
=
Interlocked
.
Increment
(
ref
_analyzedProjectCount
);
UpdateStatus
(
isRunning
:
analyzedProjectCount
<
_totalProjectCount
);
Interlocked
.
Increment
(
ref
_analyzedProjectCount
);
UpdateStatus
Core
(
);
}
// Add a message to VS status bar that we are running code analysis.
private
void
UpdateStatusOnTimer
(
object
state
)
=>
UpdateStatus
(
isRunning
:
true
);
=>
UpdateStatus
Core
(
);
public
void
Dispose
()
{
_timer
.
Dispose
();
_disposed
=
true
;
UpdateStatus
(
isRunning
:
false
);
UpdateStatus
Core
(
);
}
private
void
UpdateStatus
(
bool
isRunning
)
private
void
UpdateStatus
Core
(
)
{
Task
.
Run
(
async
()
=>
_threadingContext
.
JoinableTaskFactory
.
RunAsync
(
async
()
=>
{
await
_threadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
();
string
message
;
uint
analyzedCount
;
int
fInProgress
;
if
(
isRunning
&&
!
_disposed
&&
_analyzedProjectCount
!=
_totalProjectCount
)
var
analyzedProjectCount
=
(
uint
)
_analyzedProjectCount
;
if
(
analyzedProjectCount
==
_totalProjectCount
)
{
message
=
_statusMessageWhileRunning
;
analyzedCount
=
(
uint
)
_analyzedProjectCount
;
fInProgress
=
1
;
message
=
_statusMesageOnCompleted
;
fInProgress
=
0
;
}
else
else
if
(
_disposed
)
{
message
=
_statusMesageOnCompleted
;
analyzedCount
=
_totalProjectCount
;
message
=
_statusMesageOnTerminated
;
fInProgress
=
0
;
}
else
{
message
=
_statusMessageWhileRunning
;
fInProgress
=
1
;
}
// Update the status bar progress and text.
_statusBar
.
Progress
(
ref
_statusBarCookie
,
fInProgress
,
message
,
analyzedCount
,
_totalProjectCount
);
_statusBar
.
Progress
(
ref
_statusBarCookie
,
fInProgress
,
message
,
analyzed
Project
Count
,
_totalProjectCount
);
_statusBar
.
SetText
(
message
);
});
}
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
ced80aca
...
...
@@ -1344,6 +1344,12 @@ I agree to all of the foregoing:</value>
<data
name=
"Code_analysis_completed_for_Solution"
xml:space=
"preserve"
>
<value>
Code analysis completed for Solution.
</value>
</data>
<data
name=
"Code_analysis_terminated_before_completion_for_0"
xml:space=
"preserve"
>
<value>
Code analysis terminated before completion for '{0}'.
</value>
</data>
<data
name=
"Code_analysis_terminated_before_completion_for_Solution"
xml:space=
"preserve"
>
<value>
Code analysis terminated before completion for Solution.
</value>
</data>
<data
name=
"Background_analysis_scope_colon"
xml:space=
"preserve"
>
<value>
Background analysis scope:
</value>
</data>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Dokončila se analýza kódu pro řešení.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Obarvit regulární výrazy
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Die Codeanalyse für die Projektmappe wurde abgeschlossen.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Reguläre Ausdrücke farbig hervorheben
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
El análisis de código se ha completado para la solución.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Colorear expresiones regulares
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Analyse du code effectuée pour la solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Coloriser les expressions régulières
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Analisi codice completata per la soluzione.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Colora espressioni regolari
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
ソリューションのコード分析が完了しました。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
正規表現をカラー化
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
솔루션에 대한 코드 분석이 완료되었습니다.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
정규식 색 지정
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Ukończono analizę kodu dla rozwiązania.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Koloruj wyrażenia regularne
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Análise de código concluída para a Solução.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Colorir expressões regulares
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Анализ кода для решения выполнен.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Выделить регулярные выражения цветом
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
Çözüm için kod analizi tamamlandı.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
Normal ifadeleri renklendir
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
解决方案的代码分析已完成。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
为正规表达式着色
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf
浏览文件 @
ced80aca
...
...
@@ -122,6 +122,16 @@
<target
state=
"translated"
>
解決方案的程式碼分析已完成。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_0"
>
<source>
Code analysis terminated before completion for '{0}'.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for '{0}'.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Code_analysis_terminated_before_completion_for_Solution"
>
<source>
Code analysis terminated before completion for Solution.
</source>
<target
state=
"new"
>
Code analysis terminated before completion for Solution.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Colorize_regular_expressions"
>
<source>
Colorize regular expressions
</source>
<target
state=
"translated"
>
為規則運算式添加色彩
</target>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录