pyscripter 689 Posted July 6, 2023 (edited) See [RSP-41949] LSP does not work when project includes modified file found in the search path - Embarcadero Technologies for details. Has anyone been bitten by this? Code Insight now works in my PyScripter project. I thought that cyclic unit dependencies may be the cause and spent quite a bit of time reducing them. I guess, that this was time well spent, but it was not the source of the LSP failures. Edited July 6, 2023 by pyscripter Share this post Link to post
Brandon Staggs 277 Posted July 6, 2023 (edited) 52 minutes ago, pyscripter said: See [RSP-41949] LSP does not work when project includes modified file found in the search path - Embarcadero Technologies for details. Has anyone been bitten by this? I regularly work on a project that has local forked copies of over a dozen Delphi RTL, VCL, and Fmx units. While LSP is not exactly stable, it usually works in 11.3. I do sometimes lose the ability to find symbol declarations with CTRL+Click, and in that case, CTRL+G often works instead. But it's not always broken for me. Hopefully that QA report will help them fix a few more LSP bugs. Edited July 6, 2023 by Brandon Staggs Share this post Link to post
pyscripter 689 Posted July 6, 2023 (edited) @Brandon Staggs Could you please try the minimal project attached to the QA report. Does it work for you? I think the bug affects units that either use directly the forked units or units that depend on such units. Edited July 6, 2023 by pyscripter Share this post Link to post
ertank 27 Posted July 6, 2023 It does not work for me. I've very likely bitten by this bug numerous times but I didn't know the reason until now. Share this post Link to post
programmerdelphi2k 237 Posted July 6, 2023 @pyscripter If the test is "Ctrl+click" in "Test; (procedure)", in my IDE (RAD11.3 patch 1), the cursor goes to "procedure TForm1.Test;" as expected when I click in "Winapi.Messages," (in uses clauses), the cursor goes to your new "Winapi.Messages.pas" in your project too! if I delete this from "uses clauses", the cursor goes to "Winapi.Messages.pas in RAD sources folder" (as expected by default) and Ctrl+click in "Tests" still working as expected too if is this, then all works as expected Share this post Link to post
pyscripter 689 Posted July 6, 2023 @programmerdelphi2k You are right. It works with WinApi.Messages. I have added another project with JclSysUtils instead of WinApi.Messages. The project will compile fine if you have Jcl installed. LSP fails with that project. It also fails if you use System.Variants instead of WinApi.Messages. But in that case the project does not compile. I will try to find out what triggers the failure. Share this post Link to post
programmerdelphi2k 237 Posted July 6, 2023 (edited) @pyscripter I has this case, normally, Code-Editor/LSP assistence stop code-complition work: Example: im creating a new unit to create a class (any) basic nothing advanced. 1create 1 destroy, 1 method any then, I decide use "interface" in my new class, then... I create a new unit for my new "interface"... ok now, I go back to my unit class and add my unit-interface in my uses and add my interface in my class declaration (TInterfacedObject, ImyInterf....) as usual now, I try use new class-INTERFACED (now) in my form1 test, and the code-complition does not works anymore... (already known "red-lines" in Editor) summary: I need close the project, and re-opent it and all it's ok sometimes I see on window Messages: LSP starting did you try this too? Edited July 6, 2023 by programmerdelphi2k Share this post Link to post
pyscripter 689 Posted July 7, 2023 (edited) It turns out that the causes of LSP failure were more complex than I originally thought. In the attached project in TestCI-JclSysUtils LSP does not work. The project is relatively simple. It has three units Unit1.pas (a form with one button) uCommonFunctions.pas (contains three functions) JclSysUtils (an exact copy of the Jcl unit) With Jcl installed it compiles and runs fine. Here is the interesting thing. LSP starts working if: either you remove an unused import of JclPeImage from the uses clauses of uCommonFunctions or you remove the "forked" JclSysUtils from the project. Looks like LSP is a lot more fragile than is should be. I was without IDE support in my a project, since Delphi 11.2 was released and it took substantial effort and a bit of luck to restore it. TestCI-JclSysUtils.zip Edited July 7, 2023 by pyscripter 1 Share this post Link to post
Edwin Yip 154 Posted July 7, 2023 After working on 11.3 for months, my conclusion is that the LSP-based code completion and code navigation is much much unstable than the old non-LSP versions. I always have to kill the LSP server to get it back to normal... 1 Share this post Link to post
FredS 138 Posted July 7, 2023 15 hours ago, pyscripter said: It turns out that the causes of LSP failure were more complex than I originally thought. Little has changed since Godzilla, or maybe some of that is back again. I still use a clean bat when switching between 'Build Configurations', that limits the problem even today. What it does is delete all DCUs which exist from all but the current 'Build Configuration'. Share this post Link to post