Skip to content

Commit f2610d7

Browse files
committed
尝试修正模糊匹配检索失败的问题; 尝试修正特殊输入(新建事件等)被破坏的问题;
1 parent d332a72 commit f2610d7

File tree

4 files changed

+12
-25
lines changed

4 files changed

+12
-25
lines changed

src/Intellisense/IIdeographCompletion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal interface IIdeographCompletion
1212
/// <summary>
1313
/// 匹配文本
1414
/// </summary>
15-
string? MatchText { get; }
15+
string MatchText { get; }
1616

1717
#endregion Public 属性
1818
}

src/Intellisense/SyncCompletion/IdeographCompletionSource.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
5151
{
5252
foreach (var completion in allCompletions)
5353
{
54-
itemBuffer[bufferIndex++] = CloneCompletion(completion);
54+
itemBuffer[bufferIndex++] = completion;
5555
}
5656

5757
var processedCompletionSet = CreateNewCompletionSet(completionSet, new ArrayBaseEnumerator<Completion>(itemBuffer, 0, bufferIndex));
@@ -86,19 +86,6 @@ private static CompletionSet CreateNewCompletionSet(CompletionSet completionSet,
8686
}
8787
}
8888

89-
private Completion CloneCompletion(Completion originCompletion)
90-
{
91-
return originCompletion switch
92-
{
93-
Completion4 completion4 => completion4.Suffix?.Length > 0
94-
? new IdeographCompletion4(displayText: completion4.DisplayText, suffix: completion4.Suffix, matchText: null, origin: completion4)
95-
: new IdeographCompletion4(displayText: completion4.DisplayText, matchText: null, origin: completion4),
96-
Completion3 completion3 => new IdeographCompletion3(displayText: completion3.DisplayText, matchText: null, origin: completion3),
97-
Completion2 completion2 => new IdeographCompletion2(displayText: completion2.DisplayText, matchText: null, origin: completion2),
98-
_ => new IdeographCompletion(displayText: originCompletion.DisplayText, matchText: null, origin: originCompletion),
99-
};
100-
}
101-
10289
private Completion CreateCompletion(Completion originCompletion, string originInsertText, string spelling)
10390
{
10491
var displayText = FormatString(Options.SyncCompletionDisplayTextFormat, spelling, originInsertText);

src/Intellisense/SyncCompletion/IdeographCompletions.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ internal class IdeographCompletion : Completion, IIdeographCompletion
2727

2828
public override string InsertionText { get => _origin.InsertionText; set => _origin.InsertionText = value; }
2929

30-
public string? MatchText { get; }
30+
public string MatchText { get; }
3131

3232
public override PropertyCollection Properties => _origin.Properties;
3333

3434
#endregion Public 属性
3535

3636
#region Public 构造函数
3737

38-
public IdeographCompletion(string displayText, string? matchText, Completion origin)
38+
public IdeographCompletion(string displayText, string matchText, Completion origin)
3939
{
4040
DisplayText = displayText;
4141
MatchText = matchText;
@@ -66,15 +66,15 @@ internal class IdeographCompletion2 : Completion2, IIdeographCompletion
6666

6767
public override string InsertionText { get => _origin.InsertionText; set => _origin.InsertionText = value; }
6868

69-
public string? MatchText { get; }
69+
public string MatchText { get; }
7070

7171
public override PropertyCollection Properties => _origin.Properties;
7272

7373
#endregion Public 属性
7474

7575
#region Public 构造函数
7676

77-
public IdeographCompletion2(string displayText, string? matchText, Completion2 origin)
77+
public IdeographCompletion2(string displayText, string matchText, Completion2 origin)
7878
{
7979
DisplayText = displayText;
8080
MatchText = matchText;
@@ -107,15 +107,15 @@ internal class IdeographCompletion3 : Completion3, IIdeographCompletion
107107

108108
public override string InsertionText { get => _origin.InsertionText; set => _origin.InsertionText = value; }
109109

110-
public string? MatchText { get; }
110+
public string MatchText { get; }
111111

112112
public override PropertyCollection Properties => _origin.Properties;
113113

114114
#endregion Public 属性
115115

116116
#region Public 构造函数
117117

118-
public IdeographCompletion3(string displayText, string? matchText, Completion3 origin)
118+
public IdeographCompletion3(string displayText, string matchText, Completion3 origin)
119119
{
120120
DisplayText = displayText;
121121
MatchText = matchText;
@@ -148,23 +148,23 @@ internal class IdeographCompletion4 : Completion4, IIdeographCompletion
148148

149149
public override string InsertionText { get => _origin.InsertionText; set => _origin.InsertionText = value; }
150150

151-
public string? MatchText { get; }
151+
public string MatchText { get; }
152152

153153
public override PropertyCollection Properties => _origin.Properties;
154154

155155
#endregion Public 属性
156156

157157
#region Public 构造函数
158158

159-
public IdeographCompletion4(string displayText, string suffix, string? matchText, Completion4 origin)
159+
public IdeographCompletion4(string displayText, string suffix, string matchText, Completion4 origin)
160160
: base(displayText: null, insertionText: null, description: null, iconMoniker: default, suffix: suffix)
161161
{
162162
DisplayText = displayText;
163163
MatchText = matchText;
164164
_origin = origin;
165165
}
166166

167-
public IdeographCompletion4(string displayText, string? matchText, Completion4 origin)
167+
public IdeographCompletion4(string displayText, string matchText, Completion4 origin)
168168
{
169169
DisplayText = displayText;
170170
MatchText = matchText;

src/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="ChinesePinyinIntelliSenseExtender.4293B766-9575-4472-B6F0-98BD86737E0D" Version="1.3.1" Language="en-US" Publisher="Stratos" />
4+
<Identity Id="ChinesePinyinIntelliSenseExtender.4293B766-9575-4472-B6F0-98BD86737E0D" Version="1.3.2" Language="en-US" Publisher="Stratos" />
55
<DisplayName>IntelliSense汉语拼音拓展</DisplayName>
66
<Description xml:space="preserve">汉语拼音的IntelliSense拓展。(支持基于 IAsyncCompletionSource 的完成,如: C#、JS等;支持自定义字符映射;)</Description>
77
<MoreInfo>https://github.com/stratosblue/chinesepinyinintellisenseextender</MoreInfo>

0 commit comments

Comments
 (0)