Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-17 Thread Hairy Pixels via fpc-pascal
> On Oct 17, 2022, at 3:31 PM, Mattias Gaertner via fpc-pascal > wrote: > >> So inlay hints need to be computed with a document range so we don’t >> know a single X,Y position we could use to call FindCodeContext. If I >> had a list of identifiers which were function calls in begin blocks I >>

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-17 Thread Mattias Gaertner via fpc-pascal
On Mon, 17 Oct 2022 08:41:23 +0700 Hairy Pixels via fpc-pascal wrote: > > On Oct 16, 2022, at 9:53 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Blocks like WHILE and TRY. > > > > Codetools are optimized for finding declarations of a few > > expressions between edits. To find the para

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-16 Thread Hairy Pixels via fpc-pascal
> On Oct 16, 2022, at 9:53 PM, Mattias Gaertner via fpc-pascal > wrote: > > Blocks like WHILE and TRY. > > Codetools are optimized for finding declarations of a few expressions > between edits. To find the parameters, call for each identifier > followed by ( the FindCodeContext function. So

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-16 Thread Mattias Gaertner via fpc-pascal
On Sun, 16 Oct 2022 21:05:23 +0700 Hairy Pixels via fpc-pascal wrote: > > On Oct 16, 2022, at 4:17 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > That's correct. There are no nodes for simple statements like > > "a:=1". > > Really? I was going to use this to find unknown identifiers

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-16 Thread Hairy Pixels via fpc-pascal
> On Oct 16, 2022, at 4:17 PM, Mattias Gaertner via fpc-pascal > wrote: > > That's correct. There are no nodes for simple statements like "a:=1". Really? I was going to use this to find unknown identifiers (for LSP diagnostics) and try to implement LSP’s new inlay parameter hints feature. I

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-16 Thread Mattias Gaertner via fpc-pascal
On Sun, 16 Oct 2022 09:19:56 +0700 Hairy Pixels via fpc-pascal wrote: > I’m trying to look at the code in a the begin..end section of this > sample program but for some reason when it gets to the BeginBlock > node child count is always 0 (other nodes are as expected though). That's correct. Ther

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-15 Thread Ondrej Pokorny via fpc-pascal
Am 16.10.2022 um 04:19 schrieb Hairy Pixels via fpc-pascal: Btw, I understand this question is basically for Mattias but I don’t know where else to post. Does Mattias prefer I post in one of these forums https://forum.lazarus.freepascal.org or maybe email privately with code tools questions?