-
Notifications
You must be signed in to change notification settings - Fork 15
Code Engine
The Code Engine is a background service that keeps track of code information. It contains a basic null char terminated text tcp endpoint that external clients can connect to. The key path passed to it at startup decides what directories it handles. It uses a file system watcher to keep track of changes of files and directories inside the key path. For each changed file it will ask each supported language plugin to provide all projects, files, type signatures and signature references if it supports the file extension. The Code Engine contains facilities for doing various searches and navigation.
OpenIDE.CodeEngine.exe key_path default_language list_of_languages
1 Key path
Key path for the Code Engine.
Language to use as the default language plugin. Use the plugin name or an empty string.
A comma list of language plugins to use
When the code engine starts up it will fire up the tcp server to handle incoming messages from external clients. It will also do the initial queries to all language plugins fetching information like what file types are supported by the language plugin and ask them to do a full crawl locating all known projects, files, signatures and signature references for their language.
Every running code engine will write a connection file to $TempDir/OpenIDE.CodeEngine/[pid].pid where [pid] is the applications process id. The first line of the file is the engines key path while the second line contains the port used by the code engine.
After locating and connecting to code engine you can start sending commands to and query it. All commands are also available through oi.
Open the type search window
Open the file explorer window
get-projects [query]
Retrieves projects based on the filter passed to it. To limit the result you can pass a query with it. The query format is file=MyProj*. Supported properties: file. As this is a query you will have to submit a correlation id with it so that you can identify the reply. The command format is "correlationID=MyCorrelationID|get-projects file=/path/to/MyFile.cs". The reply format is "correlationID=MyCorrelationID|Followed by a string containing one line pr project".
get-files [query]
Retrieves files based on the filter passed to it. To limit the result you can pass a query with it. The query format is file=*.cs. Supported properties: project,file. As this is a query you will have to submit a correlation id with it so that you can identify the reply. The command format is "correlationID=MyCorrelationID|get-files file=/path/to/MyFile.cs". The reply format is "correlationID=MyCorrelationID|Followed by a string containing one line pr file".
get-signatures [query]
Retrieves signatures based on the filter passed to it. To limit the result you can pass a query with it. The query format is type=class,name=MyCls*. Supported properties: type, file, signature, name. As this is a query you will have to submit a correlation id with it so that you can identify the reply. The command format is "correlationID=MyCorrelationID|get-signatures type=class". The reply format is "correlationID=MyCorrelationID|Followed by a string containing one line pr formatted signature".
get-signature-refs [query]
Retrieves signature references based on the filter passed to it. To limit the result you can pass a query with it. The query format is file=.cs,signature=My.Signature. Supported properties: file,signature. As this is a query you will have to submit a correlation id with it so that you can identify the reply. The command format is "correlationID=MyCorrelationID|get-signature-refs signature=My.Sign". The reply format is "correlationID=MyCorrelationID|Followed by a string containing one line pr formatted signature reference".
goto-definition FILE|LINE|COLUMN
Navigates to the definition of the type at a specific position. If the language plugin handling the file (detected by the file extension of file passed to it) can locate the defined type under the cursor it will navigate to where the definition is.
member-lookup FILE|LINE|COLUMN
Lists the members from the type definition at a specific position. The member look up form has a list of members that can be used for auto completion (intellisense).