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

Commit

Permalink
Limit num of symbols returned to workaround high CPU usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ypresto authored and rebornix committed Jan 23, 2017
1 parent d649bac commit 33996d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ function activate(context) {
console.warn(`Unknown symbol type: ${symbolInfo.type}`);
return SymbolKind.Variable;
};
const symbolConverter = matches => matches.map(match => {
// NOTE: Workaround for high CPU usage on IPC (channel.onread) when too many symbols returned.
// For channel.onread see issue like this: https://github.com/Microsoft/vscode/issues/6026
const numOfSymbolLimit = 3000;
const symbolConverter = matches => matches.slice(0, numOfSymbolLimit).map(match => {
const symbolKind = (symbolKindTable[match.type] || defaultSymbolKind)(match);
const uri = vscode.Uri.file(match.file);
const location = new Location(uri, new Position(match.line, match.char));
Expand Down

0 comments on commit 33996d8

Please sign in to comment.