Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
34a43dde
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,发现更多精彩内容 >>
提交
34a43dde
编写于
7月 12, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove more blocking on async calls.
上级
e133ca42
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
15 addition
and
13 deletion
+15
-13
src/EditorFeatures/CSharp/AutomaticCompletion/AutomaticLineEnderCommandHandler.cs
...p/AutomaticCompletion/AutomaticLineEnderCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/AutomaticCompletion/AbstractAutomaticLineEnderCommandHandler.cs
...ticCompletion/AbstractAutomaticLineEnderCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
...ionComments/AbstractDocumentationCommentCommandHandler.cs
+2
-2
src/EditorFeatures/Core/Implementation/Preview/PreviewFactoryService.cs
...ures/Core/Implementation/Preview/PreviewFactoryService.cs
+4
-2
src/EditorFeatures/VisualBasic/AutomaticCompletion/AutomaticLineEnderCommandHandler.vb
...c/AutomaticCompletion/AutomaticLineEnderCommandHandler.vb
+1
-1
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService`2.IVsLanguageTextOps.cs
...geService/AbstractLanguageService`2.IVsLanguageTextOps.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs
...isualStudio/Core/Def/Implementation/Preview/FileChange.cs
+3
-3
src/VisualStudio/Core/Def/Implementation/Snippets/SnippetFunctions/AbstractSnippetFunctionSimpleTypeName.cs
...SnippetFunctions/AbstractSnippetFunctionSimpleTypeName.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioFormattingRuleFactoryServiceFactory.cs
...kspace/VisualStudioFormattingRuleFactoryServiceFactory.cs
+1
-1
未找到文件。
src/EditorFeatures/CSharp/AutomaticCompletion/AutomaticLineEnderCommandHandler.cs
浏览文件 @
34a43dde
...
...
@@ -109,7 +109,7 @@ protected override string GetEndingString(Document document, int position, Cance
// prepare expansive information from document
var
tree
=
document
.
GetSyntaxTreeSynchronously
(
cancellationToken
);
var
root
=
tree
.
GetRoot
(
cancellationToken
);
var
text
=
tree
.
GetText
Async
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
text
=
tree
.
GetText
(
cancellationToken
);
var
semicolon
=
SyntaxFacts
.
GetText
(
SyntaxKind
.
SemicolonToken
);
// Go through the set of owning nodes in leaf to root chain.
...
...
src/EditorFeatures/Core/Implementation/AutomaticCompletion/AbstractAutomaticLineEnderCommandHandler.cs
浏览文件 @
34a43dde
...
...
@@ -140,7 +140,7 @@ public void ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextHandle
private
int
?
GetInsertionPoint
(
Document
document
,
ITextSnapshotLine
line
,
CancellationToken
cancellationToken
)
{
var
root
=
document
.
GetSyntaxRootSynchronously
(
cancellationToken
);
var
text
=
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResul
t
(
cancellationToken
);
var
text
=
root
.
SyntaxTree
.
GetTex
t
(
cancellationToken
);
var
syntaxFacts
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
...
...
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
浏览文件 @
34a43dde
...
...
@@ -447,8 +447,8 @@ private void AddLineBreaks(SourceText text, IList<string> lines)
return
false
;
}
var
text
=
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
syntaxTree
=
document
.
GetSyntaxTreeSynchronously
(
cancellationToken
);
var
text
=
syntaxTree
.
GetText
(
cancellationToken
);
return
insertAction
(
syntaxTree
,
text
,
caretPosition
,
originalCaretPosition
,
subjectBuffer
,
textView
,
cancellationToken
);
}
...
...
@@ -552,8 +552,8 @@ public CommandState GetCommandState(InsertCommentCommandArgs args, Func<CommandS
TMemberNode
targetMember
=
null
;
_waitIndicator
.
Wait
(
"IntelliSense"
,
allowCancel
:
true
,
action
:
c
=>
{
var
text
=
document
.
GetTextAsync
(
c
.
CancellationToken
).
WaitAndGetResult
(
c
.
CancellationToken
);
var
syntaxTree
=
document
.
GetSyntaxTreeSynchronously
(
c
.
CancellationToken
);
var
text
=
syntaxTree
.
GetText
(
c
.
CancellationToken
);
targetMember
=
GetTargetMember
(
syntaxTree
,
text
,
caretPosition
,
c
.
CancellationToken
);
});
...
...
src/EditorFeatures/Core/Implementation/Preview/PreviewFactoryService.cs
浏览文件 @
34a43dde
...
...
@@ -539,7 +539,8 @@ private ITextBuffer CreateNewBuffer(Document document, CancellationToken cancell
var
contentTypeService
=
document
.
Project
.
LanguageServices
.
GetService
<
IContentTypeLanguageService
>();
var
contentType
=
contentTypeService
.
GetDefaultContentType
();
return
_textBufferFactoryService
.
CreateTextBuffer
(
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
).
ToString
(),
contentType
);
return
_textBufferFactoryService
.
CreateTextBuffer
(
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
).
ToString
(),
contentType
);
}
private
ITextBuffer
CreateNewPlainTextBuffer
(
TextDocument
document
,
CancellationToken
cancellationToken
)
...
...
@@ -548,7 +549,8 @@ private ITextBuffer CreateNewPlainTextBuffer(TextDocument document, Cancellation
var
contentType
=
_textBufferFactoryService
.
TextContentType
;
return
_textBufferFactoryService
.
CreateTextBuffer
(
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
).
ToString
(),
contentType
);
return
_textBufferFactoryService
.
CreateTextBuffer
(
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
).
ToString
(),
contentType
);
}
private
async
Task
<
object
>
CreateNewDifferenceViewerAsync
(
PreviewWorkspace
leftWorkspace
,
PreviewWorkspace
rightWorkspace
,
...
...
src/EditorFeatures/VisualBasic/AutomaticCompletion/AutomaticLineEnderCommandHandler.vb
浏览文件 @
34a43dde
...
...
@@ -44,7 +44,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.AutomaticCompletion
Protected
Overrides
Function
GetEndingString
(
document
As
Document
,
position
As
Integer
,
cancellationToken
As
CancellationToken
)
As
String
' prepare expansive information from document
Dim
root
=
document
.
GetSyntaxRootSynchronously
(
cancellationToken
)
Dim
text
=
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResul
t
(
cancellationToken
)
Dim
text
=
root
.
SyntaxTree
.
GetTex
t
(
cancellationToken
)
' get line where the caret is on
Dim
line
=
text
.
Lines
.
GetLineFromPosition
(
position
)
...
...
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService`2.IVsLanguageTextOps.cs
浏览文件 @
34a43dde
...
...
@@ -47,8 +47,8 @@ private int FormatWorker(IVsTextLayer textLayer, TextSpan[] selections, Cancella
return
VSConstants
.
E_FAIL
;
}
var
text
=
document
.
GetTextAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
root
=
document
.
GetSyntaxRootSynchronously
(
cancellationToken
);
var
text
=
root
.
SyntaxTree
.
GetText
(
cancellationToken
);
var
ts
=
selections
.
Single
();
int
start
=
text
.
Lines
[
ts
.
iStartLine
].
Start
+
ts
.
iStartIndex
;
...
...
src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs
浏览文件 @
34a43dde
...
...
@@ -48,9 +48,9 @@ internal class FileChange : AbstractChange
_componentModel
=
componentModel
;
var
bufferFactory
=
componentModel
.
GetService
<
ITextBufferFactoryService
>();
var
bufferText
=
left
!=
null
?
left
.
GetTextAsync
(
CancellationToken
.
None
).
WaitAndGetResult
(
CancellationToken
.
None
)
:
right
.
GetTextAsync
(
CancellationToken
.
None
).
WaitAndGetResult
(
CancellationToken
.
None
);
var
bufferText
=
left
!=
null
?
left
.
GetTextAsync
(
CancellationToken
.
None
).
WaitAndGetResult
(
CancellationToken
.
None
)
:
right
.
GetTextAsync
(
CancellationToken
.
None
).
WaitAndGetResult
(
CancellationToken
.
None
);
_buffer
=
bufferFactory
.
CreateTextBuffer
(
bufferText
.
ToString
(),
bufferFactory
.
InertContentType
);
_encoding
=
bufferText
.
Encoding
;
...
...
src/VisualStudio/Core/Def/Implementation/Snippets/SnippetFunctions/AbstractSnippetFunctionSimpleTypeName.cs
浏览文件 @
34a43dde
...
...
@@ -82,4 +82,4 @@ private bool TryGetDocumentWithFullyQualifiedTypeName(Document document, out Tex
return
true
;
}
}
}
}
\ No newline at end of file
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioFormattingRuleFactoryServiceFactory.cs
浏览文件 @
34a43dde
...
...
@@ -81,7 +81,7 @@ public IFormattingRule CreateRule(Document document, int position)
var
spans
=
pooledObject
.
Object
;
var
root
=
document
.
GetSyntaxRootSynchronously
(
CancellationToken
.
None
);
var
text
=
document
.
GetTextAsync
(
CancellationToken
.
None
).
WaitAndGetResul
t
(
CancellationToken
.
None
);
var
text
=
root
.
SyntaxTree
.
GetTex
t
(
CancellationToken
.
None
);
spans
.
AddRange
(
containedDocument
.
GetEditorVisibleSpans
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录