Read/Write API for Xojo IDE Code Editor to enable AI Integration

As AI-assisted development becomes increasingly prevalent in modern software engineering, it is essential for development environments to provide the necessary extensibility to support intelligent tooling.

This feature request proposes the introduction of a formal, documented API that allows external tools to interact with the Xojo IDE Code Editor. Specifically, the API should provide:

  • Read access to retrieve the current text contents of the Code Editor.
  • Write access to programmatically insert, update, or replace code.
  • Event hooks or notifications for cursor movement, text changes, or focus events to enable real-time interactions.

The primary goal is to enable seamless integration with external AI services and assistants (e.g., for code suggestions, refactoring, error detection, documentation generation, etc.). This would significantly enhance the Xojo development experience and align the IDE with current trends in smart programming environments.

By exposing such an API, Xojo would position itself as a forward-thinking platform, open to ecosystem expansion and future-oriented workflows.

Thank you for your consideration.

Feature Request: #79189

12 Likes

In my humble opinion, I don’t think the current level of AI capabilities warrant the investment or effort required to make this happen.

Though, with that said, I think it would be helpful for Xojo Inc. to publish (or make known to us) their strategy regarding an AI integrated IDE. It could be as simple as “we’re looking into it”, or “watch for it in the Roadmap”, or “Not going to happen”. If this already exists, maybe someone can provide a link?

Lastly, here’s a perspective on the current state of coding with AI.

4 Likes

if xojo would integrate ai then the ai must use exact the xojo version frame work. (and source code examples)

if you allow ai access to the source code we keep in mind the copyright or company rules.

what ai is good for is the code completion at ms vs c# ide to write faster.

… I’m going back to using my brain …

first choice :slight_smile: and make use of the online manual.

1 Like

Stupid question: what is the AI integration supposed to improve? It would save me a tiny bit of copy-and-paste. Instead it would give me a big headache of making sure that the AI only gets the bits it is supposed to get and nothing more.

2 Likes

Copilot (in vscode) is quite good at taking a description and making code from it. We use it for Go at work and its suggestions are very good. That said, you still do need to be able recognize errors because they do hallucinate sometimes and just make stuff up.

I think xojo’s biggest problem is that the language itself has evolved so much in recent years, making any existing code out there in GitHub or wherever potentially completely incorrect. The Recordset to RowSet change is a good example.

Even though ChatGPT 4o is very good at writing Xojo code, it still mixes API 1, API 1.5 and API 2 code, sometime with incorrect or hilarious result.

Current solutions already work very well in many areas and make it much easier to find errors and potential solutions. This area of ​​generative AI is developing rapidly, as it’s much easier to generate code than to communicate with people, and the industry’s desire for systems that can evolve themselves is huge.

I don’t think we should wait until code generation via LLM works perfectly. And the question of whether Xojo should offer something like that isn’t really relevant anymore. It’s more about how long we have to watch while the software development sector rapidly approaches a future in which we developers can focus on creating new solutions instead of excessively commenting on old algorithms for later revisions.

Nobody expects an LLM that can completely and autonomously develop an application from idea to production readiness in the next 3-5 years (although this is already conceivable today). However, LLM can help with the optimization and debugging of routines.

And I’m sick of hearing all this “but the LLM will steal my code” and “it makes mistakes too” We’re long past the point where an LLM needs to steal MY code (and even if it does…). And yes, it makes mistakes too… like me. But it probably learns much faster and never forgets. Besides, this thread isn’t about how good LLMs are today, but rather whether Xojo can afford to miss out on this development…

Apart from all that, an API would not force anyone to use an AI assistant and those who are unsure could use a local LLM.
Furthermore, such an API could also be used for other purposes such as snippet management or localized spelling and grammar checking, etc. …

6 Likes

It’s not just code. I’ve actually had Claude design a UI. If you paste in a sample xojo xml project with a window in it, you can ask it to generate a ui layout for x, y, z and then copy/paste the xml output into a new file. Sometimes it breaks the format though, and xojo won’t import it, then it’s a chore to figure out what’s missing. Having it integrated in script/IDE could have more granular, line-by-line integration rather than an all-or-nothing approach, so if it breaks you at least get some of it.

As a side note, Claude rolled out two new models yesterday that I haven’t tried with Xojo yet, but are currently at the top of the swebench leaderboards.

2 Likes

Your point about Claude mixing up the Xojo API versions is a good example of where clear documentation would help immensely. The Xojo documentation on this point, API versions, is confusing to anyone who wasn’t along for the ride of v1 to 1.5 to 1. If Xojo ensured all documentation was for the most recent version or at a minimum said which version it was applicable to these issues could be minimised. Adding local documentation as a resource for the LLM coding tool is helpful.

This week I wrote a custom control almost entirely using initially Cursor, then Claude Code with 3.7. The part I did was to add the class, name it, and set it to inherit from Canvas. After that it was pretty much all done by an LLM.

All told I spent a couple of hours to get to a working, admittedly proof of concept, control that solved my immediate problem, which was that I needed something like a listbox with variable height rows plus a few other things.

