Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
76091e36
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,发现更多精彩内容 >>
提交
76091e36
编写于
5月 21, 2019
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address PR feedback
上级
69d422b7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
12 deletion
+15
-12
src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs
src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs
+8
-8
src/Workspaces/Core/Portable/PublicAPI.Unshipped.txt
src/Workspaces/Core/Portable/PublicAPI.Unshipped.txt
+4
-0
src/Workspaces/Core/Portable/Workspace/Solution/AdditionalTextWithState.cs
...re/Portable/Workspace/Solution/AdditionalTextWithState.cs
+1
-1
src/Workspaces/Core/Portable/Workspace/Solution/Project.cs
src/Workspaces/Core/Portable/Workspace/Solution/Project.cs
+1
-1
src/Workspaces/Core/Portable/Workspace/Solution/TextDocumentKind.cs
...aces/Core/Portable/Workspace/Solution/TextDocumentKind.cs
+1
-2
未找到文件。
src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs
浏览文件 @
76091e36
...
...
@@ -860,7 +860,7 @@ public async Task TestAnalyzerConfigFile_Properties()
using
(
var
workspace
=
CreateWorkspace
())
{
var
document
=
new
TestHostDocument
(
"public class C { }"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
"
some text
"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
"
root = true
"
);
var
project1
=
new
TestHostProject
(
workspace
,
name
:
"project1"
,
documents
:
new
[]
{
document
},
analyzerConfigDocuments
:
new
[]
{
analyzerConfigDoc
});
workspace
.
AddTestProject
(
project1
);
...
...
@@ -876,7 +876,7 @@ public async Task TestAnalyzerConfigFile_Properties()
var
analyzerConfigDocument
=
project
.
GetAnalyzerConfigDocument
(
analyzerConfigDoc
.
Id
);
Assert
.
Equal
(
"
some text
"
,
(
await
analyzerConfigDocument
.
GetTextAsync
()).
ToString
());
Assert
.
Equal
(
"
root = true
"
,
(
await
analyzerConfigDocument
.
GetTextAsync
()).
ToString
());
}
}
...
...
@@ -919,8 +919,8 @@ public async Task TestAnalyzerConfigFile_DocumentChanged()
{
using
(
var
workspace
=
CreateWorkspace
())
{
var
startText
=
@"
<setting value = ""goo""
"
;
var
newText
=
@"
<setting value = ""goo1""
"
;
var
startText
=
@"
root = true
"
;
var
newText
=
@"
root = false
"
;
var
document
=
new
TestHostDocument
(
"public class C { }"
);
var
analyzerConfigPath
=
PathUtilities
.
CombineAbsoluteAndRelativePaths
(
Temp
.
CreateDirectory
().
Path
,
".editorconfig"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
startText
,
filePath
:
analyzerConfigPath
);
...
...
@@ -989,7 +989,7 @@ public async Task TestAnalyzerConfigFile_OpenClose()
{
using
(
var
workspace
=
CreateWorkspace
())
{
var
startText
=
@"
<setting value = ""goo""
"
;
var
startText
=
@"
root = true
"
;
var
document
=
new
TestHostDocument
(
"public class C { }"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
startText
);
var
project1
=
new
TestHostProject
(
workspace
,
name
:
"project1"
,
documents
:
new
[]
{
document
},
analyzerConfigDocuments
:
new
[]
{
analyzerConfigDoc
});
...
...
@@ -1062,7 +1062,7 @@ public void TestAnalyzerConfigFile_AddRemove()
{
using
(
var
workspace
=
CreateWorkspace
())
{
var
startText
=
@"
<setting value = ""goo""
"
;
var
startText
=
@"
root = true
"
;
var
document
=
new
TestHostDocument
(
"public class C { }"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
startText
,
"original.config"
);
var
project1
=
new
TestHostProject
(
workspace
,
name
:
"project1"
,
documents
:
new
[]
{
document
},
analyzerConfigDocuments
:
new
[]
{
analyzerConfigDoc
});
...
...
@@ -1130,7 +1130,7 @@ public void TestAnalyzerConfigFile_AddRemove_FromProject()
{
using
(
var
workspace
=
CreateWorkspace
())
{
var
startText
=
@"
<setting value = ""goo""
"
;
var
startText
=
@"
root = true
"
;
var
document
=
new
TestHostDocument
(
"public class C { }"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
startText
,
"original.config"
);
var
project1
=
new
TestHostProject
(
workspace
,
name
:
"project1"
,
documents
:
new
[]
{
document
},
analyzerConfigDocuments
:
new
[]
{
analyzerConfigDoc
});
...
...
@@ -1184,7 +1184,7 @@ public void TestAnalyzerConfigFile_GetDocumentIdsWithFilePath()
const
string
docFilePath
=
"filePath1"
;
var
document
=
new
TestHostDocument
(
"public class C { }"
,
filePath
:
docFilePath
);
var
analyzerConfigDocFilePath
=
PathUtilities
.
CombineAbsoluteAndRelativePaths
(
Temp
.
CreateDirectory
().
Path
,
".editorconfig"
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
@"
<setting value = ""goo""
"
,
filePath
:
analyzerConfigDocFilePath
);
var
analyzerConfigDoc
=
new
TestHostDocument
(
@"
root = true
"
,
filePath
:
analyzerConfigDocFilePath
);
var
project1
=
new
TestHostProject
(
workspace
,
name
:
"project1"
,
documents
:
new
[]
{
document
},
analyzerConfigDocuments
:
new
[]
{
analyzerConfigDoc
});
workspace
.
AddTestProject
(
project1
);
...
...
src/Workspaces/Core/Portable/PublicAPI.Unshipped.txt
浏览文件 @
76091e36
...
...
@@ -23,6 +23,10 @@ Microsoft.CodeAnalysis.Solution.RemoveAnalyzerConfigDocument(Microsoft.CodeAnaly
Microsoft.CodeAnalysis.Solution.WithAnalyzerConfigDocumentText(Microsoft.CodeAnalysis.DocumentId documentId, Microsoft.CodeAnalysis.Text.SourceText text, Microsoft.CodeAnalysis.PreservationMode mode = Microsoft.CodeAnalysis.PreservationMode.PreserveValue) -> Microsoft.CodeAnalysis.Solution
Microsoft.CodeAnalysis.Solution.WithAnalyzerConfigDocumentText(Microsoft.CodeAnalysis.DocumentId documentId, Microsoft.CodeAnalysis.TextAndVersion textAndVersion, Microsoft.CodeAnalysis.PreservationMode mode = Microsoft.CodeAnalysis.PreservationMode.PreserveValue) -> Microsoft.CodeAnalysis.Solution
Microsoft.CodeAnalysis.Solution.WithAnalyzerConfigDocumentTextLoader(Microsoft.CodeAnalysis.DocumentId documentId, Microsoft.CodeAnalysis.TextLoader loader, Microsoft.CodeAnalysis.PreservationMode mode) -> Microsoft.CodeAnalysis.Solution
Microsoft.CodeAnalysis.TextDocumentKind
Microsoft.CodeAnalysis.TextDocumentKind.AdditionalDocument = 1 -> Microsoft.CodeAnalysis.TextDocumentKind
Microsoft.CodeAnalysis.TextDocumentKind.AnalyzerConfigDocument = 2 -> Microsoft.CodeAnalysis.TextDocumentKind
Microsoft.CodeAnalysis.TextDocumentKind.Document = 0 -> Microsoft.CodeAnalysis.TextDocumentKind
Microsoft.CodeAnalysis.Workspace.CheckAnalyzerConfigDocumentIsInCurrentSolution(Microsoft.CodeAnalysis.DocumentId documentId) -> void
Microsoft.CodeAnalysis.Workspace.CheckAnalyzerConfigDocumentIsNotInCurrentSolution(Microsoft.CodeAnalysis.DocumentId documentId) -> void
Microsoft.CodeAnalysis.Workspace.OnAnalyzerConfigDocumentAdded(Microsoft.CodeAnalysis.DocumentInfo documentInfo) -> void
...
...
src/Workspaces/Core/Portable/Workspace/Solution/AdditionalTextWithState.cs
浏览文件 @
76091e36
...
...
@@ -7,7 +7,7 @@
namespace
Microsoft.CodeAnalysis.Diagnostics
{
/// <summary>
///
Represents a non source additional text
.
///
An implementation of <see cref="AdditionalText"/> for the compiler that wraps a <see cref="TextDocumentState"/>
.
/// </summary>
internal
sealed
class
AdditionalTextWithState
:
AdditionalText
{
...
...
src/Workspaces/Core/Portable/Workspace/Solution/Project.cs
浏览文件 @
76091e36
...
...
@@ -264,7 +264,7 @@ internal TextDocumentState GetAdditionalDocumentState(DocumentId documentId)
return
_projectState
.
GetAdditionalDocumentState
(
documentId
);
}
internal
Text
DocumentState
GetAnalyzerConfigDocumentState
(
DocumentId
documentId
)
internal
AnalyzerConfig
DocumentState
GetAnalyzerConfigDocumentState
(
DocumentId
documentId
)
{
return
_projectState
.
GetAnalyzerConfigDocumentState
(
documentId
);
}
...
...
src/Workspaces/Core/Portable/Workspace/Solution/TextDocumentKind.cs
浏览文件 @
76091e36
...
...
@@ -5,8 +5,7 @@ namespace Microsoft.CodeAnalysis
/// <summary>
/// Indicates kind of a <see cref="TextDocument"/>
/// </summary>
/// <remarks>CONSIDER: Make this type public</remarks>
internal
enum
TextDocumentKind
public
enum
TextDocumentKind
{
/// <summary>
/// Indicates a regular source <see cref="CodeAnalysis.Document"/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录