I am trying to learn Kotlin by following the tutorial. I managed to get the plugin installed in Intellij. But I am not able to get the first exercise to run. When I click on the little checkbok it tells me
Failed to launch checking. See idea.log for more details.
(I created another blank project and type the same simple exercise in a scratch file and it works.)
link to docs
Try to check the project's is linked to the right JDK. Open File/Project Structure/Project. Then select the correct Project SDK.
To me, this helped. But as others have pointed out, please, share your idea.log, which you can find at Help/Show log in [whatever text editor it's associated with].
Related
Update: Known IDEA issue: https://youtrack.jetbrains.com/issue/KTIJ-10228. Thanks #somethingsomething for the pointer.
I'm learning Kotlin and in one of the examples, there's the following code:
listOf("carrot", "cheese", "chocolate")
Putting it in IDEA and following up listOf source (control/command + click) leads to:
Which is very nice. I can see actual source code and learn from the origin. But!!!
When further clicking on asList leads to:
But here, there's no source code. Dead end :(
The expect keyword means that the actual implementation is platform dependent.
Is there a way to look up the code, connecting it to IDEA? For example, if I'm on a Mac, how do I see the local implementation and connect it to IDEA using control/command + click? Thanks.
I've searched for similar questions in SO. Found some related to dependency definitions in pom to see the source code instead of decompiled code. My problem is different. I actually see the source code - not any decompiled code. My specific problem is that not all source code is shown. Specifically missing the platform dependent source code.
IDEA version:
IntelliJ IDEA 2022.1.1 (Ultimate Edition)
Build #IU-221.5591.52, built on May 10, 2022
Coming from Eclipse world, I really miss this important feature where Eclipse suggests if particular package needs to be imported for compilation error
e.g.
new ArrayList , this simply says Can't resolve symbol
'ArrayList' but doesn't suggest which package to import like eclipse
does.
Is this bug with IDEA or some setting needs to be done in it ?
[Solution]
The problem turns out be bad UX from IDEA
If user does mouse over, it show error message as per above screen shot
If user puts mouse somewhere else; it suggests package to import sometimes. It's not as friendly as Eclipse though
I've posted answer in bottom part of question. IDEA has got confusing & not so user friendly UX which gives hints about package to import.
I find it more useful in Eclipse, hope IDEA team will fix this
https://www.jetbrains.com/help/idea/auto-import.html
Im trying to find a way to run my grails unit/integration tests in vim without having to leave my editor. Is there a good plugin for that? I took a lot of tips from here http://www.objectpartners.com/2012/02/21/using-vim-as-your-grails-ide-part-1-navigating-your-project/ but I dont want to have to switch to just see the output.
I tried it with a keymap but grails has to start up each time. Any ideas? How do you guys do this?
I also found this https://github.com/hoffoo/vim-grails-console but couldn't get it set up properly.
Thanks!
I've started to use Tim Pope's vim-dispatch plugin to execute tests in a shell and then report the results back to vim. You can see my version of executing a grails test in my dotfiles repo, specifically, in grailsScripts
In order for the plugin to report back to vim, you need to set an errorformat. I've battled with vim's errorformat for quite awhile and ultimately landed on using a combination of reformatting the output with a groovy script and using errorformat to highlight file paths. The result is that you see the entire grails output in the error list, but can hit enter on lines with file paths and go to the line in question. It's not perfect, but it works.
If you are interested in using that method, you'll want to also get the following files from my dotfiles:
.vim/tools/filters.groovy
.vim/compiler/grails.vim
Note that these scripts work in my setup, but I haven't made them into a plugin yet, so your mileage may vary. I hope it helps!
Is there tool that will give me a detailed report on number lines each file/class in project has?
I tried CLOC. All that I get is that the project level and that is nice to start with. I want a detailed drill down on each class. Do we have any open source tools that will do this for me?
I recommend using sloccount, you will get the LOC by directories and files as expected. You won't be able to have the LOC by class however.
If this limitation is ok, just use the --details flag in the command line you are using, for example if you run the sloccount command in the root directory of your Xcode project::
sloccount --duplicates --wide --details YOUR-TARGET-NAME
The output is a bit hard to read but you will get all the information you need.
If you want to have a nice report and be able to drill down in the directories/files via a HTML report, I suggest using Jenkins. Just install the 'Jenkins plugin for sloccount' via Jenkins UI.
You can see how to setup it in this blog article (disclaimer: I am the author). You will also be able to see examples of such reports.
I use Xcode Assistant...
Download here...
i was looking for a good open source metrics counter for Objective C for a long time... i didn't find any yet...
you can use ProjectCodeMeter http://projectcodemeter.com, but it's not free... hovever the trial version works for 3 months and when it ran out i installed it on my laptop and got another 3 months :)
I only find Xcode Statistician at http://www.literatureandlatte.com/freestuff/index.html
I've been playing with Sublime Text 2 the last few days and was wondering if anyone out there has had any success getting Cocoa method completions working yet? Is there a plugin (or in-progress project to create one) out there?
Any general comments on using Objective-C in Chocolat or Sublime Text 2 would also be welcome.
There is an in-progress Sublime Text package that connects to clang to get autocomplete data called SublimeClang I've not managed to successfully get it to work totally with Cocoa/UIKit Dev, but here's a screenshot
and my options, that are a start
In MacVim I use a plugin called Cocoa.vim which haves useful python scripts that generates a classes and methods files for autocompletion. I didn't try so much with ST2, but may be is posible to create a sublime-package or sublime-completions file with all this data.
For the moment, I only create a sublime-completions file with some snippets. If I find a way to make this work, I will tell you.
I let my SublimeClang configuration options if helps anybody. I've already some of the autocompletions working:
"options":[
"-Wall",
"-isystem", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/",
"-isystem", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/c++/4.2.1/",
"-I/usr/lib/clang/3.1/include/**",
"-I", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/",
"-arch","armv7",
"-isysroot", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk",
"-D__IPHONE_OS_VERSION_MIN_REQUIRED=50000",
"-ferror-limit=0"
]
Answering my own question here. A quick visit to the Sublime forums didn't turn up any leads nor did Google. It looks as though method completions for Objective-C aren't currently part of the default install nor available via 3rd-party quite yet.
This user http://b.rthr.me/wp/?p=368 claims to have gotten SublimeClang working. I may report back myself once I try it...