The areas where it ran into problems were highly consistent; where to get the graphics object for paint events, RecordSet vs RowSet (as previously mentioned), and casting numbers to strings (it kept trying to wrap a calculation in a .tostring. If I were doing it again, I’d take the error messages from when it did those and put them into the instructions file for the LLM. It would use that as a resource and not make the error again.

Leaving aside the vibe-coding hype, my view is that LLM tools work really well when you adopt the role of architect and treat it as a very fast junior developer. A junior developer that doesn’t get upset when you tell it 5 times in a row “still not working, here’s the error message”. It invariably cheerfully responds “oh yes, that’s because api xxx requires blah blah, I’ll fix that”. They also work superbly well at understanding a new code base. Even if you don’t want to use an LLM to write the code, ask it to understand and document a code-base. You’ll be shocked how good the readme.md is. Ask it to look for classes of errors and it will give you a clear list of whichever type of error you’re interested in.

If I can provide a non-Xojo example of something else I did this week. I asked Claude to make a typescript app and gave it a text file with the 10 questions. It gave me a usable app to gather the responses with a results dashboard behind a login. 15 minutes from start to finish! It then was deployed in another 5. Would that scale, no, but for the need it was perfect. I should say that when I “asked it”, I gave it a very clear two paragraph set of requirements. Those requirements were akin to what I would give to an enthusiastic but clueless junior dev - no room for misunderstanding.

If you’re dismissing LLM coding tools don’t. Spend a few hours and try to build something with one, you’ll probably be shocked how far it’s come so quickly. I’ll admit I’m a massive enthusiast. I’ve spent much of the last five years writing Python code around machine learning and AI. In the last six months I’ve incorporated LLM coding tools into my coding workflow and it’s been a remarkable improvement in both quality and speed to deliver. I’m worrying less about obscure syntax issues and spending more time on architecture.

3 Likes

Haven’t had much luck with xml, yet. Hopefully, this will improve.

But, what if I like my role as the person writing the code…

Nothing stopping you from doing that.

3 Likes

The API is just an option…

Oh, I know. For now that is.

But will it be? With all the hype and excitement surrounding AI (and lack of an “official” strategy from Xojo Inc.), I worry about losing the simple pleasure of writing code one keystroke at a time.

I also worry about other things.

If they did it anything like VSCode, it would be optional and you wouldn’t have to accept its suggestions.

2 Likes

I would point out that your API would also need to be able to show suggested code as well as read/write code and get selection updates.

Just FYI - you can already get the things that you asked for above using IDE scripting and by using the IDE Communicator with the v2 protocol.

Text gets/sets the contents of the current code editor. SelectionStart and SelectionLength tell you where the cursor is and if there’s a selection (they are also settable). Location lets you get/set the currently selected item in the navigator.

1 Like

This feature request proposes the introduction of a formal, documented API that allows external tools to interact with the Xojo IDE Code Editor.

Ideally this would not be a homegrown API: one already exists. Just make Xojo an MCP host.

This week I wrote a custom control almost entirely using initially Cursor, then Claude Code with 3.7. The part I did was to add the class, name it, and set it to inherit from Canvas. After that it was pretty much all done by an LLM.

Glad to hear about your experience! I’ve been hesitant to use LLMs with Xojo code because I’ve been unsure what happens if LLM suggestions lead to invalid xojo source files; I’m also skittish about modifying source files while the IDE has the project open.

Is your approach to ask Claude to work solely on new files that aren’t already in the project, and then you manually integrate them once you’re happy with the result?

1 Like

I would prefer a dedicated interface rather than one that limits us to a protocol for specific services.

I’ve already done some testing with Copilot on GitHub. Apart from a few syntax errors, the results were very impressive (and helpful).

yeah, MCP server is the way to go. A good first starting point would be an MCP server for the documentation. Similar to what Cloudflare has done - all their docs are available via MCP. GitHub - cloudflare/mcp-server-cloudflare

My app is a proof of concept so I was less worried about what happens if things go wrong. I’m trying to establish whether Xojo can build what I want without too many workarounds. Mostly…

I assumed that Claude doesn’t know all the gory details of Xojo text format project structure, so I created that in the IDE. However, once that’s in place most of the format looks pretty straightforward and Claude seemed to pick up on it easily. So I added the class in the IDE then worked with Claude to build the control. If I had a production app, I’d certainly build the control outside that, test thoroughly, then integrate it.

Claude’s errors were pretty consistent, so if I were doing a lot of coding this way I’d take the common error patterns and solutions then put them into an instruction file for Claude to use as a resource. I’m pretty sure that would reduce the errors dramatically.

1 Like

Short: in my experience with Xcode (and Xojo) this claim is about as wrong as it can be.
AI is nowadays hugely capable and use it daily with great succes.

6 Likes

I’m having the same experience, and it’s getting better every day. Today’s tests, for example, are much better than they were a month ago. It’s easy to imagine that in a few months we’ll see very impressive results in many languages…