ManuelGil / vscode-angular-generator

Angular File Generator is a Visual Studio Code extension that allows you to generate Angular files with a few clicks. It is based on the Angular CLI and uses the same schematics as the CLI. It also allows you to generate files from the terminal.
https://marketplace.visualstudio.com/items?itemName=imgildev.vscode-angular-generator
MIT License
4 stars 2 forks source link

[Feature request] custom commands list #3

Open BachiMjavanadze opened 4 months ago

BachiMjavanadze commented 4 months ago

Please allow the ability to create a list of custom commands; Let's say I often create a component with the same settings:

image

add last item to menu:

image

if I select it, I can create a name for my template. My custom template should be stored somewhere in .vscode and the next time I can call it:

image

system should not ask anything, just a name of template.

ManuelGil commented 4 months ago

Hi @BachiMjavanadze ,

The request is very clear, but at the same time very specific. When building an extension, the goal is to have general features that can be applied to various scenarios.

This does not mean that the request is not approved for this reason, because although the work is quite a lot, the biggest drawback is the little flexibility offered by the VSCode API to build dynamic menus (since menus are not built at the code level but through a manifest as explained in the official documentation).

Unfortunately, building this feature is impractical, so it will not be added to the extension.

BachiMjavanadze commented 4 months ago

@ManuelGil Hi!

The request is very clear, but at the same time very specific. When building an extension, the goal is to have general features that can be applied to various scenarios.

I don't think this is my specific request. I just don't want to do the same routine every time. In our project, we agreed that we would only create a standalone component using inline CSS and inline template. I don't want to have to click the same menu items every time, it could be easier.

the biggest drawback is the little flexibility offered by the VSCode API to build dynamic menus (since menus are not built at the code level but through a manifest as explained in the official documentation

Your colleague almost solved this drawback. I'm talking about Customize Toolbar. Install this extention and read the descreption:

image

I don't care about restarting twice. Please just do it. Using this extension I created two buttons in the menu bar:

image

These are my extension settings, but do not write both buttons settings at the same time, write one, then restart (twice) and then write the second:

  "CustomizeToolbar.buttonConfig": [
    {
      "name": "Save All",
      "icon": "save-all",
      "command_vscode": "workbench.action.files.saveAll"
    },
    {
      "name": "Toggle AutoSave",
      "icon": "sync",
      "command_vscode": "workbench.action.toggleAutoSave"
    },
  ],

Perhaps this will give you a clearer idea of my request.

ManuelGil commented 4 months ago

@BachiMjavanadze

This is a specific request as I don't know of any extensions that can make dynamic changes to your menu. However, I don't think this is the point to discuss.

The solution presented is a partial and inefficient solution, which could be perceived as a bug by other users.

In order to avoid annoyance on your part, I propose to add custom commands in the settings through a single item in the menu that does not affect the construction of the extension.

  "angular.submenu.customCommands": [
    {
      "name": "template 1",
      "command": "ng g c"
      "args": "--style css --standalone true --inline-style --inline-template --prefix custom"
    },
  ],

You can find this solution within the next 24 hours, hoping that it will be efficient enough to meet your needs.

BachiMjavanadze commented 4 months ago

Thanks!

BachiMjavanadze commented 4 months ago

@ManuelGil May I suggest you to create framework agnostic VSCode extension?

I mean this, but it has been abandoned for a long time. It only lacks one feature.

ManuelGil commented 4 months ago

I am not sure about working on this extension for two reasons:

  1. VSCode has in its API settings for task automation, which I don't know to what extent it can replace this extension as I have never used it. In case it could replace it, the extension would be instantly deprecated and it would not be feasible to release a new update.

  2. I am maintaining several extensions as Side Projects without generating revenue and I have some backlog of tasks, so it would be difficult for me to work on an extension that has a different structure than the structure and form of code that I already manage.