microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.62k stars 28.39k forks source link

Show Comments in TextMate Scope Inspector #206192

Open Number-3434 opened 5 months ago

Number-3434 commented 5 months ago

In TextMate grammar, you can declare comments like so:

[
  {
    "match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?",
    "name": "meta.tag.sgml.doctype.html",
    "comment": "Doctype declaration."
  },
]

It would be useful if VSCode showed the comments in some way, as currently they are only descriptive in the TextMate file, and do not provide any external help.

This could be used to provide basic documentation for TextMate scopes.

You can also declare names for token customisations.

Proposal

Show comments in the TextMate scope inspector (access using Developer: Inspect Editor Tokens and Scopes (editor.action.inspectTMScopes))

image

Views

### Tasks
- [ ] https://github.com/microsoft/vscode-textmate/issues/227
Number-3434 commented 5 months ago

@RedCMD would you like this?

EDIT: @RedCMD this is in the Backlog now!

alexr00 commented 5 months ago

Took a quick look at adding this. It will need a change in vscode-textmate. It should be very easy to show the comments in VS Code if https://github.com/microsoft/vscode-textmate/issues/227 is added.

Number-3434 commented 5 months ago

Wow, thank you 😊!

alexr00 commented 5 months ago

@Number-3434 just to be clear, I don't know if or when https://github.com/microsoft/vscode-textmate/issues/227 will be added! But if it is, then the additional work will be small.

Number-3434 commented 5 months ago

@alexr00 I understand, I'm just very happy that it is now in the Backlog (instead of Backlog Candidates, which I've never been able to get more than 3 upvotes on) 😃.

Number-3434 commented 5 months ago

@alexr00 By the way, would it be possible to also include the name property in the TextMate customisations in editor.tokenColorCustomizations?

WilmarE commented 5 months ago

By the way, would it be possible to also include the name in the textmate customisations