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

[Omni complete] Missing autocomplete for Foo. #17

Open
oyvindkinsey opened this issue May 17, 2013 · 4 comments
Open

[Omni complete] Missing autocomplete for Foo. #17

oyvindkinsey opened this issue May 17, 2013 · 4 comments

Comments

@oyvindkinsey
Copy link

When doing C-X, C-O in insert mode on the string Foo. with the cursor after the ., no types are suggested for types imported via eg the cjs plugins.

. should in this case be treated as show me any available properties, something which works perfectly with locally defined types.

var Foo = require('Foo');
Foo.

By typing out the property name, and executing :TernType, Tern is able to correctly infer the type, so the cjs plugin i working properly.

Any hints as to how to debug this? The plugin we use for loading required modules is close to the Node module, and is successfully resolving and passing back source for each requested module.

@albertosantini
Copy link

You should add a .tern-project file containing node plugin.

For instance,

{
  "libs": [
    "browser",
    "yui"
  ],
  "plugins": {
      "node": {}
  }
}

See also the documentation:
http://ternjs.net/doc/manual.html#plugins

@oyvindkinsey
Copy link
Author

We don't have any issues loading modules.
On May 18, 2013 11:00 PM, "albertosantini" [email protected] wrote:

You should add a .tern-project file containing node plugin.

For instance,

{
"libs": [
"browser",
"yui"
],
"plugins": {
"node": {}
}
}

See also the documentation:
http://ternjs.net/doc/manual.html#plugins


Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-18112897
.

@oyvindkinsey
Copy link
Author

We have multiple custom plugins, for loading and type annotation, so the
project file is all dandy :)
On May 18, 2013 11:03 PM, "Øyvind Sean Kinsey" [email protected] wrote:

We don't have any issues loading modules.
On May 18, 2013 11:00 PM, "albertosantini" [email protected]
wrote:

You should add a .tern-project file containing node plugin.

For instance,

{
"libs": [
"browser",
"yui"
],
"plugins": {
"node": {}
}
}

See also the documentation:
http://ternjs.net/doc/manual.html#plugins


Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-18112897
.

@marijnh
Copy link
Member

marijnh commented May 19, 2013

should in this case be treated as show me any available properties, something which works perfectly with locally defined types.

By default, Tern will only show any available properties when at least two characters have been given. These come from the cx.props registry, which is kept with no regard to origin file, so I don't see a reason for this to break for properties from different files. Are you sure you're comparing apples to apples? (I.e. does it really work for local properties when you don't type anything after the dot?)

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

3 participants