ONE-vscode icon indicating copy to clipboard operation
ONE-vscode copied to clipboard

[OneExplorer] Support cfg refactoring

Open dayo09 opened this issue 2 years ago • 4 comments

What?

When a filename changes, change the line of corresponding filename in cfg.
(NOT When a filename line in cfg changes, change the actual filename.)

From https://github.sec.samsung.net/RS7-RuntimeNTools/secret/issues/187#issuecomment-1522094

GIF 를 보고 번뜩 떠오른 생각 입니다. *.tflite 파일에 대해 rename 기능과 별개로 refactoring 기능이 있으면 좋겠네요. refactoring시에는 *.tflite 파일 이름만 변경하는것이 아니라, 해당 파일이 참조된 *.cfg 파일 내부의 *.tflite 이름까지도 자동으로 함께 변경해주는....


Point

  1. File(abs path) to URI mapping relation
  • A single derived model file can be mapped to multiple tree item URIs or none. (1-> 0|1|Many)
  • A single base model file can be mapped to a unique tree item URI (1 -> 1)
  • A single cfg file can be mapped to a unique URI or none (1 -> 0|1)

dayo09 avatar Jun 09 '22 07:06 dayo09

As this job is considered to be lowered priority, I remove this job from the milestone.

dayo09 avatar Jul 18 '22 01:07 dayo09

@lemmaa I made this 'refactoring cfg' feature out as can be seen in GIF, I wonder if you have any better idea about the UI :-D

This commit enables refactoring by renaming, so that the model file renaming can be automatically applied to related config files. It renames all the changed model file names in children config files.

ONE-vscode-DCO-1.0-Signed-off-by: Dayoung Lee [email protected]

For #768

GIF

1017-refactor

dayo09 avatar Oct 17 '22 08:10 dayo09

How vscode support 'Refactor' of symbols

1019-refactor-vscode

  • Command name: 'Rename Symbol'
  • Options:Enter to 'Rename' & Shift+Enter to 'Preview'
  • 'Preview' shows Renaming Candidates
  • It edits the document, not saving it.

dayo09 avatar Oct 19 '22 04:10 dayo09

TODOs

  • [x] Introduce the simple refactoring command which we have discussed so far. It will ask user if he/she will do 'Refactor', and if user answers 'yes', it will alter all the related configs and save. Command name can be 'Rename Base Model' #1361

    • [ ] Keep the node's collapsing status
  • [ ] Make it not to save but to only edit using CfgEditor.

  • [ ] Consider if I can show the 'panel'(as you can see in above gif, vscode shows the list of lines to be changed) to let user select which config file to be changed.

  • Reference : vscode panel https://code.visualstudio.com/api/ux-guidelines/panel

dayo09 avatar Oct 19 '22 04:10 dayo09