Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Extending SSE
Extending SSE [message #170688] Tue, 06 June 2006 07:35 Go to next message
Eclipse UserFriend
Originally posted by: alban_news.laposte.net

Hello,

I'm trying to extend SSE in order to have an editor in a language which
the structure is similar to JSP.

My first step is to obtain the syntax highlighting for this language.

I have:
1. extended the SSE extention point TextViewerConfiguration.
2. a parser that parse in regions a structured document.
3. a partitioner and a lineStyleProvider.

What are the next tasks to do in order to color the code?
Is a DOM model essential to obtain the syntax highligting?

I've found very few technical papers about the extension of SSE. Is the
some articles or tutorial about it?

Thanks for any help!

Alban
Re: Extending SSE [message #170740 is a reply to message #170688] Tue, 06 June 2006 18:23 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence MandelFriend
Messages: 486
Registered: July 2009
Senior Member
Hi Alban,

You might like to take a look at the EclipseCon SSE tutorial [1].

[1] http://www.eclipsecon.org/2006/Sub.do?id=186

Lawrence
Re: Extending SSE [message #170838 is a reply to message #170688] Thu, 08 June 2006 14:29 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Tue, 06 Jun 2006 03:35:33 -0400, Alban <alban_news@laposte.net> wrote:

> What are the next tasks to do in order to color the code? Is a DOM model
> essential to obtain the syntax highligting?
>

No, a DOM Model is not needed. You might need a contentType (for whole
file)
in order to register your lineStyleProvider(s) per partition type.

These LineStyleProviders are not yet API, since we do need to use some
care to "fit in" to the platform's way of doing it ... so your experiences
and the "how to" knowledge to learn would be very interesting and useful.
Re: Extending SSE [message #170963 is a reply to message #170688] Fri, 09 June 2006 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alban_news.laposte.net

Thanks a lot for your answers!

> No, a DOM Model is not needed.

Ok, that was I thought. The DOM Model in mainely usefull to content
assist and validation, right?

> You might need a contentType (for whole file)
> in order to register your lineStyleProvider(s) per partition type.

Where is the link between a ContentType and the LineStyleProvider/partition?

Is the implementation of a content type easy or is it heavy ? (I've
looked at the content type described by the JSP plugin and it appears
quite complex first...)


> These LineStyleProviders are not yet API, since we do need to use some
> care to "fit in" to the platform's way of doing it ... so your experiences
> and the "how to" knowledge to learn would be very interesting and useful.

Ok, I will post remarks about the LineStyleProviders as soon as I have
acquired more experience on the subject.

Alban
Re: Extending SSE [message #171022 is a reply to message #170963] Sat, 10 June 2006 03:00 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Fri, 09 Jun 2006 12:25:49 -0400, Alban <alban_news@laposte.net> wrote:

>
> Ok, that was I thought. The DOM Model in mainely usefull to content
> assist and validation, right?
>

Yes, mainly. (technically, it could be useful in syntax highlighting, but
1. our "structuredDocumentRegions" (basically) is already pretty rich
information, and
2. DOM access/precessing tends to be slower, so is not appropriate for
lineStyleProviders,
per se ... would have to move some processing and highlight updating to
another thread.

>
> Where is the link between a ContentType and the
> LineStyleProvider/partition?
>

Not sure off top of my head, I'd have to dig around.
(some part of structuredTextViewerConfiguration and/or
search for "internal" extension points with "lineStyle" in
them).

> Is the implementation of a content type easy or is it heavy ? (I've
> looked at the content type described by the JSP plugin and it appears
> quite complex first...)
>

Can be very light, or very heavy. JSP is not a good one to start with
as an example. To just associate an extension to an existing one
is the easiest to do. To "peek" in the file gets progressively more
complex.
Re: Extending SSE [message #171314 is a reply to message #170963] Thu, 15 June 2006 08:35 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Alban wrote:
> Where is the link between a ContentType and the
> LineStyleProvider/partition?

The platform's ContentType determines which text viewer
configuration class is loaded, you'll see examples of associating
the Content Type ID to viewer configuration classes in the
org.eclipse.wst.xml.ui and similar plugins. It's easy to confuse
with the method and argument names "contentType", which in the
SourceViewer and SourceViewerConfiguration hierarchy actually mean
_partition_ types. The structured text viewer configuration uses
the partition type to call the correct line style provider.

--
- Nitin


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Extending SSE [message #171695 is a reply to message #170838] Tue, 20 June 2006 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alban_news.laposte.net

Hello,

Tanks for your help, my syntax highlighting works!

> These LineStyleProviders are not yet API, since we do need to use some
> care to "fit in" to the platform's way of doing it ... so your experiences
> and the "how to" knowledge to learn would be very interesting and useful.

- The hard point (as says Nitin), is to understand the difference
between the content type (of a file, indicated by its extension) and the
content type which is the partition type. It's really easy to get
confused with something which have the same name and a different concept...

- The LineStyleProvider use needs to have assimilated both concepts of
StructuredDocument and partionning. After this step, it's quite easy to
manipulate. The method getAttributefor who defines the mapping between
styles and regions provides a global view of the mapping used by the
Highlighter.

- It could be useful to have the future LineStyleProvider API defined in
the StructuredTextConfiguration extension point instead of declaring
them in the StructuredTextConfiguration class (by adding an element
LineStyleProvider to the StructuredTextconfiguration extension point
schema). The new element could contain the partionning types supported
by the LineStyleProvider and the class who implements the
LineStyleProvider.
This could make the syntax highlighting process more readable.

Alban
Re: Extending SSE [message #171711 is a reply to message #170688] Tue, 20 June 2006 14:27 Go to previous message
Eclipse UserFriend
Originally posted by: alban_news.laposte.net

Hi,

I'm now trying to get the content assist for my editor.

I have watched how the XML DOM Model is implemented and some questions
remains:

- Where should I start in order to create a DOM Model?

- What are the Adapters/AdapterFactory for?

- My idea is that the parser parse a document into regions, the adapters
are here to provide a structured region document -> DOM Model
conversion. Am i right?

- What are the different steps in order to provide content assist?

- How does the XML plugin provides a schema based content assist?

Thanks for any help.

Alban
Previous Topic:HTML validation error into the Problems view?
Next Topic:Pulling XML editing features from WTP to eclipse IDE layer
Goto Forum:
  


Current Time: Fri Apr 19 07:11:52 GMT 2024

Powered by FUDForum. Page generated in 0.02552 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top