adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.26k stars 7.63k forks source link

Why brackets do not close tags on autocomplet? #12087

Open onigetoc opened 8 years ago

onigetoc commented 8 years ago

When you begin your a tag <div and when you close it <div> it should give you instantly this: <div></div> Closing the tag.

Another thing. If i change my div to span, it should be smart enough to change the closing tag with span. Google elements inspector do it.

Even ace editor do it naturally with autocompletion. https://ace.c9.io/demo/autocompletion.html

petetnt commented 8 years ago

Make sure your closeTags preference is set correctly:

{
    "closeTags": { "whenOpening": true, "whenClosing": true, "indentTags": [] },
}

If it is already correct, can you clarify which document mode you are using for HTML?

For the second part, AFAIK CodeMirror doesn't support replacing the other tag automatically yet, but there might be an extension for it.

onigetoc commented 8 years ago

Brackets do not have preference at all. (I use the french version)

petetnt commented 8 years ago

@onigetoc You can set the preference yourself from debug -> Open preferences file. Just add it before (or after) the others (on the right pane)

onigetoc commented 8 years ago

In the right panel brakets.json ? I just did it but it do not work.

My setting. { "fonts.fontSize": "14px", "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace", "hirse.beautify.onSave": true, "themes.theme": "dark-theme", "acb-bootstrap-snippets.enabled": true, "linting.collapsed": true, "livedev.multibrowser": true, "useTabChar": false, "acb-jade-bootstrap-snippets.enabled": true, "closeTags": { "whenOpening": true, "whenClosing": true, "indentTags": [] } }

The defaylt preference is like that. `"closeTags": { // Ensemble de balises qui ne doivent pas se fermer automatiquement "dontCloseTags": [],

    // Ensemble de balises qui, quand elles sont ouvertes, disposent d’une ligne vierge
    "indentTags": [],

    // Fermer quand l’utilisateur tape le caractère / de la balise de fermeture
    "whenClosing": true,

    // Fermer quand l’utilisateur tape le caractère > de la balise d’ouverture
    "whenOpening": true`
onigetoc commented 8 years ago

Ok, it work for all tags except div ?

petetnt commented 8 years ago

@onigetoc Sounds weird... have you tried launching Brackets without extensions? (Debug -> Reload Without Extensions). Empty dontCloseTags should enable all tags to close.

HHK01 commented 7 years ago

I have the same problem too, i reloaded it without extensions, i write

but doesn't autocompletes

HHK01 commented 7 years ago

Nevermind i had a missing tag that i forgot to complete, that's why when i wrote another

tag it did not autocompleted it

JBallin commented 6 years ago

Voting to close this issue as there isn't a clear bug here.