Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PRQL to SQL context menus to PRQL editor title #41

Closed
RandomFractals opened this issue Feb 3, 2023 · 2 comments
Closed

Add PRQL to SQL context menus to PRQL editor title #41

RandomFractals opened this issue Feb 3, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@RandomFractals
Copy link
Collaborator

This change would add direct access to the prqlSqlOutputPanel.open command to the open PRQL editor title menu and vscode title bar context menu.

Required package.json changes to the extension contributes config:

...
    "commands": [
      {
        "command": "prqlSqlOutputPanel.open",
        "title": "Open SQL Output Panel",
        "category": "PRQL",
        "icon": "$(database)"
      }
    ],
    "menus": {
      "editor/title": [
        {
          "command": "prqlSqlOutputPanel.open",
          "when": "resourceFilename =~ /.*(.prql)/",
          "group": "navigation"
        }
      ],
      "editor/title/context": [
        {
          "command": "prqlSqlOutputPanel.open",
          "when": "resourceFilename =~ /.*\\.(prql)/",
          "group": "navigation"
        }
      ]
    }
...

We can use the standard vscode $(database} icon to expose Open SQL Output Panel command in the top right corner of editor panel as depicted below:

prql-to-sql-db-icon-context-menu

@max-sixty
Copy link
Member

I think this would be great!

@RandomFractals
Copy link
Collaborator Author

RandomFractals commented Feb 4, 2023

Closing this as it was merged into main branch as part of PR #40.

We might consider changing prqlSqlOutputPanel.open command and editor title menu icon from $(database) to $(open-preview) and use the database icon later on for selection of database to connect to and run generated SQL.

I'll expand more on it in #42.

max-sixty pushed a commit that referenced this issue Feb 5, 2023
* use prql logo icon for .prql file ext. in prql language config (#39)

* add Open SQL Output Panel editor title and context menus (#41)

* rename Sql Ouput Panel to SQL Preview

- rename preview command to prql.openSqlPreview
- use vscode open-preview icon in the editor panel title bar for Sql Preview command
- rename sql output panel title to Sql Preview
- rename sql ouput panel id to prql.sqlPreviewPanel
- update Sql Preview info in README.md

Remaining: generate new demo gif with all the recent PRQL iconography and menu options update.
@RandomFractals RandomFractals added the enhancement New feature or request label Feb 8, 2023
@RandomFractals RandomFractals self-assigned this Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants