globals var and method invisible

I’ve got an solution in 401 (i’ve imported it from servoy 357).

In eclipse can’t see globals variable or method, i can see them in the right panel (outline) of Eclipse but not in the left one (Servoy Solution Explorer)

i can right click and edit global.js in the script editor but if i want to run my solution it can’t find my globals method or vars.

Do you have any idea ?

erdione:
In eclipse can’t see globals variable or method, i can see them in the right panel (outline) of Eclipse but not in the left one (Servoy Solution Explorer)

You can select the Globals node and the methods list in the pane below. Same with the (global) variables.

erdione:
i can right click and edit global.js in the script editor but if i want to run my solution it can’t find my globals method or vars.

Not sure what you mean by this.

In one of my solution In the left panel nothing appears when i click on global (no variables and no methods), it seems that it can’t decode globals.js (but i can load it in script editor)

I’ve got a warning (see enclosed my screen capture), but the text is in french and i don’t known how to give you the english version of this error.

You can change the locale of Servoy to English. It should then give errors in English as well…

The english version is “illegal octal literal digit 9; interpreting it as a decimal digit”

Aha, I have that error as well but it does not stop my application from executing…

I found what cause my trouble

var idEtape = 09
``` instead of ```
var idEtape = 9

just a typing error, what is strange is that the warning is not shown on the real bad line of the global.js

Hi erdione,

Could you please register this in our support system? Then the engineers can see if they can improve the error feedback.

Regards,

Paul

This is what I have:

