[fpc-pascal] Pascal Language Server

Ryan Joseph genericptr at gmail.com
Thu Apr 30 05:30:20 CEST 2020



> On Apr 29, 2020, at 3:15 PM, Ryan Joseph <genericptr at gmail.com> wrote:
> 
> This wasn't doing what I thought. It still doesn't give an error until I query at another point in the unit. I thought it would pre-parse or something but it seems to be on demand. I may have to handle the errors in another way.
> 
>    Code := CodeToolBoss.FindFile(URI.Path + URI.Document);
>    for Change in contentChanges do
>    begin
>      Code.Source := TTextDocumentContentChangeEvent(Change).text;
>      if CodeToolBoss.ErrorMessage <> '' then
>        begin
>          writeln(stderr, 'Document Parse error: ', 
>                          CodeToolBoss.ErrorMessage,
>                          CodeToolBoss.ErrorLine, ':', CodeToolBoss.ErrorColumn);
>          flush(stderr);
>        end;
>    end;

I found the "Explore" method which appears to do what I wanted. There's also CheckSyntax which appears to do basically the same thing.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list