I am new to Scala and IntelliJ IDEA. I am learning Lift from Simply Lift examples. I have setup my IDE as per instructions provided here. I am using Maven based approach.The Scala plugin is versioned (0.4.1084 -- latest as of June 30, 2011). IntelliJ IDEA version is 10.5.
The archetype is
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank_2.8.1 \
-DarchetypeVersion=2.3 \
-DarchetypeRepository=http://scala-tools.org/repo-releases \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=com.company \
-DartifactId=lift_test \
-Dversion=1.0
When I started coding the Snippet and Sitemap example. I see IDE show error (and nasty wavy line below the code) at the following line
Menu.i("Info") / "info" submenus (
Menu.i("About") / "about" >> Hidden >> LocGroup("bottom"),
Menu.i("Contact") / "contact",
Menu.i("Feedback") / "feedback" >> LocGroup("bottom")
),
The error says,
Expression of type (Menu.Menuable , Menu.Menuable with Menu.withSlash,
Menu.Menuable) doesn't conform to expected type ConvertableToMenu
However, when I run a Maven > Install or Compile 'Boot.scala from IDEA they seem to run without error.
I am having hard time on getting Scala/Lift working perfectly on either of the two IDEs, IDEA and Eclipse.
Please let me know what am I missing?
I have added a bug report, you may see it here http://youtrack.jetbrains.net/issue/SCL-3429?projectKey=SCL
The plugin is still under development. Good code red and bad code green are both issues that arise in every day usage. If you want to help with the development of the plugin, please file a bug report with a short example demonstrating your issue.
http://youtrack.jetbrains.net/issues/SCL
Related
I've added a REPL (read eval print loop) to may Java project1 which is build with maven. The REPL can be started with a script. The relevant parts are
declare -r GRADLE_CLASSPATH="$(gradle :minidns-repl:printClasspath --quiet |tail -n1)"
java \
-Dscala.usejavacp=true \
-classpath "${GRADLE_CLASSPATH}" \
scala.tools.nsc.MainGenericRunner \
-i minidns-repl/scala.repl
This works so far. The only thing that is missing which would make the REPL perfect is tab completion. I know from Scala that it does support this.
How can I enable it for MainGenericRunner?
1: Feel free to test the REPL:
git clone https://github.com/rtreffer/minidns.git \
&& cd minidns \
&& ./repl`
Then perform a DNS query, e.g. c.query("wikipedia.org", TYPE.A)
Although current scala repl has autocompletion feature right now it is not working very well. (that's aside the issue mentioned by som-snytt).
If you need the working completions in repl you best bet would be Ammonite REPL which also has some more features then the standard repl.
NOTE: I haven't tested tab completions in 2.11.8, but it looks like they had been rewritten from scratch and are looking very promising.
There's a known issue with the way -i is handled, that breaks completion.
There's also a fix pending, but I don't if it will get into 2.11.8, which also has an entirely new completion feature.
I have run into a weird situation. I have an application which was originally developed in RAD and uses a construct like
rendered="#{bean.show and user.can('foo')}"
Our developers use mix of RAD and Eclipse Juno / Kepler. So we need to make the code work in both the environments.
In RAD, the above line does not generate any errors. When I export the project as archive and import it into Eclipse Juno, it generates this error
Cannot apply expression operators to method bindings
Our environment is Websphere 8.5, RAD / Eclipse, JSF 2.1
How can I fix this?
In general, if you face a false EL validation error in a JSF file in Eclipse, try peeking around in Window > Preferences > Web > JavaServer Faces Tools > Validation and tune some settings currently (unnecessarily) set at Error.
Your particular problem is triggered by "Applying operator to method binding" which indeed defaults to Error. If upgrading Eclipse to most recent version is somehow not an option, setting it back to Warning should tone down it.
After all, EL validation in Eclipse is quite an epic fail. It seems like it's using regular expressions to validate EL syntax instead of a true stack based parser like as EL itself is doing. There are several entries below "Type Coercion Problems" and "Type Assignment Problems" which are unnecessarily set to Error and known to cause false errors.
See also:
Method must have signature "String method() ...[etc]..." but has signature "void method()"
Eclipse errors on #{component.valid}: "valid cannot be resolved as a member of component”
I had the same error with any of these statements:
<h:panelGroup rendered="#{!bean.isValid(obj)}">
<h:panelGroup rendered="#{not bean.isValid(obj)}">
I resolved the error by changing the statement as follows:
<h:panelGroup rendered="#{bean.isValid(obj) == false}">
I found yet another example that resolved the problem:
<ui:fragment rendered="#{bean.isValid(obj) eq 'false'}">
I pulled the 'test-patterns-scala' Typesafe Activator template. Once loaded into Intellij 13.1.5 I right-clicked on the test/scala directory and selected 'Run->All Tests' this returned the output :
0 test class found in package '
There is also a popup which says:
Tests were not found in module 'test-patterns-scala', Use module "test-patterns-scala-build" instead
This is my first stackoverflow post, I searched for similar problems and only found the unanswered link below, however I couldn't up-vote it as a first time poster and the circumstances are a little different so I thought a new question was justified. Any help much appreciated!
Link to similar post: 0 test class found in package ‘<default package>’
I had the same problem a while ago. I got a fix by running 'sbt test' from the command line for the first go (in the project directory ofcourse).
After this the IntelliJ didn't have any problem in identifying the package and ran the test.
This message is also posted on grails mailing list.
In addition to my earlier question I downloaded the grails source from github.
Building via documented gradlew install works (almost) perfect. Than I imported the whole project into Eclipse. And with a bit fighting groovy plugins and "project - workspace-groovy-compiler-issues" I only have a few issues left, all boiling down to java Collection modification in groovy classes. For instance in PluginBuildSettings.groovy:
List<Resource> artefactResourcesList = []
...
artefactResources.addAll compileScopePluginInfo.artefactResources
which gives an error:
Groovy:[Static type checking] - Cannot call java.util.List#addAll(java.util.Collection ) with arguments [java.util.Set ]
I really don't see what the issue may be.
I tried changing the artefactResources declaration in PluginScopeInfo from:
Set<Resource> artefactResources = []
to:
Set<Object> artefactResources = []
which takes away error above, but introduces some other problems let alone the unittests. I'm not hindered with extensive groovy knowledge but it looks all perfect valid to me.
I'm using ggts:
Groovy/Grails Tool Suite
Version: 3.1.0.RELEASE
Build Id: 201210061306
groovy-compiler: 2.0.4.xx -20120921
On mac os x 8.2
java 6.0._37
groovy compiler: 2.0 (workspace and project).
With my favorite search engine I found a reference to grails bug 5516, which is solved but it looks resurected
Type checker fails verification of generic types with addAll
Fixed in 2.0 rc 3,
I want to run the Flex SDK 4.5.1 on Eclipse IDE. I have followed this http://www.seanhsmith.com/2010/03/29/flex-for-free-setting-up-the-flex-4-sdk-with-eclipse-ide/
step by step and it was same as it was written.
But then when i first built my sample code and ran it, it gave me these errors. I cant figure out what the problem is:
This is the sample code:
and these are the ERRORS:
Loading configuration file C:\Mario's Files\STF\Flex SDK\flex_sdk_4.5.1.21328\frameworks\flex-config.xml
_application_Styles.as(24): col: 38 Error: Syntax error: expecting rightparen before s.
[Embed(_resolvedSource='C:/Mario's Files/STF/Flex SDK/flex_sdk_4.5.1.21328/frameworks/libs/framework.swc$Assets.swf', symbol='mx.skins.cursor.BusyCursor', source='C:/Mario's Files/STF/Flex SDK/flex_sdk_4.5.1.21328/frameworks/libs/framework.swc$Assets.swf', original='Assets.swf', _line='194', _pathsep='true', _file='C:/Mario's Files/STF/Flex SDK/flex_sdk_4.5.1.21328/frameworks/libs/framework.swc$defaults.css')]
^
Any solutions?
Do we have to get a compatible Eclipse-FlexSDK-Flash version??
The ' in "Mario's Files" throws off the parser, because it assumes the path ends there. Your folder names should not have a ' in it, ever. Call the folder "Marios Files" and you're fine.
Read up on String delimiters and escape characters, it's knowledge you will need anyway at some point.
This question might also be off-topic.