AnWeber / vscode-statusbar-command

MIT License
16 stars 4 forks source link

Make "command" property optional #11

Closed moxwel closed 3 years ago

moxwel commented 3 years ago

I don't know if this is by design, a bug, or what, but I discover a trick.

If I put text: " " and no command on the Statusbar Commands, like this:

{"text": " ","priority": 1,"alignment": "left"}

It makes a "spacer".


For example:

{
  "text": "$(terminal)",
  "alignment": "left",
  "command": "workbench.action.terminal.toggleTerminal",
  "priority": 10030,
},
{"text": " ","priority": 10011,"alignment": "left"},
{
  "text": "$(file-binary) Hex",
  "alignment": "left",
  "command": "hexEditor.openFile",
  "priority": 10007,
},

That code makes a space between the two commands: image

I think it's very neat, but in settings.json, there's a warning:

image

I'm wondering if that "command" property can be optional? So, these warnings doesn't appear. Anyway, It's just a esthetic detail.

AnWeber commented 3 years ago

I released a update. Could you please test. Thanks

moxwel commented 3 years ago

Hmm, I just updated, and the warning is still there.

image


Edit: I think i got it why it still shows as "required". https://github.com/AnWeber/vscode-statusbar-command/blob/5ba54b91b342a94083f7a91f46274ccaee1240cf/package.json#L143-L146

I think you must erase the line with command in it.

AnWeber commented 3 years ago

Yes, you are right. That fixed it. Yesterday I did not test and edited the package.json in the browser. Now it works, tested. A nice feature by the way.

moxwel commented 3 years ago

Nice!