fbpx

XIDE plugin?

More
8 months 3 weeks ago #1 by SHirsch
XIDE plugin? was created by SHirsch
Hi Chris,

is it possible to write PlugIns for XIDE? In VO I had an build counter that was incremented at every compile run. Also the export file name was changed with build number in file name. I would like to implement something similar to XIDE.

Regards,
Stefan

Please Log in or Create an account to join the conversation.

More
8 months 3 weeks ago #2 by wriedmann
Replied by wriedmann on topic XIDE plugin?
Hi Stefan,

I have written a plugin for XIDE, you can download the sources here:

https://www.riedmann.it/download/XIDE_WR_Plugin.zip

This plugin has some useful functions, but not what you need.

The currently implemented functions are:


Wolfgang
Attachments:

Please Log in or Create an account to join the conversation.

More
8 months 3 weeks ago - 8 months 3 weeks ago #3 by Chris
Replied by Chris on topic XIDE plugin?
Hi Stefan,

Please see Wolfgang's sample plugin to get you started with it. But in order to implement the features you want, I need to add support for them in the plugin system (fortunately it's easy).

So you need a callback that will be called in your plugin every time an app/library is compiled and another one when exporting. Do you mean when you export viaef/vipef files? Do you prefer to put a new command to do the export the way you like, or do you want to just intervene when exporting from the current procedure and modify the filename in the save dialog?

Chris

XSharp Development Team
chris(at)xsharp.eu
Last edit: 8 months 3 weeks ago by Chris.

Please Log in or Create an account to join the conversation.

More
8 months 3 weeks ago #4 by SHirsch
Replied by SHirsch on topic XIDE plugin?
Hi Chris,

that sounds good.
A callback before compiling and one before exporting as viaef/vipef. At export I would like to change filename before SaveDialog.

Regards,
Stefan

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #5 by SHirsch
Replied by SHirsch on topic XIDE plugin?
Hi Chris,

your methods are working, thanks.
After implementing my first ideas more ideas appear:
- I would like to zip the exported files. So a callback after export (also auto export) would be nice. Or maybe this could be implemented as option in Xide with file extension vipefx/viaefx.
- I would like to add menu items to context menu in project tree. I have not found any method how to do that although some methods names sound like it could be done. Maybe you can help out.
- I hacked a bit through the controls to get the currently selected app (Xide.PluginSystem.Application). From ProjectTreeView I get Xide.AppClass and then call Xide.PluginSystem.Application.__InternalCreate(app, TRUE) to create the Application object. It's working but looks not elegant. Maybe I missed something?

I will populate the plugin in chit-chat.

Regards,
Stefan

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #6 by wriedmann
Replied by wriedmann on topic XIDE plugin?
Hi Stefan,

the appetite comes while eating <g>.

The request to add an option to the context menu in the project browser is not new, but unfortunately it is not that easy because it depends on the context, or better, if you are on a project, a folder, an application or on a simple item.

And yes, Chris had forgotten to hide the XIDE internals from a plugin, so you can access also XIDEs internals from a plugin (fortunately this opens a lot of possibilities, and I needed some of them also in my own plugin).

I have a lot of other ideas for plugins, and what I will make when I have a bit of time: a sort of Export Explorer for viaef and vipef files.

Wolfgang

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #7 by Chris
Replied by Chris on topic XIDE plugin?

Stefan Hirsch wrote: your methods are working, thanks.
After implementing my first ideas more ideas appear:


Very glad it worked ok!

Stefan Hirsch wrote: - I would like to zip the exported files. So a callback after export (also auto export) would be nice. Or maybe this could be implemented as option in Xide with file extension vipefx/viaefx.


That's a bit more complicated. And it gets even more complicated, because there are more commands that have to do with app and project export files, like Project|Compare All Files which compares the contents of all your files with their version included in a previous .vipef or .viaef file. Probably it will be easier if I implement this myself, but this will require a hard dependancy on a zip library (btw, which one would you suggest to use?). Will also give it some thought on providing plugin interface for that, but I don't think I can do this quickly. I assume it's not highest priority for you either, am I right?

Stefan Hirsch wrote: - I would like to add menu items to context menu in project tree. I have not found any method how to do that although some methods names sound like it could be done. Maybe you can help out.


Ah, yeah, there's a callback method OnProjectContextMenuPopup(), and I see I have actually written code in the main IDE that calls it, but this code is commented out. Can't remember why, I think as Wolfgang said it was not ready. I will have a look again and will try to enable it soon. Just to get an idea, what kind of command do you want to put there?

Stefan Hirsch wrote: - I hacked a bit through the controls to get the currently selected app (Xide.PluginSystem.Application). From ProjectTreeView I get Xide.AppClass and then call Xide.PluginSystem.Application.__InternalCreate(app, TRUE) to create the Application object. It's working but looks not elegant. Maybe I missed something?


Amazing, I had a look at your code, that was quite some reverse engineering, you are using classes of the IDE that even I do not remember how they work! :)Regarding getting the active app, this is missing by mistake, there's already a GetActiveProject(), a GetActiveFilePad(), I will also add a GetActiveApp(), it is very easy to do, so you do not need to go through the internals to get it.

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago - 8 months 2 weeks ago #8 by Chris
Replied by Chris on topic XIDE plugin?
Hi Wolfgang,

