浏览代码

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(' ');
           end else begin
             WordList := FMemosStyler.KeywordsWordList[Section];
-            if WordList = '' then { Messages & CustomMessages }
+            if WordList = '' then { CustomMessages }
               Exit;
             if IsParamSection then
               FActiveMemo.SetAutoCompleteFillupChars(':')

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

@@ -99,7 +99,7 @@ type
     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;
@@ -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;
@@ -745,12 +746,13 @@ begin
 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;

+ 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 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>