Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 0f4e1bb

Browse files
committed
Limit num of symbols returned to workaround high CPU usage
1 parent f76af29 commit 0f4e1bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ruby.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ function activate(context) {
188188
console.warn(`Unknown symbol type: ${symbolInfo.type}`);
189189
return SymbolKind.Variable;
190190
};
191-
const symbolConverter = matches => matches.map(match => {
191+
// NOTE: Workaround for high CPU usage on IPC (channel.onread) when too many symbols returned.
192+
// For channel.onread see issue like this: https://github.com/Microsoft/vscode/issues/6026
193+
const numOfSymbolLimit = 3000;
194+
const symbolConverter = matches => matches.slice(0, numOfSymbolLimit).map(match => {
192195
const symbolKind = (symbolKindTable[match.type] || defaultSymbolKind)(match);
193196
const uri = vscode.Uri.file(match.file);
194197
const location = new Location(uri, new Position(match.line, match.char));

0 commit comments

Comments
 (0)