forked from CachesToCaches/emacs_cpp_completion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
51 lines (38 loc) · 1.56 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* ** main.cpp **
* Author: Gregory J. Stein
* Email: [email protected]
* License: None; feel free to use at will.
*/
#include <iostream.h>
#include "rect.hpp"
main()
{
// Hello!
std::cout << "Hello World!";
// Define some testing variables here
int foobar = 1;
double foobar_d = 0;
// Now that the above variables are defined, irony should be working. You can
// call 'M-x irony-completion-at-point-async' after typing the first few
// characters 'foo' here:
// foo
// Upon running this, a new buffer should open which shows both 'foobar' and
// 'foobar_d' as options. In addition, running the command 'company-irony'
// will rely on 'company' to show the completion in place (try it and
// see). This has the added advantage of showing the type of each of the
// variables, so that 'foobar' is recognized as being an int and 'foobar_d' as
// a double.
// DEGUG: if 'irony' does not work, the command 'M-x irony-install-server' may
// need to be run.
// Now we can define a class object from the imported 'rect' class.
rect square = rect();
// Not only will the object 'square' complete from 'squ', but once it's
// completed, running 'company-complete' after 'square.' (notice the period)
// will load the properties as well. Notice that some of the options are shown
// multiple times. This is because both 'irony' and 'gtags' are capable of
// finding the completions. However, 'irony' does not seem to scale to
// extremely large projects, so 'gtags' becomes necessary.
// squ
// square.
return 0;
}