-
Notifications
You must be signed in to change notification settings - Fork 59
Add Unified Expression Language (EL) and include it in JSP #65
Conversation
Here are a few EL examples from the oracle page: http://docs.oracle.com/javaee/6/tutorial/doc/bnaim.html#bnain |
@@ -0,0 +1,94 @@ | |||
'scopeName': 'source.java.el' | |||
'name': 'Unified Expression Language (EL)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a grammar that someone will ever want to explicitly choose in the Grammar Selector? If not, this line should be removed.
@@ -0,0 +1,94 @@ | |||
'scopeName': 'source.java.el' | |||
'name': 'Unified Expression Language (EL)' | |||
'fileTypes': [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
'fileTypes': [] | ||
'patterns': [ | ||
{ | ||
'include': '#el' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just include all the patterns here directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The primary new feature of JSP 2.1 is the unified expression language (unified EL), which represents a union of the expression language offered by JSP 2.0 and the expression language created for JavaServer Faces technology
-- https://docs.oracle.com/javaee/5/tutorial/doc/bnahq.html
Meaning the unified el grammar could also be useful outside of JSP in a JavaServer Faces (JSF) context. Therefore I thought a separate grammar would make sense although no JSF language package exists yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does #el
only contain the expression language up to JSP 2.0? And that perhaps in the future someone may add support for JSP 2.1 in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups, I mistaken the code snippet for something else and comply misunderstood you. 🙈
Ignore my first comment. You are right, it makes no sense to include everything like this. I probably just copied this from some other grammar without understanding what exactly it meant.
Also yes, specs will be required for this PR. I think some basic tests for each pattern should suffice. |
This implements atom#64. Since Version 2.1 JSP includes the Unified Expression Language (or short EL). Because other technologies (like JSF) use EL as well, the EL grammar is added as its own language file.
...since the grammar should only be used in an embedded context
@50Wliu rebases against master, fixed your remarks and added specs. |
This is my attempt to implement #64.
Because other technologies (like JSF) use EL as well, the EL grammar is added as its own language file.
There are a few things I am unsure about:
source.java.el
a good scopeName?The problem I see is that snippets, autocomplete providers and alike which are intended to work with Java will also apply to EL.
Some JSP code I used for testing: