(
private readonly messenger: IMessenger<ToCoreProtocol, FromCoreProtocol>,
private readonly ide: IDE,
)
| 126 | // TODO: It shouldn't actually need an IDE type, because this can happen |
| 127 | // through the messenger (it does in the case of any non-VS Code IDEs already) |
| 128 | constructor( |
| 129 | private readonly messenger: IMessenger<ToCoreProtocol, FromCoreProtocol>, |
| 130 | private readonly ide: IDE, |
| 131 | ) { |
| 132 | try { |
| 133 | // Ensure .continue directory is created |
| 134 | migrateV1DevDataFiles(); |
| 135 | |
| 136 | const ideInfoPromise = messenger.request("getIdeInfo", undefined); |
| 137 | const ideSettingsPromise = messenger.request("getIdeSettings", undefined); |
| 138 | this.configHandler = new ConfigHandler(this.ide, this.llmLogger); |
| 139 | |
| 140 | this.docsService = DocsService.createSingleton( |
| 141 | this.configHandler, |
| 142 | this.ide, |
| 143 | this.messenger, |
| 144 | ); |
| 145 | |
| 146 | MCPManagerSingleton.getInstance().onConnectionsRefreshed = () => { |
| 147 | void this.configHandler.reloadConfig("MCP Connections refreshed"); |
| 148 | |
| 149 | // Refresh @mention dropdown submenu items for MCP providers |
| 150 | const mcpManager = MCPManagerSingleton.getInstance(); |
| 151 | const mcpProviderNames = Array.from(mcpManager.connections.keys()).map( |
| 152 | (mcpId) => `mcp-${mcpId}`, |
| 153 | ); |
| 154 | |
| 155 | if (mcpProviderNames.length > 0) { |
| 156 | this.messenger.send("refreshSubmenuItems", { |
| 157 | providers: mcpProviderNames, |
| 158 | }); |
| 159 | } |
| 160 | }; |
| 161 | |
| 162 | this.codeBaseIndexer = new CodebaseIndexer( |
| 163 | this.configHandler, |
| 164 | this.ide, |
| 165 | this.messenger, |
| 166 | this.globalContext.get("indexingPaused"), |
| 167 | ); |
| 168 | |
| 169 | this.configHandler.onConfigUpdate((result) => { |
| 170 | void (async () => { |
| 171 | const serializedResult = |
| 172 | await this.configHandler.getSerializedConfig(); |
| 173 | this.messenger.send("configUpdate", { |
| 174 | result: serializedResult, |
| 175 | profileId: |
| 176 | this.configHandler.currentProfile?.profileDescription.id || null, |
| 177 | profiles: this.configHandler.profileDescriptions, |
| 178 | }); |
| 179 | |
| 180 | if (await this.codeBaseIndexer.wasAnyOneIndexAdded()) { |
| 181 | await this.codeBaseIndexer.refreshCodebaseIndex( |
| 182 | await this.ide.getWorkspaceDirs(), |
| 183 | ); |
| 184 | } |
| 185 |
nothing calls this directly
no test coverage detected