diff --git a/docs/vscode_monaco_upgrade.md b/docs/vscode_monaco_upgrade.md new file mode 100644 index 00000000..25608113 --- /dev/null +++ b/docs/vscode_monaco_upgrade.md @@ -0,0 +1,26 @@ +# How to upgrade to next vscode and monaco-editor version + +## Preparation + +- Get the new vscode commit from the new monaco-editor release version (in the package.json there is a `vscodeRef` field) +- Open the vscode repo, reset to the previous vscodeRef commit +- Apply the current patch: `patch -p1 < /path/to/monaco-vscode-api/scripts/vscode.patch` +- `git stash` +- checkout new vscodeRef commit +- `git stash pop` +- resolve conflicts, update code... +- generate new patch: `git diff --staged > /path/to/monaco-vscode-api/scripts/vscode.patch` + +## the monaco-vscode-api side + +- update monaco-editor (and other dependencies) and update to the new `vscodeRef` +- wait for the new vscode version to be downloaded and built +- Fix errors, adapt code, build, include the `vscode.patch` into this commit +- update demo + +## Further points (needs polishing / ne integrated properly) + +- Do not hesitate to run the eslint autofix, it gets rid of the majority of your errors +- I've just realized we need to run npx @vscode/dts dev after an update (to upate the vscode.proposed.xxx.d.ts files): it fixes the error in api.ts +- The remaining errors in missing-services.ts are not hard to fix +- Implement missing services (usually seem when running the demo) diff --git a/src/missing-services.ts b/src/missing-services.ts index 91536747..1250e54f 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -163,9 +163,14 @@ import { IEncryptionService } from 'vs/platform/encryption/common/encryptionServ import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService' import { IDiagnosticsService, NullDiagnosticsService } from 'vs/platform/diagnostics/common/diagnostics' import { INotebookSearchService } from 'vs/workbench/contrib/search/common/notebookSearch' +import { IChatProviderService } from 'vs/workbench/contrib/chat/common/chatProvider' +import { IChatSlashCommandService } from 'vs/workbench/contrib/chat/common/chatSlashCommands' +import { IChatVariablesService } from 'vs/workbench/contrib/chat/common/chatVariables' +import { IAiRelatedInformationService } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation' +import { IAiEmbeddingVectorService } from 'vs/workbench/services/aiEmbeddingVector/common/aiEmbeddingVectorService' import { ResourceSet } from 'vs/base/common/map' -import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor' import { unsupported } from './tools' +import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor' class NullLoggerService extends AbstractLoggerService { constructor () { @@ -2142,3 +2147,41 @@ registerSingleton(INotebookSearchService, class NotebookSearchService implements _serviceBrand: undefined }, InstantiationType.Delayed) + +registerSingleton(IChatProviderService, class ChatProviderService implements IChatProviderService { + _serviceBrand: undefined + registerChatResponseProvider = unsupported + fetchChatResponse = unsupported +}, InstantiationType.Delayed) + +registerSingleton(IChatSlashCommandService, class ChatSlashCommandService implements IChatSlashCommandService { + onDidChangeCommands = unsupported + registerSlashData = unsupported + registerSlashCallback = unsupported + registerSlashCommand = unsupported + executeCommand = unsupported + getCommands = unsupported + hasCommand = unsupported + _serviceBrand: undefined +}, InstantiationType.Delayed) + +registerSingleton(IChatVariablesService, class ChatVariablesService implements IChatVariablesService { + registerVariable = unsupported + getVariables = unsupported + resolveVariables = unsupported + _serviceBrand: undefined +}, InstantiationType.Delayed) + +registerSingleton(IAiRelatedInformationService, class AiRelatedInformationService implements IAiRelatedInformationService { + isEnabled = () => false + getRelatedInformation = unsupported + registerAiRelatedInformationProvider = unsupported + _serviceBrand: undefined +}, InstantiationType.Delayed) + +registerSingleton(IAiEmbeddingVectorService, class AiEmbeddingVectorService implements IAiEmbeddingVectorService { + _serviceBrand: undefined + isEnabled = () => false + getEmbeddingVector = unsupported + registerAiEmbeddingVectorProvider = unsupported +}, InstantiationType.Delayed)