|
| 1 | +// Pascal Language Server |
| 2 | +// Copyright 2026 Simon Hsu |
| 3 | + |
| 4 | +// This file is part of Pascal Language Server. |
| 5 | + |
| 6 | +// Pascal Language Server is free software: you can redistribute it |
| 7 | +// and/or modify it under the terms of the GNU General Public License |
| 8 | +// as published by the Free Software Foundation, either version 3 of |
| 9 | +// the License, or (at your option) any later version. |
| 10 | + |
| 11 | +// Pascal Language Server is distributed in the hope that it will be |
| 12 | +// useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 13 | +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +// GNU General Public License for more details. |
| 15 | + |
| 16 | +// You should have received a copy of the GNU General Public License |
| 17 | +// along with Pascal Language Server. If not, see |
| 18 | +// <https://www.gnu.org/licenses/>. |
| 19 | + |
| 20 | +unit PasLS.JcfUINull; |
| 21 | +{$mode ObjFPC} |
| 22 | +interface |
| 23 | + |
| 24 | +uses |
| 25 | + System.UITypes, ParseTreeNode,JcfUiTools; |
| 26 | + |
| 27 | +type |
| 28 | + TJcfUINull = class(TJcfUIBase) |
| 29 | + public |
| 30 | + procedure UpdateGUI(aCounter: integer = 0; aUpdateInterval: integer = 512); override; |
| 31 | + function MessageDlgUI(const aMessage: string): TModalResult; override; |
| 32 | + procedure ShowErrorMessageUI(const aMessage: string); override; |
| 33 | + procedure SetWaitCursorUI; override; |
| 34 | + procedure RestoreCursorUI; override; |
| 35 | + procedure ShowParseTreeUI(const pcRoot: TParseTreeNode); override; |
| 36 | + function OpenDocumentUI(const aPath: string): boolean; override; |
| 37 | + end; |
| 38 | + |
| 39 | +implementation |
| 40 | + |
| 41 | +procedure TJcfUINull.UpdateGUI(aCounter: integer; aUpdateInterval: integer); |
| 42 | +begin |
| 43 | + |
| 44 | +end; |
| 45 | + |
| 46 | +function TJcfUINull.MessageDlgUI(const aMessage: string): TModalResult; |
| 47 | +begin |
| 48 | + /// The Language Server Protocol (LSP) must remain non-blocking. |
| 49 | + /// When user confirmation or a dialog interaction is required, |
| 50 | + /// it defaults to "OK" or "Yes" to ensure continuous execution. |
| 51 | + Result := mrOK; |
| 52 | +end; |
| 53 | + |
| 54 | +procedure TJcfUINull.ShowErrorMessageUI(const aMessage: string); |
| 55 | +begin |
| 56 | + |
| 57 | +end; |
| 58 | + |
| 59 | +procedure TJcfUINull.SetWaitCursorUI; |
| 60 | +begin |
| 61 | + // ignore |
| 62 | +end; |
| 63 | + |
| 64 | +procedure TJcfUINull.RestoreCursorUI; |
| 65 | +begin |
| 66 | + // ignore |
| 67 | +end; |
| 68 | + |
| 69 | +procedure TJcfUINull.ShowParseTreeUI(const pcRoot: TParseTreeNode); |
| 70 | +begin |
| 71 | + // ignore |
| 72 | +end; |
| 73 | + |
| 74 | +function TJcfUINull.OpenDocumentUI(const aPath: string): boolean; |
| 75 | +begin |
| 76 | + // LSP should not open documents in an editor. |
| 77 | + Result := True; |
| 78 | +end; |
| 79 | + |
| 80 | +end. |
0 commit comments