diff --git a/lib/GetChineseExpression.js b/lib/GetChineseExpression.js index ddfce5ed03de34eeaeb0af0f882dd5f22a7451c1..06cef0df4fde8a5dccfea07d222aaa584b527859 100644 --- a/lib/GetChineseExpression.js +++ b/lib/GetChineseExpression.js @@ -10,7 +10,7 @@ module.exports = function 获得中文字符表示({ 表示方法, 文本, 选 } if (表示方法.indexOf('拼音')) { var 结果 = null - 结果 = 拼音(文本, { heteronym: 选项.使用多音字 == 'yes', style: 拼音.STYLE_NORMAL }) + 结果 = 拼音(文本, { heteronym: true, style: 拼音.STYLE_NORMAL }) 结果 = 结果.map(a => a.map(a => 转换为大写(a[0]) + a.substring(1))) 结果 = 多重笛卡尔积(结果).map(a => a.join('')) if (表示方法 != "全拼") diff --git a/package.json b/package.json index 4a8e72aa70a46b5f59c7e4499f865ed29d9f5e0c..3b2659a317a50d694db4e8e80384ea7f9eeaf50e 100755 --- a/package.json +++ b/package.json @@ -50,18 +50,6 @@ "谷歌拼音输入法(需能访问谷歌api)", "百度搜索联想" ] - }, - "ChineseInputAssistant.InputMethod_polyphone": { - "type": "string", - "default": "no", - "enum": [ - "no", - "yes" - ], - "enumDescriptions": [ - "不使用多音字", - "使用多音字" - ] } } }, diff --git "a/\350\241\245\345\205\250\345\256\236\347\216\260.js" "b/\350\241\245\345\205\250\345\256\236\347\216\260.js" index 2a5a898cf2d8a7665396f4783bde240045a51ec6..f874efed53e0b54b8ef1fd4224a9b2365836b3a0 100755 --- "a/\350\241\245\345\205\250\345\256\236\347\216\260.js" +++ "b/\350\241\245\345\205\250\345\256\236\347\216\260.js" @@ -45,7 +45,6 @@ async function provideCompletionItems(document, position, token, context) { var 用户配置 = {} 用户配置.使用输入法 = vscode.workspace.getConfiguration('ChineseInputAssistant').get("InputMethod") - 用户配置.使用多音字 = vscode.workspace.getConfiguration('ChineseInputAssistant').get("InputMethod_polyphone") 用户配置.提示方式 = vscode.workspace.getConfiguration('中文代码快速补全').get("提示方式") // log('用户配置', 用户配置) @@ -109,7 +108,7 @@ async function provideCompletionItems(document, position, token, context) { 补全项 = 补全项.map(a => R.set(R.lensProp('label'), `${a.label}\t${获得中文字符表示({ 表示方法: 用户配置.提示方式, 文本: a.label, - 选项: { 使用多音字: 用户配置.使用多音字 } + 选项: {} })}`, a)) log('补全项', 补全项.map(a => a.label))