IntelliJ + unbound namespace in html files

353 views
Skip to first unread message

Mathew de Detrich

unread,
Jun 15, 2011, 6:11:40 AM6/15/11
to Lift
I believe I am getting the same error message here (http://
groups.google.com/group/liftweb/browse_thread/thread/a8b91799604f79ad/
3ac947cbf1e70f5b?#3ac947cbf1e70f5b) where basically the index.html
files in IntelliJ (when used with Lift) complain about an unbound
namespace error when using IntelliJ's Web Facet

Just using the basic lift-basic package (Lift 2.3 with Scala 2.8.1),
in the file /src/main/webapp/templates-hidden/wizard-all.html,
IntelliJ says that 'Namespace 'wizard' is not bound. I believe this is
an issue due to the fact that the IntelliJ Web Facet plugin simply
does not detect these namespaces, obviously it needs to be reported
somewhere however I am not sure where (it might have to be fixed by
creating a 'lift' plugin for IntelliJ, it might technically not be a
'bug')

dave

unread,
Jun 15, 2011, 1:32:19 PM6/15/11
to Lift
I think you're right that this is the lack of a feature instead of a
bug. I've seen at least one report that the next version of the Scala
plugin will be more Lift-aware. But I cannot confirm it.

I fixed these by binding the namespace myself. In the topmost element
of your .html file, you can add the xmlns:lift attribute. For your
wizard template, you can also add xmlns:wizard.

For example, my wizard-all template starts with:
<lift:Children xmlns:lift="http://liftweb.net" xmlns:wizard="http://
liftweb.net/wizard">

Now the resources themselves will get a red highlight, but there's an
intention auto-correct thingie which you can use to basically tell
IntelliJ to ignore the external resource (or something like that; it's
been forever since I've done it).

Alternatively, there's probably a way to disable the check entirely.

I know this works when using XHTML with no ill effect; I haven't tried
it with HTML 5.

The only annoying side effect is that the xmlns: bindings remain in
the final generated HTML. These have caused me no harm... so far.

Hope this helps,
dave
<><

Mathew de Detrich

unread,
Jun 15, 2011, 9:50:34 PM6/15/11
to lif...@googlegroups.com
Since this namespace stuff is specific to lift (in the sense it has nothing to do specifically with scala, but the fact that a scope containing the namespace from scala projects needs to be applied to the xhtml files) this should be probably done as a seperate lift face instead of in the scala facet. The scala facet should strictly deal with only scala related stuff, and these things are specific to the lift framework

<><

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.


Reply all
Reply to author
Forward
0 new messages