diff --git a/src/ce_dcd.pas b/src/ce_dcd.pas index 9e6e6ddd..b98d1c39 100644 --- a/src/ce_dcd.pas +++ b/src/ce_dcd.pas @@ -52,6 +52,7 @@ type constructor create(aOwner: TComponent); override; destructor destroy; override; // + procedure addImportFolders(const folders: TStrings); procedure addImportFolder(const aFolder: string); procedure getComplAtCursor(aList: TStrings); procedure getCallTip(out tips: string); @@ -155,7 +156,7 @@ begin if fold.dirExists and (folds.IndexOf(fold) = -1) then folds.Add(fold); end; - for fold in folds do addImportFolder(fold); + addImportFolders(folds); finally folds.Free; end; @@ -255,6 +256,28 @@ begin waitClient; end; +procedure TCEDcdWrapper.addImportFolders(const folders: TStrings); +var + imp: string; +begin + if not fAvailable then exit; + if not fServerListening then exit; + // + fClient.Parameters.Clear; + for imp in folders do + begin + if fImportCache.IndexOf(imp) <> -1 then + continue; + fImportCache.Add(imp); + fClient.Parameters.Add('-I' + imp); + end; + if fClient.Parameters.Count <> 0 then + begin + fClient.Execute; + waitClient; + end; +end; + procedure TCEDcdWrapper.getCallTip(out tips: string); begin if not fAvailable then exit; diff --git a/src/ce_libman.pas b/src/ce_libman.pas index 35574796..cdcce512 100644 --- a/src/ce_libman.pas +++ b/src/ce_libman.pas @@ -140,14 +140,21 @@ end; procedure TLibraryManager.updateDCD; var itm: TLibraryItem; + str: TStringList; i: Integer; begin if not DcdWrapper.available then exit; // note: new items are directly handled but removed ones still in cache until server restarts. - for i := 0 to fCol.Count-1 do - begin - itm := TLibraryItem(fCol.Items[i]); - DcdWrapper.addImportFolder(itm.libSourcePath); + str := TStringList.Create; + try + for i := 0 to fCol.Count-1 do + begin + itm := TLibraryItem(fCol.Items[i]); + str.Add(itm.libSourcePath); + end; + DcdWrapper.addImportFolders(str); + finally + str.Free; end; end; diff --git a/wiki/wiki.txt b/wiki/wiki.txt index 22114b05..16a222fd 100644 --- a/wiki/wiki.txt +++ b/wiki/wiki.txt @@ -315,9 +315,9 @@ _DCD_ also has a native configuration system. Refer to the official [_Readme_](h - . invokes the completion if the editor option _autoDotDelay_ is greater than 0. - CTRL + SHIFT + UP: Jumps to the declaration of the symbol located at the cursor. The default shortcut can be modified. - CTRL + LEFT MOUSE BUTTON: ditto. -- (: Gets the function call tips. -- ): Closes the call tips window. -- ESC: ditto. +- (: Gets the function call tips. When functions calls are nested, call tips are stacked and separated by a group of hyphen. +- ): If the call tips are displayed then decreases by one the stack of call tips. +- ESC: Closes the call tips window, whatever is the level of the stack. Documentation comments associated to a symbol are displayed when hovering the symbol with the mouse.