[KDevelop/PHP] Importing functions and const from other namespaces
ClosedPublic

Authored by hmitonneau on Dec 13 2019, 3:38 PM.

Details

Summary

T6810
Add support for syntax use const xxx\xxx and use function xxx\xxx

Diff Detail

Repository
R52 KDevelop: PHP Support
Lint
Lint Skipped
Unit
Unit Tests Skipped
hmitonneau created this revision.Dec 13 2019, 3:38 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptDec 13 2019, 3:38 PM
hmitonneau requested review of this revision.Dec 13 2019, 3:38 PM
pprkut added a subscriber: pprkut.Dec 28 2019, 9:48 AM
pprkut added inline comments.
duchain/tests/uses.cpp
1105–1134

This is fine as a duchain test (within duchain.cpp), but for uses you should compare that the actual references are correct. See calls to compareUses() in other tests here

1116

This doesn't seem to be working. "BazD" isn't a constant in the new context, i.e. "echo BazD;" has no highlighting for BazD.

hmitonneau updated this revision to Diff 72680.Jan 3 2020, 12:12 PM

fix: const are case sensitive
improve tests

Looks good :)

Could you add another unit test for comma separated imports? Like:

use function foo\bar\baz, foo\bar\qux;

Then this is ready to go.

hmitonneau updated this revision to Diff 72966.Jan 7 2020, 12:12 PM

add some tests

pprkut accepted this revision.Jan 13 2020, 5:53 PM
This revision is now accepted and ready to land.Jan 13 2020, 5:53 PM
This revision was automatically updated to reflect the committed changes.