From a17f2ed6c663d9d679bf409b44fc2114df520968 Mon Sep 17 00:00:00 2001 From: ran Date: Wed, 1 Nov 2023 23:50:11 +0800 Subject: [PATCH] Fix the bug that the first one returned by stream is \n, which is unacceptable, and re-plan the partition for the sidebar. --- .../src/bigcode-Inline-completion-provider.ts | 5 +++- .../src/components/bigcode-settings.tsx | 28 ++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/jupyter-ai/src/bigcode-Inline-completion-provider.ts b/packages/jupyter-ai/src/bigcode-Inline-completion-provider.ts index 2eb2c144d..faeeefe63 100644 --- a/packages/jupyter-ai/src/bigcode-Inline-completion-provider.ts +++ b/packages/jupyter-ai/src/bigcode-Inline-completion-provider.ts @@ -226,7 +226,10 @@ export class BigcodeInlineCompletionProvider ); const items: IInlineCompletionItem[] = []; - if (this._lastRequestInfo.insertText.startsWith(newAddedCodeText)) { + if ( + this._lastRequestInfo.insertText.startsWith(newAddedCodeText) && + newAddedCodeText !== '' + ) { items.push({ isIncomplete: false, insertText: this._lastRequestInfo.insertText.replace( diff --git a/packages/jupyter-ai/src/components/bigcode-settings.tsx b/packages/jupyter-ai/src/components/bigcode-settings.tsx index 34b2db49b..b2ebb238f 100644 --- a/packages/jupyter-ai/src/components/bigcode-settings.tsx +++ b/packages/jupyter-ai/src/components/bigcode-settings.tsx @@ -79,7 +79,14 @@ export const BigCodeSetting = observer(() => { onChange={toggleCodeCompletionWrapper} /> - {CodeCompletionContextstore.enableCodeCompletion && ( + +

Enable mock test code completion { onChange={toggleMockTestWrapper} />

- )} + +

Short cut for completion

+ +
{ type="password" onChange={e => setAccessTokenWrapper(e.target.value)} /> -

Short cut for completion

-

Advanced Settings