Javascript editor, StorageEditorInput [message #228106] |
Fri, 20 February 2009 17:25 |
Carl Hagenmaier Messages: 11 Registered: July 2009 |
Junior Member |
|
|
I'm trying to use the javascript editor with StorageEditorInput rather
than a file. When I open the editor, the initial contents are always
empty even when the contents of the StorageEditorInput is not empty.
After debugging I've concluded that the problem is in
CompilationUnitDocumentProvider.createFileInfo()
<code>
protected FileInfo createFileInfo(Object element) throws CoreException {
IJavaScriptUnit original= null;
if (element instanceof IFileEditorInput) {
IFileEditorInput input= (IFileEditorInput) element;
original= createCompilationUnit(input.getFile());
if (original == null)
return null;
}
FileInfo info= super.createFileInfo(element);
if (!(info instanceof CompilationUnitInfo))
return null;
if (original == null)
original= createFakeCompiltationUnit(element, false);
</code>
In my case, element is a IStorageEditorInput and not an IFileEditorInput,
so the createFakeCompilationUnit(element, false) is executed. The second
parameter to (false) instructs it NOT to read the contents. Is this a
bug, a limitation, or am I just doing something wrong?
|
|
|
Powered by
FUDForum. Page generated in 0.03794 seconds