Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primitives completion is not working #11187

Closed
alexdima opened this issue Aug 30, 2016 · 5 comments
Closed

Primitives completion is not working #11187

alexdima opened this issue Aug 30, 2016 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

Testing #10997

function Person(name, age) {
    this.name = name;
    this.age = age;
}
Person.prototype.greet = function(whom) {
    console.log('Hello ' + whom.name + ', my name is ' + this.name); // <---- BREAKPOINT HERE
}

Student.prototype = Object.create(Person.prototype);
function Student(name, age, school) {
    Person.call(this, name, age);
    this.school = school;
}
Student.prototype.getSchool = function() {
    return this.school;
}

var a = new Person('John', 20);
var b = new Student('Charlie', 20, 'UNI');
a.greet(b);

When typing 'hello'. or 5. I would expect to get functions and properties available on the constants I defined. I use this a lot in Chromium to find a method and try it out quickly. At the moment, I get global suggestions such as Buffer or console which results in an invalid expression error.

@isidorn isidorn removed their assignment Aug 30, 2016
@isidorn
Copy link
Contributor

isidorn commented Aug 30, 2016

The list of suggestions is coming from the node debug adapter, thus forwarding to @weinand

@isidorn isidorn added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 30, 2016
@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Aug 30, 2016
@weinand weinand added this to the August 2016 milestone Aug 30, 2016
@weinand weinand added the verification-needed Verification of issue is requested label Aug 31, 2016
@roblourens
Copy link
Member

This works, but I'm not sure whether it should work in the 5. case. It will prompt you to complete it like 5.toString() but this is not valid syntax. And it works because the debug adapter wraps the input before the dot in (). Feels wrong to me. It doesn't work in Chrome. Any other thoughts?

@sandy081 sandy081 added the verified Verification succeeded label Sep 2, 2016
@sandy081
Copy link
Member

sandy081 commented Sep 2, 2016

I agree with @roblourens. Showing proposals for number constants does not makes sense. Also 5.toString() is not a valid syntax and doing this will give an error. Hence we should not show.

@weinand Shall I open a new issue for this?

@sandy081
Copy link
Member

sandy081 commented Sep 2, 2016

screen shot 2016-09-02 at 10 45 51

@weinand
Copy link
Contributor

weinand commented Sep 2, 2016

@sandy081 yes, please create a new issue (but I do not intend to fix that behaviour).

The proposals are valid for the type 'number' and they are still helpful for @alexandrudima use case.

Since I do not have a JavaScript parser/scanner available, I do not want to start validating JavaScript expression. There is an infinite number of incorrect expressions where we still return IntelliSense.

@weinand weinand removed the verification-needed Verification of issue is requested label Sep 2, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants