Emmet: Pelengkapan otomatis tidak berfungsi dengan kunci TAB untuk JSX dalam teks Sublime 3, build 3143

Dibuat pada 4 Feb 2018  ·  2Komentar  ·  Sumber: emmetio/emmet

Hai, saya tahu ini seharusnya berfungsi, saya punya laptop lain tempat kerjanya, tetapi di sini saya telah memperbarui ke Sublime text 3 terbaru, dan tidak ada autocomplete tag html yang berfungsi di BEJ.

Inilah yang saya gunakan,

Tahu kenapa? apakah ada masalah terkenal dengan plugin lain, saya telah menjelajah, mencoba mencari tahu, tetapi tidak ada yang berhasil

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

Komentar yang paling membantu

Tidak yakin mengapa, tetapi ini di bawah ini berhasil!

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

Semua 2 komentar

Tidak yakin mengapa, tetapi ini di bawah ini berhasil!

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

Punya masalah yang sama, konsol mengirimkan peringatan seperti ini "nilai tingkat atas harus berupa array".

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

Kode di atas adalah objek,
dan kode di bawah ini adalah array objek

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

Ini memperbaiki peringatan "nilai tingkat atas harus berupa array", itu sebabnya ini berhasil.

Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

HeikoMamerow picture HeikoMamerow  ·  16Komentar

deathmood picture deathmood  ·  15Komentar

renatorib picture renatorib  ·  26Komentar

midgethoen picture midgethoen  ·  8Komentar

corysimmons picture corysimmons  ·  5Komentar