Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
8f220bd4
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,体验更适合开发者的 AI 搜索 >>
提交
8f220bd4
编写于
10月 07, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renames
上级
b5ada0e5
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
151 addition
and
123 deletion
+151
-123
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsFormatDefinition.cs
...tures/Core.Wpf/InlineHints/InlineHintsFormatDefinition.cs
+6
-6
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTag.cs
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTag.cs
+49
-41
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTagger.cs
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTagger.cs
+15
-11
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTaggerProvider.cs
...eatures/Core.Wpf/InlineHints/InlineHintsTaggerProvider.cs
+5
-5
src/EditorFeatures/Core/EditorFeaturesResources.resx
src/EditorFeatures/Core/EditorFeaturesResources.resx
+2
-2
src/EditorFeatures/Core/InlineHints/InlineHintDataTag.cs
src/EditorFeatures/Core/InlineHints/InlineHintDataTag.cs
+8
-10
src/EditorFeatures/Core/InlineHints/InlineHintsDataTaggerProvider.cs
...eatures/Core/InlineHints/InlineHintsDataTaggerProvider.cs
+9
-9
src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf
...EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf
src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf
...itorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf
+3
-3
src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf
...itorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf
+3
-3
src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs
src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs
+18
-0
未找到文件。
src/EditorFeatures/Core.Wpf/InlineHints/Inline
ParameterName
HintsFormatDefinition.cs
→
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsFormatDefinition.cs
浏览文件 @
8f220bd4
...
...
@@ -17,21 +17,21 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints
internal
sealed
class
ClassificationTypeDefinitions
{
[
Export
]
[
Name
(
Inline
ParameterName
HintsTag
.
TagId
)]
[
Name
(
InlineHintsTag
.
TagId
)]
[
BaseDefinition
(
PredefinedClassificationTypeNames
.
FormalLanguage
)]
internal
ClassificationTypeDefinition
Inline
ParameterName
Hints
;
internal
ClassificationTypeDefinition
InlineHints
;
[
Export
(
typeof
(
EditorFormatDefinition
))]
[
Name
(
Inline
ParameterName
HintsTag
.
TagId
)]
[
Name
(
InlineHintsTag
.
TagId
)]
[
Order
(
After
=
LanguagePriority
.
NaturalLanguage
,
Before
=
LanguagePriority
.
FormalLanguage
)]
[
UserVisible
(
true
)]
internal
sealed
class
Inline
ParameterName
HintsFormatDefinition
:
EditorFormatDefinition
internal
sealed
class
InlineHintsFormatDefinition
:
EditorFormatDefinition
{
[
ImportingConstructor
]
[
Obsolete
(
MefConstruction
.
ImportingConstructorMessage
,
error
:
true
)]
public
Inline
ParameterName
HintsFormatDefinition
()
public
InlineHintsFormatDefinition
()
{
this
.
DisplayName
=
EditorFeaturesResources
.
Inline_
Parameter_Name_
Hints
;
this
.
DisplayName
=
EditorFeaturesResources
.
Inline_Hints
;
this
.
ForegroundBrush
=
Brushes
.
Black
;
this
.
BackgroundBrush
=
Brushes
.
LightGray
;
}
...
...
src/EditorFeatures/Core.Wpf/InlineHints/Inline
ParameterName
HintsTag.cs
→
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTag.cs
浏览文件 @
8f220bd4
...
...
@@ -29,22 +29,23 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints
/// This is the tag which implements the IntraTextAdornmentTag and is meant to create the UIElements that get shown
/// in the editor
/// </summary>
internal
class
Inline
ParameterName
HintsTag
:
IntraTextAdornmentTag
internal
class
InlineHintsTag
:
IntraTextAdornmentTag
{
public
const
string
TagId
=
"inline parameter name hints"
;
public
const
string
TagId
=
"inline hints"
;
private
readonly
IToolTipService
_toolTipService
;
private
readonly
ITextView
_textView
;
private
readonly
SnapshotSpan
_span
;
private
readonly
SymbolKey
_key
;
private
readonly
SymbolKey
?
_key
;
private
readonly
IThreadingContext
_threadingContext
;
private
readonly
Lazy
<
IStreamingFindUsagesPresenter
>
_streamingPresenter
;
private
Inline
ParameterName
HintsTag
(
private
InlineHintsTag
(
FrameworkElement
adornment
,
ITextView
textView
,
SnapshotSpan
span
,
SymbolKey
key
,
Inline
ParameterName
HintsTaggerProvider
taggerProvider
)
SymbolKey
?
key
,
InlineHintsTaggerProvider
taggerProvider
)
:
base
(
adornment
,
removalCallback
:
null
,
PositionAffinity
.
Predecessor
)
{
_textView
=
textView
;
...
...
@@ -68,57 +69,64 @@ internal class InlineParameterNameHintsTag : IntraTextAdornmentTag
/// <param name="textView">The view of the editor</param>
/// <param name="span">The span that has the location of the hint</param>
/// <param name="key">The symbolkey associated with each parameter</param>
public
static
InlineParameterNameHintsTag
Create
(
string
text
,
TextFormattingRunProperties
format
,
IWpfTextView
textView
,
SnapshotSpan
span
,
SymbolKey
key
,
InlineParameterNameHintsTaggerProvider
taggerProvider
)
public
static
InlineHintsTag
Create
(
string
text
,
TextFormattingRunProperties
format
,
IWpfTextView
textView
,
SnapshotSpan
span
,
SymbolKey
?
key
,
InlineHintsTaggerProvider
taggerProvider
)
{
return
new
InlineParameterNameHintsTag
(
CreateElement
(
text
,
textView
,
format
),
textView
,
span
,
key
,
taggerProvider
);
return
new
InlineHintsTag
(
CreateElement
(
text
,
textView
,
format
),
textView
,
span
,
key
,
taggerProvider
);
}
public
async
Task
<
IReadOnlyCollection
<
object
>>
CreateDescriptionAsync
(
CancellationToken
cancellationToken
)
{
var
document
=
_textView
.
TextBuffer
.
CurrentSnapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
var
textContentBuilder
=
new
List
<
TaggedText
>();
if
(
document
!=
null
)
if
(
_key
!=
null
)
{
var
compilation
=
await
document
.
Project
.
GetRequiredCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
symbol
=
_key
.
Resolve
(
compilation
,
cancellationToken
:
cancellationToken
).
Symbol
;
var
document
=
_span
.
Snapshot
.
TextBuffer
.
CurrentSnapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
if
(
symbol
!=
null
)
if
(
document
!=
null
)
{
var
workspace
=
document
.
Project
.
Solution
.
Workspace
;
var
semanticModel
=
await
document
.
GetRequiredSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
symbolDisplayService
=
document
.
Project
.
LanguageServices
.
GetRequiredService
<
ISymbolDisplayService
>();
var
formatter
=
document
.
Project
.
LanguageServices
.
GetService
<
IDocumentationCommentFormattingService
>();
var
sections
=
await
symbolDisplayService
.
ToDescriptionGroupsAsync
(
workspace
,
semanticModel
,
_span
.
Start
,
ImmutableArray
.
Create
(
symbol
),
cancellationToken
).
ConfigureAwait
(
false
);
textContentBuilder
.
AddRange
(
sections
[
SymbolDescriptionGroups
.
MainDescription
]);
if
(
formatter
!=
null
)
{
var
documentation
=
symbol
.
GetDocumentationParts
(
semanticModel
,
_span
.
Start
,
formatter
,
cancellationToken
);
var
compilation
=
await
document
.
Project
.
GetRequiredCompilationAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
symbol
=
_key
.
Value
.
Resolve
(
compilation
,
cancellationToken
:
cancellationToken
).
Symbol
;
if
(
documentation
.
Any
())
if
(
symbol
!=
null
)
{
var
textContentBuilder
=
new
List
<
TaggedText
>();
var
workspace
=
document
.
Project
.
Solution
.
Workspace
;
var
semanticModel
=
await
document
.
GetRequiredSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
symbolDisplayService
=
document
.
GetRequiredLanguageService
<
ISymbolDisplayService
>();
var
formatter
=
document
.
GetRequiredLanguageService
<
IDocumentationCommentFormattingService
>();
var
sections
=
await
symbolDisplayService
.
ToDescriptionGroupsAsync
(
workspace
,
semanticModel
,
_span
.
Start
,
ImmutableArray
.
Create
(
symbol
),
cancellationToken
).
ConfigureAwait
(
false
);
textContentBuilder
.
AddRange
(
sections
[
SymbolDescriptionGroups
.
MainDescription
]);
if
(
formatter
!=
null
)
{
textContentBuilder
.
AddLineBreak
();
textContentBuilder
.
AddRange
(
documentation
);
var
documentation
=
symbol
.
GetDocumentationParts
(
semanticModel
,
_span
.
Start
,
formatter
,
cancellationToken
);
if
(
documentation
.
Any
())
{
textContentBuilder
.
AddLineBreak
();
textContentBuilder
.
AddRange
(
documentation
);
}
}
}
if
(
sections
.
TryGetValue
(
SymbolDescriptionGroups
.
AnonymousTypes
,
out
var
parts
))
{
if
(!
parts
.
IsDefaultOrEmpty
)
if
(
sections
.
TryGetValue
(
SymbolDescriptionGroups
.
AnonymousTypes
,
out
var
parts
))
{
textContentBuilder
.
AddLineBreak
();
textContentBuilder
.
AddLineBreak
();
textContentBuilder
.
AddRange
(
parts
);
if
(!
parts
.
IsDefaultOrEmpty
)
{
textContentBuilder
.
AddLineBreak
();
textContentBuilder
.
AddLineBreak
();
textContentBuilder
.
AddRange
(
parts
);
}
}
var
uiCollection
=
Implementation
.
IntelliSense
.
Helpers
.
BuildInteractiveTextElements
(
textContentBuilder
.
ToImmutableArray
<
TaggedText
>(),
document
,
_threadingContext
,
_streamingPresenter
);
return
uiCollection
;
}
}
var
uiCollection
=
Implementation
.
IntelliSense
.
Helpers
.
BuildInteractiveTextElements
(
textContentBuilder
.
ToImmutableArray
<
TaggedText
>(),
document
,
_threadingContext
,
_streamingPresenter
);
return
uiCollection
;
}
return
Array
.
Empty
<
object
>();
...
...
src/EditorFeatures/Core.Wpf/InlineHints/Inline
ParameterName
HintsTagger.cs
→
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTagger.cs
浏览文件 @
8f220bd4
...
...
@@ -15,13 +15,13 @@
namespace
Microsoft.CodeAnalysis.Editor.InlineHints
{
/// <summary>
/// The purpose of this tagger is to convert the <see cref="Inline
ParameterNameHintDataTag"/> to
///
the <see cref="InlineParameterNameHintsTag"/>, which actually creates the UIElement. It reacts to
///
tags changing and updates the
adornments accordingly.
/// The purpose of this tagger is to convert the <see cref="Inline
HintDataTag"/> to the <see
///
cref="InlineHintsTag"/>, which actually creates the UIElement. It reacts to tags changing and updates the
/// adornments accordingly.
/// </summary>
internal
sealed
class
Inline
ParameterName
HintsTagger
:
ITagger
<
IntraTextAdornmentTag
>,
IDisposable
internal
sealed
class
InlineHintsTagger
:
ITagger
<
IntraTextAdornmentTag
>,
IDisposable
{
private
readonly
ITagAggregator
<
Inline
ParameterName
HintDataTag
>
_tagAggregator
;
private
readonly
ITagAggregator
<
InlineHintDataTag
>
_tagAggregator
;
/// <summary>
/// stores the parameter hint tags in a global location
...
...
@@ -42,26 +42,30 @@ internal sealed class InlineParameterNameHintsTagger : ITagger<IntraTextAdornmen
private
readonly
IClassificationType
_hintClassification
;
private
readonly
ForegroundThreadAffinitizedObject
_threadAffinitizedObject
;
private
readonly
Inline
ParameterNameHintsTaggerProvider
_inlineParameterNameHintsT
aggerProvider
;
private
readonly
Inline
HintsTaggerProvider
_t
aggerProvider
;
private
readonly
ITextBuffer
_buffer
;
private
readonly
IWpfTextView
_textView
;
public
event
EventHandler
<
SnapshotSpanEventArgs
>?
TagsChanged
;
public
InlineParameterNameHintsTagger
(
InlineParameterNameHintsTaggerProvider
taggerProvider
,
IWpfTextView
textView
,
ITextBuffer
buffer
,
ITagAggregator
<
InlineParameterNameHintDataTag
>
tagAggregator
)
public
InlineHintsTagger
(
InlineHintsTaggerProvider
taggerProvider
,
IWpfTextView
textView
,
ITextBuffer
buffer
,
ITagAggregator
<
InlineHintDataTag
>
tagAggregator
)
{
_cache
=
new
List
<
ITagSpan
<
IntraTextAdornmentTag
>>();
_threadAffinitizedObject
=
new
ForegroundThreadAffinitizedObject
(
taggerProvider
.
ThreadingContext
);
_
inlineParameterNameHintsT
aggerProvider
=
taggerProvider
;
_
t
aggerProvider
=
taggerProvider
;
_textView
=
textView
;
_buffer
=
buffer
;
_tagAggregator
=
tagAggregator
;
_formatMap
=
taggerProvider
.
ClassificationFormatMapService
.
GetClassificationFormatMap
(
textView
);
_hintClassification
=
taggerProvider
.
ClassificationTypeRegistryService
.
GetClassificationType
(
Inline
ParameterName
HintsTag
.
TagId
);
_hintClassification
=
taggerProvider
.
ClassificationTypeRegistryService
.
GetClassificationType
(
InlineHintsTag
.
TagId
);
_formatMap
.
ClassificationFormatMappingChanged
+=
this
.
OnClassificationFormatMappingChanged
;
_tagAggregator
.
TagsChanged
+=
OnTagAggregatorTagsChanged
;
}
...
...
@@ -125,8 +129,8 @@ public IEnumerable<ITagSpan<IntraTextAdornmentTag>> GetTags(NormalizedSnapshotSp
{
var
dataTagSpan
=
dataTagSpans
[
0
];
var
parameterHintSnapshotSpan
=
new
SnapshotSpan
(
dataTagSpan
.
Start
,
0
);
var
parameterHintUITag
=
Inline
ParameterNameHintsTag
.
Create
(
textTag
.
ParameterName
,
Format
,
_textView
,
dataTagSpan
,
textTag
.
ParameterSymbolKey
,
_inlineParameterNameHintsT
aggerProvider
);
var
parameterHintUITag
=
Inline
HintsTag
.
Create
(
textTag
.
Text
,
Format
,
_textView
,
dataTagSpan
,
textTag
.
SymbolKey
,
_t
aggerProvider
);
_cache
.
Add
(
new
TagSpan
<
IntraTextAdornmentTag
>(
parameterHintSnapshotSpan
,
parameterHintUITag
));
}
...
...
src/EditorFeatures/Core.Wpf/InlineHints/Inline
ParameterName
HintsTaggerProvider.cs
→
src/EditorFeatures/Core.Wpf/InlineHints/InlineHintsTaggerProvider.cs
浏览文件 @
8f220bd4
...
...
@@ -24,8 +24,8 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints
[
Export
(
typeof
(
IViewTaggerProvider
))]
[
ContentType
(
ContentTypeNames
.
RoslynContentType
)]
[
TagType
(
typeof
(
IntraTextAdornmentTag
))]
[
Name
(
nameof
(
Inline
ParameterName
HintsTaggerProvider
))]
internal
class
Inline
ParameterName
HintsTaggerProvider
:
IViewTaggerProvider
[
Name
(
nameof
(
InlineHintsTaggerProvider
))]
internal
class
InlineHintsTaggerProvider
:
IViewTaggerProvider
{
private
readonly
IViewTagAggregatorFactoryService
_viewTagAggregatorFactoryService
;
public
readonly
IClassificationFormatMapService
ClassificationFormatMapService
;
...
...
@@ -36,7 +36,7 @@ internal class InlineParameterNameHintsTaggerProvider : IViewTaggerProvider
[
ImportingConstructor
]
[
Obsolete
(
MefConstruction
.
ImportingConstructorMessage
,
error
:
true
)]
public
Inline
ParameterName
HintsTaggerProvider
(
public
InlineHintsTaggerProvider
(
IViewTagAggregatorFactoryService
viewTagAggregatorFactoryService
,
IClassificationFormatMapService
classificationFormatMapService
,
IClassificationTypeRegistryService
classificationTypeRegistryService
,
...
...
@@ -61,8 +61,8 @@ internal class InlineParameterNameHintsTaggerProvider : IViewTaggerProvider
return
null
;
}
var
tagAggregator
=
_viewTagAggregatorFactoryService
.
CreateTagAggregator
<
Inline
ParameterName
HintDataTag
>(
textView
);
return
new
Inline
ParameterName
HintsTagger
(
this
,
(
IWpfTextView
)
textView
,
buffer
,
tagAggregator
)
as
ITagger
<
T
>;
var
tagAggregator
=
_viewTagAggregatorFactoryService
.
CreateTagAggregator
<
InlineHintDataTag
>(
textView
);
return
new
InlineHintsTagger
(
this
,
(
IWpfTextView
)
textView
,
buffer
,
tagAggregator
)
as
ITagger
<
T
>;
}
}
}
src/EditorFeatures/Core/EditorFeaturesResources.resx
浏览文件 @
8f220bd4
...
...
@@ -936,8 +936,8 @@ Do you want to proceed?</value>
<data
name=
"external"
xml:space=
"preserve"
>
<value>
(external)
</value>
</data>
<data
name=
"Inline_
Parameter_Name_
Hints"
xml:space=
"preserve"
>
<value>
Inline
Parameter Name
Hints
</value>
<data
name=
"Inline_Hints"
xml:space=
"preserve"
>
<value>
Inline Hints
</value>
</data>
<data
name=
"Error_creating_instance_of_CodeFixProvider_0"
xml:space=
"preserve"
>
<value>
Error creating instance of CodeFixProvider '{0}'
</value>
...
...
src/EditorFeatures/Core/InlineHints/Inline
ParameterName
HintDataTag.cs
→
src/EditorFeatures/Core/InlineHints/InlineHintDataTag.cs
浏览文件 @
8f220bd4
...
...
@@ -11,20 +11,18 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints
/// The simple tag that only holds information regarding the associated parameter name
/// for the argument
/// </summary>
internal
class
Inline
ParameterName
HintDataTag
:
ITag
internal
class
InlineHintDataTag
:
ITag
{
public
readonly
SymbolKey
ParameterSymbolKey
;
public
readonly
string
ParameterName
;
public
readonly
string
Text
;
public
readonly
SymbolKey
?
SymbolKey
;
public
Inline
ParameterNameHintDataTag
(
SymbolKey
parameterSymbolKey
,
string
parameterName
)
public
Inline
HintDataTag
(
string
text
,
SymbolKey
?
symbolKey
)
{
if
(
parameterName
.
Length
==
0
)
{
throw
new
ArgumentException
(
"Must have a length greater than 0"
,
nameof
(
parameterName
));
}
if
(
text
.
Length
==
0
)
throw
new
ArgumentException
(
"Must have a length greater than 0"
,
nameof
(
text
));
ParameterSymbolKey
=
parameterSymbolKey
;
ParameterName
=
parameterName
;
Text
=
text
;
SymbolKey
=
symbolKey
;
}
}
}
src/EditorFeatures/Core/InlineHints/Inline
ParameterName
HintsDataTaggerProvider.cs
→
src/EditorFeatures/Core/InlineHints/InlineHintsDataTaggerProvider.cs
浏览文件 @
8f220bd4
...
...
@@ -27,9 +27,9 @@ namespace Microsoft.CodeAnalysis.Editor.InlineHints
/// </summary>
[
Export
(
typeof
(
IViewTaggerProvider
))]
[
ContentType
(
ContentTypeNames
.
RoslynContentType
)]
[
TagType
(
typeof
(
Inline
ParameterName
HintDataTag
))]
[
Name
(
nameof
(
Inline
ParameterName
HintsDataTaggerProvider
))]
internal
class
Inline
ParameterNameHintsDataTaggerProvider
:
AsynchronousViewTaggerProvider
<
InlineParameterNam
eHintDataTag
>
[
TagType
(
typeof
(
InlineHintDataTag
))]
[
Name
(
nameof
(
InlineHintsDataTaggerProvider
))]
internal
class
Inline
HintsDataTaggerProvider
:
AsynchronousViewTaggerProvider
<
Inlin
eHintDataTag
>
{
private
readonly
IAsynchronousOperationListener
_listener
;
...
...
@@ -37,7 +37,7 @@ internal class InlineParameterNameHintsDataTaggerProvider : AsynchronousViewTagg
[
Obsolete
(
MefConstruction
.
ImportingConstructorMessage
,
error
:
true
)]
[
ImportingConstructor
]
public
Inline
ParameterName
HintsDataTaggerProvider
(
public
InlineHintsDataTaggerProvider
(
IThreadingContext
threadingContext
,
IAsynchronousOperationListenerProvider
listenerProvider
,
IForegroundNotificationService
notificationService
)
...
...
@@ -76,7 +76,7 @@ protected override IEnumerable<SnapshotSpan> GetSpansToTag(ITextView textView, I
return
SpecializedCollections
.
SingletonEnumerable
(
visibleSpanOpt
.
Value
);
}
protected
override
async
Task
ProduceTagsAsync
(
TaggerContext
<
Inline
ParameterName
HintDataTag
>
context
,
DocumentSnapshotSpan
documentSnapshotSpan
,
int
?
caretPosition
)
protected
override
async
Task
ProduceTagsAsync
(
TaggerContext
<
InlineHintDataTag
>
context
,
DocumentSnapshotSpan
documentSnapshotSpan
,
int
?
caretPosition
)
{
var
cancellationToken
=
context
.
CancellationToken
;
var
document
=
documentSnapshotSpan
.
Document
;
...
...
@@ -91,11 +91,11 @@ protected override async Task ProduceTagsAsync(TaggerContext<InlineParameterName
Contract
.
ThrowIfNull
(
parameterHint
.
Parameter
);
cancellationToken
.
ThrowIfCancellationRequested
();
context
.
AddTag
(
new
TagSpan
<
Inline
ParameterName
HintDataTag
>(
context
.
AddTag
(
new
TagSpan
<
InlineHintDataTag
>(
new
SnapshotSpan
(
snapshotSpan
.
Snapshot
,
parameterHint
.
Position
,
0
),
new
Inline
ParameterName
HintDataTag
(
parameterHint
.
Parameter
.
GetSymbolKey
(
cancellationToken
)
,
parameterHint
.
Parameter
.
Name
)));
new
InlineHintDataTag
(
parameterHint
.
Parameter
.
Name
,
parameterHint
.
Parameter
.
GetSymbolKey
(
cancellationToken
)
)));
}
}
}
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Přejít na základní typ
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"
translated"
>
Nápovědy k názvům vložených parametrů
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"
new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Zu Basis wechseln
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Ir a base
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Accéder à la base
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Vai a base
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
基本へ移動
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
기본으로 이동
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Przejdź do podstawy
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Ir Para a Base
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Перейти к базовому
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
Tabana Git
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
转到基础映像
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"
translated"
>
内联参数名提示
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"
new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf
浏览文件 @
8f220bd4
...
...
@@ -77,9 +77,9 @@
<target
state=
"translated"
>
移至基底
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_
Parameter_Name_
Hints"
>
<source>
Inline
Parameter Name
Hints
</source>
<target
state=
"new"
>
Inline
Parameter Name
Hints
</target>
<trans-unit
id=
"Inline_Hints"
>
<source>
Inline Hints
</source>
<target
state=
"new"
>
Inline Hints
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Invalid_assembly_name"
>
...
...
src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs
浏览文件 @
8f220bd4
...
...
@@ -56,6 +56,24 @@ internal static class InlineHintsOptions
nameof
(
SuppressForParametersThatMatchMethodIntent
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.SuppressForParametersThatMatchMethodIntent"
));
public
static
readonly
PerLanguageOption2
<
bool
>
EnabledForTypes
=
new
(
nameof
(
InlineHintsOptions
),
nameof
(
EnabledForTypes
),
defaultValue
:
false
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.InlineTypeHints"
));
public
static
readonly
PerLanguageOption2
<
bool
>
ForImplicitVariableTypes
=
new
(
nameof
(
InlineHintsOptions
),
nameof
(
ForImplicitVariableTypes
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.InlineTypeHints.ForImplicitVariableTypes"
));
public
static
readonly
PerLanguageOption2
<
bool
>
ForLambdaParameterTypes
=
new
(
nameof
(
InlineHintsOptions
),
nameof
(
ForLambdaParameterTypes
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.InlineTypeHints.ForLambdaParameterTypes"
));
}
[
ExportOptionProvider
,
Shared
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录