Monodevelop code highlight and autocomplete

Hi there,

I have started to use Monodevelop instead of Unitron to test the new features. The problem is that syntax highlight and code autocompletation doesn’t work well. Here is an example of the problem with the hghlight:

if i write:

Input.GetAxis("Horizontal")

only “Input” and “Horizontal” are highlighted. Another example:
transfom.position.x
No word is highlighted.
With the autocompletation the problem is that it only has some words, for example it recognize “Transform” but not “transform”, and all the time it converts you writing making coding a pain.

Any clue how to solve this?

Thx!

Cesar

I’ve never had autocomplete issues like this with Visual Studio, maybe try that? (if you’re using C#, if you’re using UnityScript/Boo I don’t think it will won’t work.)

However, I do imagine that in either IDE “GetAxis” would not be highlighted. Typically members of objects (methods, fields, etc.) are not automatically highlighted. There may be options or plugins you can use to change that highlight, but I’m not sure.

Use UnityDevelop (available on these forums) for Unityscript; it has very nice autocomplete functionality.

Hello,

I hope that you don’t mind that I post my auto complete question here too :).

With following java script example the local variable weapon01 will not Intellisense:

function Update () {
    
    if (Input.GetButtonDown("Fire1"))
    {
        //create the prefab
        var weapon01 : GameObject = Instantiate(weapon01Prefab, transform.position, Quaternion.identity);
        
        
        //add force to the prefab
        weapon01.rigidbody.AddForce(transform.forward * 1000);
    }
    
}

I don’t have this behaivor with my C# scripts. It can really get annoying if my local variable starts with a word that makes part of a larger word in the auto completion list. For example:

hit will be automatically auto completed to WheelHit because I press space bar after typing hit! The escape from this is every time hit the escape button before pressing the space bar. In my opinion it should not auto complete if there is no exact match. Can this behaivor somewhere tweaked?

A solution to this problem is match appreciated. :sunglasses:

Peter.

Im using UnityScript and Mac, so VisualStudio is not an option to me (sadly)

When using Unitron all Unity classes are highlighted, Input.GetAxis as an example is fully highlighted. I well give a try to UnityDevelop to show it that helps.

Thanks all

It’s not a full solution, but this makes life A LOT better:

Go to Preferences → Text Editor → General → uncheck “Commit completion list selection with space or punctuation”

Now you will have to press enter to get auto complete… instead of having to press escape to not get it.

Awesome!!! - Thanks for that… it has made a big difference.

Sorry for reopen this thread but i have noticed that the new monodevelop version solves some problems. The “Transform/transform” problem is solved, but the syntax highlight problem is still there. Any clues to solve it? (Im using UnityScript and Mac)

I am having the same issue… using MonoDevelop 2.4.1 there is no Unity syntax highlighting.

Yes, I noticed this right away in the latest version of Unity, currently 3.1.

The funny thing is that MonoDevelop comes pre-installed along with Unity, yet… it doesn’t even pick up syntax/code highlighting, nor does it pick up auto-complete.

I smell “unfinished product” all over the place here. Anyways, I just went from UniScite, which is the default editor for Windows Unity, to trying to upgrade to MonoDevelop for more versatile programming IDE, to going back to UniScite.

Also, UniSciTE’s default coloring scheme for syntax highlighting needs a total re-do. What’s up with reserved keywords turning black to extremely dark blue? I have to literally put my face 1" from the monitor to see if the code highlighting even took place.

What’s really odd is this works on my machine (Mac Snow Leopard). I have 2.4 (not sure if it’s 2.4.1 it does not say that explicitly). I was able to simply post this into an existing code file, didn’t have to hit save or anything, and started type “we” and weapon01 was there to choose.

There seems to be an issue with the MonoDevelop version provided with Unity3D (could be Mac only, not sure).

When Unity opens the file in MonoDevelop no intellisense exists, pressing the period (.) results in only file local class members and standard system assembly types being listed. Unity-specific types don’t exist.

However, closing the file and reopening it via the project window will then initialize intellisense correctly and all then works. This is however a HUGE hassle.

I was looking through the MonoDevelop 2.4.1 changelog and there does appear to be a fix for opening files via the Finder on Mac, but since I haven’t upgraded MonoDevelop past that provided by Unity I can’t check whether this actually fixes that problem or not.

I seem to have found an old thread, but rather than starting a new one: this is still a problem in the currently bundled MonoDevelop 4.0.1. There’s a “Toggle Completion Suggestion Mode” option in the Edit menu that helps greatly, but is set to a bad default state (with no visual indication or checkmark) and doesn’t affect the period key, only the spacebar.

So for example, type this (with no leading zero)…

var x : float = .2

…and you get “byte” added automatically, generating an error:

var x : float = .byte2

(I’m developing for iOS on Mac, so Visual Studio isn’t an option.)