Skip to content

Commit

Permalink
Added autocompletion support for the [Messages] section.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Oct 25, 2024
1 parent d6d8def commit f41fde6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Projects/Src/IDE.MainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5271,7 +5271,7 @@ procedure TMainForm.InitiateAutoComplete(const Key: AnsiChar);
FActiveMemo.SetAutoCompleteFillupChars(' ');
end else begin
WordList := FMemosStyler.KeywordsWordList[Section];
if WordList = '' then { Messages & CustomMessages }
if WordList = '' then { CustomMessages }
Exit;
if IsParamSection then
FActiveMemo.SetAutoCompleteFillupChars(':')
Expand Down
12 changes: 7 additions & 5 deletions Projects/Src/IDE.ScintStylerInnoSetup.pas
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ TInnoSetupStyler = class(TScintCustomStyler)
procedure BuildKeywordsWordList(const Section: TInnoSetupStylerSection;
const Parameters: array of TScintRawString);
procedure BuildKeywordsWordListFromTypeInfo(const Section: TInnoSetupStylerSection;
const EnumTypeInfo: Pointer);
const EnumTypeInfo: Pointer; const PrefixLength: Integer);
procedure BuildScriptFunctionsLists(const ScriptFuncTable: TScriptTable;
const ClassMembers: Boolean; const SL: TStringList);
function BuildWordList(const WordStringList: TStringList): AnsiString;
Expand Down Expand Up @@ -591,15 +591,16 @@ constructor TInnoSetupStyler.Create(AOwner: TComponent);
BuildKeywordsWordList(scIcons, IconsSectionParameters);
BuildKeywordsWordList(scINI, INISectionParameters);
BuildKeywordsWordList(scInstallDelete, DeleteSectionParameters);
BuildKeywordsWordListFromTypeInfo(scLangOptions, TypeInfo(TLangOptionsSectionDirective));
BuildKeywordsWordListFromTypeInfo(scLangOptions, TypeInfo(TLangOptionsSectionDirective), 2);
BuildKeywordsWordList(scLanguages, LanguagesSectionParameters);
BuildKeywordsWordList(scRegistry, RegistrySectionParameters);
BuildKeywordsWordList(scRun, RunSectionParameters);
BuildKeywordsWordListFromTypeInfo(scSetup, TypeInfo(TSetupSectionDirective));
BuildKeywordsWordListFromTypeInfo(scSetup, TypeInfo(TSetupSectionDirective), 2);
BuildKeywordsWordList(scTasks, TasksSectionParameters);
BuildKeywordsWordList(scTypes, TypesSectionParameters);
BuildKeywordsWordList(scUninstallDelete, DeleteSectionParameters);
BuildKeywordsWordList(scUninstallRun, UninstallRunSectionParameters);
BuildKeywordsWordListFromTypeInfo(scMessages, TypeInfo(TSetupMessageID), 3);
end;

procedure BuildScriptLists;
Expand Down Expand Up @@ -745,12 +746,13 @@ procedure TInnoSetupStyler.BuildKeywordsWordList(
end;

procedure TInnoSetupStyler.BuildKeywordsWordListFromTypeInfo(
const Section: TInnoSetupStylerSection; const EnumTypeInfo: Pointer);
const Section: TInnoSetupStylerSection; const EnumTypeInfo: Pointer;
const PrefixLength: Integer);
begin
var SL := TStringList.Create;
try
for var I := 0 to GetTypeData(EnumTypeInfo).MaxValue do
AddWordToList(SL, AnsiString(Copy(GetEnumName(EnumTypeInfo, I), 3, Maxint)), awtDirective);
AddWordToList(SL, AnsiString(Copy(GetEnumName(EnumTypeInfo, I), PrefixLength+1, Maxint)), awtDirective);
FKeywordsWordList[Section] := BuildWordList(SL);
finally
SL.Free;
Expand Down
1 change: 1 addition & 0 deletions whatsnew.htm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<li>Added autocompletion support for all Pascal Scripting support functions, types, constants, etcetera. Existing option <i>Invoke autocompletion automatically</i> controls whether the autocompletion suggestions appear automatically or only when invoked manually by pressing Ctrl+Space or Ctrl+I.</li>
<li>Added parameter hints and autocompletion support for all Pascal Scripting support class members and properties. Both always show all classes' members and properties instead of just those of the current object's class.</li>
<li>Added autocompletion support for all Pascal Scripting event function parameters. Always shows all parameters instead of just those of the current event function.</li>
<li>Added autocompletion support for the [Messages] section.</li>
<li>Added new <i>Enable section folding</i> option which allows you to temporarily hide sections while editing by clicking the new minus or plus icons in the editor's gutter or by using the new keyboard shortcuts (Ctrl+Shift+[ to fold and Ctrl+Shift+] to unfold) or menu items. Enabled by default.</li>
<li>The editor's gutter now shows change history to keep track of saved and unsaved modifications. Always enabled.</li>
<li>The editor's font now defaults to Consolas if available, consistent with most other modern editors.</li>
Expand Down

0 comments on commit f41fde6

Please sign in to comment.