Bug 418356 - "Buffer" globals not recognized in Node.js content assist
Summary: "Buffer" globals not recognized in Node.js content assist
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.0 RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-30 11:37 EDT by Mark Macdonald CLA
Modified: 2013-09-30 17:47 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2013-09-30 11:37:09 EDT
Using the new Node.js content assist from bug 417876, I found 2 issues:

1) When member-completing on an instance of Buffer, I do not see Buffer's methods proposed (eg. readXXX, writeXXX):

> /*jslint node:true */
> var mybuf = new Buffer();
> mybuf.
        ^ press Ctrl+Space here


2) When member-completing on the `buffer` global, the inferencer throws an exception:

> /*jslint node:true */
> buffer.
         ^ press Ctrl+Space here

FWIW, I can manually require("buffer") and assign it to a variable, which then shows the expected fields. In practice though, Node developers just reference the globals, so we need them to work.
Comment 1 Manu Sridharan CLA 2013-09-30 14:38:33 EDT
Thanks for testing this out!  I have a branch and commit that fixes this issue here.

Branch: https://github.com/msridhar/orion.client/tree/node-buffer-fix
Commit: https://github.com/msridhar/orion.client/commit/36d0b88bdd750e34435a6a394dbbb3546ac61577

Let me know if you still see problems.
Comment 2 Mark Macdonald CLA 2013-09-30 17:47:15 EDT
Great! Thanks for the fix.
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=d105e22