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

How to manage !effect or !custom with simple property. #473

Closed
angelozerr opened this issue Jan 7, 2015 · 2 comments
Closed

How to manage !effect or !custom with simple property. #473

angelozerr opened this issue Jan 7, 2015 · 2 comments

Comments

@angelozerr
Copy link
Contributor

I'm writing a tern plugin for jasmine https://github.com/angelozerr/tern-jasmine

I can manage this case :

expect(true).  // here Ctrl+Space must shows not, toBeDefined, etc

expect is a function which returns a custom function (because jasmine matchers can be dynamic).

"expect": {
      "!type": "fn(value: ?) -> !custom:jasmineExpect",
      "!doc": "Expectations are built with the function expect which takes a value, called the actual. It is chained with a Matcher function, which takes the expected value."
    },

See https://github.com/angelozerr/tern-jasmine/blob/master/jasmine.js#L146

The not matcher must return the matchers list too like expect function (`not', 'toBeDefined', etc, So I have written :

"not": {
          "!type": "!custom:jasmineExpect",

But as not matcher is a property and not a function, it doesn't work.

I would like to manage that :

expect(true).not.  // here Ctrl+Space must shows not, toBeDefined, etc

@marijnh have you an idea how to I could manage not case?

@marijnh
Copy link
Member

marijnh commented Jan 20, 2015

What does not hold, then? Is it a getter property? If it's not a function, Tern can currently not associate effects with it.

@angelozerr
Copy link
Contributor Author

not is a simple property. That's why I have created an issue for that : associate an effects with a property.

I have fixed my problem by writing my JSON Type Defitnition with an other mean and it works https://github.com/angelozerr/tern-jasmine/blob/master/jasmine.js#L47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants