Conversation
…directives, and unit info
|
I just filed that bug at #151 but if you find reproducible CodeTools errors can you file those and we can see if they can be fixed in CodeTools. You may just mean during typing and legit identifiers don't exist and thus CodeTools fail at that point. I think that's just how it works and nothing can be done. |
|
Define "stable" ? I doubt it will ever be possible to get it as correct as Lazarus: I have had many discussions with the Lazarus devs, and a 'workspace' directory (VS Code terminology) is not compatible with the Lazarus notion of project and packages. In the best case, a workspace corresponds to a project group. This does not mean codetools has no bugs, of course: Mattias Gaertner fixed some bugs this week. |
what is it missing exactly? We can provide all the paths it needs to find units and we provide the full text of the unit so isn't everything there? Simon needs to report the bugs he's seeing so we can look in to them. |
|
A project file is more than just a set of paths. For simple cases this is indeed sufficient. But for complex setups with different paths/dependencies per OS/CPU, it is not sufficient. For larger projects, if you have one or more testsuites in one of the subdirectories, then search paths will differ for these projects, and you may end up at wildly different places when ctrl-clicking on an identifier. At first I thought like you, but Mattias quickly set me straight... |
|
Even in some small projects, similar errors sometimes occur. I’ve always suspected that I might not be providing enough information to CodeTools, but I don’t know what else needs to be provided. So I provided this helper class to compare with Lazarus, but I didn’t find anything particularly significant. |
|
Maybe the lazarus source editor itself already filters out some cases before calling the code tools. |
|
The pattern I see often is code tools breaks and gives random missing identifiers or strange errors that doesn't reflect at all what's in the document. Restarting the server always fixes the problem. Not sure if it's the editor/server integration or a bug in the server we messed up the document content and confused code tools with bad input. |

Add TCodeToolManagerHelper with methods for reporting defines, directives, and unit info
This class provides some methods to print relevant information, which can help with debugging.
Additionally, although Pascal Language Server has already implemented many commonly used features, in practical use it is still not as stable as Lazarus. This is reflected in the frequent occurrence of errors such as “unit not found” or “Identifier not found.” Do we have the ability to make this component as stable as Lazarus?