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

Unable to correctly recognize {/} when ifdef/else preprocessor directives are present #8

Open
Crazyokd opened this issue Jan 2, 2024 · 2 comments

Comments

@Crazyokd
Copy link

Crazyokd commented Jan 2, 2024

i found the number of { can't be identified correctly in below situation.

#!ifdef WITH_AUTH
	if (!ims_www_authenticate("$td")) {
#!else
	if (($var(alg) == "MD5") && (!ims_www_authenticate("$td"))) {
#!endif

image

whatsoever circumstances, There should be only one valid {, but it recognizes it as two, causing an error in bracket matching.

@miconda
Copy link
Owner

miconda commented Jan 3, 2024

I don't think this can be covered without a language server, which is not an easy task. The (not the nicest) variants for now would be:

  • move the opening curly brace on the next line:
#!ifdef WITH_AUTH
   if( ... )
#!else
   if( ... )
#!end
   {
  • to have similar ifdef for closing curly braces.
#!ifdef WITH_AUTH
   }
#!else
   }
#!end

Not having the knowledge nor the time for it, I am going to close this issue soon if nobody else volunteers to develop it.

@werebear73
Copy link
Contributor

I have looked at building a language server for this project a couple of times and it makes my head swim. I haven't given up but it may be awhile.

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

3 participants