[C#] embed SQL instead of using with_prototype#4416
[C#] embed SQL instead of using with_prototype#4416keith-hall wants to merge 1 commit intosublimehq:masterfrom
Conversation
|
Are you going to do long string and/or long format string as well? |
|
Probably we will want to extend the SQL syntax for C# embedding and add some string formatting contexts for those, it isn't quite as straightforward. I agree that it needs to be done, probably this PR doesn't bring much benefit without it... Maybe a job for my next chunk of spare time 😅 |
|
I'm not sure if you saw that my "Ripping SQL out of C#" comment on SublimeText/PowerShell#213 was accompanied by SublimeText/PowerShell@cf8df09 that actually does so when embedding the C#. I don't know how valuable it is to PowerShell users to have the fancy SQL embedding in their C# strings. And it's not like they're losing something they were used to. So no pressing need. |
| embed: scope:source.sql | ||
| escape: (?=""") |
There was a problem hiding this comment.
| embed: scope:source.sql | |
| escape: (?=""") | |
| embed: scope:source.sql | |
| escape: (?=""") | |
| pop: 1 |
|
Extending and embedding SQL pro:
contra:
FWIW, I also have a Python (and C#) branch with SQL embedded insead of being included. Current Python with SQL included is about 1.5MB. Embedding SQL shrinks Python to 150kB, but increases whole package's syntax cache size to about 7MB. It is however the more bullet proove solution, regardless overall size, unless any other syntax pushes C# (or Python) using |
|
For those looking for some inspiration ... https://github.com/deathaxe/sublime-packages/tree/pr/cs/embed-sql Current C# is about 1.4MB of size. With SQL embedded (3x), each SQL is of about 1MB of size + C# using about 740kB. |
|
Are caches generated for embedded syntaxes whose activating pattern is never encountered? |
|
Not until they are loaded, which they are when running syntax tests. Comparing cache sizes, may primarily indicate how good ST can dedup or re-use existing patterns to achieve a certain kind of highlighting. The larger caches are the more distinct patterns are involved, which may also increase RAM usage. It may however also be of no sense, to compare them. |
|
See also #4464 |
SublimeText/PowerShell#213