Skip to content

Commit 56ef795

Browse files
authored
Merge pull request #441 from fredericbarthelet/completion-support-default
Set completion support to false by default
2 parents 5028496 + 430d6d4 commit 56ef795

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/src/lib/hooks/useConnection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function useConnection({
9191
const [requestHistory, setRequestHistory] = useState<
9292
{ request: string; response?: string }[]
9393
>([]);
94-
const [completionsSupported, setCompletionsSupported] = useState(true);
94+
const [completionsSupported, setCompletionsSupported] = useState(false);
9595

9696
const pushHistory = (request: object, response?: object) => {
9797
setRequestHistory((prev) => [
@@ -505,7 +505,7 @@ export function useConnection({
505505
throw error;
506506
}
507507
setServerCapabilities(capabilities ?? null);
508-
setCompletionsSupported(true); // Reset completions support on new connection
508+
setCompletionsSupported(capabilities?.completions !== undefined);
509509

510510
if (onPendingRequest) {
511511
client.setRequestHandler(CreateMessageRequestSchema, (request) => {

0 commit comments

Comments
 (0)