Addin Help

Hi guys,
Excellent product, love resharper, etc...

Back around a year ago i suggested a feature, a line marker indicator (a
faint colored background on the current line) similar to what eclipse (and
other editors) has by default. I recieved a email that its something that
has been considered but never got a high enough priority (i'm assuming by
the PMs). Anyway i created a small addin that i will release as open source
that has this feature plus some other niceities.
Just wondering if any dev over there can help me out w/ some questions on
drawing ontop of the editor window, since there is no documentation on this.
a quick one is how do you know where the beginning of the line starts in
the window, ie (where to clip the outline of the bracket highlighting) i
see it changes whether the indicator margin is shown or not. also the clipping
on the left changes depending on wether there is a vertical scrollbar or
not, are you just querying the setting on paint, and hardcoded the pixel
values or is there some safer way?

Is there a way to reduce flashing during horizontal scrolling? Anything would
help i'm dying here :(

thanks for any of your help.
-john


4 comments
Comment actions Permalink

Hello John,

thank you for your feedback. We indeed considered implementing current line
emphasizing but cut it
because of necessity to fix higher priority issues.

In order to draw on top of the editor window, you'll need to subclass the
editor window (in Win32 sense).
This trick is used by many VS extensions including ReSharper. You can get
HWND of the editor window
using the IVsTextView interface from the VSIP SDK. IVsTextView also contains
functions for coordinate
transformations you may want to use for finding the beginning of the current
line. There is a documentation
on this interface in VSIP docs:
http://msdn.microsoft.com/vstudio/extend/ (look for VSIP SDK there).

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi guys,
Excellent product, love resharper, etc...
Back around a year ago i suggested a feature, a line marker indicator
(a
faint colored background on the current line) similar to what eclipse
(and
other editors) has by default. I recieved a email that its something
that
has been considered but never got a high enough priority (i'm assuming
by
the PMs). Anyway i created a small addin that i will release as open
source
that has this feature plus some other niceities.
Just wondering if any dev over there can help me out w/ some questions
on
drawing ontop of the editor window, since there is no documentation on
this.
a quick one is how do you know where the beginning of the line starts
in
the window, ie (where to clip the outline of the bracket highlighting)
i
see it changes whether the indicator margin is shown or not. also the
clipping
on the left changes depending on wether there is a vertical scrollbar
or
not, are you just querying the setting on paint, and hardcoded the
pixel
values or is there some safer way?
Is there a way to reduce flashing during horizontal scrolling?
Anything would help i'm dying here :(

thanks for any of your help.
-john



0
Comment actions Permalink

Hello Dmitry,

Thanks for the response, i ended up downloading the VSIP pack, for some reason
i thought they charged for this api, but i guess now they decided to open
it up to the public. Anyway, i ended up doing exactly what you send i'm subclassing
the editor window, and i'm using the IVsTextViewEvents OnChangeCaretLine
to redraw the line marker. In addition , i'm using GetScrollInfo + GetPointOfLineColumn
combo from IVsTextView to get the first column position. The line draws well
and its pretty much a working prototype, there are some refresh issues when
scrolling horizontally, and it overall needs some more stablization. I'm
thinking on releasing it like this and hopefully some people would help me
stablizing it.
I heard on an earlier post that you guys were considering having a user contributed
plugin architecture to RS, this i think would be a perfect candidate. Its
standing (although shaking pretty badly) on its own as a full addin but if
it was harnessed by resharper, that would stablize it tremedously.

In addition Dmitry is their a link to what you guys are implementing (spec
or feature list) for ASP.NET support? I wanted the ability to outline corresponding
end tags similiar to how matching brackets are outlined in CS files. If this
feature is not on your plate i wanted to take a stab at it with this project.
I'm not going to try to come up with a language service or anything crazy
like that, just some balanced regular expressions or something to find the
corresponding end/begin tag and outline it.

Second feature would be some way to auto format the html code. Obliviously
a harder task, but i started developing a small plugin architecture where
using this addin users can create their own modules that the plugin will
pass the html through. Anyway I want to know what the asp.net support status
is so i can make sure i align my this project scope accordingly.

