Git Product home page Git Product logo

xsedit's Introduction

README

XsEdit An advanced XojoScript editor for Xojo®.

General Information

The Xojo IDE has a built-in script editor, but it's missing some handy features like auto-complete or even line numbers. XsEdit fills that gap with a full-featured editor that still runs the scripts through the IDE.

Benefits

Some of the benefits of XsEdit over the native XojoScript editor:

  • Line numbers.
  • Compiler error messages and highlighting.
  • Auto-complete.
  • Find and replace dialog.
  • Comment and Uncomment sections of code.
  • Include external files to emulate context.

How To Use It

Download and build the project. Start up the XsEdit app and either create a new script or open an existing one. Use the Compile and Run In IDE buttons to compile or run.

About Test Run

The Test Run button will force your script to run directly in XsEdit. This is good for testing small scripts but any IDE scripting methods or functions like Location will not actually do anything.

One benefit of Test Run is the ability to ignore the remaining Print and Input events in a script. Although there is no way to cancel the running script, you can fake it this way.

About Auto-complete

Auto-complete works, but it is not scope or context aware. It merely auto-completes any known keyword or any variable, module, class, interface, etc., that you've defined earlier in the script whether you can access to it at that point or not, and whether it makes sense the way you are using it or not.

About Includes

You can write, compile, and run an IDE script without doing anything special, but you might want to edit a script that's meant to run in your app that might have a context assigned. To address this, XsEdit will allow you to include one or more external files by starting a line like this:

'#include /path/to/file.xojo_script

or this:

//#include file.xojo_script

(You may also use either an absolute path, or relative path to your current script.)

Or you can use the menu option to select the file as a convenience.

At compile time, XsEdit will substitute the contents of the included file at the point of the include directive. Within the included file, you can recreate the functions, methods, and properties of your context. (They don't actually have to do anything, just keep the compiler from complaining.)

Who Did This?

This project was designed and implemented by:

  • Kem Tekinay (ktekinay at mactechnologies.com)
  • Jeremy Cowgar (jeremy at cowgar.com)

With special thanks to Thomas Tempelmann and his CustomEditfield.

FAQ

How much does this cost?

One-TRILLION dollars!! Or nothing, your choice.

You may freely use this in any project, but don't come back to us if it erases your hard drive or paints your house yellow or something. See the included LICENSE.txt file for details.

How do I contribute?

Fork the project to your GitHub account. Use the "develop" branch for general fixes. Make your changes, then submit a pull request. We'll look it over and merge what's appropriate or provide feedback.

Release Notes

1.0 (July 7, 2015)

  • Initial release.

1.1 (July 9, 2015)

  • Emulated methods, functions, and properties will show a message if used in a script that's run within XsEdit.
  • Fixed bug in CustomEditField that munged the test when pasting multiple lines at once.
  • Added additional keywords.
  • Files will be saved with the EOL for the given platform.
  • Comment/Uncomment has been combined and improved.

1.2 (August 24, 2015)

  • When window position is restored, the Toolbar visibility will be considered.
  • Window staggering code fixed.
  • Commenting will start at the first non-whitespace character.
  • Fixed bug where line-continuation character within a comment was treated as a true line-continuation character.
  • In Test Run, ability to ignore the remaining Print and Input events in the script (a sort-of cancel function).
  • Copying code will copy with indents.
  • Option to save a script with indents.
  • Added keyboard shortcuts to menus for Windows and Linux.
  • CurrentBuildTarget returns an integer instead of a string.

1.2.1 (September 21, 2015)

  • Fixed typo (SubLocations, not SubLocation).

1.2.2 (November 30, 2015)

  • Fixed WindowTitle so it returns a String.

1.3 (___, 2016)

  • Fixed access to Resources folder on Windows.
  • Added new constants, functions, and methods.
  • Added functionality to some functions when a script is run within XsEdit.

xsedit's People

Contributors

jcowgar avatar ktekinay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

whidbey npalardy

xsedit's Issues

Create context that emulates the Xojo IDE

When testing an IDE script, it should be able to respond to, and track, calls to ConstantValue, PropertyValue, Text, etc.

The results of these calls should show up in a Results window or area.

Emulated functions should show warning

XsEdit emulates IDE scripting functions to allow compilation, but if someone tries to use those functions within XsEdit, the user won't know that nothing happened. Instead, a once-per-session warning should come up telling the user that the function will not work as written.

Won't compile in 64-bit

I'm guessing this is a known issue but I've just tried to compile this as 64-bit on a Mac (OS 10.13.3) running Xojo 2017 R3 and I get the following errors:

Linking Executable
Undefined symbols for architecture x86_64:  "_SetDragImageWithCGImage", referenced from:_DragImage.$SetImage%%o<DragItem>o<Picture> in DragImage.o
ld: symbol(s) not found for architecture x86_64
Linking Executable
Undefined symbols for architecture x86_64:  "_SetDragImageWithCGImage", referenced from:"_QDBeginCGContext", referenced from:
ld: symbol(s) not found for architecture x86_64
Linking Executable
Undefined symbols for architecture x86_64:  "_SetDragImageWithCGImage", referenced from:_DragImage.NewCGImage%p%o<Picture> in DragImage.o
ld: symbol(s) not found for architecture x86_64
Linking Executable
Undefined symbols for architecture x86_64:  "_SetDragImageWithCGImage", referenced from:"_QDEndCGContext", referenced from:
ld: symbol(s) not found for architecture x86_64
Linking Executable
Undefined symbols for architecture x86_64:  "_SetDragImageWithCGImage", referenced from:_DragImage.NewCGImage%p%o<Picture> in DragImage.o
ld: symbol(s) not found for architecture x86_64

Add #include param

Something like

//#xsedit_include /native/path

That will insert the code from that file into the script at that point for the purposes of compiling. Basically, it would be a context stand-in.

Also provide a menu item to do the insertion with a file path.

cmd-arrow to jump to start/end of line

Would it be possible to add the macOS keyboard shortcut of cmd plus either the left or right arrow key to jump to the beginning or end of the current line? option-left/right works to jump back/forwards a word so I was wondering if it was possible to add this other system-standard key combination?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.