mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 07:36:14 +02:00
codetools: identifier completion: add system units
git-svn-id: trunk@25188 -
This commit is contained in:
parent
1a15552418
commit
03a54bdb36
@ -1182,6 +1182,22 @@ const
|
|||||||
CurrentIdentifierList.Add(NewItem);
|
CurrentIdentifierList.Add(NewItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure AddSystemUnit(const AnUnitName: PChar);
|
||||||
|
var
|
||||||
|
NewItem: TIdentifierListItem;
|
||||||
|
begin
|
||||||
|
NewItem:=TIdentifierListItem.Create(
|
||||||
|
icompUnknown,
|
||||||
|
false,
|
||||||
|
CompilerFuncHistoryIndex,
|
||||||
|
AnUnitName,
|
||||||
|
CompilerFuncLevel,
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
ctnUseUnit);
|
||||||
|
CurrentIdentifierList.Add(NewItem);
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
NewItem: TIdentifierListItem;
|
NewItem: TIdentifierListItem;
|
||||||
ProcNode: TCodeTreeNode;
|
ProcNode: TCodeTreeNode;
|
||||||
@ -1269,6 +1285,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// system types
|
||||||
AddBaseType('Char');
|
AddBaseType('Char');
|
||||||
AddBaseType('WideChar');
|
AddBaseType('WideChar');
|
||||||
AddBaseType('Real');
|
AddBaseType('Real');
|
||||||
@ -1302,6 +1319,19 @@ begin
|
|||||||
AddBaseConstant('Nil');
|
AddBaseConstant('Nil');
|
||||||
AddBaseConstant('True');
|
AddBaseConstant('True');
|
||||||
AddBaseConstant('False');
|
AddBaseConstant('False');
|
||||||
|
|
||||||
|
// system units
|
||||||
|
AddSystemUnit('System');
|
||||||
|
if (Scanner.CompilerMode in [cmDELPHI,cmOBJFPC])
|
||||||
|
and (Scanner.PascalCompiler=pcFPC) then
|
||||||
|
AddSystemUnit('ObjPas');
|
||||||
|
if (Scanner.CompilerMode=cmMacPas)
|
||||||
|
and (Scanner.PascalCompiler=pcFPC) then
|
||||||
|
AddSystemUnit('MacPas');
|
||||||
|
if (Scanner.CompilerModeSwitch=cmsObjectiveC1) then begin
|
||||||
|
AddSystemUnit('ObjC');
|
||||||
|
AddSystemUnit('ObjCBase');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIdentCompletionTool.GatherUsefulIdentifiers(CleanPos: integer;
|
procedure TIdentCompletionTool.GatherUsefulIdentifiers(CleanPos: integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user