IDE auto-complete when using extension
Right now if I do have the extension loaded and if I require the package via composer it does not work together because of the autoloader.
In order to fix this and have auto-complete in my IDE (Intellij IDEA or PHPStorm) I need to have stubs or a plugin that provides them. I didn't saw any stubs available is there a way to provide them? Or any other suggestion to make this work?
You could tease out the functions from this project
find -regex '.*/.*\.\(c\|h\)$' -exec cat {} \; 2>/dev/null | egrep -o "\bdd_\w+\(\)" | sort -u | sed "s/.*/function & {}/"
which yields:
function dd_trace_check_memory_under_limit() {}
function dd_trace_closed_spans_count() {}
function dd_trace_compile_time_microseconds() {}
function dd_trace_dd_get_memory_limit() {}
function dd_trace_forward_call() {}
function dd_trace_peek_span_id() {}
function dd_trace_pop_span_id() {}
function dd_trace_push_span_id() {}
function dd_tracer_circuit_breaker_can_try() {}
function dd_tracer_circuit_breaker_close() {}
function dd_tracer_circuit_breaker_consecutive_failures() {}
function dd_tracer_circuit_breaker_is_closed() {}
function dd_tracer_circuit_breaker_last_failure_timestamp() {}
function dd_tracer_circuit_breaker_open() {}
function dd_tracer_circuit_breaker_opened_timestamp() {}
function dd_tracer_circuit_breaker_register_error() {}
function dd_tracer_circuit_breaker_register_success() {}
function dd_tracer_circuit_breaker_total_failures() {}
function dd_trace_send_traces_via_thread() {}
function dd_trace_serialize_msgpack() {}
function dd_trace_set_trace_id() {}
function dd_trace_tracer_is_limited() {}
This can be added to a stubs include or using this project: https://github.com/JetBrains/phpstorm-stubs
@dcsg confirming this resolved this for you? Going to close out in meantime but please let us know if you have any questions.
I didn't tried it yet. But it would be nice if Datadog provided this into phpstorm.
For phpstrom you should push PR here: https://github.com/JetBrains/phpstorm-stubs
Added by PR #1942, included in release 0.85.0 #1969.