ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

ST3 NameError global name 'view' is not defined #169

Open Maxtermax opened 6 years ago

Maxtermax commented 6 years ago

I just install tern for sublime by download the repo inside the packages folder of sublime text 3 then run npm install then i try the demo located at: /Packages/tern_for_sublime/test/demo/simple/test.js it looks like this:

// Use ctrl-space to complete something
co
document.body.a 

// Put the cursor in or after an expression, press alt-o to
// find its type

var foo = ["array", "of", "strings"]
var bar = foo.slice(0, 2).join("").split("a")[0]

// Works for locally defined types too.

function CTor() { this.size = 10 }
CTor.prototype.hallo = "hallo"

var baz = new CTor
baz.

// You can press alt-space when the cursor is on a variable
// name to rename it. Try it with CTor...

// When the cursor is in an argument list, the arguments
// are shown below the editor.

[1].reduce(  )

When a try to use the intellisense dont work, so look the logs in the sublime text console and notice that in: /Packages/tern_for_sublime/tern.py crash in the line 598 because NameError: global name 'view' is not defined.

I am using:

I am not sure but a think that the problem maybe is for the python version.

marijnh commented 6 years ago

Does attached patch help?

Maxtermax commented 6 years ago

@marijnh i just download the fix and it doesn't work, this time dont throw any error but the intellisense still not work and in the sublime text console dont appear any logs of tern :(