Textmode IDE development

From Lazarus wiki
Jump to navigationJump to search

General problems

While the obvious task for the textmode IDE is of course fixing several or some of the 80 bugs, some other stuff comes to mind as future projects. Nearly all have to do with the fact that the IDE effectively stopped evolving significantly since 1.0 times. A lot of problems and uglinesses lie in the TP/DOS legacy from this period:

  • the fact that it uses Dos, rather than Sysutils for its filename operations.
    • Now that the compiler uses sysutils mostly, the Dos versions are the less tested ones.
    • the fact that shortstrings (or parts of them) are used for filenames.
    • under windows there is no support for unc-paths
  • Even the shortstring filename handling is far from perfect, since the IDE clearly hasn't had the end-user testing for *nix targets that dos/win32 had. Grepping for fixfilename() might yield such problems (like e.g. bug #5614), where filenames are pretty printing, however effectively killing case sensitive filesystems. Bringing this up to ansistring/sysutils level might also help to unify these routines between textmode IDE and Lazarus.
  • Some functionality is deprecated or not active or documented. Examples are browser and code folding (see comments of bug #6696 Some of the functionality mentioned in #11583 might also be "newer"). Note that this kind of functionality is often not finished, e.g. afaik there is no way to save folds. (make them persistent some how)
  • Another major problem is that the docs have significantly grown. On a PII-233 (128MB and a more recent 20GB disc) it took 20-40 minutes to install the html files from the help. Nowadays we have chm support in the FPC tree, maybe it is time to kill all the old helpfile formats and standarize on CHM for a while. (removing the need to have separate files html is I think more important than killing e.g. .tph)

ansistringification

Since FV has reduced in meaning, maybe it can be modernised using the delphi model a bit (streaming and constructors/destructors). I know this is heresy, but a tpobj version could continue to exist. It is mainly for the IDE. I also don't know if it is worthwhile at all (most notably exploiting if FV exploits the static nature of objects...).

Maybe a good first approximation would be to try to introduce ansistring everywhere. (Florian has said he has tried this in the past, but that he got stuck.

I did a real minor attempt to kill some redundant string routines, but are stuck with the fact that one can't import sysutils into a major TV or IDE because that will cause incompatabilities due to the pstring type. (which is defined both by TV as by sysutils). This is probably the reason why wutils wraps so many sysutils routines.

It could be easily remedied by reworking TV/IDE to use a "pshortstring" everywhere, which is still compatible with pstring for backwards compatibility.

A second stage would replace all path related strings by ansistrings.

Units of the IDE

Here a short list of the units in the IDE, and their contents. A rough size in kb is added to indicate the relative size of the unit.


Unit Size Remark
fp 14k The main program for the IDE. Parameter processing and a *lot* (400 lines) of initialization.
fpcalc 14k Calculator object for the IDE
fpcatch 6k IDE exception handling.
fpcodcmp 20k Code Complete routines
fpcodtmp 18k Code Template routines
fpcompil 38k Compiler call routines for the IDE
fpconst 17k Constants used by the IDE
fpcygwin 2k Cygwin helpers (versioning, dll name)
fpdebug 103k Debugger call routines for the IDE
fpdesk 29k Desktop loading/saving routines
fpdpansi 3k Unit to export current screen buffer to an ansi file (screendump)
fpevalw 2k Debug expression evaluator dialog ?
fphelp 24k Help routines for the IDE
fpide 72k Main IDEApp object
fpini 24k Write/Read Options to INI File
fpintf 8k Misc routines for the IDE. compiling/running related mostly.
fpkeys 8k Learn keys routines for the IDE
fpredir 19k Unit to redirect output and error to files
fpregs 50k (cpu)Register debug routines for the IDE
fpswitch 49k Compiler switches routines for the IDE
fpsymbol 58k Symbol browse support routines for the IDE
fptemplt 7k Template support routines for the IDE
fptools 47k Tool (menu) support for the IDE
fpusrscr 41k User screen support routines
fputils 11k Utilility routines used by the IDE. Path/file/string related mostly.
fpvars 5k Global variables for the IDE
fpviews 131k Views and view-related functions for the IDE
pmode 6k Support routines for DPMI programs (dos support)
vesa 20k VESA (graphmode switching) support routines
wansi 28k ANSI support
wcedit 58k Code editor template objects
wconsole 2k Contains some routines that save/restore console state when executing built programs.
wconsts 0k Strings for common utilities. A handful of numeric consts, and a big includefile with textual constants (localisation?)
weditor 208k Code editor template objects
whelp 27k Help support & Borland OA .HLP reader objects and routines
whlpview 41k Help display objects. The base widgets for the help system (?)
whtml 30k base object definitions for html help?
whtmlhlp 43k Main html parser. (for separate html files, not .chm)
whtmlscn 28k HTML scanner objects
winclip 5k Functions that wrap the windows clipboard for Dos and Windows
windebug 4k Helper functions for use of GDB under Windows. cygdrive + update of running program's windowtitle.
wini 12k Ini file using TP objects
wnghelp 13k Help support for Norton Guide (.NG) files
woahelp 15k Borland OA .HLP reader objects and routines
wos2help 19k Help support for OS/2 (.INF) help files
wresourc 22k (TP?) Resource File support objects and routines
wtphwrit 7k Routines to create .tph files
wutils 32k Utils, mostly collections, string routines and file(name/path) routines.
wviews 69k Enhanced View s(widgets) (special for IDE?)
wvphelp 4k Help support for (.VPH) help files
wwinhelp 49k Help support for Windows Help (.HLP) files
compunit 0k (compiler/ dir) build unit for the compiler.
gdbcon 2k (fakegdb/) fake gdb controller unit to be used when no gdb support is included
gdbint 5k (fakegdb/) fake gdb controller unit to be used when no gdb support is included

Some functionality seems to be split between a w* unit and a fp* unit. (wini,fpini, wviews, fpview). Possibly this is an artifact of an older division between reusable and non reusable units. The fact that there are multiple utility units is also a bit of an indicator for this.

If you know/find out what the criteria herefore is, please add it here. If you find out something about a certain unit, make a link out of it prefixed with fv: (see the wutils example).

Classchart of objects + FV + IDE

An improvised classchart (objectchart?) of all code containing TP style objects ( unit objects, FV and the IDE source) is available here: Object Chart (Postscript view with GV) or pdf version, less often updated