Customizing type name in tooltip

Nicolás Alvarez nicolas.alvarez at gmail.com
Mon Jan 23 07:32:38 UTC 2017


Hello world,

I'm writing a language plugin for Pascal, mainly as an educational exercise on how to write KDevelop language plugins (Pascal is relatively easy to parse).

I just started adding support for types in variable declarations. If a variable is of type Integer, I call setType(new IntegralType(IntegralType::Int)) in the declaration builder (as far as I can tell, type builders are for complex types like structs, so I don't have one yet).

The problem is that the string representations (toString) of the different integral subtypes are biased to C++. Using IntegralType::Int makes sense for a Pascal integer, but I would want the tooltip and other parts of the UI to show 'Integer' rather than 'int'. (The list of available subtypes is also awfully biased to C++, but that's another discussion :D)

Is it possible to customize this string easily? Would I need a custom Type subclass, with its own Identity and all?

-- 
Nicolás


More information about the KDevelop-devel mailing list