-
Notifications
You must be signed in to change notification settings - Fork 15
GetStarted
For a full list of available commands in OpenIDE run oi help. For more information about a specific command run oi help COMMAND_NAME.
There are a few concepts that are important to OpenIDE. The first concepts we will look into is configuration. There is a global configuration point and a local configuration point. The global config point is located where you placed the binary files. If you run the command oi conf read cfgpoint -g. This command will output the global configuration point. This configuration point will contain configuration, scripts and plugins that are global to the machine you are on.
Your local configuration points are defined by you. You initialize local configuration points much like you do with the git init command. If you go to the root folder of your workspace / solution and type oi init it will create a .OpenIDE folder in this position. After you do this you can run oi conf read cfgpoint in this folder or any sub folder to print the path to the local config point. Not surprisingly this config point contains configuration and scripts local to this workspace / solution.
Now that you have a local configuration point we can look into the OpenIDE environment. The environment consists of a few processes running in the background taking care of communicating with active plugins, a running editor and any other extension. While within your local configuration point you can start the environment by running the oi environment start command. Now if you run the oi environment command it will list running environments.
Lets have a look at some of what is going on inside here. First of all you can see some information about a running environment by running the oi environment details KEY where KEY is the path listed by the environment command. From the output you can see that it has a endpoint running but no editor meaning it's a headless environment. Ok, let's see what's going on inside. Run the oi event-listener command. After it has connected to the running environment try to create or modify a file. As you can see file system events are passing through the system.
To shut down a running environment use the oi shutdown command. This will shut down the running environment for the current configuration point. If you give shutdown the optional KEY argument it will shut down the specified environment.
If you have gone through the necessary steps to set up a supported editor getting started should be as easy as oi editor EDITOR_NAME. This will start the environment and hook it into the editor. If you have a favorite editor it is probably easier not having to specify the EDITOR_NAME parameter. To set this up run oi conf default.editor=EDITOR_NAME -g. The -g part of the statement writes the setting to the global configuration. Again if you run the oi event-listener command you will see that buffer changed events are being published from the text editor. From the terminal we can now run commands like oi editor goto "/path/to/file|LINE|COLUMN" to open a file in the editor.
OpenIDE ships with basic package management. Out of the box it comes with a small package source from https://github.com/continuoustests/OpenIDE.packages. To list added package sources run the oi package src. To see what packages are available in the package source run oi package src list. You will see that for instance the C# language plugin with AutoTest.Net is available in the repository. To install it use it's package id with oi package install C-Sharp-AT. Installed packages can be listed through oi package.
In the previous paragraph we looked at installing the C# language plugin package. The language plugins will crawl files when changed and provides the environment with type info we can use to for instance provide type search. To start using a language plugin you will have to enable it. When initializing a configuration point you can specify one or more languages to enable like oi init C#. This will enable the language plugin and set it as the default language. If in an already initialized configuration point you can run oi conf enabled.languages+=C# and oi conf default.language=C#.
For type search use the configured editor key bindings to launch the type search window. It can also be launched from he console by using the oi codemodel gototype command. Most languages will ship with bundled commands to facilitate basic tasks. For instance the C# plugin has commands for creating project files, adding files and referencing projects and assemblies.
This is the absolute basics of OpenIDE. To start getting value out of it move on to the script and reactive script part. That's where it's starting to get real fun.