i changed html.js file (tag generator) on C:\Users\\AppData\Roaming\Brackets\extensions\user\brackets-emmet\node_modules\emmet\lib\filter
https://gist.github.com/mgundogdu38/a53af0bccd61bba4cefac56ab705d2b1
Now:
1- i find html tag generator library. html.js.
2- i find html tag generator functions. it is called processTag.
3- i need attribute generator function. it is called makeAttributesString. after i cloned. i called "makeAttributesString2" :)
function makeAttributesString2(node, profile) {
var attrQuote = profile.attributeQuote();
var cursor = profile.cursor();
return node.attributeList().map(function(a) {
var isBoolean = profile.isBoolean(a.name, a.value);
var attrName = profile.attributeName(a.name);
var attrValue = isBoolean ? attrName : a.value;
//i added there. if attribute is id. i added "." on head
if(attrName == "id")
{
return "#"+(attrValue || cursor);
}
//if attribute is class i added "." on head
if(attrName == "class")
{
return "."+(attrValue || cursor);
}
//else only tagname
if (isBoolean && profile.allowCompactBoolean()) {
return ' ' + attrName;
}
//end of my code
}).join('');
}
then i use makeAttributesString2 for generate comment title on proccessTag.
function processTag(item, profile) {
if (!item.parent) { // looks like it's root element
return item;
}
var attrs = makeAttributesString(item, profile);
var cursor = profile.cursor();
var isUnary = abbrUtils.isUnary(item);
var start = '';
var end = '';
// define opening and closing tags
if (!item.isTextNode()) {
//this is pieace of comment title.
var attrsComment = makeAttributesString2(item,profile);
var tagName = profile.tagName(item.name());
if (isUnary) {
start = '<' + tagName + attrs + profile.selfClosing() + '>';
item.end = '';
} else {
//there is comment tag. i just add "<!-- "+tagName+attrsComment+" -->\n" and "\n <!-- /"+tagName+attrsComment+" -->"
start = "<!-- "+tagName+attrsComment+" -->\n"+ '<' + tagName + attrs + '>';
end = '</' + tagName + '>'+"\n <!-- /"+tagName+attrsComment+" -->";
}
}
var placeholder = '%s';
// We can't just replace placeholder with new value because
// JavaScript will treat double $ character as a single one, assuming
// we're using RegExp literal.
item.start = utils.replaceSubstring(item.start, start, item.start.indexOf(placeholder), placeholder);
item.end = utils.replaceSubstring(item.end, end, item.end.indexOf(placeholder), placeholder);
// should we put caret placeholder after opening tag?
if (
!item.children.length
&& !isUnary
&& !~item.content.indexOf(cursor)
&& !tabStops.extract(item.content).tabstops.length
) {
item.start += cursor;
}
return item;
}