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

Highlight the "namespace" of nested components as such #3

Open
alexlafroscia opened this issue Mar 1, 2021 · 2 comments
Open

Highlight the "namespace" of nested components as such #3

alexlafroscia opened this issue Mar 1, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@alexlafroscia
Copy link
Collaborator

A Glimmer component name can have :: to denote a "namespace", where a component is inside of a directory

It might be nice to allow the namespace to be highlighted independently from the component name -- I'm sure there's a @namespace highlight or something, for languages like Ruby that use that frequently.

At the very least, the namespace should be part of the tag; : is not considered to be part of the tag right now.

<Directory::Component />
  {{! <- namespace }}
@alexlafroscia alexlafroscia added the bug Something isn't working label Mar 1, 2021
alexlafroscia added a commit that referenced this issue Mar 2, 2021
Not supporting this was reported in #2

Note that we use a short-cut here to enable mustache statements inside
of a string that disallows a `{` to appear inside a "concat statement".

Technically this should be allowed, though I would say it's quite rare.

Issue #3 was files to keep track of eventually fixing that, though it
will likely require moving the scanner into C to pull that off.

The problem is that `{` alone is safe, but `{{` together is not, and I'm
not sure you can write a regex that TreeSitter supports that can capture
that correctly.
@alexlafroscia
Copy link
Collaborator Author

^ Ignore the reference in that commit; that was in error

@alexlafroscia alexlafroscia added enhancement New feature or request and removed bug Something isn't working labels Mar 10, 2021
@alexlafroscia
Copy link
Collaborator Author

alexlafroscia commented Mar 10, 2021

I assumed that languages like Ruby, that use namespaced identifiers, highlight the namespace differently. It turns out that it doesn't seem like they do! Maybe we shouldn't, either... It might be enough to just highlight the :: separator itself as a single token.

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

No branches or pull requests

1 participant