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

Commit

Permalink
Use Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Aug 7, 2016
1 parent 739f1ca commit 4a3803e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ function completionProvider(document, position, token) {
'--column='+column]);

var outbuf = [], errbuf = [];
child.stderr.on('data', (data) => errbuf.push(data.toString()));
child.stdout.on('data', (data) => outbuf.push(data.toString()));
child.stderr.on('data', (data) => errbuf.push(data));
child.stdout.on('data', (data) => outbuf.push(data));
child.stdout.on('end', () => {
if (errbuf.length > 0) reject(errbuf.join(''));
if (errbuf.length > 0) return reject(Buffer.concat(errbuf).toString());

var completionItems = [];
outbuf.join('').split('\n').forEach(function(elem) {
Buffer.concat(outbuf).toString().split('\n').forEach(function(elem) {
var items = elem.split('\t');
if (/^[^\w]/.test(items[0])) return;
var completionItem = new vscode.CompletionItem(items[0]);
Expand Down

0 comments on commit 4a3803e

Please sign in to comment.