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

Test: contributes.resourceLabelFormatters #66910

Closed
2 tasks done
isidorn opened this issue Jan 22, 2019 · 4 comments
Closed
2 tasks done

Test: contributes.resourceLabelFormatters #66910

isidorn opened this issue Jan 22, 2019 · 4 comments

Comments

@isidorn
Copy link
Contributor

isidorn commented Jan 22, 2019

Complexity: 3

Now it is possible for extensions to contribute resource label formatters. Have an extension, in the package.json under the contributes section add a new resourceLabelFormatters contribution. Verify:

  • Naming and structure of fields make sense
  • Authority field is simple glob matched (you can use *)
  • Once the new resoruceLabelFormatter is registered it is respected accross the workbench (you can see this anywhere in the workbench where we display URIs - for example explorer hover)
  • If there are more resourceLabelFormatters which match the same URI we choose the most specific match
  • Uninstalling your extension and the URIs are no longer displayed according to rules you specified

For examples on resourceLabelFormatters check our vscode extensions.

fyi @chrmarti you migth volunteer to test

@rebornix
Copy link
Member

Not sure if I understand this contribution correctly, but I didn't make it as what's being documented. As the schema says, I can specify scheme as file and authority as *, which should match local files in explorer, but my formatting doesn't seem to take effect. I'd love to know first if I make any wrong assumption.

    "resourceLabelFormatters": [
      {
        "scheme": "file",
        "authority": "*",
        "formatting": {
            "label": "MYLABEL:${path}",
            "separator": "-",
            "tildify": true,
            "workspaceSuffix": "*"
        }
      }
    ]
  },

@isidorn
Copy link
Contributor Author

isidorn commented Jan 31, 2019

@rebornix nice example, however the issue here is that * does not match an empty string. This is an issue in our glob match library and @bpasero can comment more if this is unexpected behavior and what should be used to match the empty string.

We have already covered this in self hosting and in unit tests so if you do not find a nice example to test it is fine and feel free to close this test plan item.

@bpasero
Copy link
Member

bpasero commented Jan 31, 2019

Arguable a bug in the glob library, created #67651

@rebornix
Copy link
Member

Sounds good to me, thanks for the explanation.

@rebornix rebornix removed their assignment Jan 31, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants