<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Assistants &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/code-assistants/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 11 Feb 2025 20:12:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Testing and Debugging Code Assistants</title>
		<link>https://blog.xojo.com/2025/02/12/testing-and-debugging-code-assistants/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Wed, 12 Feb 2025 16:00:00 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Code Assistants]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<category><![CDATA[XojoScript]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=14458</guid>

					<description><![CDATA[As Senior Engineer Paul Lefebvre wrote back in 2022, Xojo added the ability to create Code Assistants starting with Xojo 2022r1. Code Assistants are functions&#8230;]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large is-resized"><img fetchpriority="high" decoding="async" width="984" height="1024" src="https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-984x1024.png" alt="" class="wp-image-14459" style="width:318px;height:auto" srcset="https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-984x1024.png 984w, https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-288x300.png 288w, https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-768x799.png 768w, https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x.png 1026w" sizes="(max-width: 984px) 100vw, 984px" /></figure>



<p>As Senior Engineer Paul Lefebvre <a href="https://blog.xojo.com/2022/04/05/using-the-new-user-code-assistants-feature/" target="_blank" rel="noreferrer noopener">wrote</a> back in 2022, Xojo added the ability to create Code Assistants starting with Xojo 2022r1. Code Assistants are functions that manipulate the code selected in the Code Editor to help with various code editing tasks. Code Assistants are written in <a href="https://documentation.xojo.com/api/language/xojoscript.html" target="_blank" rel="noreferrer noopener">XojoScript</a>, but XojoScript has no access to the Xojo Debugger. Fortunately, there&#8217;s a simple solution to this problem.</p>



<p>Xojo&#8217;s Code Assistant Tester example project makes it easy to test and debug your code before you create your Code Assistant. Go to File &gt; New Project, click on Examples then open the IDE folder to find it. With this example, you can enter the code that would go into your eventual XojoScript that will be your Code Assistant. Because this code is in methods in Xojo itself, you can test it and debug it with the Xojo Debugger.</p>



<p>Here&#8217;s a quick video on how to use Code Assistants and the Code Assistant Tester:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Introducing Xojo&#039;s New Code Assistants" width="500" height="281" src="https://www.youtube.com/embed/GDWQC1c6svQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>If you write some handy Code Assistants, consider sharing them on the <a href="https://forum.xojo.com">Xojo Forum</a> they could be useful to others in the community.</p>



<p><em>Geoff Perlman is the Founder and CEO of Xojo. When he’s not leading the Xojo team he can be found playing drums in Austin, Texas and spending time with his family.</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>2022: Welcome Back!?</title>
		<link>https://blog.xojo.com/2022/12/13/2022-welcome-back/</link>
		
		<dc:creator><![CDATA[Alyssa Foley]]></dc:creator>
		<pubDate>Tue, 13 Dec 2022 11:00:00 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[XDC]]></category>
		<category><![CDATA[Xojo Cloud]]></category>
		<category><![CDATA[Code Assistants]]></category>
		<category><![CDATA[Code Editor]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<category><![CDATA[Xojo Framework]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=10967</guid>

					<description><![CDATA[Does anyone else feel like 2022 is the first year in many years where we have gotten back together, in-person, for big events, small get-togethers, travel and even the daily office grind? Whether that is the right thing to have done or not, it seems that is what many of us did in 2022. Though we all tried new things to stay connected over the past few years (Zoom-fatigue anyone?), there's nothing like seeing an old friend after years apart.]]></description>
										<content:encoded><![CDATA[
<p>Does anyone else feel like 2022 is the first year in many years where we have gotten back together, in-person, for big events, small get-togethers, travel and even the daily office grind? Whether that is the right thing to have done or not, it seems that is what many of us did in 2022. Though we all tried new things to stay connected over the past few years (Zoom-fatigue anyone?), there&#8217;s nothing like seeing an old friend after years apart.</p>



<p>Xojo&#8217;s team was all vaxxed-up and so happy to get together in Nashville for #XDC2022. Tennessee&#8217;s Music City was a delightful backdrop for the first in-person Xojo event since 2019. Check out the short highlights <a href="https://youtu.be/t8xpWVL5pEM">video</a> from Nashville and then join us for #XDC2023 in London, UK. You can <a href="http://xojo.com/xdc/london/index.html">register</a> here.</p>



<p>This year the Xojo team and community welcomed a new Xojo engineer, Ricardo Cruz. Ricardo has applied his expertise to advance and improve Xojo Web. To quote one of Xojo&#8217;s engineers, &#8220;Ricardo coming in has been awesome,&#8221; a sentiment echoed on the Forum and the community in Nashville. </p>



<p>Xojo Web has come so far this year. Control reliability has improved, IDE previews have improved and reconnections have really improved. The web framework can now more often reconnect back to the same web session if it still exists. This is one of the things Ricardo is really happy about, &#8220;You can switch to your email app in your mobile, copy something to the clipboard, come back to the web app and it is still there, ready to continue.&#8221; Under the hood, some dependencies received updates, like jQuery. As a user, you don&#8217;t have to do anything, just use the new Xojo version! Try to tell that to another web developer, that&#8217;s sci-fi outside of Xojo. Also, thanks to the community, the memory and CPU usage continues to be improved release after release. &#8220;Honestly from my perspective it is just fun to play with little projects in it because it has really matured,&#8221; says Xojo&#8217;s Director of Engineering, Travis Hill. </p>



<p>Speaking of technical achievements, this year we added two new targets to Xojo: Windows on ARM 64 and Linux on ARM 64. On Windows, you can natively deploy to ARM-based tablets and laptops that run Windows. On Linux, you can deploy to 64-bit Raspberry Pi which can address significantly more RAM than 32-bit versions. </p>



<p>We built the <a href="https://www.xojo.com/cloud/">Xojo Cloud</a> Control Panel with an updated version of Xojo, and thanks to some Web framework improvements the controls now stay more responsive under load. Plus we&#8217;ve added Xojo Cloud servers in Sydney, Australia for web developers in Australia and New Zealand. We also continued improving and testing our upcoming support for Android, which is now feature complete and awaiting some remaining bug fixes before we make it available to everyone.</p>



<p>In addition, we want to brag about a few technical improvements, including the numerous <a href="https://blog.xojo.com/tag/pdf/">PDF updates</a> implemented by Xojo Engineer and now PDF expert, Javier Menéndez. Also there is the option to generate&nbsp;Program Database <a href="https://blog.xojo.com/2022/07/25/what-the-pdb-is-this/">(PDB)</a>&nbsp;files on Windows and improved <a href="https://blog.xojo.com/2022/10/12/improving-multi-monitor-support-on-windows/">multi-monitor support</a> shepherded by Xojo Engineer William Yu. The list goes on: <a href="https://blog.xojo.com/2022/04/05/using-the-new-user-code-assistants-feature/">Code Assistants</a>, <a href="https://blog.xojo.com/2022/04/05/on-device-ios-debugging-in-xojo/">on-device debugging in iOS</a>, new <a href="https://documentation.xojo.com/">Xojo Documentation</a> site, adding <a href="https://blog.xojo.com/2022/01/07/desktop-adding-controls-at-runtime/">Controls at runtime</a>, loading speed faster for big projects, and the time team-Lefebvre built a <a href="https://blog.xojo.com/2022/03/03/a-web-app-to-calculate-combat-rolls-in-twilight-imperium/">web app</a> to Calculate Combat Rolls in Twilight Imperium&#8230;</p>



<p>Inside Xojo we improved a lot too. Besides welcoming Ricardo and his beard to the team, we migrated Xojo&#8217;s bug and feature reporting platform from the internally managed Feedback tool to the much loved <a href="https://tracker.xojo.com">Issues</a>. This has increased productivity, streamlined work flow, made it easier to search and find, comment, edit. The team couldn&#8217;t be happier!</p>



<p>This year also included Xojo&#8217;s first Bug Bash in a long time! During the Bug Bash, Xojo&#8217;s <a href="https://blog.xojo.com/2022/10/12/bountiful-bug-bashing/">Code Editor</a> got some much needed improvements resulting in noticeably faster updates. Plus updates to the Syntax Help Area thanks to Xojo Engineer and retro-computing expert, Paul Lefebvre. Besides the very real smashing of 100 bugs, the bash had the unintended consequence of giving the engineers an opportunity to work on things they don&#8217;t normally work on, giving engineers opportunities to collaborate and better solve things.</p>



<p>All in all, 2022 was a year of forward movement for Xojo. Which has us leaning into 2023 with a lot of excitement and expectation. Our team is committed to continuing to make Xojo the best cross-platform development tool and we thank you for being part of Xojo&#8217;s continued success!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using the New User Code Assistants Feature</title>
		<link>https://blog.xojo.com/2022/04/05/using-the-new-user-code-assistants-feature/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 05 Apr 2022 13:30:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Code Assistants]]></category>
		<category><![CDATA[Code Editor]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<category><![CDATA[XojoScript]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=10131</guid>

					<description><![CDATA[With Xojo 2022 Release 1, you can use XojoScript to create Code Assistants for use with selected text in the Code Editor. Here’s a quick example of one that swaps the prefix of a comment:]]></description>
										<content:encoded><![CDATA[
<p>With Xojo 2022 Release 1, you can use <a href="https://documentation.xojo.com/api/code_execution/xojoscript.html">XojoScript</a> to create <a href="https://documentation.xojo.com/getting_started/using_the_ide/code_editor.html#getting-started-using-the-ide-code-editor-code-assistants">Code Assistants</a> for use with selected text in the <a href="https://documentation.xojo.com/getting_started/using_the_ide/code_editor.html#">Code Editor</a>. Here’s a quick example of one that swaps the prefix of a comment:</p>



<pre class="wp-block-preformatted">// This script takes the current selected comment
// and changes the comment prefix.

Function Name() As String
  Return "Swap Comment Prefix"
End Function

Function CanEdit(selection As String) As Boolean
  // Check if comments starts with // or '.
  Return Left(selection, 2) = "//" Or Left(selection, 1) = "'"
End Function

Function Edit(selection As String) As String
  // Swap // with ' or swap ' with //
  If Left(selection, 1) = "'" Then
    Return Replace(selection, "'", "//")
  ElseIf Left(selection, 2) = "//" Then
    Return Replace(selection, "//", "'")
  End If
End Function</pre>



<p>This is not too lengthy, so let’s examine the parts. With a code assistant, there are three methods that are required: Name, CanEdit and Edit.</p>



<p>The <strong>Name()</strong> method returns a string containing the name that will appear in the Code Assistants menu. You can nest items using slashes, so “Paul/Swap Comments Prefix” would have this appear in Code Assistants-&gt;Paul-&gt;Swap Comments Prefix.</p>



<p>The <strong>CanEdit() </strong>method provides the code editor selection as a parameter. In this method you should return True if this code assistant is allowed to edit the selection. If you return True, the name will appear in the Code Assistants menu. If you return False it will not appear in the menu.</p>



<p>The code above checks if the selected text starts with the comment prefixes we want to swap: // or ‘.</p>



<p>The <strong>Edit()</strong> method is where you modify the selection, returning new text that will replace the selection in the Code Editor. This method does a single replace of “//“ with “’” and “’” with “//“.</p>



<p>Save the above script as SwapCommentPrefix.xojo_code_assistant and copy it to the Scripts folder in your IDE install folder.</p>



<p>If Xojo was running, you can tell it to reload those scripts by holding down Cmd (on Mac) or Control (Windows/Linux) when right-clicking.</p>



<p>Now type a comment like this:</p>



<pre class="wp-block-preformatted">‘ This is a comment.</pre>



<p>Select that comment and right-click. Choose Code Assistants-&gt;Swap Comment Prefix.</p>



<p>The line now shows as:</p>



<pre class="wp-block-preformatted">// This is a comment.</pre>



<p>For other sample Code Assistant scripts, go to Examples/Advanced/IDE Scripts/Code Assistants in the Xojo <a href="https://www.xojo.com/download/">download</a> folder.</p>



<p>Learn more in this <a href="https://youtu.be/GDWQC1c6svQ">video</a>! Be sure to share your Code Assistant scripts in the <a href="https://forum.xojo.com">forum</a>!</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
