🧪 test: add LSP json fixtures and provider suite
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
unit MainUnit;
|
||||
interface
|
||||
|
||||
uses WorkspaceUnit, SystemUnit;
|
||||
|
||||
type Widget = class
|
||||
public
|
||||
function Create(a: integer; b: string = "x");
|
||||
function Foo(x: integer): integer;
|
||||
class function StaticFoo(y: integer): integer;
|
||||
property Prop: integer read FProp;
|
||||
private
|
||||
FProp: integer;
|
||||
FieldVal: string;
|
||||
end;
|
||||
|
||||
type Plain = class
|
||||
public
|
||||
function Create();
|
||||
end;
|
||||
|
||||
function UnitFunc(a: integer): integer;
|
||||
var UnitVar: integer;
|
||||
|
||||
implementation
|
||||
|
||||
function Widget.Create(a: integer; b: string = "x");
|
||||
begin
|
||||
end;
|
||||
|
||||
function Widget.Foo(x: integer): integer;
|
||||
begin
|
||||
return x;
|
||||
end;
|
||||
|
||||
class function Widget.StaticFoo(y: integer): integer;
|
||||
begin
|
||||
return y;
|
||||
end;
|
||||
|
||||
function Plain.Create();
|
||||
begin
|
||||
end;
|
||||
|
||||
function UnitFunc(a: integer): integer;
|
||||
begin
|
||||
return a;
|
||||
end;
|
||||
|
||||
function TestCompletions(obj: Widget; aliased: MainUnit.Widget; unit_inst: WorkspaceUnit.WorkspaceUnitClass);
|
||||
begin
|
||||
obj := new Widget;
|
||||
aliased := createobject("MainUnit.Widget");
|
||||
unit_inst := createobject("WorkspaceUnit.WorkspaceUnitClass");
|
||||
class(Widget).Sta;
|
||||
new Wid;
|
||||
new unit(MainUnit).Wid;
|
||||
new MainUnit.Wid;
|
||||
createobject(Wid);
|
||||
createobject("Wid");
|
||||
createobject(MainUnit.Wid);
|
||||
unit(MainUnit).Uni;
|
||||
MainUnit.Uni;
|
||||
obj.Fo;
|
||||
aliased.Fo;
|
||||
unit_inst.Wor;
|
||||
fun;
|
||||
UnitF;
|
||||
end;
|
||||
|
||||
procedure TestDefinitions();
|
||||
begin
|
||||
UnitFunc(1);
|
||||
WorkspaceFunc();
|
||||
SystemUnit;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,2 @@
|
||||
var target: integer;
|
||||
target := target + 1;
|
||||
@@ -0,0 +1,16 @@
|
||||
unit SystemUnit;
|
||||
interface
|
||||
|
||||
type
|
||||
SystemClass = class
|
||||
public
|
||||
function Create(x: integer);
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
function SystemClass.Create(x: integer);
|
||||
begin
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,29 @@
|
||||
unit WorkspaceUnit;
|
||||
interface
|
||||
|
||||
type
|
||||
WorkspaceUnitClass = class
|
||||
public
|
||||
function Create();
|
||||
function Work(): integer;
|
||||
end;
|
||||
|
||||
function WorkspaceUnitFunc(): integer;
|
||||
|
||||
implementation
|
||||
|
||||
function WorkspaceUnitClass.Create();
|
||||
begin
|
||||
end;
|
||||
|
||||
function WorkspaceUnitClass.Work(): integer;
|
||||
begin
|
||||
return 9;
|
||||
end;
|
||||
|
||||
function WorkspaceUnitFunc(): integer;
|
||||
begin
|
||||
return 7;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,21 @@
|
||||
type WorkspaceClass = class
|
||||
public
|
||||
function Create(a: integer);
|
||||
function Work(): integer;
|
||||
end;
|
||||
|
||||
function WorkspaceFunc(): integer;
|
||||
|
||||
function WorkspaceClass.Create(a: integer);
|
||||
begin
|
||||
end;
|
||||
|
||||
function WorkspaceClass.Work(): integer;
|
||||
begin
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function WorkspaceFunc(): integer;
|
||||
begin
|
||||
return 100;
|
||||
end;
|
||||
Reference in New Issue
Block a user