Navigation Menu

Skip to content

andyhebear/Continuum

 
 

Repository files navigation

Continuum README

0 Description

Continuum is a Cocoa IDE for Mono. Unlike most IDEs Continuum doesn’t actually build projects. It instead relies on tools like make or nant. Here is a screenshot and here is another. Here is a screenshot of the new debugger.

Continuum 0.8.0 includes the following features:

  • A debugger implemented using the Mono Soft Debugger.

  • Auto-completion for C# code.

  • Can generate make files for simple C/C++, C#, F#, and MonoMac projects. Can also build using existing make, nant, or waf files.

  • Customizable regex based syntax highlighting.

  • Support for showing build errors.

  • An sqlite database containing information about the types in each project’s assemblies and the assemblies they reference.

  • Context commands which operate on the selection using the database such as show short form or show derived classes.

  • Flexible regex based searching of single files or directories.

  • Customizable scripts to change selections.

  • Customizable scripts to refactor C# code.

  • Time Machine integration.

  • Basic integrated svn and git support.

  • Basic integrated file system support.

Continuum depends upon mobjc, mcocoa, and gear.

1 Setup

You don’t have to do any sort of installation to run Continuum, but there are a few things that you can do to make it operate better:

  • Continuum uses the Unix locate command quite a bit when searching for files. Unfortunately the locate command is disabled in Snow Leopard. To enable it you need to type the following into a terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist.

• There is a command line tool that can be used within a terminal to open files or directories using Continuum. To install the tool open Continuum and select the Install Command Line Tool item from the Continuum menu.

• It’s helpful to install the mono sources when using Continuum. This lets you open the source file associated with System or Mono types using a contextual menu. If you have one copy of the source code Continuum can figure out where it is using the locate command. But if you have multiple copies you may want to go to the Environment panel in Continuum’s preferences and double-check that it is set correctly.

• The mono installer no longer installs mdb files so if you want to step into System code while debugging you’ll need to build Mono yourself.

In order to do things like auto-complete Continuum has to parse the assemblies you build as well as all of the assemblies that they reference. This information is cached in sqlite databases stored in ~/Library/Caches/Continuum. These files can be quite large so you may want to delete them if you uninstall Continuum.

2 Operation

2.1 Directory Editor

Continuum uses a different model than most other IDEs: instead of project or solution files you open arbitrary directories and use make, nant, and waf files within the directory to build. By default, every file within the directory appears in the directory editor but you can use the preferences associated with that directory to specify globs for files to exclude, to color code files which are included, etc.

There is a contextual menu for files within the directory editor which allows you to do basic file manager and SCCS tasks. Command-shift-D can be used to duplicate a file and clicking on a file twice allows you to rename it. The file list is live so it will update as files are updated or removed from the file system.

2.2 Text Editor

The text editor is a more or less standard Cocoa editor but there are specialized contextual menus for types and methods allowing you to do things like search on apple or msdn, goto the definition, show the disassembly, show base or derived classes, and show the short form of a type.

If you right click on nothing then you can do things like hide the syntax coloring for spaces and tabs or open the last associated file within Time Machine. When you do this a new file will open with a title like App.cs (from 9 months 10 hours ago). If you right click on nothing in that file you can open even older versions of the file.

2.3 Searching

On occasion control or Unicode characters slip into source code files (e.g. when pasting in text from Wikipedia). These can cause hard to find compiler errors so the Search menu in Continuum has a Find Gremlins command. This will start at the insertion point and select the next control or non-7-bit ASCII character. If it finds such a character it will write something like 0x03B2 GREEK SMALL LETTER BETA to the Transcript window. (You can test this using the Special Characters comand in the Text menu).

