[Github-comments] [geany] Rewrite scope completion 3 (#862)

Colomban Wendling notifications at xxxxx
Wed Jan 13 16:57:05 UTC 2016


>  	}
> -	else if (typed != '.')
> -		return;
> +
> +	if (typed == '.')
> +		pos -= 1;
> +	else if (match_last_chars(sci, pos, context_sep))
> +		pos -= strlen(context_sep);
> +	else if ((ft->id == GEANY_FILETYPES_C || ft->id == GEANY_FILETYPES_CPP) &&
> +			match_last_chars(sci, pos, "->"))
> +		pos -= 2;
> +	else if (ft->id == GEANY_FILETYPES_CPP && match_last_chars(sci, pos, "->*"))
> +		pos -= 3;
> +	else

No, I meant that `\` is the character that separates namespaces *in PHP code*, so that typing `\` should trigger completion of namespaces members.

```php
<?php

namespace Ns {
	class Cls {
		static function f() { return 42; }
	}
}

namespace { /* root namespace -- yes, that's how PHP actually does it, too */
	echo Ns\Cls::f(); /* see how fun it is! */
	/* BTW, a leading \ makes the namespace resolution absolute, rather than relative to the current one */
	echo \Ns\Cls::f(); /* same as above */
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/862/files#r49617250
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160113/186ab249/attachment.html>


More information about the Github-comments mailing list