[fpc-pascal] Pascal Language Server

Ryan Joseph genericptr at gmail.com
Tue Apr 28 15:58:18 CEST 2020



> On Apr 28, 2020, at 8:52 PM, Mattias Gaertner via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> Codetoolboss.Error*

Not sure I'm understand the usage. When do I check for errors and are there ever more than 1 or just the last error? I'm guessing maybe after:

    URI := ParseURI(textDocument.uri);
    Code := CodeToolBoss.FindFile(URI.Path + URI.Document);
    for Change in contentChanges do
    begin
      Code.Source := TTextDocumentContentChangeEvent(Change).text;
      // .... check for error here? ....
    end;


    // exception handling
    procedure ClearError;
    function HandleException(AnException: Exception): boolean;
    procedure SetError(Id: int64; Code: TCodeBuffer; Line, Column: integer;
                       const TheMessage: string);
    property CatchExceptions: boolean
                                   read FCatchExceptions write FCatchExceptions;
    property WriteExceptions: boolean
                                   read FWriteExceptions write FWriteExceptions;
    property ErrorCode: TCodeBuffer read fErrorCode;
    property ErrorColumn: integer read fErrorColumn;
    property ErrorLine: integer read fErrorLine;
    property ErrorMessage: string read fErrorMsg;
    property ErrorId: int64 read FErrorId;
    property ErrorTopLine: integer read fErrorTopLine;
    property ErrorDbgMsg: string read FErrorDbgMsg;
    property Abortable: boolean read FAbortable write SetAbortable;
    property OnCheckAbort: TOnCodeToolCheckAbort
                                         read FOnCheckAbort write FOnCheckAbort;


Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list