vimspector icon indicating copy to clipboard operation
vimspector copied to clipboard

Enable PID picker injection

Open Aster89 opened this issue 3 years ago • 3 comments

Fundamentally, this is the code you sketched.

I'm not sure how to test it. I guess by inspection we can be sure it doesn't alter the current behavior.

Whether a customization actually works I guess is another story. But that's maybe ok, as in, the user has to make sure to write an appropriate function to make it work.

Anyway, I have this in my vimrc to make use of it:

let g:vimspector_custom_process_picker = 'PickProcess()'

function! PickProcess() abort
  return str2nr(split(fzf#run({'source': 'ps -e'})[0])[0])
endfunction

which I think could go in an example in the doc.

If you are happy with it, I can do it.

Aster89 avatar Sep 01 '22 18:09 Aster89

This change is Reviewable

puremourning avatar Sep 01 '22 18:09 puremourning

I'm totally fine with updating the doc, but I'd do it only after having the tests in place, as without those I don't think you're gonna accept anything. And... I guess I'd need at least some guidance to make the tests :D

Aster89 avatar Sep 01 '22 19:09 Aster89

there's info on the test framework here https://github.com/puremourning/vimspector/blob/master/CONTRIBUTING.md#pr-guidelines

I suspect that the way to test this is to write a test that sets the option to some function implemented by the test script and assert that is called etc.

puremourning avatar Sep 01 '22 20:09 puremourning

This pull request introduces 1 alert when merging 890cdbbf4f2bbf17afc656f012e40441073ff737 into c95ad4c8fb54adb75ceb0397ef6ace1c4eec3790 - view on LGTM.com

new alerts:

  • 1 for Duplication in regular expression character class

lgtm-com[bot] avatar Oct 06 '22 10:10 lgtm-com[bot]

I've just tried it. It looks ok to me. Always ready to write the doc.

Aster89 avatar Oct 24 '22 20:10 Aster89

This pull request introduces 1 alert when merging 028bb0b62e8aed08f230a342d2797a68855513b4 into 5c328b513485675c061558d2f25a98ee503cb243 - view on LGTM.com

new alerts:

  • 1 for Duplication in regular expression character class

lgtm-com[bot] avatar Oct 31 '22 20:10 lgtm-com[bot]

I'd still like to provide something in this space, but I'm still not super happy with the result currently. I'll leave this open as a reminder to look into it.

puremourning avatar Jan 04 '23 09:01 puremourning

Just fyi I haven't forgotten about this, I still intend to so something here, I'm just still not sure what is best.

puremourning avatar May 10 '23 08:05 puremourning

Actually hold on, because I had another thought about it. I'll find some time to write to you in the chat in the afternoon.

Aster89 avatar May 10 '23 09:05 Aster89

Implemented in #773

puremourning avatar May 24 '23 08:05 puremourning