clausreinke / typescript-tools

(repo no longer active) Tools related to the TypeScript language
Apache License 2.0
266 stars 29 forks source link

Asking for completions on variable declaration gives an error instead of null #12

Closed draivin closed 10 years ago

draivin commented 10 years ago

It probably should be the same as when asking for completion inside a function parameter, that will instead return null.

It does the same when asking for completions inside a string.

Test case:

update 1 D:/empty.ts
var t
completions false 1 6 D:/empty.ts

Results:

"updated D:/empty.ts"
"TSS command processing error: TypeError: Cannot set property 'prefix' of null"
draivin commented 10 years ago

Just a doubt, what is the difference between member and non-member completions?

clausreinke commented 10 years ago

member completions: properties of objects non-member completions: variables

draivin commented 10 years ago

Is it working properly tough? It seems that no matter if I ask for member or non-member completions I get the same results.

clausreinke commented 10 years ago

It used to be the editor's responsibility to set that flag. Now, the services will determine it themselves, from source context (the isMemberCompletion property in the result can differ from the parameter). The flag is mostly still there for backwards compatibility (I think).