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

Format strings not being handled in grammar #48

Open
fabioz opened this issue Jun 15, 2017 · 3 comments
Open

Format strings not being handled in grammar #48

fabioz opened this issue Jun 15, 2017 · 3 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@fabioz
Copy link

fabioz commented Jun 15, 2017

Given the grammar:

https://github.com/textmate/markdown.tmbundle/blob/master/Syntaxes/Markdown.tmLanguage it seems that vscode can't properly handle the construct https://github.com/textmate/markdown.tmbundle/blob/master/Syntaxes/Markdown.tmLanguage#L105

i.e.: when parsing a markdown with '##' with this construct (markup.heading.${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.markdown), it'd be expected that the result is markup.heading.2.markdown, whereas vscode is just giving markup.heading.${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.markdown as the result.

@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Aug 23, 2017
@alexdima
Copy link
Member

alexdima commented Aug 23, 2017

@fabioz Do you happen to know how one should interpret / substitute
${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}

i.e. what does it mean ?

https://github.com/textmate/markdown.tmbundle/blob/7a8ff34351f96d0a2c15b0f6fe1b0c7091fb08a2/Syntaxes/Markdown.tmLanguage#L105

@alexdima
Copy link
Member

alexdima commented Aug 23, 2017

From your comments at eclipse/tm4e#116

  • suppose the begin captured ##.
  • ${1} is '##'.
  • then proceed to match ## against (#)(#)?(#)?(#)?(#)?(#)? and replace with ${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}
    • ${6} through ${3} are '' (empty string)
    • ${2} is '#'
    • so the expression resolves to 2.

whoaaa

@alexdima alexdima added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Jul 12, 2019
@alexdima alexdima added this to the Backlog milestone Jul 12, 2019
@texastoland
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants