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

rewrite include to only be a single line #312

Merged
merged 2 commits into from
Jul 24, 2019
Merged

Conversation

matter123
Copy link
Collaborator

This PR rewrites the meta_preprocessor_include pattern from a range to a simple match.

Motivation


Standard Conformance

[cpp.include] Specifies that a header path cannot contain a newline. The original pattern was over matching by being a range.

Additionally, paragraph 4 permits a macro to be used as a the include path. This currently has no highlight for such contructs.

Avoiding repaints

If the #include directive is actively being typed, and as a result is incomplete/ The current grammar would often cause repaints of large swaths of the document. This is not only slow and unnecessary but often annoying.

Supporting compiler extensions

See textmate/c.tmbundle#66

@jeff-hykin jeff-hykin merged commit 8190fd2 into master Jul 24, 2019
@jeff-hykin jeff-hykin deleted the Add/one-line-include branch July 24, 2019 23:20
@matter123
Copy link
Collaborator Author

Running the tests it looks like I forgot the scope meta.preprocessor.include and changes the scope string.quoted.other.lt-gt.include to string.quoted.lt-gt.include (note the removal of other).

These should either be fixed or documented as changes.

@jeff-hykin
Copy link
Owner

We should probably keep the originals for now

@jeff-hykin
Copy link
Owner

As soon as the scopes are back I'll re-merge this.

@matter123
Copy link
Collaborator Author

Yeah, I'm working on a fix with the correct scopes and support for #include <foo> //comment

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

Successfully merging this pull request may close these issues.

2 participants