Change default type for code completion lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- Okoba · 2020-04-20 17:18 Hi, Is there a way to change default types when you hit Ctrl+Shift+C to define a variable? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i S := 'Test'If I hit Ctrl+Shift+C it will add Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i varS: string; But how can I change it to add my own string type? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i varS: MyStringType; ---------------------------------------------------------------------- Bart · 2020-04-20 17:22 AFAIK: no. Bart ---------------------------------------------------------------------- Thaddy · 2020-04-20 17:24 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type mystringtype = type string; Bart? Has its own caveats but may be enough. ---------------------------------------------------------------------- Okoba · 2020-04-20 17:25 @Thaddy it still adds 'string' not 'mystringtype' ---------------------------------------------------------------------- Thaddy · 2020-04-20 17:27 A specialized type, like I declared, is distinct from its root type. You need to read my example very carefully. And the docs. Note it is still not perfect, but it does what you want. ---------------------------------------------------------------------- Okoba · 2020-04-20 17:29 It seems you did not understand my question. I know how to define a new type. I want to change CodeTools to complete the code with my custom type not the default 'string'. ---------------------------------------------------------------------- Thaddy · 2020-04-20 17:31 If codetools is well written it should do that automatically. Note I never used codetools (consciously) ---------------------------------------------------------------------- winni · 2020-04-20 18:50 Hi! Yes a little bit of doc for the CodeTools is necessary. In my case if you try "automagic" to define a float it is allways extended. I never uses extended and for 64 Bit it is not defined - it is just a double. I want to set my CodeTool definition for a float to a single or a double. Until now: No answers. Nowhere. Winni ---------------------------------------------------------------------- PascalDragon · 2020-04-21 07:38 Quote from: Thaddy on April 20, 2020, 07:31:38 pmIf codetools is well written it should do that automatically. Note I never used codetools (consciously) This has nothing to do with well written. If the codetools see the following: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i a := 'whatever'; What do you think should it use as type for a? It does not know about any custom types. What to do if there are multiple type aliases? No, it will use the safest one, which is - if the string contains no characters that require WideChar - a String (otherwise a UnicodeString). This is correct in both $H+ and $H-.