Wolfgang Riedmann wrote: The request to add an option to the context menu in the project browser is not new, but unfortunately it is not that easy because it depends on the context, or better, if you are on a project, a folder, an application or on a simple item.


Yeah, I think it's you that had requested this first, so I had started working on it? I will look into it again. Like I asked Stefan, what kind of commands do you want to put there? Just to implement your needs first.

Wolfgang Riedmann wrote: And yes, Chris had forgotten to hide the XIDE internals from a plugin, so you can access also XIDEs internals from a plugin (fortunately this opens a lot of possibilities, and I needed some of them also in my own plugin).


I think this had started by accident, but then realized it's a good idea to give you full access to the IDE classes, so you can use stuff even if I haven't exposed them to the plugin system yet.

There's a "Ide" property of the PluginService class which gives you access to the main IDE object, and in addition almost no (or very little) code in XIDE is marked as internal/protected/private, so you can use practically everything. Of course this is not the suggested way, but then again I have no plans for a major refactoring of the code, so you're 99% safe using even the XIDE internals.

Wolfgang Riedmann wrote: I have a lot of other ideas for plugins, and what I will make when I have a bit of time: a sort of Export Explorer for viaef and vipef files.


Sounds very nice! Actually it's one of the things I have on my list, but if you do it yourself, it's a lot better for me :)

Chris

XSharp Development Team
chris(at)xsharp.eu
Last edit: 8 months 2 weeks ago by Chris.

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #9 by wriedmann
Replied by wriedmann on topic XIDE plugin?
Hi Chris,

currently my session preparation for Cologne has the highest priority... But after then I will look at it.

Wolfgang

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #10 by SHirsch
Replied by SHirsch on topic XIDE plugin?
Hi Chris,

the most import plugin function build count is now implemented. Everything else is nice to have.
As zip lib I use ZipStorer from 'Jaime Olivares' ( github.com/jaime-olivares/zipstorer ).

In context menu I would insert the same menu items as now in the Plugins menu. It would be easier to use because one does not have to control if one is in the correct app.

Some classes I walked over are internal so that I could not access them. Maybe you can change the protection level to pulbic. So that 100% of the classes are accessable due to your statement that you have no plans to refactor. Plugin developers would have even more possibilities and you do not have to write plugin classes or callbacks for every request.

Regards,
Stefan

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #11 by wriedmann
Replied by wriedmann on topic XIDE plugin?
Hi Stefan,

one of the mostly used zip libraries seems to be the DotNetZip from Ionic: https://archive.codeplex.com/?p=dotnetzip

Wolfgang

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago - 8 months 2 weeks ago #12 by Chris
Replied by Chris on topic XIDE plugin?
Hi Stefan,

Stefan Hirsch wrote: In context menu I would insert the same menu items as now in the Plugins menu. It would be easier to use because one does not have to control if one is in the correct app.


OK, I will do it the quick and easy way, will just give you a callback which will have info about the project node currently selected and the actual ContextMenu object the IDE has already created and is about to show, so you can add items to it directly. Later I will add another callback to do it the "proper" way, to provide the new items and the IDE decides how to add them to the menu.

Stefan Hirsch wrote: Some classes I walked over are internal so that I could not access them. Maybe you can change the protection level to pulbic. So that 100% of the classes are accessable due to your statement that you have no plans to refactor. Plugin developers would have even more possibilities and you do not have to write plugin classes or callbacks for every request.


You are right, I just checked and there are indeed some INTERNAL classes :)
Which ones do you need made public? The ones in the PluginSystem dll are internal on purpose, to make the public interface cleaner, no point calling directly anything that is marked as internal there.

btw, guys thanks for your Zip classes suggestions!

Chris

XSharp Development Team
chris(at)xsharp.eu
Last edit: 8 months 2 weeks ago by Chris.

Please Log in or Create an account to join the conversation.

More
8 months 2 days ago #13 by Chris
Replied by Chris on topic XIDE plugin?
Guys,

Just a quick note about this, unfortunately I did not get the time to update the XIDE plugin system for the 1.2.1 release, all our efforts were concentrated on VS for this build and XIDE has remained exactly the same.

In the next days/week though, I will make the changes we have discussed and will upload a newer XIDE version, too.

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
8 months 2 days ago #14 by wriedmann
Replied by wriedmann on topic XIDE plugin?
Hi Chris,

this is no problem at all - the most important thing is to have a demonstrable X# runtime for Cologne.

Unfortunately it seems we will miss you again this year!

Wolfgang

Please Log in or Create an account to join the conversation.

More
8 months 2 days ago #15 by Chris
Replied by Chris on topic XIDE plugin?
Hi Wolfgang,

Yeah, I am very sorry about that, I thought I could make it this year, but it's still very difficult for me. Global warming, pollution, humidity and all stuff we're having lately are no good for a heavily allergic person like me and I am not getting a break from all that. Hopefully next year, wish you all guys have a very productive and fun meeting again!

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
8 months 2 days ago #16 by wriedmann
Replied by wriedmann on topic XIDE plugin?
Hi Chris,

so hopefully we can meet next year!

I'm sure Nikos will tell you about the conference. For us partecipants one of the most important things is to talk to the development team and to exchange ideas.

Wolfgang

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #17 by Chris
Replied by Chris on topic XIDE plugin?
Hi Wolfgang,

Yeah, I agree, I've been to a lot of conferences during the vulcan era both as dev team member and also before that, it has always been great talking and exchanging ideas with so many people over the years!

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.