Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
6b7e67f6
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,发现更多精彩内容 >>
提交
6b7e67f6
编写于
10月 31, 2019
作者:
G
Gen Lu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address review comments
上级
85db98f3
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
216 addition
and
68 deletion
+216
-68
src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/ExtensionMethodImportCompletionProviderTests.vb
...Providers/ExtensionMethodImportCompletionProviderTests.vb
+70
-2
src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ExtensionMethodImportCompletionProvider.cs
...portCompletion/ExtensionMethodImportCompletionProvider.cs
+0
-3
src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ImportCompletionProviderHelper.cs
...viders/ImportCompletion/ImportCompletionProviderHelper.cs
+0
-7
src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/TypeImportCompletionProvider.cs
...roviders/ImportCompletion/TypeImportCompletionProvider.cs
+0
-3
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractExtensionMethodImportCompletionProvider.cs
...ovider/AbstractExtensionMethodImportCompletionProvider.cs
+8
-4
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractImportCompletionProvider.cs
...ortCompletionProvider/AbstractImportCompletionProvider.cs
+12
-5
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.CacheEntry.cs
...rovider/AbstractTypeImportCompletionService.CacheEntry.cs
+0
-4
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.cs
...CompletionProvider/AbstractTypeImportCompletionService.cs
+2
-1
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.CacheEntry.cs
...vider/ExtensionMethodImportCompletionHelper.CacheEntry.cs
+0
-4
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.cs
...mpletionProvider/ExtensionMethodImportCompletionHelper.cs
+14
-14
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/IRemoteExtensionMethodImportCompletionService.cs
...Provider/IRemoteExtensionMethodImportCompletionService.cs
+1
-1
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ImportCompletionItem.cs
...roviders/ImportCompletionProvider/ImportCompletionItem.cs
+2
-1
src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ExtensionMethodImportCompletionProvider.vb
...letionProvider/ExtensionMethodImportCompletionProvider.vb
+0
-4
src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ImportCompletionProviderHelper.vb
...mportCompletionProvider/ImportCompletionProviderHelper.vb
+0
-6
src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/TypeImportCompletionProvider.vb
.../ImportCompletionProvider/TypeImportCompletionProvider.vb
+0
-4
src/Workspaces/CSharp/Portable/FindSymbols/CSharpDeclaredSymbolInfoFactoryService.cs
...ble/FindSymbols/CSharpDeclaredSymbolInfoFactoryService.cs
+2
-0
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
...arp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
+5
-0
src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs
...Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs
+2
-0
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs
...anguageServices/SyntaxFactsService/ISyntaxFactsService.cs
+2
-1
src/Workspaces/Core/Portable/Shared/Extensions/DocumentExtensions.cs
...ces/Core/Portable/Shared/Extensions/DocumentExtensions.cs
+12
-1
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
+9
-0
src/Workspaces/Core/Portable/WorkspacesResources.resx
src/Workspaces/Core/Portable/WorkspacesResources.resx
+3
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf
...orkspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf
...kspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf
+5
-0
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf
...kspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf
+5
-0
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_ExtensionMethodFiltering.cs
.../Services/CodeAnalysisService_ExtensionMethodFiltering.cs
+3
-3
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
...ortable/LanguageServices/VisualBasicSyntaxFactsService.vb
+4
-0
未找到文件。
src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/ExtensionMethodImportCompletionProviderTests.vb
浏览文件 @
6b7e67f6
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports
Microsoft.CodeAnalysis.Completion
Imports
Microsoft.CodeAnalysis.Completion.Providers
Imports
Microsoft.CodeAnalysis.Editor.UnitTests
Imports
Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports
Microsoft.CodeAnalysis.Experiments
Imports
Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Imports
Microsoft.VisualStudio.Composition
...
...
@@ -207,5 +205,75 @@ End Class]]></Text>.Value
Await
VerifyItemIsAbsentAsync
(
markup
,
"ExtensionMethod1"
,
inlineDescription
:
=
"Foo"
)
Await
VerifyItemIsAbsentAsync
(
markup
,
"ExtensionMethod2"
,
inlineDescription
:
=
"Foo"
)
End
Function
<
InlineData
(
ReferenceType
.
None
)
>
<
InlineData
(
ReferenceType
.
Project
)
>
<
Theory
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Async
Function
TestImplicitTarget1
(
refType
As
ReferenceType
)
As
Task
Dim
file1
=
<
Text
><
!
[
CDATA
[
Imports
System
Imports
System.Runtime.CompilerServices
Namespace
NS
Public
Module
Foo
<
Extension
>
Public
Function
ExtentionMethod
(
x
As
Bar
)
As
Boolean
Return
True
End
Function
End
Module
Public
Class
Bar
Public
X
As
Boolean
End
Class
End
Namespace
]]
></
Text
>
.
Value
Dim
file2
=
<
Text
><
!
[
CDATA
[
Imports
System
Public
Class
Baz
Sub
M
()
Dim
x
=
New
Bar
()
{.
$$}
End
Sub
End
Class
]]></
Text
>
.
Value
Dim
markup
=
GetMarkup
(
file2
,
file1
,
refType
)
Await
VerifyItemIsAbsentAsync
(
markup
,
"ExtentionMethod"
,
inlineDescription
:
=
"NS"
)
End
Function
<
InlineData
(
ReferenceType
.
None
)
>
<
InlineData
(
ReferenceType
.
Project
)
>
<
Theory
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Async
Function
TestImplicitTarget2
(
refType
As
ReferenceType
)
As
Task
Dim
file1
=
<
Text
><
!
[
CDATA
[
Imports
System
Imports
System.Runtime.CompilerServices
Namespace
NS
Public
Module
Foo
<
Extension
>
Public
Function
ExtentionMethod
(
x
As
Bar
)
As
Boolean
Return
True
End
Function
End
Module
Public
Class
Bar
Public
X
As
Boolean
End
Class
End
Namespace
]]
></
Text
>
.
Value
Dim
file2
=
<
Text
><
!
[
CDATA
[
Imports
System
Public
Class
Baz
Sub
M
()
Dim
x
=
New
Bar
()
{.
X
=
.
$$}
End
Sub
End
Class
]]></
Text
>
.
Value
Dim
markup
=
GetMarkup
(
file2
,
file1
,
refType
)
Await
VerifyItemIsAbsentAsync
(
markup
,
"ExtentionMethod"
,
inlineDescription
:
=
"NS"
)
End
Function
End
Class
End
Namespace
src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ExtensionMethodImportCompletionProvider.cs
浏览文件 @
6b7e67f6
...
...
@@ -27,8 +27,5 @@ internal override bool IsInsertionTrigger(SourceText text, int characterPosition
protected
override
Task
<
SyntaxContext
>
CreateContextAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
)
=>
ImportCompletionProviderHelper
.
CreateContextAsync
(
document
,
position
,
cancellationToken
);
protected
override
Task
<
bool
>
IsInImportsDirectiveAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
)
=>
ImportCompletionProviderHelper
.
IsInImportsDirectiveAsync
(
document
,
position
,
cancellationToken
);
}
}
src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ImportCompletionProviderHelper.cs
浏览文件 @
6b7e67f6
...
...
@@ -30,12 +30,5 @@ public static async Task<SyntaxContext> CreateContextAsync(Document document, in
var
semanticModel
=
await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
return
CSharpSyntaxContext
.
CreateContext
(
document
.
Project
.
Solution
.
Workspace
,
semanticModel
,
position
,
cancellationToken
);
}
public
static
async
Task
<
bool
>
IsInImportsDirectiveAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
)
{
var
syntaxTree
=
await
document
.
GetSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
leftToken
=
syntaxTree
.
FindTokenOnLeftOfPosition
(
position
,
cancellationToken
,
includeDirectives
:
true
);
return
leftToken
.
GetAncestor
<
UsingDirectiveSyntax
>()
!=
null
;
}
}
}
src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/TypeImportCompletionProvider.cs
浏览文件 @
6b7e67f6
...
...
@@ -25,8 +25,5 @@ internal override bool IsInsertionTrigger(SourceText text, int characterPosition
protected
override
Task
<
SyntaxContext
>
CreateContextAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
)
=>
ImportCompletionProviderHelper
.
CreateContextAsync
(
document
,
position
,
cancellationToken
);
protected
override
Task
<
bool
>
IsInImportsDirectiveAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
)
=>
ImportCompletionProviderHelper
.
IsInImportsDirectiveAsync
(
document
,
position
,
cancellationToken
);
}
}
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractExtensionMethodImportCompletionProvider.cs
浏览文件 @
6b7e67f6
...
...
@@ -33,15 +33,15 @@ protected override bool ShouldProvideCompletion(Document document, SyntaxContext
var
syntaxFacts
=
completionContext
.
Document
.
GetRequiredLanguageService
<
ISyntaxFactsService
>();
if
(
TryGetReceiverTypeSymbol
(
syntaxContext
,
syntaxFacts
,
out
var
receiverTypeSymbol
))
{
var
items
=
await
ExtensionMethodImportCompletionHelper
.
GetUnimportExtensionMethodsAsync
(
var
items
=
await
ExtensionMethodImportCompletionHelper
.
GetUnimport
ed
ExtensionMethodsAsync
(
completionContext
.
Document
,
completionContext
.
Position
,
receiverTypeSymbol
,
namespaceInScope
,
isExpandedCompletion
,
forceIndexCreation
:
isExpandedCompletion
,
cancellationToken
).
ConfigureAwait
(
false
);
completionContext
.
AddItems
(
items
.
Select
(
Convert
));
completionContext
.
AddItems
(
items
.
Select
(
i
=>
Convert
(
i
)
));
}
}
}
...
...
@@ -49,7 +49,11 @@ protected override bool ShouldProvideCompletion(Document document, SyntaxContext
private
static
bool
TryGetReceiverTypeSymbol
(
SyntaxContext
syntaxContext
,
ISyntaxFactsService
syntaxFacts
,
[
NotNullWhen
(
true
)]
out
ITypeSymbol
?
receiverTypeSymbol
)
{
var
parentNode
=
syntaxContext
.
TargetToken
.
Parent
;
var
expressionNode
=
syntaxFacts
.
GetLeftSideOfDot
(
parentNode
,
allowImplicitTarget
:
true
);
// Even though implicit access to extension method is allowed, we decide not support it for simplicity
// e.g. we will not provide completion for unimport extension method in this case
// New Bar() {.X = .$$ }
var
expressionNode
=
syntaxFacts
.
GetLeftSideOfDot
(
parentNode
,
allowImplicitTarget
:
false
);
if
(
expressionNode
==
null
)
{
...
...
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractImportCompletionProvider.cs
浏览文件 @
6b7e67f6
...
...
@@ -24,7 +24,6 @@ internal abstract class AbstractImportCompletionProvider : CommonCompletionProvi
{
protected
abstract
Task
<
SyntaxContext
>
CreateContextAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
);
protected
abstract
ImmutableArray
<
string
>
GetImportedNamespaces
(
SyntaxNode
location
,
SemanticModel
semanticModel
,
CancellationToken
cancellationToken
);
protected
abstract
Task
<
bool
>
IsInImportsDirectiveAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
);
protected
abstract
bool
ShouldProvideCompletion
(
Document
document
,
SyntaxContext
syntaxContext
);
protected
abstract
Task
AddCompletionItemsAsync
(
CompletionContext
completionContext
,
SyntaxContext
syntaxContext
,
HashSet
<
string
>
namespacesInScope
,
bool
isExpandedCompletion
,
CancellationToken
cancellationToken
);
...
...
@@ -84,7 +83,7 @@ private HashSet<string> GetNamespacesInScope(Document document, SyntaxContext sy
var
importedNamespaces
=
GetImportedNamespaces
(
syntaxContext
.
LeftToken
.
Parent
,
semanticModel
,
cancellationToken
);
// This hashset will be used to match namespace names, so it must have the same case-sensitivity as the source language.
var
syntaxFacts
=
document
.
Get
LanguageService
<
ISyntaxFactsService
>()!
;
var
syntaxFacts
=
document
.
Get
RequiredLanguageService
<
ISyntaxFactsService
>()
;
var
namespacesInScope
=
new
HashSet
<
string
>(
importedNamespaces
,
syntaxFacts
.
StringComparer
);
// Get containing namespaces.
...
...
@@ -111,15 +110,15 @@ internal override async Task<CompletionChange> GetChangeAsync(Document document,
}
// Find context node so we can use it to decide where to insert using/imports.
var
tree
=
(
await
document
.
GetSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
false
))!
;
var
tree
=
await
document
.
GetRequiredSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
false
)
;
var
root
=
await
tree
.
GetRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
addImportContextNode
=
root
.
FindToken
(
completionListSpan
.
Start
,
findInsideTrivia
:
true
).
Parent
;
// Add required using/imports directive.
var
addImportService
=
document
.
Get
LanguageService
<
IAddImportsService
>()!
;
var
addImportService
=
document
.
Get
RequiredLanguageService
<
IAddImportsService
>()
;
var
optionSet
=
await
document
.
GetOptionsAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
placeSystemNamespaceFirst
=
optionSet
.
GetOption
(
GenerationOptions
.
PlaceSystemNamespaceFirst
,
document
.
Project
.
Language
);
var
compilation
=
(
await
document
.
Project
.
GetCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
))!
;
var
compilation
=
await
document
.
Project
.
GetRequiredCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
)
;
var
importNode
=
CreateImport
(
document
,
containingNamespace
);
var
rootWithImport
=
addImportService
.
AddImport
(
compilation
,
root
,
addImportContextNode
,
importNode
,
placeSystemNamespaceFirst
,
cancellationToken
);
...
...
@@ -185,6 +184,14 @@ async Task<bool> ShouldCompleteWithFullyQualifyTypeName()
}
}
private
static
async
Task
<
bool
>
IsInImportsDirectiveAsync
(
Document
document
,
int
position
,
CancellationToken
cancellationToken
)
{
var
syntaxFacts
=
document
.
GetRequiredLanguageService
<
ISyntaxFactsService
>();
var
syntaxTree
=
await
document
.
GetSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
leftToken
=
syntaxTree
.
FindTokenOnLeftOfPosition
(
position
,
cancellationToken
,
includeDirectives
:
true
);
return
leftToken
.
GetAncestor
(
syntaxFacts
.
IsUsingOrImport
)
!=
null
;
}
protected
static
bool
IsAddingImportsSupported
(
Document
document
)
{
var
workspace
=
document
.
Project
.
Solution
.
Workspace
;
...
...
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.CacheEntry.cs
浏览文件 @
6b7e67f6
...
...
@@ -141,10 +141,6 @@ public void Dispose()
[
ExportWorkspaceServiceFactory
(
typeof
(
IImportCompletionCacheService
<
CacheEntry
,
CacheEntry
>),
ServiceLayer
.
Editor
),
Shared
]
private
sealed
class
CacheServiceFactory
:
AbstractImportCompletionCacheServiceFactory
<
CacheEntry
,
CacheEntry
>
{
[
ImportingConstructor
]
public
CacheServiceFactory
()
{
}
}
}
}
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.cs
浏览文件 @
6b7e67f6
...
...
@@ -9,6 +9,7 @@
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.FindSymbols
;
using
Microsoft.CodeAnalysis.PooledObjects
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
using
Microsoft.CodeAnalysis.Shared.Extensions.ContextQuery
;
namespace
Microsoft.CodeAnalysis.Completion.Providers.ImportCompletion
...
...
@@ -37,7 +38,7 @@ internal AbstractTypeImportCompletionService(Workspace workspace)
throw
new
ArgumentException
(
nameof
(
project
));
}
var
compilation
=
(
await
project
.
GetCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
))!
;
var
compilation
=
await
project
.
GetRequiredCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
)
;
// Since we only need top level types from source, therefore we only care if source symbol checksum changes.
var
checksum
=
await
SymbolTreeInfo
.
GetSourceSymbolsChecksumAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.CacheEntry.cs
浏览文件 @
6b7e67f6
...
...
@@ -97,10 +97,6 @@ public void Dispose()
[
ExportWorkspaceServiceFactory
(
typeof
(
IImportCompletionCacheService
<
CacheEntry
,
object
>),
ServiceLayer
.
Editor
),
Shared
]
private
sealed
class
CacheServiceFactory
:
AbstractImportCompletionCacheServiceFactory
<
CacheEntry
,
object
>
{
[
ImportingConstructor
]
public
CacheServiceFactory
()
{
}
}
private
static
IImportCompletionCacheService
<
CacheEntry
,
object
>
GetCacheService
(
Workspace
workspace
)
...
...
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.cs
浏览文件 @
6b7e67f6
...
...
@@ -30,12 +30,12 @@ internal static partial class ExtensionMethodImportCompletionHelper
private
static
readonly
object
s_gate
=
new
object
();
private
static
Task
s_indexingTask
=
Task
.
CompletedTask
;
public
static
async
Task
<
ImmutableArray
<
SerializableImportCompletionItem
>>
GetUnimportExtensionMethodsAsync
(
public
static
async
Task
<
ImmutableArray
<
SerializableImportCompletionItem
>>
GetUnimport
ed
ExtensionMethodsAsync
(
Document
document
,
int
position
,
ITypeSymbol
receiverTypeSymbol
,
ISet
<
string
>
namespaceInScope
,
bool
isExpandedComple
tion
,
bool
forceIndexCrea
tion
,
CancellationToken
cancellationToken
)
{
var
ticks
=
Environment
.
TickCount
;
...
...
@@ -47,8 +47,8 @@ internal static partial class ExtensionMethodImportCompletionHelper
:
null
;
var
(
serializableItems
,
counter
)
=
client
==
null
?
await
GetUnimport
ExtensionMethodsInCurrentProcessAsync
(
document
,
position
,
receiverTypeSymbol
,
namespaceInScope
,
isExpandedComple
tion
,
cancellationToken
).
ConfigureAwait
(
false
)
:
await
GetUnimport
ExtensionMethodsInRemoteProcessAsync
(
client
,
document
,
position
,
receiverTypeSymbol
,
namespaceInScope
,
isExpandedComple
tion
,
cancellationToken
).
ConfigureAwait
(
false
);
?
await
GetUnimport
edExtensionMethodsInCurrentProcessAsync
(
document
,
position
,
receiverTypeSymbol
,
namespaceInScope
,
forceIndexCrea
tion
,
cancellationToken
).
ConfigureAwait
(
false
)
:
await
GetUnimport
edExtensionMethodsInRemoteProcessAsync
(
client
,
document
,
position
,
receiverTypeSymbol
,
namespaceInScope
,
forceIndexCrea
tion
,
cancellationToken
).
ConfigureAwait
(
false
);
counter
.
TotalTicks
=
Environment
.
TickCount
-
ticks
;
counter
.
TotalExtensionMethodsProvided
=
serializableItems
.
Length
;
...
...
@@ -57,31 +57,31 @@ internal static partial class ExtensionMethodImportCompletionHelper
return
serializableItems
;
}
public
static
async
Task
<(
ImmutableArray
<
SerializableImportCompletionItem
>,
StatisticCounter
)>
GetUnimportExtensionMethodsInRemoteProcessAsync
(
public
static
async
Task
<(
ImmutableArray
<
SerializableImportCompletionItem
>,
StatisticCounter
)>
GetUnimport
ed
ExtensionMethodsInRemoteProcessAsync
(
RemoteHostClient
client
,
Document
document
,
int
position
,
ITypeSymbol
receiverTypeSymbol
,
ISet
<
string
>
namespaceInScope
,
bool
isExpandedComple
tion
,
bool
forceIndexCrea
tion
,
CancellationToken
cancellationToken
)
{
var
project
=
document
.
Project
;
var
(
serializableItems
,
counter
)
=
await
client
.
TryRunCodeAnalysisRemoteAsync
<(
IList
<
SerializableImportCompletionItem
>,
StatisticCounter
)>(
project
.
Solution
,
nameof
(
IRemoteExtensionMethodImportCompletionService
.
GetUnimportedExtensionMethodsAsync
),
new
object
[]
{
document
.
Id
,
position
,
SymbolKey
.
CreateString
(
receiverTypeSymbol
),
namespaceInScope
.
ToArray
(),
isExpandedComple
tion
},
new
object
[]
{
document
.
Id
,
position
,
SymbolKey
.
CreateString
(
receiverTypeSymbol
),
namespaceInScope
.
ToArray
(),
forceIndexCrea
tion
},
cancellationToken
).
ConfigureAwait
(
false
);
return
(
serializableItems
.
ToImmutableArray
(),
counter
);
}
public
static
async
Task
<(
ImmutableArray
<
SerializableImportCompletionItem
>,
StatisticCounter
)>
GetUnimportExtensionMethodsInCurrentProcessAsync
(
public
static
async
Task
<(
ImmutableArray
<
SerializableImportCompletionItem
>,
StatisticCounter
)>
GetUnimport
ed
ExtensionMethodsInCurrentProcessAsync
(
Document
document
,
int
position
,
ITypeSymbol
receiverTypeSymbol
,
ISet
<
string
>
namespaceInScope
,
bool
isExpandedComple
tion
,
bool
forceIndexCrea
tion
,
CancellationToken
cancellationToken
)
{
var
counter
=
new
StatisticCounter
();
...
...
@@ -104,7 +104,7 @@ internal static partial class ExtensionMethodImportCompletionHelper
var
allTypeNames
=
allTypeNamesBuilder
.
ToImmutableArray
();
var
matchedMethods
=
await
GetPossibleExtensionMethodMatchesAsync
(
project
,
allTypeNames
,
isExpandedComple
tion
,
isPrecalculation
:
false
,
cancellationToken
).
ConfigureAwait
(
false
);
project
,
allTypeNames
,
forceIndexCrea
tion
,
isPrecalculation
:
false
,
cancellationToken
).
ConfigureAwait
(
false
);
counter
.
GetFilterTicks
=
Environment
.
TickCount
-
ticks
;
counter
.
NoFilter
=
matchedMethods
==
null
;
...
...
@@ -119,7 +119,7 @@ internal static partial class ExtensionMethodImportCompletionHelper
{
if
(
s_indexingTask
.
IsCompleted
)
{
s_indexingTask
=
Task
.
Run
(()
=>
GetPossibleExtensionMethodMatchesAsync
(
project
,
allTypeNames
,
isExpandedComple
tion
:
false
,
isPrecalculation
:
true
,
CancellationToken
.
None
));
s_indexingTask
=
Task
.
Run
(()
=>
GetPossibleExtensionMethodMatchesAsync
(
project
,
allTypeNames
,
forceIndexCrea
tion
:
false
,
isPrecalculation
:
true
,
CancellationToken
.
None
));
}
}
...
...
@@ -140,7 +140,7 @@ internal static partial class ExtensionMethodImportCompletionHelper
private
static
async
Task
<
MultiDictionary
<
string
,
string
>?>
GetPossibleExtensionMethodMatchesAsync
(
Project
currentProject
,
ImmutableArray
<
string
>
targetTypeNames
,
bool
isExpandedComple
tion
,
bool
forceIndexCrea
tion
,
bool
isPrecalculation
,
CancellationToken
cancellationToken
)
{
...
...
@@ -155,9 +155,9 @@ internal static partial class ExtensionMethodImportCompletionHelper
var
peReferences
=
PooledHashSet
<
PortableExecutableReference
>.
GetInstance
();
// We will only create missing indices in the following cases, neither would block completion.
// 1.
User explicitly asked for them using expander.
// 1.
We are asked explicitly to create missing indices (e.g. via expander)
// 2. We are trying to populate the data in background.
var
shouldCreateIndex
=
isExpandedComple
tion
||
isPrecalculation
;
var
shouldCreateIndex
=
forceIndexCrea
tion
||
isPrecalculation
;
try
{
...
...
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/IRemoteExtensionMethodImportCompletionService.cs
浏览文件 @
6b7e67f6
...
...
@@ -15,7 +15,7 @@ internal interface IRemoteExtensionMethodImportCompletionService
int
position
,
string
receiverTypeSymbolKeyData
,
string
[]
namespaceInScope
,
bool
isExpandedComple
tion
,
bool
forceIndexCrea
tion
,
CancellationToken
cancellationToken
);
}
}
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ImportCompletionItem.cs
浏览文件 @
6b7e67f6
...
...
@@ -129,7 +129,8 @@ private static string GetFullyQualifiedName(string namespaceName, string typeNam
return
SymbolKey
.
ResolveString
(
symbolId
,
compilation
).
GetAnySymbol
();
}
// Otherwise, this is a type item, so we should have all the data to constrcut its metadata name
// Otherwise, this is a type item, so we don't have SymbolKey data. But we should still have all
// the data to construct its full metadata name
var
containingNamespace
=
GetContainingNamespace
(
item
);
var
typeName
=
item
.
Properties
.
TryGetValue
(
AttributeFullName
,
out
var
attributeFullName
)
?
attributeFullName
:
item
.
DisplayText
;
var
fullyQualifiedName
=
GetFullyQualifiedName
(
containingNamespace
,
typeName
);
...
...
src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ExtensionMethodImportCompletionProvider.vb
浏览文件 @
6b7e67f6
...
...
@@ -28,9 +28,5 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Protected
Overrides
Function
GetImportedNamespaces
(
location
As
SyntaxNode
,
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
ImmutableArray
(
Of
String
)
Return
ImportCompletionProviderHelper
.
GetImportedNamespaces
(
location
,
semanticModel
,
cancellationToken
)
End
Function
Protected
Overrides
Function
IsInImportsDirectiveAsync
(
document
As
Document
,
position
As
Integer
,
cancellationToken
As
CancellationToken
)
As
Task
(
Of
Boolean
)
Return
ImportCompletionProviderHelper
.
IsInImportsDirectiveAsync
(
document
,
position
,
cancellationToken
)
End
Function
End
Class
End
Namespace
src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ImportCompletionProviderHelper.vb
浏览文件 @
6b7e67f6
...
...
@@ -35,11 +35,5 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Dim
semanticModel
=
Await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
False
)
Return
Await
VisualBasicSyntaxContext
.
CreateContextAsync
(
document
.
Project
.
Solution
.
Workspace
,
semanticModel
,
position
,
cancellationToken
).
ConfigureAwait
(
False
)
End
Function
Public
Shared
Async
Function
IsInImportsDirectiveAsync
(
document
As
Document
,
position
As
Integer
,
cancellationToken
As
CancellationToken
)
As
Task
(
Of
Boolean
)
Dim
syntaxTree
=
Await
document
.
GetSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
False
)
Dim
leftToken
=
syntaxTree
.
FindTokenOnLeftOfPosition
(
position
,
cancellationToken
,
includeDirectives
:
=
True
,
includeDocumentationComments
:
=
True
)
Return
leftToken
.
GetAncestor
(
Of
ImportsStatementSyntax
)()
IsNot
Nothing
End
Function
End
Class
End
Namespace
src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/TypeImportCompletionProvider.vb
浏览文件 @
6b7e67f6
...
...
@@ -24,9 +24,5 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Protected
Overrides
Function
GetImportedNamespaces
(
location
As
SyntaxNode
,
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
ImmutableArray
(
Of
String
)
Return
ImportCompletionProviderHelper
.
GetImportedNamespaces
(
location
,
semanticModel
,
cancellationToken
)
End
Function
Protected
Overrides
Function
IsInImportsDirectiveAsync
(
document
As
Document
,
position
As
Integer
,
cancellationToken
As
CancellationToken
)
As
Task
(
Of
Boolean
)
Return
ImportCompletionProviderHelper
.
IsInImportsDirectiveAsync
(
document
,
position
,
cancellationToken
)
End
Function
End
Class
End
Namespace
src/Workspaces/CSharp/Portable/FindSymbols/CSharpDeclaredSymbolInfoFactoryService.cs
浏览文件 @
6b7e67f6
...
...
@@ -558,6 +558,8 @@ private static bool TryGetSimpleTypeName(SyntaxNode node, ImmutableArray<string>
return
TryGetSimpleTypeName
(
qualifiedNameNode
.
Right
,
typeParameterNames
:
null
,
out
simpleTypeName
);
case
NullableTypeSyntax
nullableNode
:
// Ignore nullability, becase nullable reference type might not be enabled universally.
// In the worst case we just include more methods to check in out filter.
return
TryGetSimpleTypeName
(
nullableNode
.
ElementType
,
typeParameterNames
,
out
simpleTypeName
);
}
}
...
...
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
浏览文件 @
6b7e67f6
...
...
@@ -1371,6 +1371,11 @@ public bool IsUsingOrExternOrImport(SyntaxNode node)
node
.
IsKind
(
SyntaxKind
.
ExternAliasDirective
);
}
public
bool
IsUsingOrImport
(
SyntaxNode
node
)
{
return
node
.
IsKind
(
SyntaxKind
.
UsingDirective
);
}
public
bool
IsGlobalAttribute
(
SyntaxNode
node
)
{
return
node
.
IsKind
(
SyntaxKind
.
Attribute
)
&&
node
.
Parent
.
IsKind
(
SyntaxKind
.
AttributeList
)
&&
...
...
src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs
浏览文件 @
6b7e67f6
...
...
@@ -19,6 +19,8 @@ namespace Microsoft.CodeAnalysis.FindSymbols
{
internal
interface
IDeclaredSymbolInfoFactoryService
:
ILanguageService
{
// `rootNamespace` is required for VB projects that has non-global namespace as root namespace,
// otherwise we would not be able to get correct data from syntax.
bool
TryGetDeclaredSymbolInfo
(
StringTable
stringTable
,
SyntaxNode
node
,
string
rootNamespace
,
out
DeclaredSymbolInfo
declaredSymbolInfo
);
bool
TryGetTargetTypeName
(
SyntaxNode
node
,
out
string
instanceTypeName
);
...
...
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs
浏览文件 @
6b7e67f6
...
...
@@ -89,6 +89,8 @@ internal interface ISyntaxFactsService : ILanguageService
bool
IsTypeNamedVarInVariableOrFieldDeclaration
(
SyntaxToken
token
,
SyntaxNode
parent
);
bool
IsTypeNamedDynamic
(
SyntaxToken
token
,
SyntaxNode
parent
);
bool
IsUsingOrExternOrImport
(
SyntaxNode
node
);
bool
IsUsingOrImport
(
SyntaxNode
node
);
bool
IsUsingAliasDirective
(
SyntaxNode
node
);
bool
IsGlobalAttribute
(
SyntaxNode
node
);
bool
IsDeclaration
(
SyntaxNode
node
);
bool
IsTypeDeclaration
(
SyntaxNode
node
);
...
...
@@ -266,7 +268,6 @@ internal interface ISyntaxFactsService : ILanguageService
bool
IsIdentifierName
(
SyntaxNode
node
);
bool
IsGenericName
(
SyntaxNode
node
);
bool
IsQualifiedName
(
SyntaxNode
node
);
bool
IsUsingAliasDirective
(
SyntaxNode
node
);
bool
IsAttribute
(
SyntaxNode
node
);
bool
IsAttributeName
(
SyntaxNode
node
);
...
...
src/Workspaces/Core/Portable/Shared/Extensions/DocumentExtensions.cs
浏览文件 @
6b7e67f6
...
...
@@ -23,13 +23,24 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions
{
internal
static
partial
class
DocumentExtensions
{
// ⚠ Verify IVTs do not use this method before removing it.
// ⚠ Verify IVTs do not use this method before removing it.
314104
public
static
TLanguageService
?
GetLanguageService
<
TLanguageService
>(
this
Document
?
document
)
where
TLanguageService
:
class
,
ILanguageService
=>
document
?.
Project
?.
LanguageServices
?.
GetService
<
TLanguageService
>();
public
static
TLanguageService
GetRequiredLanguageService
<
TLanguageService
>(
this
Document
document
)
where
TLanguageService
:
class
,
ILanguageService
=>
document
.
Project
.
LanguageServices
.
GetRequiredService
<
TLanguageService
>();
public
static
async
Task
<
SyntaxTree
>
GetRequiredSyntaxTreeAsync
(
this
Document
document
,
CancellationToken
cancellationToken
)
{
var
syntaxTree
=
await
document
.
GetSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
if
(
syntaxTree
==
null
)
{
throw
new
InvalidOperationException
(
string
.
Format
(
WorkspacesResources
.
SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0
,
document
.
Name
));
}
return
syntaxTree
;
}
public
static
bool
IsOpen
(
this
Document
document
)
{
var
workspace
=
document
.
Project
.
Solution
.
Workspace
as
Workspace
;
...
...
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
浏览文件 @
6b7e67f6
...
...
@@ -3384,6 +3384,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Syntax tree is required to accomplish the task but is not supported by document {0}..
/// </summary>
internal
static
string
SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0
{
get
{
return
ResourceManager
.
GetString
(
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Temporary storage cannot be written more than once..
/// </summary>
...
...
src/Workspaces/Core/Portable/WorkspacesResources.resx
浏览文件 @
6b7e67f6
...
...
@@ -1482,4 +1482,7 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<data
name=
"Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0"
xml:space=
"preserve"
>
<value>
Compilation is required to accomplish the task but is not supported by project {0}.
</value>
</data>
<data
name=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
xml:space=
"preserve"
>
<value>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</value>
</data>
</root>
\ No newline at end of file
src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou šířkou se o
<target
state=
"translated"
>
Specifikace symbolů
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Soubory jazyka Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Positive Lookbehindassertionen mit Nullbreite werden normalerweise am Anfang reg
<target
state=
"translated"
>
Symbolspezifikationen
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Visual Basic-Dateien
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Las aserciones posteriores positivas de ancho cero se usan normalmente al princi
<target
state=
"translated"
>
Especificaciones de símbolos
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Archivos de Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Les assertions de postanalyse positives de largeur nulle sont généralement uti
<target
state=
"translated"
>
Spécifications de symboles
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Fichiers Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Le asserzioni lookbehind positive di larghezza zero vengono usate in genere all'
<target
state=
"translated"
>
Specifiche dei simboli
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
File Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
記号の仕様
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Visual Basic ファイル
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
기호 사양
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Visual Basic 파일
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Pozytywne asercje wsteczne o zerowej szerokości są zwykle używane na początk
<target
state=
"translated"
>
Specyfikacje symboli
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Pliki języka Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ As declarações de lookbehind positivas de largura zero normalmente são usadas
<target
state=
"translated"
>
Especificações de símbolo
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Arquivos do Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
Спецификации символов
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Файлы Visual Basic
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Sıfır genişlikli pozitif geri yönlü onaylamalar genellikle normal ifadeleri
<target
state=
"translated"
>
Sembol belirtimleri
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Visual Basic dosyaları
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
符号规范
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
visual basic 文件
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf
浏览文件 @
6b7e67f6
...
...
@@ -1317,6 +1317,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
符號規格
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0"
>
<source>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</source>
<target
state=
"new"
>
Syntax tree is required to accomplish the task but is not supported by document {0}.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Visual_Basic_files"
>
<source>
Visual Basic files
</source>
<target
state=
"translated"
>
Visual Basic 檔案
</target>
...
...
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_ExtensionMethodFiltering.cs
浏览文件 @
6b7e67f6
...
...
@@ -19,7 +19,7 @@ internal partial class CodeAnalysisService : IRemoteExtensionMethodImportComplet
int
position
,
string
receiverTypeSymbolKeyData
,
string
[]
namespaceInScope
,
bool
isExpandedComple
tion
,
bool
forceIndexCrea
tion
,
CancellationToken
cancellationToken
)
{
return
RunServiceAsync
(
async
()
=>
...
...
@@ -36,8 +36,8 @@ internal partial class CodeAnalysisService : IRemoteExtensionMethodImportComplet
var
syntaxFacts
=
document
.
GetRequiredLanguageService
<
ISyntaxFactsService
>();
var
namespaceInScopeSet
=
new
HashSet
<
string
>(
namespaceInScope
,
syntaxFacts
.
StringComparer
);
var
(
items
,
counter
)
=
await
ExtensionMethodImportCompletionHelper
.
GetUnimportExtensionMethodsInCurrentProcessAsync
(
document
,
position
,
receiverTypeSymbol
,
namespaceInScopeSet
,
isExpandedComple
tion
,
cancellationToken
).
ConfigureAwait
(
false
);
var
(
items
,
counter
)
=
await
ExtensionMethodImportCompletionHelper
.
GetUnimport
ed
ExtensionMethodsInCurrentProcessAsync
(
document
,
position
,
receiverTypeSymbol
,
namespaceInScopeSet
,
forceIndexCrea
tion
,
cancellationToken
).
ConfigureAwait
(
false
);
return
((
IList
<
SerializableImportCompletionItem
>)
items
,
counter
);
}
...
...
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
浏览文件 @
6b7e67f6
...
...
@@ -1402,6 +1402,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Function
Public
Function
IsUsingOrExternOrImport
(
node
As
SyntaxNode
)
As
Boolean
Implements
ISyntaxFactsService
.
IsUsingOrExternOrImport
Return
IsUsingOrImport
(
node
)
End
Function
Public
Function
IsUsingOrImport
(
node
As
SyntaxNode
)
As
Boolean
Implements
ISyntaxFactsService
.
IsUsingOrImport
Return
node
.
IsKind
(
SyntaxKind
.
ImportsStatement
)
End
Function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录