[VS Code]: Code Generation not streaming in VS Code version 1.98
Summary
The broader VS Code compatibility context is explained in this comment.
I re-tested the streaming today on the latest insider version
Version: 1.98.0-insider
Commit: 8cc3b69feaf3b79f333256a511e84f20cf27c24f
Date: 2025-02-12T05:04:23.243Z (5 hrs ago)
And the code generation streaming doesn't work as expected again. This time it's not completely broken but it either shows the full result at once or it flickers a bit before.
Steps to reproduce
- Trigger code suggestion streaming (e.g. run the
GitLab: Tutorialcommand and go to step 3)
What is the current bug behavior?
The streaming is not working reliably
What is the expected correct behavior?
The streaming will work as in 1.97.x
Relevant logs and/or screenshots
the issue has been introduced between the second last and the last insider version.
When I add the following patch
patch
diff --git a/src/common/language_server/language_client_middleware.ts b/src/common/language_server/language_client_middleware.ts
index 81c2aa81..6de87df9 100644
--- a/src/common/language_server/language_client_middleware.ts
+++ b/src/common/language_server/language_client_middleware.ts
@@ -172,6 +172,7 @@ export class LanguageClientMiddleware implements Middleware {
}, 0);
}
+ log.info(`returning completion ${completion}`);
return [
new vscode.InlineCompletionItem(
completion,
I see that we actually return the inline completion but VS Code doesn't show them.
debug logs
2025-02-12T12:25:12:120 [debug]: Listening to stream code-suggestion-stream-1
2025-02-12T12:25:13:736 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/, Done is false
2025-02-12T12:25:13:737 [debug]: streamResult.done = false
2025-02-12T12:25:13:737 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/
2025-02-12T12:25:13:738 [debug]: Possible detached stream, initiating check
2025-02-12T12:25:13:822 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/, Done is false
2025-02-12T12:25:13:822 [debug]: streamResult.done = false
2025-02-12T12:25:13:822 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/
2025-02-12T12:25:14:026 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {, Done is false
2025-02-12T12:25:14:026 [debug]: streamResult.done = false
2025-02-12T12:25:14:026 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
2025-02-12T12:25:14:027 [debug]: Possible detached stream, initiating check
2025-02-12T12:25:14:111 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about',, Done is false
2025-02-12T12:25:14:111 [debug]: streamResult.done = false
2025-02-12T12:25:14:111 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about',
2025-02-12T12:25:14:319 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about', (req, res) => {
res, Done is false
2025-02-12T12:25:14:319 [debug]: streamResult.done = false
2025-02-12T12:25:14:319 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about', (req, res) => {
res
2025-02-12T12:25:14:320 [debug]: Possible detached stream, initiating check
2025-02-12T12:25:14:402 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about', (req, res) => {
res.send('About us page');
});
router.get('/contact', (req, res, Done is false
2025-02-12T12:25:14:403 [debug]: streamResult.done = false
2025-02-12T12:25:14:403 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about', (req, res) => {
res.send('About us page');
});
router.get('/contact', (req, res
2025-02-12T12:25:14:472 [debug]: Possible detached stream, initiating check
2025-02-12T12:25:14:483 [debug]: Streaming Suggestion: const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about', (req, res) => {
res.send('About us page');
});
router.get('/contact', (req, res) => {
res.send('Contact us page');
});
module.exports = router;, Done is true
2025-02-12T12:25:14:483 [debug]: streamResult.done = true
2025-02-12T12:25:14:483 [info]: returning completion const express = require('express');
const router = express.Router();
router.get('/home', (req, res) => {
res.send('Welcome to the home page');
});
router.get('/about', (req, res) => {
res.send('About us page');
});
router.get('/contact', (req, res) => {
res.send('Contact us page');
});
module.exports = router;
This IMO indicates that VS Code debounces/ignores completion when it's shown in quick succession.
Edited by Tomas Vik (OOO back on 2026-01-05)