CudaText
CudaText copied to clipboard
LSP plugin: black decor icons (happens with some files drag-n-dropped from File Explorer)
black decor icons (happens with some files drag-n-dropped from File Explorer) Windows OS.
attaching file Input.zip
to reproduce: EDIT: - set this option in cuda_lsp config: 'lint_type': 'd'
- drag-and-drop attached file from file explorer. you must have clangd configured to make it show decor icons

if I close and reopen same file from inside Cud, icons will be drawn FINE. EDIT: not always
ImageList initing is missed. let's try this: formmain_py_api.inc
DECOR_SET:
begin
if not Ed.Strings.IsIndexValid(NLine) then
exit(ReturnFalse);
////ADD this---->
if Ed.ImagesGutterDecor=nil then
Ed.ImagesGutterDecor:= TImageList.Create(Ed);
added. they are not black now, but still invisible:
https://user-images.githubusercontent.com/275333/187717945-5672b7fd-3c2f-483e-af64-e430ccaf2c02.mp4
now on Win10. have Py 3.9.6 installed, and did install of LSP
pip install python-lsp-server .
pylsp.exe runs Ok.
by LSP server don't work at all in app!
I use Cud x32, coz IDE is also x32.
Console: LSP: starting server - Python; root: None
somehow ImageList is recreated and looses all icons. i want to repro this and then i want to put breakpoint in IDE to lazarus/lcl/include/imglist.inc
procedure TCustomImageList.Clear;
which is called somehow. I will see 'stack trace' window and see from where its called.
LSP server don't work at all in app! I use Cud x32,
32bit works ok.
LSP: starting server - Python; root: None

Maybe permissions problem (admin account?), or antivirus.
can you see the bug also on this simple plug? I dont. on drag-drop from Win10 explorer decor icons are ok.
can this tst plug be changed to make repro?
custom icons are ok:
https://user-images.githubusercontent.com/275333/187758552-8ab331a3-5161-4eb7-acf8-3d5c2c07070e.mp4
can this tst plug be changed to make repro?
I don't know what to change 🤔
clangd LSP, sample C file
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello.\n");
return 0;
}
and its copy (modified). drag-drop from Win10 explorer - no repro! tried with 2 groups too.
veksha, can you see 'stack trace' for this Clear call? set breakpoint only before drag-drop! https://github.com/Alexey-T/CudaText/issues/4327#issuecomment-1233127630
have you tried drag-n-dropping file I attached? Input.zip
tried this .h file now - 5 tries, no repro :(
this breakpoint is not hit on drag-n-drop, but bug is there

I will try to repro on 2nd Win10 PC (very old) later.
on clean cuda there is no bug. hmm.
let's find the culprit plugin or opt?
yes. trying now.
maybe 'lint_type' value ('d' or 'b') is important?
i have repro witjh 'lint_type': 'd' !
I have no repro without this key
found that its NOT Cud bug. its LSP plg bug. I added print('imglist fill1') near 1st place where i found imagelist_proc() call. and added 2nd print near 2nd place of imagelist_proc call.
when i see black icons - console does not print anything! (if I clear console before drag-drop)
also - when icons ok, i see FOUR prints! its bad
so 4 calls of imagelist_proc or zero. but it should be 1.
what if you remove 'lint_type': 'd' text completely from config?
how many calls then?
then 0.
oh, it defaults to 'b' (bookmarks)
can we find out, which plg function (contailing call to initing imagelist) is not called in the 'bad case'?
can be closed?