vscode-as3mxml icon indicating copy to clipboard operation
vscode-as3mxml copied to clipboard

MXML should automatically add close tag when open tag is finished and not self-closing

Open GotJimmy opened this issue 8 years ago • 7 comments

Moved to separate issue: #39

~~~2)  would be nice to have the following: when typing  /  at the end of an MXML tag I'd like to get  />  instead~~~
Moved to separate issue: #40

3)  when typing  >  at the end of an MXML tag I'd like to get the second closing tag inserted automatically. Ideally, the closing tag already 2 lines down and the cursor indented on the line between:
   <s:VGroup id="whatever">
        ......
   </s:VGroup>

Just my 2 cents.

GotJimmy avatar Dec 01 '16 22:12 GotJimmy

  1. This would be nice. I will look into it. I know that I can add the quotes, but I'll need to check if I can change the position of the cursor to go between the quotes.

  2. VSCode does not do this for normal XML. I am hesitant to go against the platform's default behavior. I can give it a try, but I may find that there are weird edge cases.

  3. VSCode also does not do this for normal XML. It's also probably more tricky than the last one, and I suspect that the APIs may not be robust enough to do it yet.

joshtynjala avatar Dec 01 '16 22:12 joshtynjala

  1. great thanks.
  2. ok.
  3. well, would be nice (got the idea from IntelliJ). However, no biggy since there's the extension "XML Tools" that automatically closes the last open tag via a keyboard shortcut.

GotJimmy avatar Dec 01 '16 22:12 GotJimmy

  1. for this point some simple snippets could insert the ="" and place the cursor between the quotes:

id="" : "id=""": { "prefix": "id", "body": [ "id="$1"" ]},

paddingLeft="" : "paddingLeft=""": { "prefix": "pl", "body": [ "paddingLeft="$1"" ]},

GotJimmy avatar Dec 02 '16 02:12 GotJimmy

Oops. Took out the backslashes. Here it goes again marked as code:

id="" : "id=\"\"": { "prefix": "id", "body": [ "id=\"$1\"" ]},

paddingLeft="" : "paddingLeft=\"\"": { "prefix": "pl", "body": [ "paddingLeft=\"$1\"" ]},

GotJimmy avatar Dec 02 '16 03:12 GotJimmy

  1. This appears to be something that Microsoft is working on, but it is currently disabled:

https://github.com/Microsoft/vscode/blob/1.7.1/extensions/xml/xml.language-configuration.json#L20

I'm guessing that this will come for free in a future update because MXML is still considered XML by VSCode.

joshtynjala avatar Dec 02 '16 16:12 joshtynjala

Looks like it. Good to know. Thanks.

  • Christian

On Dec 2, 2016, at 5:58 PM, Josh Tynjala [email protected] wrote:

• This appears to be something that Microsoft is working on, but it is currently disabled: https://github.com/Microsoft/vscode/blob/1.7.1/extensions/xml/xml.language-configuration.json#L20

I'm guessing that this will come for free in a future update.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

GotJimmy avatar Dec 02 '16 22:12 GotJimmy

This is supported by https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag when you add mxml to the list of languages in the auto-close-tag.activationOnLanguage setting.

Harbs avatar Jan 15 '20 20:01 Harbs