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

Repository is not illegal here. #13

Open
SSlinky opened this issue Sep 11, 2022 · 4 comments
Open

Repository is not illegal here. #13

SSlinky opened this issue Sep 11, 2022 · 4 comments

Comments

@SSlinky
Copy link

SSlinky commented Sep 11, 2022

image

  foo:
    name: some.scope.lang
    begin: "(?i)([a-z][a-z0-9_]*)\\s*\\("
    end: "\\)"
    patterns:
      - include: "#baz"
      - include: "#bar"
    repository:
      ...
@SSlinky
Copy link
Author

SSlinky commented Sep 11, 2022

Doesn't seem to like repository at any level below top.

image

@SSlinky
Copy link
Author

SSlinky commented Sep 11, 2022

image

  foo:
    name: some.scope.lang
    begin: "(?i)([a-z][a-z0-9_]*)\\s*\\("
    end: "\\)"
    patterns:
      - include: "#baz"
      - include: "#bar"
    repository:
      ...

Original is incorrect. For some reason, repository is not a supported key when the rule contains begin/end matches. The second comment stands. It is supported with no matches (just patterns, as above) and with a single match rule. e.g.

  foo:
    name: source.foo
    match: "If.*"
    captures:
      0:
        patterns:
          - include: "#bar"
    repository:
      bar:
        name: source.bar

image

@pedro-w
Copy link
Owner

pedro-w commented Nov 2, 2022

I tried this on the current development version of vscode-tmlanguage (i.e. not the one on the marketplace) which contains the fix for #12, on a file foo.tmLanguage.yaml containing just this:

  foo:
    name: source.foo
    match: "If.*"
    captures:
      0:
        patterns:
          - include: "#bar"
    repository:
      bar:
        name: source.bar

The result is:
image
I think this is OK? Can you point me to another file where it's not working?
Thanks!

@SSlinky
Copy link
Author

SSlinky commented Nov 16, 2022

Sure, this file shouldn't have any syntax issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants