VS Code custom Emmet output for custom language extension? - vscode-extensions

Is it possible to use Emmet to generate code for a custom language?
If I type
html>body>div
it should expand to something like
[html
[body
[div]
]
]

Related

Code styling without modifying the binaries

On the WebStorm for example and I believe in any Intellij product.
You can easily refeactor the code and style it as you like from the setting 'Code Style'.
But, the styling and refactoring actually change the binaries of the file.
for example if you decide you want new line after { it will add \n in each place.
I want to know if it possible to only visually display those different to the coder.
If I'm coding like this:
var func = function()
{
// Blah
}
And another programmer on the team code like this:
var func = function() {
// Blah
}
and also if I code like this:
var text = "";
and the other like this:
var text = '';
The thing is that I don't really care how it would actually be like in the saved file. I only care how it would be displayed to the programmer.
It is possible to achieve this ?
Simple answer: No. That's because coding rules exist and besides things like changed binaries you have the problem of version control as well. which style of your code should be versioned? While VCS' are able to deal with different line endings, what you ask for isn't supported anywhere.

Object vs Block

I'm building a model to display a UI using SDL2 on Rebol3.
So far, I'd like to do something like this:
gui: copy []
append gui context [style: 'h1 at: 10x30 text: "Hello World!" font: arial]
but should I use Object! when I only need a Block! like this:
gui: copy []
append/only gui reduce/no-set [style: 'h1 at: 10x30 text: "Hello World!" font: arial]
What's your opinion on this? What is best to use? Any other suggestion?
Why not dialect?
[h1 10x30 "Hello World!" font arial]
Internally I would store it as an object!, because it provides you with an easier manipulation.

Mailboxer stripping inline css when saving to database

I'm using tinymce which applies inline css for text colour etc. My issue is, if I apply colour change to some text tinymce produces the following:
<p><span style="color: #ff0000;">asdf</span></p>
When I save this reply:
reply = current_user.reply_to_sender(receipt[messageIndex], params[:body])
... and check the database it has:
<p><span>asdf</span></p>
If I simply print params[:body] everything is fine, it's just the result of the save
Am I missing something here. I tried this without tinymce i.e. just put the html directly into a textarea with the same results so it's not tinymce.
Also I have tinymce in other areas of my app and it works fine with the same code
Turns out that it's down to the default behaviour of the reply_to_sender method in Mailboxer where sanitize_text is set to true
(Object) reply_to_sender(receipt, reply_body, subject = nil, sanitize_text = true, attachment = nil)
changing my method call to the following fixed this:
reply = current_user.reply_to_sender(receipt[messageIndex], params[:body], nil, false, nil)

NSLocalizableString not found my key

I'm developing iPad international application.
I'm using methods NSLocalizableString to translate my application.
I have added keyword manually in my Localizable.strings in English and in French named "Orders" with value.
When I call my method NSLocalizableString with the keyword, it didn't found my keyword and don't apply the translation.
For keyword above and below, it's working perfectly.
Some code parts :
**Localizable.strings**
/* Change datas */
"ChangeDatas" = "Modifier les données";
/* Orders */
"Orders" = "Détails de votre commande";
/* Label */
"SomeLabel" = "Label";
**file.m**
//Work fine
NSLog(#"My data translation : %#", NSLocalizedString(#"ChangeDatas", #"Change datas"));
//Don't work
NSLog(#"My orders translation : %#", NSLocalizedString(#"Orders", #"Orders"));
Are you sure your editor was working in the right encoding? Also, with the correct line endings?
It can't hurt to check your .strings file with the plutil command.
Are you sure you've edited the .strings file for the same language/locale that you're using at runtime?

Customize the Prompt Box of Javascript

As the Title says, I am invoking a Prompt-box of very-flexible Javascript by the below command in my Silverlight application.
string input = System.Windows.Browser.HtmlPage.Window.Invoke("prompt", new string[] { "YOUR QUESTION GOES HERE", "THE ANSWER INPUT GOES HERE.." }) as string;
But what i want is to customize the prompt box in terms of resizing, alignment, and Prompt-box header content. How can i pass such parameters in the above code, without breaking its core Functionality ??
Jquery Plugins are available....you can use
http://theinfiniteloopblog.com/programming/jscript/custom-javascript-alert-and-confirm-dialog-boxes/