[SOLVE] Problem with pas2Js and code completion lazarus / 76-Pas2JS ---------------------------------------------------------------------- cappe · 2021-04-03 06:36 I am using lazarus 2.0.12 with pas2js 2.0.4. Open the first image, pressing CTRL + SPACE after "j:" gives me the error "web.pas (1019,49) Error: it was expected: instead JSValue was found" and opens web.pas as from the second image. How can I fix code completion? ---------------------------------------------------------------------- PascalDragon · 2021-04-03 09:08 Whenever I have such problems with not yet supported syntax I use the following trick (the following only needs to be done once): go to Tools -> Codetools Defines Editorgo to Edit -> Insert Node Below -> Define Recurseenter the following values:       Name: InLazIDE       Description: Define InLazIDE everywhere       Variable: InLazIDE       Value from text: 1 And then adjust the code like this: 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 procedure debug(Obj1: JSValue); {$ifndef InLazIDE}array of JSValue;{$endif} This way the compiler (in this case pas2js) will still see the declaration, but the IDE's codetools won't and thus they won't complain. ---------------------------------------------------------------------- cappe · 2021-04-03 09:22 Thanks, now it works. Although it was not necessary to write this code before. How come it now gives these problems? ---------------------------------------------------------------------- PascalDragon · 2021-04-03 09:27 Because pas2js was improved and thus supports/uses more syntax than Lazarus 2.0.12 supports.