Skip to content

Commit 1ae87c8

Browse files
committed
添加选项"启用特殊提交支持",在某些场景下关闭以临时解决候选项与实际输入不符的问题
1 parent 462c53b commit 1ae87c8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/Intellisense/SyncCompletion/IdeographCompletionSource.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ private static CompletionSet CreateNewCompletionSet(CompletionSet completionSet,
9090

9191
private Completion CloneCompletion(Completion originCompletion)
9292
{
93-
if (originCompletion is ICustomCommit customCommitter)
93+
if (Options.EnableSpecialCommitSupport
94+
&& originCompletion is ICustomCommit customCommitter)
9495
{
9596
return originCompletion switch
9697
{
@@ -120,7 +121,8 @@ private Completion CreateCompletion(Completion originCompletion, string originIn
120121
{
121122
var displayText = FormatString(Options.SyncCompletionDisplayTextFormat, spelling, originInsertText);
122123

123-
if (originCompletion is ICustomCommit customCommitter)
124+
if (Options.EnableSpecialCommitSupport
125+
&& originCompletion is ICustomCommit customCommitter)
124126
{
125127
return originCompletion switch
126128
{

src/Options/Model/GeneralOptions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ internal class GeneralOptions : Options<GeneralOptions>
3939
[DefaultValue(true)]
4040
public bool EnableMultipleSpellings { get; set; } = true;
4141

42+
/// <summary>基础/启用特殊提交支持 (关闭时,对于特殊提交将会按字面值进行提交,如:xaml中智能提示"&lt;新建事件处理程序&gt;",将按字面值输入"&lt;新建事件处理程序&gt;",而不是创建事件执行方法并绑定。) </summary>
43+
[Category("基础")]
44+
[DisplayName("启用特殊提交支持")]
45+
[Description("关闭时,对于特殊提交将会按字面值进行提交,如:xaml中智能提示\"<新建事件处理程序>\",将按字面值输入\"<新建事件处理程序>\",而不是创建事件执行方法并绑定。")]
46+
[DefaultValue(true)]
47+
public bool EnableSpecialCommitSupport { get; set; } = true;
48+
4249
/// <summary>基础/启用同步完成支持(实验) (是否启用对同步完成的实验性支持,如:C++) </summary>
4350
[Category("基础")]
4451
[DisplayName("启用同步完成支持(实验)")]

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.4.1" Language="en-US" Publisher="Stratos" />
4+
<Identity Id="ChinesePinyinIntelliSenseExtender.4293B766-9575-4472-B6F0-98BD86737E0D" Version="1.4.2" Language="en-US" Publisher="Stratos" />
55
<DisplayName>IntelliSense汉语拼音拓展</DisplayName>
66
<Description xml:space="preserve">表意文字补全拓展(内置汉语拼音、五笔,支持自定义字符映射;)</Description>
77
<MoreInfo>https://github.com/stratosblue/chinesepinyinintellisenseextender</MoreInfo>

0 commit comments

Comments
 (0)