فهرست منبع

Added autocompletion support for the [Messages] section.

Martijn Laan 10 ماه پیش
والد
کامیت
f41fde6bdf
3فایلهای تغییر یافته به همراه9 افزوده شده و 6 حذف شده
  1. 1 1
      Projects/Src/IDE.MainForm.pas
  2. 7 5
      Projects/Src/IDE.ScintStylerInnoSetup.pas
  3. 1 0
      whatsnew.htm

+ 1 - 1
Projects/Src/IDE.MainForm.pas

@@ -5271,7 +5271,7 @@ begin
             FActiveMemo.SetAutoCompleteFillupChars(' ');
             FActiveMemo.SetAutoCompleteFillupChars(' ');
           end else begin
           end else begin
             WordList := FMemosStyler.KeywordsWordList[Section];
             WordList := FMemosStyler.KeywordsWordList[Section];
-            if WordList = '' then { Messages & CustomMessages }
+            if WordList = '' then { CustomMessages }
               Exit;
               Exit;
             if IsParamSection then
             if IsParamSection then
               FActiveMemo.SetAutoCompleteFillupChars(':')
               FActiveMemo.SetAutoCompleteFillupChars(':')

+ 7 - 5
Projects/Src/IDE.ScintStylerInnoSetup.pas

@@ -99,7 +99,7 @@ type
     procedure BuildKeywordsWordList(const Section: TInnoSetupStylerSection;
     procedure BuildKeywordsWordList(const Section: TInnoSetupStylerSection;
       const Parameters: array of TScintRawString);
       const Parameters: array of TScintRawString);
     procedure BuildKeywordsWordListFromTypeInfo(const Section: TInnoSetupStylerSection;
     procedure BuildKeywordsWordListFromTypeInfo(const Section: TInnoSetupStylerSection;
-      const EnumTypeInfo: Pointer);
+      const EnumTypeInfo: Pointer; const PrefixLength: Integer);
     procedure BuildScriptFunctionsLists(const ScriptFuncTable: TScriptTable;
     procedure BuildScriptFunctionsLists(const ScriptFuncTable: TScriptTable;
       const ClassMembers: Boolean; const SL: TStringList);
       const ClassMembers: Boolean; const SL: TStringList);
     function BuildWordList(const WordStringList: TStringList): AnsiString;
     function BuildWordList(const WordStringList: TStringList): AnsiString;
@@ -591,15 +591,16 @@ constructor TInnoSetupStyler.Create(AOwner: TComponent);
     BuildKeywordsWordList(scIcons, IconsSectionParameters);
     BuildKeywordsWordList(scIcons, IconsSectionParameters);
     BuildKeywordsWordList(scINI, INISectionParameters);
     BuildKeywordsWordList(scINI, INISectionParameters);
     BuildKeywordsWordList(scInstallDelete, DeleteSectionParameters);
     BuildKeywordsWordList(scInstallDelete, DeleteSectionParameters);
-    BuildKeywordsWordListFromTypeInfo(scLangOptions, TypeInfo(TLangOptionsSectionDirective));
+    BuildKeywordsWordListFromTypeInfo(scLangOptions, TypeInfo(TLangOptionsSectionDirective), 2);
     BuildKeywordsWordList(scLanguages, LanguagesSectionParameters);
     BuildKeywordsWordList(scLanguages, LanguagesSectionParameters);
     BuildKeywordsWordList(scRegistry, RegistrySectionParameters);
     BuildKeywordsWordList(scRegistry, RegistrySectionParameters);
     BuildKeywordsWordList(scRun, RunSectionParameters);
     BuildKeywordsWordList(scRun, RunSectionParameters);
-    BuildKeywordsWordListFromTypeInfo(scSetup, TypeInfo(TSetupSectionDirective));
+    BuildKeywordsWordListFromTypeInfo(scSetup, TypeInfo(TSetupSectionDirective), 2);
     BuildKeywordsWordList(scTasks, TasksSectionParameters);
     BuildKeywordsWordList(scTasks, TasksSectionParameters);
     BuildKeywordsWordList(scTypes, TypesSectionParameters);
     BuildKeywordsWordList(scTypes, TypesSectionParameters);
     BuildKeywordsWordList(scUninstallDelete, DeleteSectionParameters);
     BuildKeywordsWordList(scUninstallDelete, DeleteSectionParameters);
     BuildKeywordsWordList(scUninstallRun, UninstallRunSectionParameters);
     BuildKeywordsWordList(scUninstallRun, UninstallRunSectionParameters);
+    BuildKeywordsWordListFromTypeInfo(scMessages, TypeInfo(TSetupMessageID), 3);
   end;
   end;
 
 
   procedure BuildScriptLists;
   procedure BuildScriptLists;
@@ -745,12 +746,13 @@ begin
 end;
 end;
 
 
 procedure TInnoSetupStyler.BuildKeywordsWordListFromTypeInfo(
 procedure TInnoSetupStyler.BuildKeywordsWordListFromTypeInfo(
-  const Section: TInnoSetupStylerSection; const EnumTypeInfo: Pointer);
+  const Section: TInnoSetupStylerSection; const EnumTypeInfo: Pointer;
+  const PrefixLength: Integer);
 begin
 begin
   var SL := TStringList.Create;
   var SL := TStringList.Create;
   try
   try
     for var I := 0 to GetTypeData(EnumTypeInfo).MaxValue do
     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);
     FKeywordsWordList[Section] := BuildWordList(SL);
   finally
   finally
     SL.Free;
     SL.Free;

+ 1 - 0
whatsnew.htm

@@ -55,6 +55,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
   <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 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 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 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>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 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>
   <li>The editor's font now defaults to Consolas if available, consistent with most other modern editors.</li>