elements.it2be_gantt.setDateRange(new Date(2007,08,01), new Date(2007,11,31));
```The error is
Severity and Description illegal octal literal digit 8; interpreting it as a decimal digit
Path Resource IT2BE_gantt/forms/folded_grouping_dataset
Location folded_grouping_dataset_methods.js line 188
Creation Time 1220967763170
Id 782

Maybe you should try this

elements.it2be_gantt.setDateRange(new Date(2007,8,1), new Date(2007,11,31));

It seems to be the leading Zero for integer that make errors

hmm, I ‘could’ agree. However, it used to work :(

i think the warning is correct i guess the javascript compiler is made more strict about it because it doesnt
know what you mean
and writing things with 0 in front of it means that it is a octal value.

also 1 observation when i see the included picture…
why do you start all your globals with MODDEVIS? thats pretty horrible code completion wise.
if you really want to group globals then use max ony 2 chars as a prefix and use a post fix for better explanation…

I seem to be having a similar issue. While I can open globals.js in the Script editor, the variables and the methods don’t show up in the solution explorer. They also cannot be seen by other forms and show up as errors, e.g. “button is linked to an entity that does not exist” etc. Code completion does not work and everything global does not appear in drop downs.

Strangely enough, I closed the solution, which was working fine last night and had the issue when I opened the solution today. I can add a variable in the solution explorer and I can see it in the script editor, but not in the solution explorer.

I also checked the local history and nothing that was changed in the last minutes before closing the solution should have any effect at all. I also could not find anything similar to the problem that caused the issues in the original post.

Is there a way to refresh or rebuild? I’m currently fixing the many warnings I got after upgrading from 4.1.7 to 6. I have already fixed 1000+ warnings and starting from scratch would be a disaster…

Thanks
Reto

Servoy Version: 6.0.5 - build 1230, OS X 10.7.3, MySQL 5.5.21

do you have anything in the log files? (servoy log or eclipse log in your workspace/.metadata dir)
Because it seems that it can’t parse the globals file. Are you sure you don’t have any error in it?

Indeed I do have a parsing error

!ENTRY com.servoy.eclipse.model 2 0 2012-03-26 07:01:31.791
!MESSAGE Javascript file ‘/Users/tsr/servoy6_workspace/DCA/globals.js’ had a parsing error
!STACK 0
java.lang.StringIndexOutOfBoundsException: String index out of range: -10
at java.lang.String.substring(String.java:1937)
at com.servoy.eclipse.model.repository.SolutionDeserializer.parseJSFile(SolutionDeserializer.java:1070)
at com.servoy.eclipse.model.repository.SolutionDeserializer.readObjectFilesFromSolutionDir(SolutionDeserializer.java:378)
at com.servoy.eclipse.model.repository.SolutionDeserializer.updateSolution(SolutionDeserializer.java:255)
at com.servoy.eclipse.model.repository.SolutionDeserializer.readSolution(SolutionDeserializer.java:203)
at com.servoy.eclipse.model.repository.EclipseRepository.loadRootObject(EclipseRepository.java:203)
at com.servoy.j2db.persistence.RootObjectCache.getRootObject(RootObjectCache.java:226)
at com.servoy.j2db.persistence.RootObjectCache.getActiveRootObject(RootObjectCache.java:160)
at com.servoy.j2db.persistence.RootObjectCache.getActiveRootObject(RootObjectCache.java:168)
at com.servoy.j2db.persistence.AbstractRepository.getActiveRootObject(AbstractRepository.java:426)
at com.servoy.eclipse.model.nature.ServoyProject.getSolution(ServoyProject.java:125)
at com.servoy.eclipse.core.ServoyModel.autoSelectActiveProjectIfNull(ServoyModel.java:669)
at com.servoy.eclipse.core.ServoyModel.initialize(ServoyModel.java:2538)
at com.servoy.eclipse.core.ServoyModelManager$1.run(ServoyModelManager.java:71)
at com.servoy.eclipse.core.ServoyModelManager.getServoyModel(ServoyModelManager.java:80)
at com.servoy.eclipse.core.ServoyModelProvider.getServoyModel(ServoyModelProvider.java:32)
at com.servoy.eclipse.model.ServoyModelFinder.initializeServoyModel(ServoyModelFinder.java:102)
at com.servoy.eclipse.model.ServoyModelFinder.getServoyModel(ServoyModelFinder.java:42)
at com.servoy.eclipse.debug.script.TypeCreator.getFlattenedSolution(TypeCreator.java:826)
at com.servoy.eclipse.debug.script.ValueCollectionProvider.getTopValueCollection(ValueCollectionProvider.java:154)
at org.eclipse.dltk.internal.javascript.ti.TypeInferencer2.getTopValueCollection(TypeInferencer2.java:316)
at org.eclipse.dltk.internal.javascript.ti.TopValueCollection.(TopValueCollection.java:104)
at org.eclipse.dltk.internal.javascript.ti.TypeInferencerVisitorBase.initialize(TypeInferencerVisitorBase.java:83)
at org.eclipse.dltk.internal.javascript.ti.TypeInferencer2.initializeVisitor(TypeInferencer2.java:80)
at org.eclipse.dltk.internal.javascript.ti.TypeInferencer2.doInferencing(TypeInferencer2.java:106)
at org.eclipse.dltk.internal.javascript.parser.JavaScriptSourceElementParser2.parseSourceModule(JavaScriptSourceElementParser2.java:46)
at org.eclipse.dltk.internal.core.AbstractSourceModule.buildStructure(AbstractSourceModule.java:528)
at org.eclipse.dltk.internal.core.Openable.generateInfos(Openable.java:193)
at org.eclipse.dltk.internal.core.ModelElement.openWhenClosed(ModelElement.java:184)
at org.eclipse.dltk.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:45)
at org.eclipse.dltk.internal.core.ModelOperation.run(ModelOperation.java:698)
at org.eclipse.dltk.internal.core.ModelOperation.runOperation(ModelOperation.java:764)
at org.eclipse.dltk.internal.core.SourceModule.becomeWorkingCopy(SourceModule.java:69)
at org.eclipse.dltk.internal.ui.editor.SourceModuleDocumentProvider.createFileInfo(SourceModuleDocumentProvider.java:1280)
at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:478)
at org.eclipse.dltk.internal.ui.editor.SourceModuleDocumentProvider.connect(SourceModuleDocumentProvider.java:1521)
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1444)
at org.eclipse.dltk.internal.ui.editor.ScriptEditor.internalDoSetInput(ScriptEditor.java:827)
at org.eclipse.dltk.internal.ui.editor.ScriptEditor.doSetInput(ScriptEditor.java:1323)
at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3043)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2606)
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3061)
at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3088)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:798)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271)
at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1429)
at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:942)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3593)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3286)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1567)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3593)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3286)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)

!ENTRY com.servoy.eclipse.model 1 0 2012-03-26 07:01:35.430
!MESSAGE Time taken to read in the solution DCA: 3856

Can you point me in a direction?

Thanks!

PS: I still have quite a few warnings in my globals.js, but no error is reported in the “Problems” tab.

Found it:

My type definition was wrong:

/**
 * @type {Object}
 * 
 * @properties={typeid:35,uuid:"8140251F-11C6-4D4E-AC70-76B9B8A8DECD",variableType:-4}
 */
/** @type {{form:String, sql:String, parameters:Array, index:Number}} */
var g_foundset;

instead of

/**
 * @type {{form:String, sql:String, parameters:Array, index:Number}}
 * 
 * @properties={typeid:35,uuid:"8140251F-11C6-4D4E-AC70-76B9B8A8DECD",variableType:-4}
 */
var g_foundset;

Now it works again :-) Thanks for your hint, found it with checking, when I first had the error and doing a diff on the local history.

i fixed our code a bit so that it handles those kinds of comments a bit better