TheRealSyler / vscode-sass-indented

Sass indented syntax support for VSCode
https://marketplace.visualstudio.com/items?itemName=Syler.sass-indented
Other
46 stars 8 forks source link

ContextMenu items bleed into other places #10

Closed octref closed 5 years ago

octref commented 5 years ago

Hi, this is Pine from VS Code team.

I found this issue in VS Code:

https://github.com/microsoft/vscode/issues/79224

image

I found the cause to be your contribution to view/item/context doesn't test view:

            "view/item/context": [
                {
                    "command": "sass.tree.addFromSelection",
                    "group": "0_below_nav",
                    "when": "viewItem != snippet"
                },
                {
                    "command": "sass.tree.insert",
                    "group": "navigation",
                    "when": "viewItem == snippet"
                },
                {
                    "command": "sass.tree.insertFolder",
                    "group": "navigation",
                    "when": "viewItem != snippet"
                },
                {
                    "command": "sass.tree.delete",
                    "group": "2_edit",
                    "when": "viewItem != root"
                },
                {
                    "command": "sass.tree.edit",
                    "group": "2_edit",
                    "when": "viewItem != root"
                },
                {
                    "command": "sass.tree.addFolder",
                    "group": "0_below_nav",
                    "when": "viewItem != snippet"
                },
                {
                    "command": "sass.tree.moveUp",
                    "group": "4_move",
                    "when": "viewItem != root"
                },
                {
                    "command": "sass.tree.moveDown",
                    "group": "4_move",
                    "when": "viewItem != root"
                },
                {
                    "command": "sass.tree.cut",
                    "group": "2_copyPaste",
                    "when": "viewItem != root"
                },
                {
                    "command": "sass.tree.copy",
                    "group": "2_copyPaste",
                    "when": "viewItem != root"
                },
                {
                    "command": "sass.tree.paste",
                    "group": "2_copyPaste",
                    "when": "viewItem != snippet"
                },
                {
                    "command": "sass.tree.openFile",
                    "group": "navigation",
                    "when": "viewItem == root"
                },
                {
                    "command": "sass.tree.recalculatePosition",
                    "group": "4_pos",
                    "when": "viewItem != snippet"
                },
                {
                    "command": "sass.tree.addFromFile",
                    "group": "0_below_nav",
                    "when": "viewItem != snippet"
                },
                {
                    "command": "sass.tree.addFromFileMixins",
                    "group": "1_addFrom",
                    "when": "viewItem!= snippet"
                },
                {
                    "command": "sass.tree.addFromFileVariables",
                    "group": "1_addFrom",
                    "when": "viewItem != snippet"
                }
            ]

However your package.json doesn't contains this part. Do you have a prepublish process that generates such a package.json?

You can check for view as well in the when clause, for example: https://github.com/microsoft/vscode-pull-request-github/blob/d91e778705cd5af0785c5a05184ebc550334b409/package.json#L575-L589

octref commented 5 years ago

Also, here's the official guide, hope it can help:

    "view/item/context": [
      {
        "command": "nodeDependencies.editEntry",
        "when": "view == nodeDependencies && viewItem == dependency",
        "group": "inline"
      },
      {
        "command": "nodeDependencies.deleteEntry",
        "when": "view == nodeDependencies && viewItem == dependency"
      }
    ]
TheRealSyler commented 5 years ago

@octref thanks for letting me know, i will make sure that its fixed in the next release, unfortunately I'm not at home until September, so it will take at least 10 days until I can fix it.