tern icon indicating copy to clipboard operation
tern copied to clipboard

No autocomplete on my objects

Open Lcfvs opened this issue 4 years ago • 2 comments

Hi,

Sorry for my too generic title but I think this issue can help to find interesting things to improve your incredible tool.

I made some tests on it, it works fine but not with the object created with my low-level component @etchedjs/etched (for sure, my lib is a few conceptual and complex but it's a valid JS).

Version: 0.24.1 (browser demo)

Reproducing steps

Create a etched.js file containing the @etchedjs/etched source

In the main script

import { etch, model } from './etched.js'

const entity = model(null, {
  set id (value) {}
})

const account = model(entity, {
  set name (value) {}
})

const jack = etch(account, {
  id: 123,
  name: 'Jack'
})

const renamed = etch(jack, {
  name: 'Jack-Renamed'
})

jack. // doesn't autocompletes anything

Hope it helps. :)

If you need more informations, just ask.

Lcfvs avatar Nov 22 '20 13:11 Lcfvs

Based on the sample you provided above. I think this is because the limitation of tern. Tern is static analysis tool so it can't do everything like a runtime.

othree avatar Dec 24 '20 05:12 othree

It's a few unfortunate... I hope to see it going further in futures versions :stuck_out_tongue:

Lcfvs avatar Dec 26 '20 15:12 Lcfvs