...ctags project. But their tex file does not seem to have anything for macros, and is considerably different from the ctags/latex.c file here.
Sigh, looks like in the past "somebody" made significant changes without getting them upstream which will make sharing improvements hard in future. That was why I asked had you tried first. Ok, guess it will have to be local only.
One way of making this functionality more generic would be to use the lexer to filter which symbols can be used for autocompletion. So if the lexer can tell whether the current word is a macro or not, and if the known symbols are properly typed, the LaTeX specific code could go away. But I don't know if this could break autocompletion for other languages.
Just a note on Geany terminology, lexers are the things inside Scintilla that do purely syntax identification for highlighting, the ctags things are parsers since they understand semantics (at least of declarations). Being purely semantics the lexers don't know what a syntactic element (like a name) represents. But they can compare syntactic elements that are names with a list of known names and identify them differently if they are in the list. This list is usually provided by the parsers from the declarations. But be warned, occurrence of a name will allways be identified that way irrespective of its context, so depending on how latex treats names YMMV (works fairly ok in C, but often quite badly in C++).
What sorts of names does latex have? What sorts are identified by the parser? The autocomplete operation is currently really elementary, and only (sort of) works for C/C++ and look alike languages that use . or -> (which is why you will see an occasional "not all languages are C" rant in Geany discussions :).
So a more general mechanism for having autocomplete handle context when offering names would be good.
Or possibly you could look at re-mapping the symbol kinds used in latex so they can be filtered by the C like mechanism already available an so only need a setting for the separator (instead of . and ->).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1011#issuecomment-215276679