-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Please support '<' ">' angle bracket in multiple line template in c++ #465
Comments
As I am a C++ user, I may get to this in the future, but it is low priority for me, so a pull request will most likely get it in much quicker. |
This is something that will be really helpful for me! I have had horrible bugs in template meta-programming just because sometimes is hard to distinguish if angles were right or not, and the compiler does not help very much. Another example of use, is to analyse errors of the generated code after some meta-programing. You literally get hundreds of angles, and one of them can give you clues where the error is coming from. |
Unfortunately, I rarely touch templates in the kind of C/C++ coding I do (mostly embedded systems). That's not to say templates aren't used in our code, I just rarely have to touch that area. Because of that, this has been pretty low on my priority list. Also, If the current syntax language doesn't scope these special, it may be difficult to pull this off as there are many ways angle brackets are used: shifting, comparing, header include, templates, etc. Anyways, it is on my list, I just can't promise when I'll get around to looking into this. |
Yes I understand that is very demanding, even compilers had troubles in the beginning to understand these codes. Even if you could program something that can recognise these scopes, I guess it will make BracketHighlighter very slow. So, I don't think that should be the approach here. Instead I would go in another direction which might be very easy to implement: activate template highlighter (i.e. a simple angle highlighter) with a hotkey when needed. The reason is that outside templates, angle brackets are very messy and difficult to understand and would require a lot of work to distinguish, however, inside templates there cannot be pointer operators, shifts operator, and static comparisons must be done within a parenthesis scope. It means that a simple angle highlighter is more than enough. Right now my approach is something near to that: I have a simple angle highlighter that I enable by hand only when i really need to be sure that templates are correct. Do you think that is too hard to add such a hotkey? |
I haven't looked yet, but if I have to code up a special template highlighter, that would be more difficult. I may be able to use existing Scopes, I just don't know yet. When I get a chance, I'll let you know. |
Please support '<' ">' angle bracket in multiple line template in c++ like the 'red' angle brackets in below image.
Because more and more people like to use template In modern C++ 11.
Thank you!
The text was updated successfully, but these errors were encountered: