Setting up Javadoc for Scala projects in IntelliJ - intellij-idea

After setting up my Scaladoc, i see that some documentation is still missing from the IDE
It seems to me (many thanks to Peter for noticing this) that:
functions with non-bold font have no documentation
functions with bold font have bare minimum
underlined functions have complete documentation
No documentation (normal non-bold font)
Bare minimum documentation (bold)
Complete documentation (underlined)
For the record, my scaladoc is installed as follows
doc
├── scala-devel-docs
│   └── api
│   ├── index
│   ├── lib
│   └── scala
│   ├── actors
│   │   ├── remote
│   │   └── scheduler
│   ├── annotation
│   │   ├── meta
│   │   └── unchecked
and is configured as follows:
EDIT:
Downloaded Javadoc from Oracle and placed into the /Library/Scala/2.10.0-RC2/doc/javadoc
javadoc/api
├── index-files
├── java
│   ├── applet
│   │   └── class-use
│   ├── awt
│   │   ├── class-use
│   │   ├── color
│   │   │   └── class-use
│   │   ├── datatransfer
│   │   │   └── class-use
Added 1 more entry to IDEA:
Does not seem to help.
Please clarify

You should install Javadocs as well - those bold methods have in fact plenty of documentation because they come from Java.
On the meaning of highlighting, I've answered on your other thread.
To add the JavaDocs, take a look at the picture below: .
From your snapshot, I'm tempted to guess you added them next to the ScalaDocs for the same library. However, the JavaDocs/ScalaDocs are associated with a specific library, so you should undo the step you did - IDEA will only look for docs of Scala library classes within the paths you specified there.
The picture shows that within the "Project structure" dialog, you need to go to SDKs, select the Java SDK you're using, go to documentation paths and press one of the "+" buttons on the bottom. The picture shows how to add a link to the Internet documentation, but with the other "+" button you can add the local documentation you downloaded (which will be faster to access). The path you specified seems correct.

Related

Kotlin Script: Import class across directories/packages

I'm new to Kotlin so forgive me if this is an easy question. I'm writing a kotlin script that I hope will utilize a custom Hashtable implementation to store data from a file. I'm having trouble getting the script to find the HashTable class.
Here is my structure:
.
├── scripts
│   ├── kotlin
│   │   ├── [other scripts]
│   │   └── wordcount.kts
│   └── tests
│   └── wc
│   └── smallfile.txt
└── src
├── main
│   └── kotlin
│      └── dataStructures
│         └── HashTable.kt
└── test
The script is wordcount.kts and the class I'm trying to import is in HashTable.kt. I tried import dataStructures.HashTable and import kotlin.dataStructures.HashTable to no avail. I also tried adjusting the PWD (in IntelliJ runtime configuration) to the project directory, also with no luck. How do I import HashTable correctly? Let me know if I can provide any further information!
import is used to link to things that are on your classpath, so before you can use that you need to allow the compiler to actually find that HashTable class.
You have a couple of options, I would however recommend to rename wordcount.kts to wordcount.main.kts (kotlin script requires the executable to be named x.main.kts for most features to work), HashTable.kt to HashTable.kts and link it with #file:Import(<path-to-hashtable.kts>).
If you can't rename the hashtable you will need to import it either by compiling it to a class file and adding it to the classpath with kotlinc -script -cp <dir-with-.class> wordcount.main.kts. Or compile to a jar and link the jar with #file:DependsOn<path-to-jar> in the script.
For the reference to all this stuff, look here: https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md

Cucumber runner not needed anymore?

Quick question - since when Cucumber doesn't need any separate runner class with steps glued etc? Nothing else is needed currently after adding JUnit dependency to pom.xml? I've just setup a simple project and as I can see nothing besides chromedriver, step definitions, feature files and Selenium/JUnit/Cucumber dependencies is needed. Was it always like that? Because I remember these projects were uneasy to setup because of that class and few other things. Was I just stupid back then, or did something change and it's easy now?
Quite a few things have improved! Just not the thing you mentioned.
When you are using the CLI (either directly or through IDEA) Cucumber will search the entire class path for step definitions and feature files. This means that things usually just work.
To integrate with JUnit4 you will still need a runner class. However unless you tell it otherwise with #CucumberOptions the runner class will look for features and glue in the package and subpackages it is in.
So if you put everything in the right group and in the same package no additional configuration is needed. You should make use of this!
There is a little gotcha when using maven. If you put your feature files in the src/test/java folder, maven won't copy them to your class path. Features should always go into src/test/resources.
~/Projects/cucumber/cucumber-jvm/examples/calculator-java-junit4$ tree
.
├── pom.xml
└── src
├── main
│   └── java
│   └── io
│   └── cucumber
│   └── examples
│   └── calculator
│   └── RpnCalculator.java
└── test
├── java
│   └── io
│   └── cucumber
│   └── examples
│   └── calculator
│   ├── RpnCalculatorSteps.java
│   └── RunCucumberTest.java
└── resources
├── cucumber.properties
└── io
└── cucumber
└── examples
└── calculator
└── basic_arithmetic.feature
You can also do the 10 minute tutorial to get a fresh start: https://cucumber.io/docs/guides/10-minute-tutorial/

How we could configure icons image for a new document format in webtop?

I am using webtop 6.8.1 , CS 7.2.
I need to add one new Document format say .xyz. I have added it successfully.
But when such Document is listed, its icon is not getting shown correctly, while for other formats like pdf or gif it is showing correct icon.
do we need to add any gif in war file theme/icons folder?
You can add custom icon for any format.
Icon images should be in GIF format and should be present in two dimensions: 16x16 and 32x32 pixels. Both GIF files should be located in webtop/custom/theme/documentum/icons/format folder and named using this pattern: f_formatname_XX.gif where:
formatname - is a value of the name attribute of the dm_format object
XX - is an image size with possible values 16 and 32
For example we had on our past project icons for Jasper Reports and InfoPath XML files in this structure:
webtop
├── custom
│   └── theme
│   └── documentum
│   └── icons
│   ├── format
│   │   ├── f_jasperreport_16.gif
│   │   ├── f_jasperreport_32.gif
│   │   ├── f_xmlinfopath_16.gif
│   │   └── f_xmlinfopath_32.gif
...

Do you use express.static(‘public’) OR (path.join(__dirname, ‘public’))?

My tree:
├── app.js
├── data
│ └── stuff.json
├── package.json
├── public
│ ├── index.html
│ ├── main.js
├── routes
└── api.js
Below are two lines I’ve used in my app.js file in order to serve the static file public/index.html
This first option works fine. As I understand it, it directs the user to the public directory relative to app.js:
app.use(express.static('public'))
The following second line doesn’t work. As I understand it, this is the absolute path to the public directory.
app.use(express.static(path.join(__dirname, 'public')))
The https://expressjs.com/en/starter/static-files.html seems to suggest the first option, yet most web sites and books encourage the second. Why/When is the second encouraged? And why doesn’t it work for me in this case?

Conditional loading of Dojo modules

Let me first present directory structure of what I have
/
├── dojo/
├── dojox/
├── dijit/
└── app/
├── a/
│ └── moduleA.js
├── b/
│ └── moduleA.js
└── c/
I'm trying to configure Dojo to be able to load moduleA.js in following way:
require(["app/moduleA"]
and in the same time resolve it according to below pseudocode:
if moduleA exists in c
load "app/c/moduleA.js"
else if moduleA exists in b
load "app/b/moduleA.js"
else if moduleA exists in a
load "app/a/moduleA.js"
else
standard fail, same as when no module is defined
It would be great if order a, b and c could be passed as array for instance ["app/c/moduleA", "app/b/moduleA", "app/a/moduleA"].
I was looking into documentation hoping to find something, but no luck. https://dojotoolkit.org/reference-guide/1.7/loader/amd.html#module-identifiers was closest I got. There is packages.location property, but it takes string to load module, so I guess it has no additional logic regards to arrays.
Any idea how to solve this problem?