PhpStorm and JavaScript: how to get full doc support - javascript

I use PhpStorm 2017.1.4 IDE. When I code in PHP, the core functions are all documented in the IDE (beyond just the parameters, I can see what the function does etc..)
I'm now practicing my JavaScript. Although the IDE knows the core functions, there is no documentation:
So find myself always going on MDN reference to learn about functions, which really slows down my work. How can I shore up my IDE to provide fuller documentation?

Quick documentation popup opened on F1 (or Ctrl+Q) shows information written in comments attached to object in .js file object is defined in (plugins\JavaScriptLanguage\lib\JavaScriptLanguage.jar!\com\intellij\lang\javascript\index\predefined\EcmaScript.js in your case). You can create a copy of this file somewhere on your disk, add more doc comments to functions stubs, and add this modified file as a JavaScript library to your project
If you like to see full API docs, hit Shift+F1, or press blue 'up' arrow button in documentation popup toolbar (note that this function is only available for libraries that have 'documentation URL' configured)
See https://www.jetbrains.com/help/webstorm/2016.2/viewing-inline-documentation.html

Related

Custom intellisense auto completion in vscode: how to dynamically point intellisense to a class or another?

my question is simple but I can't find any relevant documentation or code example that points me to the right direction.
I have a modular javascript architecture where modules are registered at startup in a moduleService.
So when I call moduleService.moduleA.myMethod(), it does not provide any suggestion because moduleService is just instanciated as an empty service and constructed dynamically.
I'm planning to make a vscode extension that could be able to find all registered modules, and for each, get the corresponding classes and provide completion and method documentation.
Have you got a clue on how to achieve that ?
You don't need a code completion provider for that functionality. Instead provide a typings file with the definitions from your modules and make this available to vscode. It will then happily show the info in its normal completion suggestions.
How you make your typings file available in the source tree is up to you. I simply placed mine in node_modules/#types/mymodule/mymodule.d.ts and that was it.

WebStorm: How to generate JSDoc documentation

I just started using WebStorm and JSDoc to document my JavaScript. Still I have not found a way to generate a HTML documentation using some kind of WebStorm built-in functionality. I searched the web and Stack Overflow, but only found a lot of questions about the syntax of JSDoc, etc.
What am I missing? I am using WebStorm 7.0.3.
Since Webstorm v8.0.0, you can create JSDoc comments by simply typing /** right before the method or function declaration you want to add the documentation, and then press Enter, this will generate a basic block with all your parameters already set.
More info on this Webstorm article.
Nice article about jsDoc for phpStorm at this link.
In WebStorm I guess the same.
WebStorm has no built-in functionality to generate documentation. You can use external solutions for that, at least as https://github.com/jsdoc3/jsdoc
I use jsduck for that: https://github.com/senchalabs/jsduck
WebStorm has a built-in function to help a little when creating JSDoc documentation in your code, they explain it in this article. As far as I could look for, there's no plugin on the WebStorm plugin store to further help us creating nor rendering JSDoc documentation. For that, you would need to use external tools.

How do you attach JSdoc in Eclipse so that I can have autocomplete for a personal library

I have a JavaScript library that I am working on currently. I have structured it into lots of files and I use the module approach to define each 'module'.
var ns = generateNamespace("me.mycompany.mypackage.MyFile");
(function (ns, undefined) {
// some module
}(ns));
The modules are dynamically named using a namespacing function meaning that autocomplete is almost impossible as things stand (unless Eclipse can run my code and figure out the namespaces, Visual Studio can!).
Therefore I intend to generate JSdoc for my project in the hope that if I include this into Eclipse (somehow) Eclipse can use this to give me content assist.
Firstly I do not know if this is possible... however I think that it is as I can see that it is maybe how this works? However I tried to follow this along and struggled to get something working, by this I mean it didn't work. The interesting info from the link:
"JSDT libraries are collections of JavaScript source files that have prototyped object/class definitions and JSDoc. The inference engine then models these libraries... making them available to every JavaScript file in the project... Bindings for nonstandard and future runtimes are similarly easy to create... add the... library to their project and gain content completion and hover help"
I know how to write JSdoc annotations and I know how to generate JSdoc using one of the various tools.
What I need therefore is instructions on how to include JSdoc (as a library maybe) in Eclipse so that it will give auto complete for the stuff in the JSdoc.
Previous answer:
You can also run jsdoc_toolkit from within eclipse by setting up Run -
> External Tools -> Open External Tools Dialog...
Location
C:\Program Files\Java\jre1.5.0_12\bin\java.exe
Working Directory
C:\DirectoryToWhereJsDocToolkitIsLocated\jsdoc_toolkit
Arguments
-jar app/js.jar app/run.js -r=4 -t=templates/htm "-d=C:
\PathToWhereDocIsSaved" "C:\PathToWebsiteToDocument"
For more about the arguments check the jsdoc_toolkit documentation.
Have fun
Simon
Taken from this Google Groups thread.
Updated Answer:
Eclipse JavaScript Editor: content assist for js files, autocompletion
Disclaimer, I'm the author of tern.java.
I suggest you that you install tern.java. It provides a JSDoc support. Once you have selected this support, you can benefit
with completion :
and soon with validation:
This support is not perfect but it starts working.
I am not using it by myself, so I'm not sure if it works, but there exists a grunt-plugin for jsdoc3. Grunt is supported by Eclipse. So maybe it helps.
Grunt-PlugIn in npm

add jsdoc for javascript core in intellij

I am new to IntelliJ Idea
I want to add jsdoc for JavaScript core
That means, when I press the ctrl+q short key on a javascript element like .getElementsByTagName() method , I want to see the documentation, but there is not any thing!
Is there any way?
Like adding documentation jar file near to a library jar file for showing documentation.
Thanks
Mohi
Documentation is taken from the DOMCore.js stub file that doesn't contain a lot of useful information:
If you know where to find or how to generate similar stub file with complete documentation, it should be possible to use it instead.

Can I control where CKEditor finds plugins to load?

I'm writing a CKEditor plugin specific to my Web app. Until now, I've successfully kept my own files outside of the CKEditor code structure, but the only documentation I can find about the plugin creation process (being a user-made tutorial, no less) says to just shoehorn my plugin code into ckeditor/_source/plugins.
Is this really the only way to go? Am I stuck with commingling my code with CKEditor release code, or is there a way to tell it where to load plugins from? A PLUGINPATH setting, if you will?
Looking at the tutorial you posted, I see that the section called Plugin Configuration uses CKEDITOR.plugins.add to load the plugin resources. Have you tried using CKEDITOR.plugins.addExternal instead? The API documentation for it can be found here.
You want to load the uncompressed, unpacked plugins to load for debugging purposes right?
Just do this. Refer ckeditor_source.js instead of ckeditor.js. That way your created plugin inside the ckeditor/_source/plugins will run.
Read Minimum Setup for CKEditor with a microscope :)
There is a line like this here
_source — this directory contains CKEditor source code. It is needed
only if you intend to use the
ckeditor_source.js script and load
CKEditor from source files.
Too little documentation for a wonderful editor!
Update:
And inside the wonderful tutorial link you have provided, George Wu has mentioned that in the first paragraph also.
During development, you will want to
execute from source code by using
ckeditor_source.js instead of
ckeditor.js.
Now, create
ckeditor_source\plugins\footnote
folder and plugin.js under that
folder.
BTW, I found Tutorial create external plugin for CKEDITOR helpful too.

Categories

Resources