Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
faf8e7a5
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,发现更多精彩内容 >>
提交
faf8e7a5
编写于
5月 19, 2016
作者:
V
VSadov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure that compiling is finished by the time we get to collect diagnostics.
上级
7e4c666f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
6 deletion
+33
-6
src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
...ompilers/CSharp/Portable/Compilation/CSharpCompilation.cs
+5
-0
src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
+2
-1
src/Compilers/Core/Portable/CommandLine/CommonCompiler.cs
src/Compilers/Core/Portable/CommandLine/CommonCompiler.cs
+7
-4
src/Compilers/Core/Portable/Compilation/Compilation.cs
src/Compilers/Core/Portable/Compilation/Compilation.cs
+15
-1
src/Compilers/VisualBasic/Portable/Compilation/VisualBasicCompilation.vb
...isualBasic/Portable/Compilation/VisualBasicCompilation.vb
+4
-0
未找到文件。
src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
浏览文件 @
faf8e7a5
...
...
@@ -1733,6 +1733,11 @@ internal override void ReportUnusedImports(SyntaxTree filterTree, DiagnosticBag
}
}
CompleteTrees
(
filterTree
);
}
internal
override
void
CompleteTrees
(
SyntaxTree
filterTree
)
{
// By definition, a tree is complete when all of its compiler diagnostics have been reported.
// Since unused imports are the last thing we compute and report, a tree is complete when
// the unused imports have been reported.
...
...
src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
浏览文件 @
faf8e7a5
...
...
@@ -7729,12 +7729,13 @@ public void NoWarnAndWarnAsError_InfoDiagnostic()
return
output
;
}
[
WorkItem
(
11368
,
"https://github.com/dotnet/roslyn/issues/11368"
)]
[
WorkItem
(
899050
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/899050"
)]
[
WorkItem
(
981677
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/981677"
)]
[
WorkItem
(
998069
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/998069"
)]
[
WorkItem
(
998724
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/998724"
)]
[
WorkItem
(
1021115
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1021115"
)]
[
Fact
(
Skip
=
"https://github.com/dotnet/roslyn/issues/11368"
)
]
[
Fact
]
public
void
NoWarnAndWarnAsError_WarningDiagnostic
()
{
// This assembly has a WarningDiagnosticAnalyzer type which should produce custom warning
...
...
src/Compilers/Core/Portable/CommandLine/CommonCompiler.cs
浏览文件 @
faf8e7a5
...
...
@@ -501,12 +501,15 @@ private int RunCore(TextWriter consoleOutput, ErrorLogger errorLogger, Cancellat
win32ResourceStreamOpt
,
diagnosticBag
,
cancellationToken
);
}
if
(
success
)
{
compilation
.
ReportUnusedImports
(
null
,
diagnosticBag
,
cancellationToken
);
}
// only report unused usings if we have success.
if
(
success
)
{
compilation
.
ReportUnusedImports
(
null
,
diagnosticBag
,
cancellationToken
);
}
compilation
.
CompleteTrees
(
null
);
}
}
...
...
src/Compilers/Core/Portable/Compilation/Compilation.cs
浏览文件 @
faf8e7a5
...
...
@@ -1480,11 +1480,25 @@ internal bool IsRealSigned
DiagnosticBag
diagnostics
,
CancellationToken
cancellationToken
);
/// <summary>
/// Reports all unused imports/usings so far (and thus it must be called as a last step of Emit)
/// </summary>
internal
abstract
void
ReportUnusedImports
(
SyntaxTree
filterTree
,
DiagnosticBag
diagnostics
,
CancellationToken
cancellationToken
);
/// <summary>
/// Signals the event queue, if any, that we are done compiling.
/// There should not be more compiling actions after this step.
/// NOTE: once we signal about completion to analyzers they will cancel and thus in some cases we
/// may be effectively cutting off some diagnostics.
/// It is not clear if behavior is desirable.
/// See: https://github.com/dotnet/roslyn/issues/11470
/// </summary>
/// <param name="filterTree">What tree to complete. null means complete all trees. </param>
internal
abstract
void
CompleteTrees
(
SyntaxTree
filterTree
);
internal
bool
Compile
(
CommonPEModuleBuilder
moduleBuilder
,
bool
emittingPdb
,
...
...
@@ -1695,7 +1709,7 @@ internal void EnsureAnonymousTypeTemplates(CancellationToken cancellationToken)
{
ReportUnusedImports
(
null
,
diagnostics
,
cancellationToken
);
}
}
}
}
finally
{
...
...
src/Compilers/VisualBasic/Portable/Compilation/VisualBasicCompilation.vb
浏览文件 @
faf8e7a5
...
...
@@ -1610,6 +1610,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
If
End
If
CompleteTrees
(
filterTree
)
End
Sub
Friend
Overrides
Sub
CompleteTrees
(
filterTree
As
SyntaxTree
)
' By definition, a tree Is complete when all of its compiler diagnostics have been reported.
' Since unused imports are the last thing we compute And report, a tree Is complete when
' the unused imports have been reported.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录