-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help to convert tutorials to running programs within a project #80
Comments
This looks more like a stackoverflow question, could you post the link to the question here? |
@reactormonk I considered Stackoverflow because I'm probably missing something basic, but my question is specific to the content of this tutorial. In my opinion, tutorials should provide enough information for anyone to run them, even novices. |
@etorreborre Here is my build.sbt file. As you can see I include those compiler plugins. I still get the error.
|
@reactormonk I posted a question on Stackoverflow here: http://stackoverflow.com/questions/42894647/converting-tutorial-to-a-running-program-in-intellij-idea |
@russellcameronthomas I pasted your program into ammonite shell and it worked just fine. I don't know how you're building your project, but I highly suggest you ditch IntelliJ (for builds) because of issues like this one exactly. The reason why IntelliJ cannot figure out your code in particular looks to be because IntelliJ is not capable of simulating implicit-directed type inference; the Member implicits have a type member, More to the point: you can fix this by calling |
@edmundnoble Thanks for all this info. Yes, your explanation makes sense, at least to the degree that I understand "implicit-directed type inference". Regarding your "fix", can you post the exact code? At this point, I don't care at all about being verbose or adding boilerplate. What I care about is getting code that runs, so I can learn from it through incremental modifications. As for "building my project", I entered the build.sbt file, as shown, and then I clicked the "run" button in IntelliJ-IDEA. |
I have resolved my problem -- to a degree. The IDE still shows the error highlighted, as described above. But instead of directly running the App object, I clicked I'm not happy about this, but at least it runs. Thanks for your help. @etorreborre : It would be nice if you added a paragraph or two to your Tutorial on "How to run the Tutorial in an IDE" Context: One of my strong values is that we should be helping novices not just experts in what ever language, libraries, and tools we are using. When I write tutorials (e.g. Probabilistic Programming http://library.meritology.com) I do my best to serve novices as well as experts. |
@russellcameronthomas I am glad you found the issue to your problem. I must also say that my open-source time is fairly limited. For instance I spent a good chunk of my week-end reworking interpreters to make them easier to understand in the next release. I would love to have more time to add more detailed tutorials but there's only so much I can do as an individual 😸 (this is not my only open-source project). So please if you like the library and think the doc should be expanded, make a PR, the 2 paragraphs should probably be added here. |
@russellcameronthomas btw the intellij issue you see about highlighting is something I frequently get with "type-aware" highlighting. I have been unchecking this option for at least the past 3 years now :-(. |
@russellcameronthomas Ah ok, the issue was the assumption that when intellij tells you something doesn't compile, it won't - I just skip directly to the underlying scala compiler and wouldn't call it "it doesn't compile" but "intellij doesn't think it compiles". |
I am closing this for now, I hope the current issue + the paragraph added by @reactormonk will help. Let's re-open if that's not the case. |
I am relatively new to Scala (with Java background) and I am teaching myself Functional Programming. I am working my way through your tutorials.
My problem is that I am only able to get them running through the command line REPL. I have been trying to take the (simple) step of inserting each of the tutorials into a file within IntelliJ IDEA so that they print results to the console. My problem is they won't compile without errors, and I don't know why.
For example, taking code from the "Introduction" here is the file I have created:
The compiler error is in the last line: "Cannot resolve symbol 'run'". I have tried many other approaches and structures, and they all give this error, or some other "Cannot resolve..." error.
I have already tried the "clear cache" fix, with restart of IntelliJ IDEA.
Can anyone help?
The text was updated successfully, but these errors were encountered: