Comments (5)
Hi. Oddly enough, that is correct behavior. <int>
It is a StringTemplate expression referring to an attribute called int
using the default angle bracket delimiters.
from jetbrains-plugin-st4.
Then why doesn't StringTemplate interpret it as such? I get no "undefined attribute" warning and
typeMap ::= [
"list\<int>": "std::vector\<int>",
"list\<long>": "std::vector\<long>",
"list\<float>": "std::vector\<float>",
"list\<double>": "std::vector\<double>"
]
doesn't work as expected (<if(typeMap.(attribute))>
evaluates to false when attribute == "list<double>"
).
If I change my template to:
typeMap ::= [
"list<int>": "std::vector\<int>",
"list<long>": "std::vector\<long>",
"list<float>": "std::vector\<float>",
"list<double>": "std::vector\<double>"
]
Then the backslashes appear in the output.
So this is either a bug in StringTemplate itself or in the plugin.
from jetbrains-plugin-st4.
It is because of lazy evaluation. bad attrs can only be detected at ST exec time. Those are usueble as templates not just strings...maybe that is the source of confusion. Hmm...let me verify strings can be templates.
from jetbrains-plugin-st4.
Ok, in that case both the highlighting and StringTemplate's behavior would make sense. It's still very confusing, though.
from jetbrains-plugin-st4.
@Moritz90 I think that this is because the key is just a plain string but the value is interpreted as a template.
from jetbrains-plugin-st4.
Related Issues (20)
- Error markers have no tooltip HOT 5
- Auto-closing paired symbols HOT 13
- Color settings page HOT 3
- Highlight missing <endif> HOT 4
- Show templates in symbol search
- Support `.st` files HOT 4
- Does not work with IntelliJ 2020.1 HOT 7
- Setting custom delimiters doesn't work with new highlighting HOT 8
- Double-click word selection is broken HOT 8
- Tab-to-indent does not respect indentation settings HOT 4
- Word Autocompletion
- Surround With
- Live templates
- Escaped delimiters are reported as errors HOT 1
- Bug: common NullPointerException in StringTemplate v4 (0.8) plugin in IntelliJ IDEA 2020.3 IDE HOT 1
- Support selection on plain text words, by double-click, as well as only template words HOT 4
- NullPointerException after update to 0.9 HOT 7
- Syntax highlighter breaks down on XML namespaces: mismatched input '=' expecting LPAREN HOT 3
- String template plugin in Rider (2022.3.1) fails to open template file (infinite spinning wheel) HOT 4
- IntelliJ 2022.3.x NullPointer on startup with ST4 plugin 0.9 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetbrains-plugin-st4.