Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype: Supercompletions #3389

Merged
merged 22 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
"source.organizeImports.biome": "explicit"
},
"editor.insertSpaces": true,
"cSpell.words": [
"Supercompletion",
"Supercompletions"
],
}
1 change: 1 addition & 0 deletions lib/shared/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface Configuration {
experimentalSimpleChatContext: boolean
experimentalChatContextRanker: boolean | undefined
experimentalOllamaChat: boolean
experimentalSupercompletions: boolean

/**
* Unstable Features for internal testing only
Expand Down
12 changes: 7 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,18 @@
"command": "cody.fixup.cancelNearest",
"key": "alt+z",
"when": "cody.activated && !editorReadonly && cody.hasActionableEdit"
},
{
"command": "cody.supercompletion.jumpTo",
"args": ["next"],
"key": "shift+ctrl+down",
"when": "cody.activated && !editorReadonly && cody.hasActionableSupercompletion"
},
{
"command": "cody.supercompletion.jumpTo",
"args": ["previous"],
"key": "shift+ctrl+up",
"when": "cody.activated && !editorReadonly && cody.hasActionableSupercompletion"
}
],
"submenus": [
Expand Down Expand Up @@ -1195,6 +1207,7 @@
"lru-cache": "^10.0.0",
"mkdirp": "^3.0.1",
"os-browserify": "^0.3.0",
"parse-git-diff": "^0.0.14",
"socks-proxy-agent": "^8.0.1",
"unzipper": "^0.10.14",
"uuid": "^9.0.0",
Expand All @@ -1221,7 +1234,7 @@
"@types/isomorphic-fetch": "^0.0.39",
"@types/js-levenshtein": "^1.1.1",
"@types/lodash": "^4.14.195",
"@types/mocha": "^10.0.1",
"@types/mocha": "^10.0.6",
"@types/pako": "^2.0.3",
"@types/progress": "^2.0.5",
"@types/semver": "^7.5.0",
Expand Down
3 changes: 3 additions & 0 deletions vscode/src/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ describe('getConfiguration', () => {
return false
case 'cody.experimental.chatContextRanker':
return false
case 'cody.experimental.supercompletions':
return false
default:
throw new Error(`unexpected key: ${key}`)
}
Expand All @@ -125,6 +127,7 @@ describe('getConfiguration', () => {
},
commandCodeLenses: true,
experimentalSimpleChatContext: true,
experimentalSupercompletions: false,
experimentalSymfContext: true,
experimentalTracing: true,
editorTitleCommandIcon: true,
Expand Down
1 change: 1 addition & 0 deletions vscode/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export function getConfiguration(
experimentalTracing: getHiddenSetting('experimental.tracing', false),

experimentalOllamaChat: getHiddenSetting('experimental.ollamaChat', false),
experimentalSupercompletions: getHiddenSetting('experimental.supercompletions', false),

experimentalChatContextRanker: getHiddenSetting('experimental.chatContextRanker', false),

Expand Down
7 changes: 6 additions & 1 deletion vscode/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { createOrUpdateEventLogger, telemetryService } from './services/telemetr
import { createOrUpdateTelemetryRecorderProvider, telemetryRecorder } from './services/telemetry-v2'
import { onTextDocumentChange } from './services/utils/codeblock-action-tracker'
import { enableDebugMode, exportOutputLog, openCodyOutputChannel } from './services/utils/export-logs'
import { SupercompletionProvider } from './supercompletions/supercompletion-provider'
import { parseAllVisibleDocuments, updateParseTreeOnEdit } from './tree-sitter/parse-tree-cache'

/**
Expand Down Expand Up @@ -263,6 +264,8 @@ const register = async (
})
)

const statusBar = createStatusBar()

// Important to respect `config.experimentalSymfContext`. The agent
// currently crashes with a cryptic error when running with symf enabled so
// we need a way to reliably disable symf until we fix the root problem.
Expand All @@ -277,7 +280,9 @@ const register = async (
)
}

const statusBar = createStatusBar()
if (config.experimentalSupercompletions) {
disposables.push(new SupercompletionProvider({ statusBar, chat: chatClient }))
}

// Adds a change listener to the auth provider that syncs the auth status
authProvider.addChangeListener(async (authStatus: AuthStatus) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
Expand All @@ -12,6 +11,7 @@ import {
featureFlagProvider,
} from '@sourcegraph/cody-shared'

import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api'
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base'
import { version } from '../../version'
import { ConsoleBatchSpanExporter } from './console-batch-span-exporter'
Expand Down
Loading
Loading