mikaeljorhult / brackets-todo

Brackets/Edge Code extension that displays all TODO comments in current document or project.
144 stars 37 forks source link

Add Lua TODO prefix support #134

Closed hulu1522 closed 7 years ago

mikaeljorhult commented 7 years ago

Looks good. To you have an example file (in Lua) for me to test?

hulu1522 commented 7 years ago

@mikaeljorhult

Example:

  -- =============================================================
  -- TODO: Remove after other apps handle unique login requests  =
  -- =============================================================
  local addr = ngx.header["CF-Connecting-IP"] or
               ngx.header["Fastly-Client-IP"] or
               ngx.header["Incap-Client-IP"]  or
               ngx.header["X-Real-IP"]

  -- NOTE: This is only used as a last resort for IP
  if not addr then
    addr = ngx.header["X-Forwarded-For"]
    if addr then
      local s = (addr:find(',', 1, true))
      if s then
          addr = addr:sub(1, s - 1)
      end
    else
      addr = ngx.var.remote_addr
    end
  end
mikaeljorhult commented 7 years ago

Great! Thank you, again!