Emmet: Autocompletar no funciona con la tecla TAB para JSX en Sublime text 3, compilación 3143

Creado en 4 feb. 2018  ·  2Comentarios  ·  Fuente: emmetio/emmet

Hola, sé que se supone que esto funciona, tengo otra computadora portátil en la que funciona, pero aquí he actualizado a la versión más reciente de Sublime text 3, y no funciona el autocompletado de etiquetas html en JSX.

Esto es lo que estoy usando,

¿Alguna idea de por qué? ¿Hay algún problema bien conocido con otros complementos? He estado navegando, intente averiguarlo, pero nada funciona.

{
  "keys": ["tab"],
  "command": "expand_abbreviation_by_tab",

  // put comma-separated syntax selectors for which
  // you want to expandEmmet abbreviations into "operand" key
  // instead of SCOPE_SELECTOR.
  // Examples: source.js, text.html - source
  "context": [
    {
      "operand": "source.js, meta.class.js, meta.group.braces.curly.js, meta.group.braces.round.js, meta.jsx.js ",
      "operator": "equal",
      "match_all": true,
      "key": "selector"
    },

    // run only if there's no selected text
    {
      "match_all": true,
      "key": "selection_empty"
    },

    // don't work if there are active tabstops
    {
      "operator": "equal",
      "operand": false,
      "match_all": true,
      "key": "has_next_field"
    },

    // don't work if completion popup is visible and you
    // want to insert completion with Tab. If you want to
    // expand Emmet with Tab even if popup is visible --
    // remove this section
    {
      "operand": false,
      "operator": "equal",
      "match_all": true,
      "key": "auto_complete_visible"
    },
    {
      "match_all": true,
      "key": "is_abbreviation"
    }
  ]
}

Comentario más útil

No estoy seguro de por qué, ¡pero esto a continuación funcionó!

[
  { "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context":
    [
        { "operand": "source.js", "operator": "equal", "match_all": true, "key": "selector" },
        { "match_all": true, "key": "selection_empty" },
        { "operator": "equal", "operand": false, "match_all": true, "key": "has_next_field" },
        { "operand": false, "operator": "equal", "match_all": true, "key": "auto_complete_visible" },
        { "match_all": true, "key": "is_abbreviation" }
    ]
}
]

Todos 2 comentarios

No estoy seguro de por qué, ¡pero esto a continuación funcionó!

[
  { "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context":
    [
        { "operand": "source.js", "operator": "equal", "match_all": true, "key": "selector" },
        { "match_all": true, "key": "selection_empty" },
        { "operator": "equal", "operand": false, "match_all": true, "key": "has_next_field" },
        { "operand": false, "operator": "equal", "match_all": true, "key": "auto_complete_visible" },
        { "match_all": true, "key": "is_abbreviation" }
    ]
}
]

Tenía el mismo problema, la consola enviaba advertencias como esta "el valor de nivel superior debe ser una matriz".

{
  "keys": ["tab"],
  "command": "expand_abbreviation_by_tab",

  // put comma-separated syntax selectors for which
  // you want to expandEmmet abbreviations into "operand" key
  // instead of SCOPE_SELECTOR.
  // Examples: source.js, text.html - source
  "context": [
    {
      "operand": "source.js, meta.class.js, meta.group.braces.curly.js, meta.group.braces.round.js, meta.jsx.js ",
      "operator": "equal",
      "match_all": true,
      "key": "selector"
    },

    // run only if there's no selected text
    {
      "match_all": true,
      "key": "selection_empty"
    },

    // don't work if there are active tabstops
    {
      "operator": "equal",
      "operand": false,
      "match_all": true,
      "key": "has_next_field"
    },

    // don't work if completion popup is visible and you
    // want to insert completion with Tab. If you want to
    // expand Emmet with Tab even if popup is visible --
    // remove this section
    {
      "operand": false,
      "operator": "equal",
      "match_all": true,
      "key": "auto_complete_visible"
    },
    {
      "match_all": true,
      "key": "is_abbreviation"
    }
  ]
}

El código de arriba es objeto,
y el código a continuación es una matriz de objetos

[
  { "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context":
    [
        { "operand": "source.js", "operator": "equal", "match_all": true, "key": "selector" },
        { "match_all": true, "key": "selection_empty" },
        { "operator": "equal", "operand": false, "match_all": true, "key": "has_next_field" },
        { "operand": false, "operator": "equal", "match_all": true, "key": "auto_complete_visible" },
        { "match_all": true, "key": "is_abbreviation" }
    ]
}
]

Esto corrige la advertencia "el valor de nivel superior debe ser una matriz", por eso funciona.

¿Fue útil esta página
0 / 5 - 0 calificaciones

Temas relacionados

nicothin picture nicothin  ·  18Comentarios

sergeche picture sergeche  ·  25Comentarios

midgethoen picture midgethoen  ·  8Comentarios

deathmood picture deathmood  ·  15Comentarios

MarvinXu picture MarvinXu  ·  10Comentarios