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

variables not being tokenized #45

Closed
tat3r opened this issue Mar 28, 2019 · 5 comments
Closed

variables not being tokenized #45

tat3r opened this issue Mar 28, 2019 · 5 comments
Labels
☠️ provably impossible Things that are actually impossible with Textmate

Comments

@tat3r
Copy link

tat3r commented Mar 28, 2019

Variables are not being tokenized in global or local scope. This is an issue with C syntax but possibly exists in C++ as well.

Screen Shot 2019-03-27 at 10 32 44 PM

Screen Shot 2019-03-27 at 10 33 04 PM

@jeff-hykin
Copy link
Owner

Sadly I think this is similar to #39.

Textmate markup isn't smart enough to know when a name is a variable.

It could be possible to tag it on declarations though, but it would only work for primitives. Is the issue for the declaration or for all instances of variables?

@jeff-hykin jeff-hykin added the 🔍 investigating More information is being gathered label Mar 28, 2019
@tat3r
Copy link
Author

tat3r commented Mar 28, 2019

all instances, however with foo.bar or foo->bar, bar gets picked up, but foo is still missing.

@jeff-hykin
Copy link
Owner

jeff-hykin commented Mar 29, 2019

Screen Shot 2019-03-28 at 7 06 55 PM

`foo.bar` should be picked up.

Sadly, tagging all instances is impossible without a powerful C/C++ specific parser. Its way outside the ability of TextMate grammars.

For example:

#ifdef thing
    int x = 10;
#else 
    class x { };
#endif 

Its basically impossible to know what x is without emulating the entire C/C++ preprocessor

@jeff-hykin jeff-hykin added ☠️ provably impossible Things that are actually impossible with Textmate and removed 🔍 investigating More information is being gathered labels Mar 29, 2019
@matter123
Copy link
Collaborator

struct f foo Could mark f as type like C++ does.
additionally for both C and C++ enum f foo should mark f as a type.

C++ C
Screenshot from 2019-03-28 18-30-55 Screenshot from 2019-03-28 18-32-32

@jeff-hykin
Copy link
Owner

Lets create a new issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☠️ provably impossible Things that are actually impossible with Textmate
Projects
None yet
Development

No branches or pull requests

3 participants