ECLIPSE THEIA - CORE EXTENSION
Description
The @theia/core
extension is the main extension for all Theia-based applications, and provides the main framework for all dependent extensions.
The extension provides the base APIs for all Theia-based applications, including:
- Application APIs
- Shell APIs
- Base Widgets
- Contribution Points (ex: commands, menu items, keybindings)
Theia Extension
A Theia extension is a node package declaring theiaExtensions
property in package.json
:
{
"theiaExtensions": [{
"frontend": "lib/myExtension/browser/myextension-frontend-module",
"backend": "lib/myExtension/node/myextension-backend-module",
}, {
"frontend": "lib/myExtension2/browser/myextension2-browser-module",
"frontendElectron": "lib/myExtension2/electron-browser/myextension2-electron-browser-module",
"backend": "lib/myExtension2/node/myextension2-node-module",
"backendElectron": "lib/myExtension2/electron-main/myextension2-electron-main-module"
}]
}
Each extension can consist of the following modules:
frontend
is used in the browser env and as well in the electron if frontendElectron
is not provided
frontendElectron
is used in the electron env
backend
is used in the node env and as well in the electron env if backendElectron
is not provided
backendElectron
is used in the electron env
An extension module should have a default export of ContainerModule | Promise<ContainerModule>
type.
Theia Application
A Theia application is a node package listing Theia extensions as dependencies and managed with Theia CLI.
Re-Exports Mechanism
In order to make application builds more stable @theia/core
re-exports some common dependencies for Theia extensions to re-use. This is especially useful when having to re-use the same dependencies as @theia/core
does: Since those dependencies will be pulled by Theia, instead of trying to match the same version in your own packages, you can use re-exports to consume it from the framework directly.
Usage Example
Let's take inversify as an example since you will most likely use this package, you can import it by prefixing with @theia/core/shared/
:
import { injectable } from '@theia/core/shared/inversify';
@injectable()
export class SomeClass {
}
Re-Exports
@theia/core/electron-shared/...
@theia/core/shared/...
Logging Configuration
It's possible to change the log level for the entire Theia application by
passing it the --log-level={fatal,error,warn,info,debug,trace}
option. For
more fine-grained adjustment, it's also possible to set the log level per
logger (i.e. per topic). The root
logger is a special catch-all logger
through which go all messages not sent through a particular logger. To change
the log level of particular loggers, create a config file such as
{
"defaultLevel": "info",
"levels": {
"terminal": "debug",
"task": "error"
}
}
where levels
contains the logger-to-log-level mapping. defaultLevel
contains the log level to use for loggers not specified in levels
. This file
can then be specified using the --log-config
option. Theia will watch that
file for changes, so it's possible to change log levels at runtime by
modifying this file.
It's unfortunately currently not possible to query Theia for the list of
existing loggers. However, each log message specifies from which logger it
comes from, which can give an idea, without having to read the code:
root INFO [parcel-watcher: 10734] Started watching: /Users/captain.future/git/theia/CONTRIBUTING.md
^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^
Where root
is the name of the logger and INFO
is the log level. These are optionally followed by the name of a child process and the process ID.
Environment Variables
THEIA_HOSTS
- A comma-separated list of hosts expected to resolve to the current application.
- e.g:
theia.app.com,some.other.domain:3000
- The port number is important if your application is not hosted on either
80
or 443
.
- If possible, you should set this environment variable:
- When not set, Theia will allow any origin to access the WebSocket services.
- When set, Theia will only allow the origins defined in this environment variable.
FRONTEND_CONNECTION_TIMEOUT
- The duration in milliseconds during which the backend keeps the connection contexts for the frontend to reconnect.
- This duration defaults to '0' if not set.
- If set to negative number, the backend will never close the connection.
Additional Information
License
Trademark
"Theia" is a trademark of the Eclipse Foundation
https://www.eclipse.org/theia
1.59.0 - 02/27/2025
- [ai] added claude sonnet 3.7 to default models #15023
- [ai] added contextsummary variable to ai system #14971
- [ai] aligned ai chat toggle keybinding with vs code on macos #14850
- [ai] allowed multiple replacements in coder function #14934
- [ai] allowed to close chats again #14992
- [ai] chore: used fileservice.exist instead of trying to read the file #14849
- [ai] chore(chat): moved chat window to the right by default #14970
- [ai] consolidated the variables we provided in the chat #15021
- [ai] corrected description in workspace agent functions #14898
- [ai] correctly set the systempromptid in custom agents #14988
- [ai] feat(ai): enabled context variables for chat requests #14787
- [ai] fixed autocompletion for functions in chat input #14838
- [ai] fixed: provided open handler for quick file open #15003
- [ai] fixed(chat): avoided file suggestions on colons #14965
- [ai] fixed(chat): improved variable autocompletion #15018
- [ai] fixed(chat): prevented duplicate context element entries #14979
- [ai] fixed(chat): prevented focus outline color of ai chat #15020
- [ai] fixed closing changesets #14994
- [ai] fixed structured output dispatch and settings #14811
- [ai] fixed tool call prompt text replacement #14830
- [ai] fixed tool calling string in messages #14906
- [ai] fixed: quick input hover initialization #15064
- [ai] instructed coder to use replace when search and replace failed #15061
- [ai] implemented asynch iterator for open ai stream #14920
- [ai] improved integration between variableregistry and ai variableservice #14827
- [ai] introduced ai-ide package and moved ai configuration view #14948
- [ai] labeled ai as alpha #14968
- [ai] localized theia ai strings #14857
- [ai] made dependency on monaco explicit #14907
- [ai] made universal default prompt plain #15007
- [ai] made new code completion prompt default and turned on inline by default #14822
- [ai] pinned chat agent #14716
- [ai] refined coder prompt #14887
- [ai] refined search-replace prompt default of coder and made it default #14870
- [ai] refined system message settings #14877
- [ai] refactored chat agents into separate ide package #14852
- [ai] removed aieditormanager #14912
- [ai] renamed workspace agent to architect #14963
- [ai] set o1 to stream by default #14947
- [ai] streamlined the agent code #14859
- [ai] supported anyof in function parameters #15012
- [ai] updated chatmodel naming #14913
- [ai] updated default openai models #14808
- [ai] used content from monacoworkspaceservice for ai getfilecontent #14885
- [application-manager] used default import of fix-path package #14812
- [ci] fixed next build #14981
- [console] fixed: console text model used the language id #14854
- [core] added commands to toggle left and right panel #15041
- [core] fixed: removed files in editor tab when deleted #14990
- [core] fixed problems related with menu bar updates on focus change #14959 - Contributed on behalf of STMicroelectronics
- [core] made context element mandatory when showing a context menu #14982 - Contributed on behalf of STMicroelectronics
- [core] only sent visibility change notification when the visibility actually changed #15040 - Contributed by STMicroelectronics
- [core] streamlined logging api #14861
- [core] supported manual override of text blocks #14712
- [debug] fixed: handled the breakpoint update event for id:0 #14866
- [debug] fixed: no watch evaluation if no current stack frame #14874
- [debug] fixed: warned user before starting the same debug session multiple times #14862
- [debug] handled the case where the editor model was set to null #15013 - Contributed on behalf of STMicroelectronics
- [dev-container] devcontainer: added ability to use localenv for containerenv property #14821
- [dev-container] devcontainer: added simple containerenv contribution #14816
- [dev-container] fixed recent workspace tracking for devcontainer workspaces #14925
- [dev-packages] fixed webpack watching #14844
- [doc] updated build command in publishing.md #14798
- [doc] updated mcp readme with autostart option #15046
- [filesystem] deprioritized file resource resolver to avoid resolution delays #14917
- [monaco] chore: updated vscode-oniguruma+vscode-textmate #14848
- [monaco] did not create a model reference for inline editors #14942 - Contributed on behalf of STMicroelectronics
- [monaco] emptied hidden editors #14909 - Contributed on behalf of STMicroelectronics
- [monaco] fixed: contenthoverwidget respected theia styles #14836
- [monaco] fixed monaco editor localization #15016
- [monaco] fixed monaco model reference creation #14957
- [notebook] added an error for when a notebook editor was opened with a non existing file #14891
- [notebook] fixed new notebook cell editor outline and width with open right sidebar #14800
- [notebook] fixed notebook widget disposal #14964
- [plugin] added missing vs code json schemas #14864
- [plugin] passed code action provider metadata to editor #14991 - Contributed on behalf of STMicroelectronics
- [plugin] refreshed root when change notification had no items #14868
- [plugin] sent plugin logs to the frontend #14908
- [plugin] supported snippet file edits #15066
- [scm] used diffeditor diffnavigator to navigate diffs #14889
- [terminal] fixed: exited shell process on terminal close #14823
- [vscode] bumped vs code api version #15069 - Contributed on behalf of STMicroelectronics
- [vscode] introduced the commentingrange type #15015 - Contributed on behalf of STMicroelectronics
- [vscode] made public the documentpaste proposed api #14953 - Contributed on behalf of STMicroelectronics
- [vscode] shellexecution updated with undefined command #15047 - Contributed on behalf of STMicroelectronics
<a name="breaking_changes_1.59.0">Breaking Changes:</a>
- [ai] refined system message settings #14877
- [ai-chat] changed chat api by removing chatsetchangedeleteevent, updating changeset interface with added ondidchange event and dispose method (renamed accept to apply and discard to revert), modified changesetelement and changesetimpl accordingly #14910
- [ai-chat] abstractchatagent updated getsystemmessagedescription to require a context parameter #14930
- [ai-core] chatmodel interface was updated to include context and promptservice was updated with an optional context argument in getprompt #14930
- [ai-ide] content-replacer.ts moved from ai-ide/src/browser/ to core/src/common/ #14930
- [ai-scanoss] scanossdialog constructor accepted an array of results instead of a single result #14930
- [core] a context html element became mandatory when showing a context menu #14982 - Contributed on behalf of STMicroelectronics
- [core] adjusted binding of named ilogger injections and instructed removal of duplicate ilogger bindings on ambiguous match errors
- [core] streamlined logging api #14861
- [core] made context element mandatory when showing a context menu #14982 - Contributed on behalf of STMicroelectronics
- [debug] fixed: handled the breakpoint update event for id:0 #14866