This package has the SUBJ.
https://github.com/alexey-t/atsynedit_cmp
It can be ported to Delphi (part is ATSynEdit dependant but all access to ATSynEdit properties can be replaced to use other editor).
I welcome you to use its non-ATSynEdit part. and welcome to extend it. E.g. HTML auto-completion can be extended to support completions of CLASS= and ID= values from the mentioned CLASS/ID values in the CSS file.
List of features:
https://wiki.freepascal.org/CudaText#Sp ... completion
https://wiki.freepascal.org/CudaText#Sp ... completion