2

I have the next code that works and compiled. The app runs with no errors, but the IDE shows a red stripe and hover popup:

E1030 Invalid compiler directive: 'private'

on code:

type
  TForm1 = class(TForm)
    PaintBox1: TPaintBox;
  private
    procedure PaintBox1Paint(Sender: TObject; Canvas: TCanvas);
  end;

I do not know why, because the code compiles and runs. no problems.

the private is red striped:

delphi programming code error red stripe

Hover on the red explanation mark is what shows this:

E1030 Invalid compiler directive: 'private'

Can anyone explain why please?

3
  • 1
    Try to run the command taskkill /im delphilsp.exe /f (in a console window). Commented Aug 28 at 18:22
  • Actually, the word private is underlined with a red wiggly line Commented Aug 29 at 5:15
  • Or since Delphi 12 use the Toolbar Tools > Reload LSP Server. What will do the same thing discribed by Andreas Commented Sep 1 at 5:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.