Forum > IDE/CodeTools
Change default type for code completion
Okoba:
Hi,
Is there a way to change default types when you hit Ctrl+Shift+C to define a variable?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---S := 'Test'If I hit Ctrl+Shift+C it will add
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---varS: string;
But how can I change it to add my own string type?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---varS: MyStringType;
Bart:
AFAIK: no.
Bart
Thaddy:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type mystringtype = type string;
Bart?
Has its own caveats but may be enough.
Okoba:
@Thaddy it still adds 'string' not 'mystringtype'
Thaddy:
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.
Navigation
[0] Message Index
[#] Next page