This relates to the go language plugin (version 0.9.15.3) for IntelliJ IDEA.
I have a directory structure in the following format:
src/
fred/
fred.go
bill/
bill.go
In (say) bill/bill.go, I import fred.go, and the compiler picks up references to fred.Something (when run from the command line).
But IntelliJ IDEA does not recognise the references to fred.Something; they come up in red, and actions such as 'go to definition' do not work.
Is there anything I can do to make this work?
I don't want to upgrade to the alpha version of the plugin if I can help it, unless it is stable (in which case, it should not be alpha).
Please don't use 0.9.15.3. The latest plugin should work properly for your case, if not please open a issue.
To get the latest plugin, please follow the instructions from here: https://github.com/go-lang-plugin-org/go-lang-idea-plugin#pre-release-builds
Related
Hi everyone I am new to IntelliJ in general and especially to Gradle and I feel like a total noob. :D
Im not sure if this is a Kotlin DSL thing or if I just do it the wrong way and it wouldn't work in Groovey either.
After hours of trial and error and reading other SO posts I'm still not able to install a simple dependency... it can't be that hard...
Currently I am playing around with Jetpack Compose for Desktop even though it's still in alpha and it works but for the love of god I am not able to add a dependency.
So here is my Problem:
I try to install the dependency like they say I should in
https://developer.android.com/jetpack/compose/navigation#kts
and yes I know it's an android package so it may not compile or it may crash during runtime but shouldn't it at least find and download the dependency???
So... if I add
implementation("androidx.navigation:navigation-compose:2.4.0-alpha10")
to my build.gradle.kts
And try to compile it I get an exception during the build process:
What I tried so far:
I checked if the repository maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
who is configured in my build.gradle.kts repositories-section and in my settings.gradle.kts pluginManagement-section contains the package that I want.
The site https://mvnrepository.com/artifact/androidx.navigation/navigation-compose?repo=space-public-compose-dev tells me, that the repository contains the package that I need.
I checked the error log itself.
But I don't relly know what it tries to say.
I use Java SDK16, since I expect downward compatibility and the fact that the dependency is still in alpha I assume it should be compatible.
I use Kotlin 1.5....
that's it.
Thanks for reading all that :) I really appreciate your time... If I forgot some crucial information let me know and I will add it as soon as I can.
the problem which I feel is, is you are basically opening the wrong file. (I don't use jetpack compose so the answer might differ)
on the top left corner in the image, where there is project dropdown, open it and select android.
now there will be a different set of files in the Gradle folder, in fact, there will be 2 different files in that folder.
build.gradle (project: <project_name>)
build.gradle (Module: <project_name>.app)
open the second file and there will be dependencies copy + paste implementation code there.
the file which you have opened is actually the first file.
Well... here I am back again answering my own question.
After I switched to the terminal in IntelliJ Idea (which to be honest I could have thought of that prior to posting my question) there was highlighted text that gave me the necessary insight, why it wasn't working.
And after some searching the web in order to find out what an "aar" file is and why I didn't get a jar file like I expected it turns out that android has it's own little file format for android applications and that those cannot be used in regular java/kotlin projects.
I read somewhere, that 'aar' files contain a jar file and some other stuff and extracting the jar file from the aar file may be a way to get it working, but it didn't fix anything, maybe because the dependencies of the navigation package are aar files as well and therefor I'd need those packages as well and extract the jar file from those as well and it all seems like this isn't the right way...
So I guess I have to wait until Jetpack Compose for desktop somehow is able to use aar files or until the repositories deliver the packages in a regular jar file.
I encountered the following issue. I have four Cucumber feature files in IntelliJ. I added the Cucumber support via the IntelliJ plugin. After creating my features I edited my configuration like followed so i can execute the feature files.
Glue should be the name of the package the step definitions reside in. In my case the package is called stepdefinitions.
The following image shows what my project structure looks like. The feature files reside in /src/test/resource/features while the stepdefinitions are stored in /src/test/java/stepdefinitions.
Sadly when I try to run the cucumber features with the step definitions I get prompted "You can implement missing steps with the snippets below:" But I already did this. I already copied those snippets to the step definition files. When I hover a scenario IntelliJ tells me *Unimplemented Substep Definition".
Those two things lead me to the conclusion that IntelliJ does not find my step definitions. Maybe one of you knows what I am doing wrong.
I finally found the solution to my question. The error was caused by a plugin called Substep IntelliJ Plugin. You need to search for it in the IntelliJ Plugin Section and disable or deinstall it.
Try 'Invalidate cache and restart'. It worked for me - something the plugin gets stuck.
Disable the Cucumber plugin to avoid collisions over feature file association, install the Substeps plugin. See http://substeps.github.io/ for more docs on how to use the Substeps BDD framework alongside downloading a sample starter project from here: https://github.com/Substeps/substeps-example/archive/1.1.zip
Image of the errors
I don't how to fix this red underlines I recently got in my routes files.
What I did:
I split up my routes files into 3 files:
- routes
- rest.routes
- web.routes
And after I did, IntelliJ said something about "We have a new program that can handle .routes files" and I clicked yes to it. <-- Stupid me :(
Can also mention that I cant remember what addon that was installed, and I cant find any addons that differs from previous versions.
Before there was no "spellchecking" on the file, but now I get this box in top of the file saying "Project SDK is not defined 'Setup SDK' ". It also gives the red "undelining" similar to spellchecking under every single line of code in the file.
The code itself works great, its just very frustrating to have these red lines everywhere.
Anyone know how to get rid of it?
Highly appreciated!
IntelliJ 2017.2 and Play Framework 1, I had this problem one day. Took me awhile to figure out but it was the Scala plugin that made this fail for me. After uninstalling the Scala plugin it works again.
I also faced similar issue recently. The plugin that Intellij asks to install in this case is Erlang. You just have to uninstall it (or just suppress the warning).
To uninstall Erlang go to Preferences.. -> Plugins. Then search for Erlang and select. Then click uninstall (on the right pane).
First, setup Java SDK (even if you use scala)
Second, try to compile code (run play application) and recheck routes files. I suggest that IDEA use compile routes classes to verify config.
Third, check syntax of your conf/routes . Are you sure want use -> ?
I am attempting to use an external diff tool (Beyond Compare) to compare folders in Intellij IDEA 13 (EAP Build #IU-133.471).
Settings
My Intellij IDEA settings are as follows:
Documentation
Relevant documentation for BC : here and here
Intellij IDEA's doc on the subject : here
Herein Lies the Rub
And here is what happens when I select two directories and press Ctrl + D (the shortcut to Compare Directories) :
The same works fine when comparing files:
I have attempted using the current stable version of both Beyond Compare (v3.0) as well as Intellij to no avail. I have had no joy after appending the parameters %1 %2 etc. to the Path to Executable either.
Can you think of what I might be missing ? Have you used an external diff tool to compare folders in Intellij IDEA ?
Am planning to ask this question in the Intellij forums and/or raise a Support Ticket with them after waiting to hear back from the SO community.
Thanks!
Update
Question now present in the Intellij IDEA forums too : http://devnet.jetbrains.com/message/5506980
This seems to be a bug in Intellij.
See this.
Update (9-Nov-2015)
I am using Intellij Idea v 14.1.5 and can confirm that this bug has been fixed.
I really like the IntelliJ plugin "Compare Directories" I have used it since IntelliJ 13.
Here's the plugin's home page: http://plugins.jetbrains.com/plugin/?idea&id=113
Once installed, the tool can be used by right clicking a directory or package and then setting the directory structure to compare against. This tool includes directory and file level comparisons.
I have a Scala Play project. I'm using Play 2.2.1. I downloaded Scala, Play 2 supported and SBT plugins. Everything is OK, but When I call route on Action in the Controller appear following error(Look screenshots):
I'm using IntelliJ IDEA 12.1.6 Ultimate version. Scala version 2.10.2
Anybody know how to fix this problem?
Thanks in advance!
Edit
When I generate my project to Intellij IDEA via "play idea" command in play console, and I opened project in IDEA project structure was such:
Then I saw answer #millhouse and discussing on this githup([Play 2.2] "play idea" creates not working source mapping in target) and I removed following folders from Sources Folders:
target\scala-2.10\src_managed\main\controllers
target\scala-2.10\src_managed\main\views
and "Report highlighting error" disappeared, but now there is another error:
and
my route:
And I've changed "Sources Folders" as shown below:
But it doesn't help me. And remains "Unspecified value parametrs" error.
millhouse's answer helped me find the right answer. Play 2.2 (and perhaps earlier versions, haven't checked) output a scala version of the routes file to project_dir/target/scala-2.10/src_managed/main So for IntelliJ to get the highlighting right you need to make sure that src_managed/main is added as a source folder. The reverse routes for javascript are for some reason included in project_dir/target/scala-2.10/classes_managed so you'll have to add that as well. (In your screenshot it looks like classes_managed is set to excluded so you'll want to un-exclude it by pressing the x button on the right hand side.)
Here's a screen shot of my project structure:
Update:
In Play 2.3 (or perhaps recent versions of IntelliJ) adding the classes_managed no longer fixes the problem. Instead of adding classes_managed to the project's sources add it to it's dependencies. By doing that IntelliJ should be able to pick up the compiled routes.class.
This is a common problem, it's because IntelliJ needs to be shown where to look for the compiled Scala templates and routes file. Here's how I fixed it on my IntelliJ 12.1 installation:
Go to the Module Settings for your project in IntelliJ (select the top-level, hit F4)
Choose the Modules item in the Project Structure window that appears
Select the projectname item (as opposed to the projectname-build item)
Add the compiler's output directory to the Source Folders items;
For Scala 2.10 it's target/scala-2.10/classes
I personally find the IntelliJ UI for this to be very non-intuitive; you might need to take the target directory and/or one of its subdirectories out of the Excluded Folders first
After applying that change, IntelliJ should see the results of compiling each routes and .scala.html file as just-another source file, so they won't show as "broken" and auto-complete should work for them.