angelozerr / tern.jsduck

Tern Plugin for ExtJS, CKEditor
MIT License
9 stars 3 forks source link

#11 Make completion for ExtJS 4.2.1 work #12

Closed fflorent closed 7 years ago

fflorent commented 7 years ago
angelozerr commented 7 years ago

Thanks @fflorent !

I have tested with 4.2.1 and it works great but with 5.0.0 and 5.1.1, when I open completion (without key);I have the error:

C:\Users\azerr\git\tern.java\core\ternjs\node_modules\tern-extjs_5.1.1\extjs_5.1.1.js:238
  var defs = {"!name":"extjs","!define":{"Ext_AbstractManager_cfg":{"!proto":"Ext_Base_cfg"},"Ext_Action_cfg":{"!proto":"Ext_Base_cfg","disabled":{"!type":"bool","!doc":"<p>True to disable all components configured by this Action, false to enable them.</p>\n"},"handler":{"!type":"fn()","!doc":"<p>The function that will be invoked by each component tied to this Action\nwhen the component's primary event is triggered.</p>\n"},"hidden":{"!type":"bool","!doc":"<p>True to hide all components configured by this Action, false to show them.</p>\n"},"iconCls":{"!type":"string","!doc":"<p>The CSS class selector that specifies a background image to be used as the header icon for\nall components configured by this Action.</p>\n\n<p>An example of specifying a custom icon class would be something like:</p>\n\n<pre><code>// specify the property in the config for the class:\n     ...\n     iconCls: 'do-something'\n\n// css class that 
    at Object.Module._extensions..js (module.js:442:10)
    at Module._compile (module.js:414:25)
    at exports.runInThisContext (vm.js:53:16)
    at Module.load (module.js:356:32)
SyntaxError: Unexpected token ILLEGAL

    at Module.require (module.js:366:17)
    at Function.Module._load (module.js:313:12)
    at require (module.js:385:17)
    at loadPlugins (C:\Users\azerr\git\tern.java\core\ternjs\node_modules\tern\bin\tern:138:15)
    at startServer (C:\Users\azerr\git\tern.java\core\ternjs\node_modules\tern\bin\tern:176:17)
    at Object.<anonymous> (C:\Users\azerr\git\tern.java\core\ternjs\node_modules\tern\bin\tern:172:14)
fflorent commented 7 years ago

I'll take a loo in a week, but it's weird, because the error points to the plugin directly. If that's a syntax error, I should see it even in a browser if I execute it (modulo faking tern.registerFunction), but I don't.

Moreover I have tested it using neovim, and it works. Are you sure about the integrity of the plugin file? If so, I'll take a look using tern.java

Florent

angelozerr commented 7 years ago

@fflorent perhaps it's the version of ternjs that I'm using inside tern.java? I get sometimes ternjs from master and I copy/paste to tern.java. I will try to study the problem.

angelozerr commented 7 years ago

@fflorent it was my fautl, sorry -(

Your work works like a charm, thanks!

angelozerr commented 7 years ago

I have just a problem "TypeError: Cannot read property 'node' of undefined" when I open completion when my editor is empty.

angelozerr commented 7 years ago

@fflorent it seems that the problem comes from findCompletionsForXtypeStrings with

var thisExpr = expressionsAround.expr;
var propExpr = expressionsAround.propExpr;

where thisExpr and propExpr are null in case of completion is opened when editor is empty.

fflorent commented 7 years ago

@angelozerr Fixed (in TDD style :))

See https://github.com/angelozerr/tern.jsduck/commit/20bdf105f788bb5db00dfe2323bc283f8df58716

angelozerr commented 7 years ago

Thanks a lot @fflorent ! I will integrate your work inside tern.java.

Thanks again!