timknapen/Arduino-With-XCode — Issue #3: Codesense not working XCode 3.2
Author: timknapen
Created: 2011-11-28 14:40:45+00:00
State: open

The Auto Suggestion feature of XCode3.2 doesn't work "sometimes"...
If you add a class to ProjectFolder/src/ the auto completion works, but the exact same code for one of the standard library classes in Arduino.app doesn't trigger the auto completion correctly.

example:

ArduinoProgram.h
''''
#ifndef ARDUINO_PROGRAM_H
#define ARDUINO_PROGRAM_H

#include "WProgram.h"
#include "Stepper.h"	// in Arduino.app
#include "TestThing.h" // in Projectfolder/src/

class ArduinoProgram {
public:

void setup();
void loop();

// variables
TestThing thing1;
TestThing* thingPointer1;

Stepper stepper1;
Stepper* stepperPointer1;

};

#endif
''''

ArduinoProgram.cpp
''''
#include "ArduinoProgram.h"

void ArduinoProgram::setup(){

// These work
thing1.doSomething(0);	// CodeSense suggested void doSomething(int variable)

thingPointer1->doSomething(0); // CodeSense suggested void doSomething(int variable)

TestThing thing2;
thing2.doSomething(0);	// CodeSense suggested void doSomething(int variable)

TestThing* thingPointer2;
thingPointer2->doSomething(0);	// CodeSense suggested void doSomething(int variable)

// These fail:
stepper1.step(0);	// CodeSense says "No completions found"

stepperPointer1->step(0);	// CodeSense says "No completions found"

// These Work:
Stepper stepper2;
stepper2.step(0);	//CodeSense suggested void step(int number_of_steps)

Stepper * stepperPointer2;
stepperPointer2->step(0);	//CodeSense suggested void step(int number_of_steps)

}

void ArduinoProgram::loop(){
//
}
''''

TestThing.h
''''
#ifndef TEST_THING
#define TEST_THING

#include "WProgram.h"

class TestThing{
public:
void doSomething(int variable);

};

#endif
''''

TestThing.cpp:
''''

#include "TestThing.h"

void TestThing::doSomething(int variable){
// do something
}
''''