On Mon, 6 Jul 2020 10:27:55 +0700 Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote:
> Currently I walk the node tree for a given unit and collect all the > relevant symbols into a list which represents the symbols in the > current document. I'm running into problems with include files > because I'm getting symbols which technically belong to another file > which should not be displayed according to the LSP. > > Given a TCodeTreeNode can I identity if the node came from an include > file or not so I can ignore it? Something like this: Node:=AItem.Node; if Node<>nil then begin Scanner:=Tool.Scanner; LinkIndex:=Scanner.LinkIndexAtCleanPos(Node.StartPos); if LinkIndex<0 then // dangling node, e.g. syntax error else InIncludeFile:=Scanner.LinkP[LinkIndex]^.Code<>Scanner.MainCode; end else ; // artificial node, e.g. intrinsic Mattias _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal