Emmet: Автозаполнение не работает с клавишей TAB для JSX в Sublime text 3, сборка 3143

Созданный на 4 февр. 2018  ·  2Комментарии  ·  Источник: emmetio/emmet

Привет, я знаю, что это должно работать, у меня есть другой ноутбук, на котором он работает, но здесь я обновился до последней версии Sublime text 3, и автозаполнение тегов html не работает в JSX.

Вот что я использую,

Есть идеи, почему? есть ли известная проблема с другими плагинами, я просматривал, пытался выяснить, но ничего не работает

{
  "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"
    }
  ]
}

Самый полезный комментарий

Не уверен, почему, но это ниже сработало!

[
  { "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" }
    ]
}
]

Все 2 Комментарий

Не уверен, почему, но это ниже сработало!

[
  { "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" }
    ]
}
]

Была такая же проблема, консоль отправляла предупреждения, подобные этому, «значение верхнего уровня должно быть массивом».

{
  "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"
    }
  ]
}

Код выше является объектом,
и код ниже представляет собой массив объектов

[
  { "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" }
    ]
}
]

Это исправляет предупреждение «значение верхнего уровня должно быть массивом», поэтому оно работает.

Была ли эта страница полезной?
0 / 5 - 0 рейтинги

Смежные вопросы

corysimmons picture corysimmons  ·  5Комментарии

renatorib picture renatorib  ·  26Комментарии

sergeche picture sergeche  ·  25Комментарии

DanielRuf picture DanielRuf  ·  5Комментарии

nicothin picture nicothin  ·  18Комментарии