| new Javascript editor [message #697896] |
Mon, 18 July 2011 05:55  |
sulakshana.vasanth Messages: 11 Registered: July 2011 |
Junior Member |
|
|
Have created a new plugin project in which trying to create a JavaScript editor. In plugin.xml have specified
<extension
point="org.eclipse.ui.editors">
<editor
class="com.eclipse.ide.sourceeditors.NewCSSStructuredTextEditor"
default="false"
extensions="css"
id="com.eclipse.ide.editor1"
name="New CSS Editor">
</editor>
<editor
class="com.eclipse.ide.sourceeditors.NewJavaScriptStructuredTextEditor"
default="false"
extensions="js"
id="com.eclipse.ide.editor3"
name="New JavaScript Editor">
</editor>
</extension>
and NewCSSStructuredTextEditor and NewJavaScriptStructuredTextEditor extends StructuredTextEditor. when I launch another instance of eclipse I can open CSS files with New CSS Editor and code completion works fine.
but when tried to open a JS page with New JavaScript Editor getting an error as
"Unsupported content type in editor
To associate file extension with a supported content type,
please see content type prefernce page"
also getting the errors on console as:
!ENTRY org.eclipse.wst.sse.ui 2 2 2011-07-18 15:13:30.520
!MESSAGE StructuredTextEditor being used without StructuredDocument
!ENTRY org.eclipse.wst.sse.ui 2 2 2011-07-18 15:13:30.520
!MESSAGE Input Name: new.js
!ENTRY org.eclipse.wst.sse.ui 2 2 2011-07-18 15:13:30.520
!MESSAGE Unexpected IDocument implementation: org.eclipse.core.internal.filebuffers.SynchronizableDocument
IDocumentProvider implementation: org.eclipse.ui.editors.text.TextFileDocumentProvider
How to solve this???
[Updated on: Tue, 26 July 2011 03:44] Report message to a moderator
|
|
|
| Re: new Javascript editor [message #698283 is a reply to message #697896] |
Tue, 19 July 2011 04:00   |
 |
Nitin Dahyabhai Messages: 1847 Registered: July 2009 |
Senior Member |
|
|
There's not much to "solve" here. A number of classes (parser, reparser, model loader, adapter factory provider, viewer configurations, etc.) have to be authored for languages WTP supports through the StructuredTextEditor, and no such implementation is provided for JavaScript. The messages you're seeing indicate that the JavaScript content type isn't one of the languages supported through the StructuredTextEditor. While it's not impossible to create such classes, the existing JavaScript support in WTP has more in common with the Java plug-ins provided in the Eclipse project than the editors built on SSE.
What is it that you're trying to do that requires subclassing StructuredTextEditor? For the most part we discourage doing so except for very specific scenarios where the input to the editor, either due to timing issues or other corner cases, can't be used to alter its behavior in the way desired. If you're just reusing the editors, you don't have to subclass them. If you're trying to inject your own template proposals from your own template context, you really want to approach it by contributing content assist computers (with the org.eclipse.wst.sse.ui.completionProposal extension point) rather than entire editors.
---
Nitin Dahyabhai
Eclipse WTP, IBM
|
|
|
|
|
|
|
| Re: new Javascript editor [message #757731 is a reply to message #757358] |
Mon, 21 November 2011 06:36   |
sulakshana.vasanth Messages: 11 Registered: July 2011 |
Junior Member |
|
|
thank you for your support, I could do it . now I can open my JS editor with my templates view available.
but when try the default code completion it works but I get
!ENTRY org.eclipse.wst.jsdt.ui 4 10001 2011-11-21 16:49:06.875
!MESSAGE Internal Error
!STACK 1
JavaScript Model Exception: JavaScript Model Status [Index out of bounds]
at org.eclipse.wst.jsdt.internal.core.Openable.codeComplete(Openable.java:125)
at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:305)
......
!SUBENTRY 1 org.eclipse.wst.jsdt.core 4 980 2011-11-21 16:49:06.875
!MESSAGE Index out of bounds
how to solve this?? and also got an error saying
"org.eclipse.wst.jsdt.ui" did not complete normally. the extension took too long to return from "computeCompletionProposal()". to avoid this disable "Other JavaScript Proposal" on content assist preference page.
But I want "Other JavaScript Proposal" also in my editor...
How can solve this??????
Waiting for your reply,
Sulakshana
[Updated on: Mon, 21 November 2011 08:01] Report message to a moderator
|
|
|
|
|
| Re: new Javascript editor [message #766053 is a reply to message #758392] |
Thu, 15 December 2011 01:25  |
sulakshana.vasanth Messages: 11 Registered: July 2011 |
Junior Member |
|
|
Hi,
Using extension point "org.eclipse.ui.editors.templates" have added template view to my editor where templates have few new ContextType like html and JS. have added contextTypes using AbstractJavaContextType. I could see the templates sorted according to the context types.
Now the problem is adding new template, edit the template and remove template options are not working. after some investigation found that
getTemplateStore().save(); or getTemplateStore().delete(..); getTemplateStore().add(..);
are not working. where as getTemplateStore() returns the correct set of templates which i have inserted.
what could be the reason for this?? how can I solve this??
waiting for reply,
Sulakshana
|
|
|
Powered by
FUDForum. Page generated in 0.01992 seconds