BTW this project is going to be open-source, and completely free. Using the
VSIP pack, i have to double check the license agreement, but i believe for
shareware/free projects its ok. If there is is anyone interested in helping
out please let me know! :)


Thanks again for your response.
-john

Hello John,

thank you for your feedback. We indeed considered implementing current
line
emphasizing but cut it
because of necessity to fix higher priority issues.
In order to draw on top of the editor window, you'll need to subclass
the
editor window (in Win32 sense).
This trick is used by many VS extensions including ReSharper. You can
get
HWND of the editor window
using the IVsTextView interface from the VSIP SDK. IVsTextView also
contains
functions for coordinate
transformations you may want to use for finding the beginning of the
current
line. There is a documentation
on this interface in VSIP docs:
http://msdn.microsoft.com/vstudio/extend/ (look for VSIP SDK there).
Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> Hi guys,
>> Excellent product, love resharper, etc...
>> Back around a year ago i suggested a feature, a line marker indicator
>> (a
>> faint colored background on the current line) similar to what eclipse
>> (and
>> other editors) has by default. I recieved a email that its something
>> that
>> has been considered but never got a high enough priority (i'm
>> assuming
>> by
>> the PMs). Anyway i created a small addin that i will release as open
>> source
>> that has this feature plus some other niceities.
>> Just wondering if any dev over there can help me out w/ some
>> questions
>> on
>> drawing ontop of the editor window, since there is no documentation
>> on
>> this.
>> a quick one is how do you know where the beginning of the line starts
>> in
>> the window, ie (where to clip the outline of the bracket
>> highlighting)
>> i
>> see it changes whether the indicator margin is shown or not. also the
>> clipping
>> on the left changes depending on wether there is a vertical scrollbar
>> or
>> not, are you just querying the setting on paint, and hardcoded the
>> pixel
>> values or is there some safer way?
>> Is there a way to reduce flashing during horizontal scrolling?
>> Anything would help i'm dying here :(
>> thanks for any of your help.
>> -john


0
Comment actions Permalink

Hi John,

I'm glad that you've succeeded with your project.

We indeed plan to have an extensible artchitecture for ReSharper,
though I cannot say right now when its detailed specifications will be
available. Our plan can be reached at:
http://www.jetbrains.net/confluence/display/ReSharper/ReSharper2.0Plan
As you can see, we have no intention to support html formatting in the 2.0
version,
so a third-party plugin for ReSharper offering such a feature would look
very appealing.

Concerning licensing issues related to open source projects which use VSIP,
you better check VS Extensibility newsgroups (referenced from their main
Extensibility
center page). I remember there was a discussion on this subject there.

Thank you for your interest!

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello Dmitry,

Thanks for the response, i ended up downloading the VSIP pack, for
some reason i thought they charged for this api, but i guess now they
decided to open it up to the public. Anyway, i ended up doing exactly
what you send i'm subclassing the editor window, and i'm using the
IVsTextViewEvents OnChangeCaretLine to redraw the line marker. In
addition , i'm using GetScrollInfo + GetPointOfLineColumn combo from
IVsTextView to get the first column position. The line draws well and
its pretty much a working prototype, there are some refresh issues
when scrolling horizontally, and it overall needs some more
stablization. I'm thinking on releasing it like this and hopefully
some people would help me stablizing it. I heard on an earlier post
that you guys were considering having a user contributed plugin
architecture to RS, this i think would be a perfect candidate. Its
standing (although shaking pretty badly) on its own as a full addin
but if it was harnessed by resharper, that would stablize it
tremedously.

In addition Dmitry is their a link to what you guys are implementing
(spec or feature list) for ASP.NET support? I wanted the ability to
outline corresponding end tags similiar to how matching brackets are
outlined in CS files. If this feature is not on your plate i wanted to
take a stab at it with this project. I'm not going to try to come up
with a language service or anything crazy like that, just some
balanced regular expressions or something to find the corresponding
end/begin tag and outline it.

