phan intergrations

Discussion about CodeLite development process and patches
AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

phan intergrations

Post 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)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: phan intergrations

Post 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
Make sure you have read the HOW TO POST thread
AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: phan intergrations

Post 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?
Post Reply