mirror of https://gitlab.com/basile.b/dexed.git
add highlighter attribute for function calls and definitions
This commit is contained in:
parent
87c8ca3cd1
commit
f3df449a9d
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
|
||||||
- GDB commander: added the _maxCallStackDepth_ option. It prevents slowdowns, especially after an automatic break caused by a stack overflow.
|
- D highlighter: added option to highlights function calls and function definition. Use options window: _Editor/HighlighterDlang/calls_ to test it as by default the same properties as identifiers are used.
|
||||||
|
- GDB commander: added the _maxCallStackDepth_ option. It prevents slowdowns, especially after an automatic break got SEGFAULT caused by a stack overflow.
|
||||||
|
|
||||||
## Bugs fixed
|
## Bugs fixed
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ uses
|
||||||
type
|
type
|
||||||
|
|
||||||
TTokenKind = (tkCommt, tkIdent, tkKeywd, tkStrng, tkBlank, tkSymbl, tkNumbr,
|
TTokenKind = (tkCommt, tkIdent, tkKeywd, tkStrng, tkBlank, tkSymbl, tkNumbr,
|
||||||
tkDDocs, tkSpecK, tkError, tkAsmbl, tkAttri, tkLost, tkTypes);
|
tkDDocs, tkSpecK, tkError, tkAsmbl, tkAttri, tkLost, tkTypes, tkCall);
|
||||||
|
|
||||||
TRangeKind = (rkString1, rkString2, rkBlockCom1, rkBlockCom2,
|
TRangeKind = (rkString1, rkString2, rkBlockCom1, rkBlockCom2,
|
||||||
rkBlockDoc1, rkBlockDoc2, rkAsm, rkAttrib,
|
rkBlockDoc1, rkBlockDoc2, rkAsm, rkAttrib,
|
||||||
|
@ -63,6 +63,7 @@ type
|
||||||
fAttriAttrib: TSynHighlighterAttributes;
|
fAttriAttrib: TSynHighlighterAttributes;
|
||||||
fLost_Attrib: TSynHighlighterAttributes;
|
fLost_Attrib: TSynHighlighterAttributes;
|
||||||
fTypesAttrib: TSynHighlighterAttributes;
|
fTypesAttrib: TSynHighlighterAttributes;
|
||||||
|
fFCallAttrib: TSynHighlighterAttributes;
|
||||||
fLineBuf: string;
|
fLineBuf: string;
|
||||||
fTokStart, fTokStop: Integer;
|
fTokStart, fTokStop: Integer;
|
||||||
fTokKind: TTokenKind;
|
fTokKind: TTokenKind;
|
||||||
|
@ -84,6 +85,7 @@ type
|
||||||
procedure setErrorAttrib(value: TSynHighlighterAttributes);
|
procedure setErrorAttrib(value: TSynHighlighterAttributes);
|
||||||
procedure setAttriAttrib(value: TSynHighlighterAttributes);
|
procedure setAttriAttrib(value: TSynHighlighterAttributes);
|
||||||
procedure setTypesAttrib(value: TSynHighlighterAttributes);
|
procedure setTypesAttrib(value: TSynHighlighterAttributes);
|
||||||
|
procedure setFCallAttrib(value: TSynHighlighterAttributes);
|
||||||
procedure doAttribChange(sender: TObject);
|
procedure doAttribChange(sender: TObject);
|
||||||
procedure doChanged;
|
procedure doChanged;
|
||||||
protected
|
protected
|
||||||
|
@ -105,6 +107,7 @@ type
|
||||||
property errors: TSynHighlighterAttributes read fErrorAttrib write setErrorAttrib stored true;
|
property errors: TSynHighlighterAttributes read fErrorAttrib write setErrorAttrib stored true;
|
||||||
property attributes: TSynHighlighterAttributes read fAttriAttrib write setAttriAttrib stored true;
|
property attributes: TSynHighlighterAttributes read fAttriAttrib write setAttriAttrib stored true;
|
||||||
property types: TSynHighlighterAttributes read fTypesAttrib write setTypesAttrib stored true;
|
property types: TSynHighlighterAttributes read fTypesAttrib write setTypesAttrib stored true;
|
||||||
|
property calls: TSynHighlighterAttributes read fFCallAttrib write setFCallAttrib stored true;
|
||||||
property DefaultFilter stored false;
|
property DefaultFilter stored false;
|
||||||
property enabled stored false;
|
property enabled stored false;
|
||||||
public
|
public
|
||||||
|
@ -217,6 +220,7 @@ begin
|
||||||
fErrorAttrib := TSynHighlighterAttributes.Create('Error','Error');
|
fErrorAttrib := TSynHighlighterAttributes.Create('Error','Error');
|
||||||
fAttriAttrib := TSynHighlighterAttributes.Create('Attri','Attri');
|
fAttriAttrib := TSynHighlighterAttributes.Create('Attri','Attri');
|
||||||
fTypesAttrib := TSynHighlighterAttributes.Create('Types','Types');
|
fTypesAttrib := TSynHighlighterAttributes.Create('Types','Types');
|
||||||
|
fFCallAttrib := TSynHighlighterAttributes.Create('Calls','Calls');
|
||||||
fLost_Attrib := TSynHighlighterAttributes.Create('Lost','Lost');
|
fLost_Attrib := TSynHighlighterAttributes.Create('Lost','Lost');
|
||||||
|
|
||||||
fNumbrAttrib.Foreground := $000079F2;
|
fNumbrAttrib.Foreground := $000079F2;
|
||||||
|
@ -231,6 +235,7 @@ begin
|
||||||
fLost_Attrib.Foreground := clLime;
|
fLost_Attrib.Foreground := clLime;
|
||||||
fDDocsAttrib.Foreground := clTeal;
|
fDDocsAttrib.Foreground := clTeal;
|
||||||
fTypesAttrib.Foreground := clBlack;
|
fTypesAttrib.Foreground := clBlack;
|
||||||
|
fFCallAttrib.Foreground := clBlack;
|
||||||
|
|
||||||
fLost_Attrib.Background := clBlack;
|
fLost_Attrib.Background := clBlack;
|
||||||
|
|
||||||
|
@ -260,6 +265,7 @@ begin
|
||||||
AddAttribute(fErrorAttrib);
|
AddAttribute(fErrorAttrib);
|
||||||
AddAttribute(fAttriAttrib);
|
AddAttribute(fAttriAttrib);
|
||||||
AddAttribute(fTypesAttrib);
|
AddAttribute(fTypesAttrib);
|
||||||
|
AddAttribute(fFCallAttrib);
|
||||||
|
|
||||||
fAttribLut[TTokenKind.tkident] := fIdentAttrib;
|
fAttribLut[TTokenKind.tkident] := fIdentAttrib;
|
||||||
fAttribLut[TTokenKind.tkBlank] := fWhiteAttrib;
|
fAttribLut[TTokenKind.tkBlank] := fWhiteAttrib;
|
||||||
|
@ -275,6 +281,7 @@ begin
|
||||||
fAttribLut[TTokenKind.tkAttri] := fAttriAttrib;
|
fAttribLut[TTokenKind.tkAttri] := fAttriAttrib;
|
||||||
fAttribLut[TTokenKind.tkTypes] := fTypesAttrib;
|
fAttribLut[TTokenKind.tkTypes] := fTypesAttrib;
|
||||||
fAttribLut[TTokenKind.tkLost] := fLost_Attrib;
|
fAttribLut[TTokenKind.tkLost] := fLost_Attrib;
|
||||||
|
fAttribLut[TTokenKind.tkCall] := fFCallAttrib;
|
||||||
|
|
||||||
SetAttributesOnChange(@doAttribChange);
|
SetAttributesOnChange(@doAttribChange);
|
||||||
fTokStop := 1;
|
fTokStop := 1;
|
||||||
|
@ -395,6 +402,11 @@ begin
|
||||||
fTypesAttrib.Assign(value);
|
fTypesAttrib.Assign(value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynD2Syn.setFCallAttrib(value: TSynHighlighterAttributes);
|
||||||
|
begin
|
||||||
|
fFCallAttrib.Assign(value);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynD2Syn.setLine(const NewValue: string; LineNumber: Integer);
|
procedure TSynD2Syn.setLine(const NewValue: string; LineNumber: Integer);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
@ -1142,6 +1154,8 @@ begin
|
||||||
fTokKind := tkSpecK
|
fTokKind := tkSpecK
|
||||||
else if fPhobosStyleType and ('A' <= fLineBuf[FTokStart]) and (fLineBuf[FTokStart] <= 'Z') then
|
else if fPhobosStyleType and ('A' <= fLineBuf[FTokStart]) and (fLineBuf[FTokStart] <= 'Z') then
|
||||||
fTokKind:= tkTypes
|
fTokKind:= tkTypes
|
||||||
|
else if reader^ = '(' then
|
||||||
|
fTokKind:= tkCall
|
||||||
else if rkAsm in fCurrRange.rangeKinds then
|
else if rkAsm in fCurrRange.rangeKinds then
|
||||||
fTokKind:=tkAsmbl;
|
fTokKind:=tkAsmbl;
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -384,6 +384,8 @@ begin
|
||||||
getHl.types.Foreground:=clBlack;
|
getHl.types.Foreground:=clBlack;
|
||||||
getHl.types.Style:=[fsBold];
|
getHl.types.Style:=[fsBold];
|
||||||
getHl.phobosStyleType := True;
|
getHl.phobosStyleType := True;
|
||||||
|
//
|
||||||
|
getHl.calls.Assign(getHl.identifiers);
|
||||||
end;
|
end;
|
||||||
with fPresets.insertPreset(1) do
|
with fPresets.insertPreset(1) do
|
||||||
begin
|
begin
|
||||||
|
@ -429,6 +431,7 @@ begin
|
||||||
selection.Foreground := clNone;
|
selection.Foreground := clNone;
|
||||||
selection.BackPriority:= 2;
|
selection.BackPriority:= 2;
|
||||||
getHl.phobosStyleType := True;
|
getHl.phobosStyleType := True;
|
||||||
|
getHl.calls.Assign(getHl.identifiers);
|
||||||
end;
|
end;
|
||||||
with fPresets.insertPreset(2) do
|
with fPresets.insertPreset(2) do
|
||||||
begin
|
begin
|
||||||
|
@ -471,6 +474,7 @@ begin
|
||||||
selection.Foreground := clNone;
|
selection.Foreground := clNone;
|
||||||
selection.BackPriority := 1;
|
selection.BackPriority := 1;
|
||||||
getHl.phobosStyleType := True;
|
getHl.phobosStyleType := True;
|
||||||
|
getHl.calls.Assign(getHl.identifiers);
|
||||||
end;
|
end;
|
||||||
with fPresets.insertPreset(3) do
|
with fPresets.insertPreset(3) do
|
||||||
begin
|
begin
|
||||||
|
@ -508,6 +512,7 @@ begin
|
||||||
selection.Foreground := clNone;
|
selection.Foreground := clNone;
|
||||||
selection.BackPriority := 10;
|
selection.BackPriority := 10;
|
||||||
getHl.phobosStyleType := True;
|
getHl.phobosStyleType := True;
|
||||||
|
getHl.calls.Assign(getHl.identifiers);
|
||||||
end;
|
end;
|
||||||
with fPresets.insertPreset(4) do
|
with fPresets.insertPreset(4) do
|
||||||
begin
|
begin
|
||||||
|
@ -545,6 +550,7 @@ begin
|
||||||
selection.Background := 12837345;
|
selection.Background := 12837345;
|
||||||
selection.Foreground := clNone;
|
selection.Foreground := clNone;
|
||||||
getHl.phobosStyleType := True;
|
getHl.phobosStyleType := True;
|
||||||
|
getHl.calls.Assign(getHl.identifiers);
|
||||||
end;
|
end;
|
||||||
with fPresets.insertPreset(5) do
|
with fPresets.insertPreset(5) do
|
||||||
begin
|
begin
|
||||||
|
@ -587,6 +593,7 @@ begin
|
||||||
mouseLink.Style := [fsBold, fsUnderline];
|
mouseLink.Style := [fsBold, fsUnderline];
|
||||||
selection.Background := $9DAABC;
|
selection.Background := $9DAABC;
|
||||||
selection.Foreground := clNone;
|
selection.Foreground := clNone;
|
||||||
|
getHl.calls.Assign(getHl.identifiers);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
fEditor := TSynEdit.Create(self);
|
fEditor := TSynEdit.Create(self);
|
||||||
|
|
Loading…
Reference in New Issue