File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 11module . exports = {
2- CLI_SELCTOR_MAX_DISPLAYING_LOG : 5 ,
32 UI_String : {
43 TYPE_INPUT : 'Type input.' ,
54 } ,
Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ const path = require("path");
33const findFiles = require ( "./findFiles" ) ;
44const fs = require ( "fs" ) ;
55const { getProperties, getInput, getQuickPick } = require ( "./util" ) ;
6- const { CLI_SELCTOR_MAX_DISPLAYING_LOG , UI_String } = require ( "./constant" ) ;
6+ const { UI_String } = require ( "./constant" ) ;
7+
8+ // fetch setting value from vscode's settings
9+ // See package.json's contributes's configuration
10+ const maxLogDisplayCnt = vscode . workspace . getConfiguration ( ) . get ( 'code.replacer.setting' ) ;
711
812/**
913 * @param {vscode.ExtensionContext } context
@@ -60,7 +64,8 @@ const fetchLog = ({ jsonPath, keyName }) => {
6064 const usageLogJson = require ( jsonPath )
6165
6266 let displayCnt = 0
63- const maxDisplayCnt = CLI_SELCTOR_MAX_DISPLAYING_LOG
67+ const maxDisplayCnt = maxLogDisplayCnt
68+ console . log ( maxLogDisplayCnt )
6469 const keys = Object . keys ( usageLogJson ) . reverse ( )
6570 for ( const usageLogKey of keys ) {
6671 if ( usageLogJson [ usageLogKey ] [ keyName ] && ! logs . includes ( usageLogJson [ usageLogKey ] [ keyName ] ) && ( displayCnt < maxDisplayCnt ) ) {
Original file line number Diff line number Diff line change 1414 "categories" : [
1515 " Other"
1616 ],
17+ "keywords" : [
18+ " vscode-plugin" ,
19+ " cope-replacing"
20+ ],
1721 "activationEvents" : [
1822 " onCommand:code-replacer-vscode-plugin.entry"
1923 ],
2226 "commands" : [
2327 {
2428 "command" : " code-replacer-vscode-plugin.entry" ,
25- "title" : " rp"
29+ "title" : " rp" ,
30+ "icon" : " image/rp.svg" ,
31+ "category" : " code-replacer entry point"
32+ }
33+ ],
34+ "configuration" : {
35+ "title" : " codeReplacerSetting" ,
36+ "properties" : {
37+ "code.replacer.setting" : {
38+ "type" : " integer" ,
39+ "default" : 5 ,
40+ "description" : " Please specify up to how many logs you want to display."
41+ }
2642 }
27- ]
43+ }
2844 },
2945 "scripts" : {
3046 "lint" : " eslint ." ,
You can’t perform that action at this time.
0 commit comments