Find and Find in Files optionally allow regular expressions to be used. These are the .NET .NET Framework Regular Expressions[regular expressions. Note that when replacing $1 is used to insert the first matched parenthesized expression instead of \1.

Find in Files allows you to control where the search happens. This is done by specifying a simple pattern with an ellipsis and an optional prefix or suffix. The search is done within the ellipsis text, but only if the text matches the prefix and suffix. So, //… will search within comments and @"…" will search within verbatim strings.

2.4 Auto-Complete

Auto-complete is currently initiated by typing a . or quickly pressing tab twice when the insertion point is just after an identifier. A period will complete namespaces or members. A double tab will complete constructors when used in a new expression or locals, arguments, and members otherwise. The auto-complete window has a context menu which allows you to filter out items using criteria such as whether it is an extension method or belongs to a class or interface.

The argument completion window which pops up after auto-completion may be dragged using the mouse and also has a context menu which allows you to close the window or select a different overload.

2.5 Special Keys

command-option-left arrow

cycles down the document window stack

command-option-right arrow

cycles up the document window stack

command-option-up arrow

cycles between C/C++/Obj-C headers and source

command-~

cycles between open windows

control-1

browse recent files

control-2

browse local files

control-3

opens the declarations popup menu

control-K

deletes the rest of the line

control-L

centers the current line in the window

shift-delete

deletes the current line (if there is no selection)

option-tab

selects the next identifier

option-shift-tab

selects the previous identifier

tab

indents lines (if one or more lines is selected)

shift-tab

unindents lines (if one or more lines is selected)

tab-tab

when done quickly auto-completes

3 Debugging

Continuum can be used to debug command-line Mono applications, Monomac applications, or mcocoa applications. For a command-line app the Debug menu item or an Apple Script can be used to directly debug the app. For a Cocoa app point the Debug menu item or Apple Script at the application bundle to be debugged.

The AppleScript command is named debug and has a direct parameter naming the exe or app bundle to open and the following optional parameters:

  • with lists command line arguments to pass to the assembly.

  • vars contains a space separated list of environment variables formatted as NAME=value.

  • wdir is the working directory.

  • break is a boolean parameter which defaults to false. If true a breakpoint is added to main.

  • using is the name of the Unix tool used to run the assembly. It defaults to "mono".

It is often convenient to use make files or build scripts to debug an assembly. With make you can do something like:

bin := $(abspath bin)	# use a full path to specify the assembly

debug-cli: cli
	osascript -e 'tell application "Continuum" to debug "$(bin)/cli.exe" with "--arg=value --arg2"'

debug-app: app
	osascript -e 'tell application "Continuum" to debug "$(bin)/MyApp.app"'

The debugger’s usage should be obvious but it does have one unusual feature: the ability to trace garbage collector roots. You can do this via the contextual menu in the Variables window and trace roots for either a type or a class instance. When the trace finishes a window will popup showing references from GC roots (e.g. locals and statics) to whatever you are tracing.

There are a number of attributes in the System.Diagnostics namespace that customize the behavior of the debugger. The most useful ones for Continuum are:

DebuggerBrowsableAttribute allows you to mark fields or properties which should not be displayed in the debugger. It also allows you to mark a field or property that should be used in place of the type it is within.

DebuggerTypeProxyAttribute allows you to name a proxy type which will be instantiated with the object the debugger is trying to display. The value of the proxy is then displayed instead of the original value. Mono for example uses System.Collections.Generic.CollectionDebuggerView as the proxy for generic collections which allows debuggers to display the collections as arrays.

DebuggerDisplayAttribute allows you to specify a string that is used when displaying an object’s value. The string may contain field, property, or nullary method names enclosed in curly braces (Count={Count}) that will be evaluated before displaying the string. Note that it’s usually easier to do this sort of thing with a ToString override.

4 Customization

4.1 Languages

Syntax highlighting and the method popup menu at the bottom of text editor windows is done with the aid of language files. These are xml files which use .NET regular expressions to define patterns for things like comments, keywords, strings, type definitions, and member definitions. You can add new languages by going to the Continuum preferences, navigating to the Language Globs panel, and pressing the Open Languages button.

After you do this a directory in the Finder will open up allowing you to add a new language to the user directory. The syntax for these files is defined by the standard/Language.schema file. After adding a new language edit the Globs file in the custom directory and restart Continuum.

4.2 Text Scripts

These are shell scripts which read from stdin and write to stdout. They are automatically added to the Text menu and the text editor contextual menu. When invoked they pass the current selection into the script via stdin and replace the selection with stdout. New scripts can be added by selecting the Open Scripts command from the Text menu and adding a new tool to the user directory.

4.3 Refactor Scripts

These scripts allow you to do more complex processing of C# source. They are written in a custom little language which allows you to easily access and change C# code. To add a new refactor select the Open Refactors menu item from the Refactor menu. standard/Refactor Language.rtf explains the language used to write the refactors.

5 Known Issues

  • Continuum started crashing when exiting within some unknown finalizer starting with mono 2.10. I’ve also seen the same thing with fsi so it may be a mono bug.

  • Auto-complete won’t complete subscripted expressions (name[0].) or bound generic types (List<string> foo; foo.First().).

  • Auto-complete will attempt to deduce the type of local variables declared as var but this only works when the expression is a new expression, an as cast, a function call like Get<T>(), or a linq query.

  • Cocoa doesn’t handle aliases very well so work needs to be done to support it ourselves.

  • Editing very large files is slower than it should be.

  • There is support for saving files using different encodings, but no support for specifying the encoding when loading (although utf8 and the various forms of utf16 should work fine).

About

Cocoa IDE for Mono

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.2%
  • Makefile 1.4%
  • Other 0.4%