Second feature would be some way to auto format the html code.
Obliviously a harder task, but i started developing a small plugin
architecture where using this addin users can create their own modules
that the plugin will pass the html through. Anyway I want to know what
the asp.net support status is so i can make sure i align my this
project scope accordingly.

BTW this project is going to be open-source, and completely free.
Using the VSIP pack, i have to double check the license agreement, but
i believe for shareware/free projects its ok. If there is is anyone
interested in helping out please let me know! :)

Thanks again for your response.
-john

>> Hello John,
>>
>> thank you for your feedback. We indeed considered implementing
>> current
>> line
>> emphasizing but cut it
>> because of necessity to fix higher priority issues.
>> In order to draw on top of the editor window, you'll need to subclass
>> the
>> editor window (in Win32 sense).
>> This trick is used by many VS extensions including ReSharper. You can
>> get
>> HWND of the editor window
>> using the IVsTextView interface from the VSIP SDK. IVsTextView also
>> contains
>> functions for coordinate
>> transformations you may want to use for finding the beginning of the
>> current
>> line. There is a documentation
>> on this interface in VSIP docs:
>> http://msdn.microsoft.com/vstudio/extend/ (look for VSIP SDK there).
>> Regards,
>> Dmitry Shaporenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> Hi guys,
>>> Excellent product, love resharper, etc...
>>> Back around a year ago i suggested a feature, a line marker
>>> indicator
>>> (a
>>> faint colored background on the current line) similar to what
>>> eclipse
>>> (and
>>> other editors) has by default. I recieved a email that its something
>>> that
>>> has been considered but never got a high enough priority (i'm
>>> assuming
>>> by
>>> the PMs). Anyway i created a small addin that i will release as open
>>> source
>>> that has this feature plus some other niceities.
>>> Just wondering if any dev over there can help me out w/ some
>>> questions
>>> on
>>> drawing ontop of the editor window, since there is no documentation
>>> on
>>> this.
>>> a quick one is how do you know where the beginning of the line
>>> starts
>>> in
>>> the window, ie (where to clip the outline of the bracket
>>> highlighting)
>>> i
>>> see it changes whether the indicator margin is shown or not. also
>>> the
>>> clipping
>>> on the left changes depending on wether there is a vertical
>>> scrollbar
>>> or
>>> not, are you just querying the setting on paint, and hardcoded the
>>> pixel
>>> values or is there some safer way?
>>> Is there a way to reduce flashing during horizontal scrolling?
>>> Anything would help i'm dying here :(
>>> thanks for any of your help.
>>> -john


0
Comment actions Permalink

Hello Dmitry,
Thanks again for the feedback, i again did what you suggested and searched
the forums about this issue. Sadly, it looks like this project is not going
to work considering i'm not going to be able to open it up. Microsoft really
dissappoints me when things like this happens, its like they are afraid to
lose all the control they have. There is a post where a dev by the name of
Arron wanted to create a open-source boo language service, where he clearly
points out lines in the EULA that forbids open source projects using the
VSIP SDK. The post is about a month old, and the MS guys have not responded.
Its really a shame, his project like mine seemed like it has potential.
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=52858

i really cannot wait until RS IDE goes into beta.

Thanks
-john

Hi John,

I'm glad that you've succeeded with your project.

