Page 1 of 1

phan intergrations

Posted: Fri Oct 13, 2017 12:05 am
by AJenbo
Phan is a powerful php static anazlyer, capable of finding a lot of issues you would normaly only find when compiling more strict languages. Unfortunatly the process requires that it analyzes the entire project witch is time consuming. For IDE intergration they provide at deamon mode where it tracks any file changes in the project and the IDE can then request an analysis of a single file (can even be from the buffer version).
https://github.com/phan/phan/wiki/Using ... aemon-Mode

The thing is I don't know how I would go about launching the deamon/server automatically from CodeLite instead of needing the user to do so. Any idea how to do this?

Also this might be somewhat reusable for integrating with with clang_refactor as it has a similar setup:
https://clang.llvm.org/docs/ClangTools.html
(a bit the project is still in an early state)

Re: phan intergrations

Posted: Sun Oct 15, 2017 12:04 am
by eranif
Starting a process from within CodeLite is a simple task:

Look here for how we do this for NodeJS:
https://github.com/eranif/codelite/blob ... r.cpp#L123

You need to bind two events: wxEVT_ASYNC_PROCESS_OUTPUT & wxEVT_ASYNC_PROCESS_TERMINATED:
https://github.com/eranif/codelite/blob ... er.cpp#L32

Re: phan intergrations

Posted: Sun Oct 15, 2017 7:12 pm
by AJenbo
Thanks that looks like what I was looking for :)

Another issue is that by default the server runs on port 4846, if a user has multiple instances of codelite running I would need a way to pick a different port for the service to listen on. Is there a good way to figure out what ports are available, or do you think it's fair to limit it to one instance at a time?