Samsung / ONE-vscode

Visual Studio Code Extension of ONE compiler toolchain
Apache License 2.0
48 stars 50 forks source link

Format command ids #728

Closed dayo09 closed 2 years ago

dayo09 commented 2 years ago

What?

Let's format our command names as one.\<module\>.\<command\>

  1. one. prefix
    • Use one instead of onevscode as our extension's official name is 'one'
  2. \<module\>.\<command\>
    • Currently, you can see that vscode defines their own commands as this.
    • workbench.view.earch (View: Show Search)
    • workbench.extensions.action.installExtensions (Extensions: Install Extensions)

Current command lists

onevscode.refresh-one-explorer ---> one.exploer.refresh
onevscode.create-cfg 
onevscode.flip-cfg-to-gui ----------> one.cfg-editor.open-gui
onevscode.flip-cfg-to-ini
onevscode.infer-model
onevscode.run-cfg
onevscode.rename-on-oneexplorer
onevscode.refresh-toolchain -------> one.toolchain.refresh
onevscode.install-toolchain
onevscode.uninstall-toolchain
onevscode.register-device ----------> one.devices.register 
onevscode.build
onevscode.import
onevscode.json-tracer
onevscode.configuration-settings
onevscode.toggle-codelens
onevscode.circle-tracer
onevscode.circle-graphview
onevscode.refresh-one-explorer
onevscode.refresh-toolchain
onevscode.install-toolchain
onevscode.register-device
onevscode.run-cfg
onevscode.rename-on-oneexplorer
onevscode.open-text-editor-on-one-explorer
onevscode.create-cfg
onevscode.uninstall-toolchain
onevscode.flip-cfg-to-gui
onevscode.flip-cfg-to-ini

Why?

  1. For our convinience -> There are basic operations like "add / move / delete" which one explorer / toolchain view/ device view will implement. Let's separate their namespace for convinience.

  2. To have sync with the naming rule of other vscode commands.

dayo09 commented 2 years ago

Namespace decisions

It's clear about explorer/toolchain/device view's commands, but it's hard to decide pre-existing function's workspace names.. Please suggest any ideas on this table.

🏃: PR ✔️ : Merged

Before After State
- one.explorer #757
onevscode.refresh-one-explorer one.explorer.refresh ✔️
onevscode.create-cfg one.explorer.createCfg ✔️
onevscode.run-cfg one.explorer.run ✔️
onevscode.rename-on-oneexplorer one.explorer.rename ✔️
onevscode.refresh-one-explorer one.explorer.refresh ✔️
onevscode.open-cfg-as-text one.explorer.openAsText ✔️
onevscode.open-cfg one.explorer.open ✔️
onevscode.openContainingFolder one.explorer.openContainingFolder ✔️
onevscode.collapse-all one.explorer.collapseAll ✔️
- one.toolchain #758
onevscode.refresh-toolchain one.toolchain.refresh ✔️
onevscode.install-toolchain one.toolchain.install ✔️
onevscode.uninstall-toolchain one.toolchain.uninstall ✔️
- one.editor #759
onevscode.flip-cfg-to-gui one.editor.openCfg ✔️
onevscode.flip-cfg-to-ini one.editor.openCfgAsText ✔️
onevscode.toggle-codelens one.editor.toggleCodelens ✔️
onevscode.configuration-settings one.editor.openCfgWithLegacyEditor ✔️
- one.device #762
onevscode.register-device one.device.register ✔️
- one.backend #763
onevscode.infer-model one.backend.infer ✔️
- one.viewer #766
onevscode.json-tracer one.viewer.chromeTracer ✔️
onevscode.circle-tracer one.viewer.circleTracer ✔️
onevscode.circle-graphview one.viewer.circleNetron ✔️
- one.project #761
onevscode.build onevscode.project.build ✔️
onevscode.import onevscode.project.import ✔️
hyunsik-yoon commented 2 years ago

onevscode.toggle-codelens

CodeLensProvider is in ONE-vscode/src/Editor/. I guess it's a part of editor.... How about one.editor.toggleCodelens?

likewise, onevscode.build -> onevscode.project.build onevscode.import -> onevscode.project.import onevscode.configuration-settings -> onevscode.config.show ? ... ?

dayo09 commented 2 years ago

@hyunsik-yoon Thanks for your opinions!

  1. one.editor.toggleCodelens and onevscode.project.build sounds cool.
  2. Actually, I don't know what onevscode.import does. Seemingly, it opens a cfg file... It might be not about project.
  3. configuration-settings looks like to open a legacy editor view. (maybe one.editor.openAsOneCfgLegacy ?)
hyunsik-yoon commented 2 years ago

@dayo09 Marking some of previous code to legacy also needs some consensus (and maybe some process) in future. So, it's kinda early to renaming it to legacy.

IMHO If you think some would become legacy or deprecated code, how about adding some comment like the following instead of spending time to rename it?

// TODO Consider renaming. Refer to https://github.com/Samsung/ONE-vscode/issues/728

dayo09 commented 2 years ago

@llFreetimell Could you give some opinion about those commands? (what they do, will they remain..)

command field
onevscode.import (deprecate?)
onevscode.configuration-settings (deprecate?)
llFreetimell commented 2 years ago

I think following five commands should be considered in the near future.

So how about setting those field as one.notdefined.* and then deprecate or reset them later? :D

llFreetimell commented 2 years ago

And if you don't mind, I want to suggest following idea :)

dayo09 commented 2 years ago

@llFreetimell

Well, I just come up with this:

one.editor.open one.editor.openAsText

I have genererated PR, so let's discuss there #759

dayo09 commented 2 years ago

What do you guys think about the namespace?

backend or device?

@yunjayh @struss

Before After
onevscode.register-device one.(backend/device).register
onevscode.infer-model one.(backend/device).infer
yunjayh commented 2 years ago

onevscode.infer-model was first introduced for temporal use. backend will be more appropriate for now, because infer itself only depends on backend, not devices.

However, if we consider about long term usage of command infer, I think neither backend nor device, but execute... or something is better for its namespace. The infer command can be done on both toolchain and device.

Would you like to remain current infer as backend.infer and change it including the namespace when full functions are intruduced?

dayo09 commented 2 years ago

@yunjayh Yeah, sure :-D Then, one.backend.infer. Thanks for your opinion.

dayo09 commented 2 years ago

@struss gave me an opinion of one.device.register by knox chat.

dayo09 commented 2 years ago

Done!