We indeed plan to have an extensible artchitecture for ReSharper,
though I cannot say right now when its detailed specifications will be
available. Our plan can be reached at:
http://www.jetbrains.net/confluence/display/ReSharper/ReSharper2.0Pl
an
As you can see, we have no intention to support html formatting in the
2.0
version,
so a third-party plugin for ReSharper offering such a feature would
look
very appealing.
Concerning licensing issues related to open source projects which use
VSIP,
you better check VS Extensibility newsgroups (referenced from their
main
Extensibility
center page). I remember there was a discussion on this subject there.
Thank you for your interest!

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> Hello Dmitry,
>>
>> Thanks for the response, i ended up downloading the VSIP pack, for
>> some reason i thought they charged for this api, but i guess now they
>> decided to open it up to the public. Anyway, i ended up doing exactly
>> what you send i'm subclassing the editor window, and i'm using the
>> IVsTextViewEvents OnChangeCaretLine to redraw the line marker. In
>> addition , i'm using GetScrollInfo + GetPointOfLineColumn combo from
>> IVsTextView to get the first column position. The line draws well and
>> its pretty much a working prototype, there are some refresh issues
>> when scrolling horizontally, and it overall needs some more
>> stablization. I'm thinking on releasing it like this and hopefully
>> some people would help me stablizing it. I heard on an earlier post
>> that you guys were considering having a user contributed plugin
>> architecture to RS, this i think would be a perfect candidate. Its
>> standing (although shaking pretty badly) on its own as a full addin
>> but if it was harnessed by resharper, that would stablize it
>> tremedously.
>>
>> In addition Dmitry is their a link to what you guys are implementing
>> (spec or feature list) for ASP.NET support? I wanted the ability to
>> outline corresponding end tags similiar to how matching brackets are
>> outlined in CS files. If this feature is not on your plate i wanted
>> to take a stab at it with this project. I'm not going to try to come
>> up with a language service or anything crazy like that, just some
>> balanced regular expressions or something to find the corresponding
>> end/begin tag and outline it.
>>
>> Second feature would be some way to auto format the html code.
>> Obliviously a harder task, but i started developing a small plugin
>> architecture where using this addin users can create their own
>> modules that the plugin will pass the html through. Anyway I want to
>> know what the asp.net support status is so i can make sure i align my
>> this project scope accordingly.
>>
>> BTW this project is going to be open-source, and completely free.
>> Using the VSIP pack, i have to double check the license agreement,
>> but i believe for shareware/free projects its ok. If there is is
>> anyone interested in helping out please let me know! :)
>>
>> Thanks again for your response.
>> -john
>>> Hello John,
>>>
>>> thank you for your feedback. We indeed considered implementing
>>> current
>>> line
>>> emphasizing but cut it
>>> because of necessity to fix higher priority issues.
>>> In order to draw on top of the editor window, you'll need to
>>> subclass
>>> the
>>> editor window (in Win32 sense).
>>> This trick is used by many VS extensions including ReSharper. You
>>> can
>>> get
>>> HWND of the editor window
>>> using the IVsTextView interface from the VSIP SDK. IVsTextView also
>>> contains
>>> functions for coordinate
>>> transformations you may want to use for finding the beginning of the
>>> current
>>> line. There is a documentation
>>> on this interface in VSIP docs:
>>> http://msdn.microsoft.com/vstudio/extend/ (look for VSIP SDK there).
>>> Regards,
>>> Dmitry Shaporenkov
>>> JetBrains, Inc
>>> http://www.jetbrains.com
>>> "Develop with pleasure!"
>>>> Hi guys,
>>>> Excellent product, love resharper, etc...
>>>> Back around a year ago i suggested a feature, a line marker
>>>> indicator
>>>> (a
>>>> faint colored background on the current line) similar to what
>>>> eclipse
>>>> (and
>>>> other editors) has by default. I recieved a email that its
>>>> something
>>>> that
>>>> has been considered but never got a high enough priority (i'm
>>>> assuming
>>>> by
>>>> the PMs). Anyway i created a small addin that i will release as
>>>> open
>>>> source
>>>> that has this feature plus some other niceities.
>>>> Just wondering if any dev over there can help me out w/ some
>>>> questions
>>>> on
>>>> drawing ontop of the editor window, since there is no documentation
>>>> on
>>>> this.
>>>> a quick one is how do you know where the beginning of the line
>>>> starts
>>>> in
>>>> the window, ie (where to clip the outline of the bracket
>>>> highlighting)
>>>> i
>>>> see it changes whether the indicator margin is shown or not. also
>>>> the
>>>> clipping
>>>> on the left changes depending on wether there is a vertical
>>>> scrollbar
>>>> or
>>>> not, are you just querying the setting on paint, and hardcoded the
>>>> pixel
>>>> values or is there some safer way?
>>>> Is there a way to reduce flashing during horizontal scrolling?
>>>> Anything would help i'm dying here :(
>>>> thanks for any of your help.
>>>> -john


0

Please sign in to leave a comment.