Sedirisiwa sa Phetolelo ya Khoutu ya mo Inthaneteng go ya go Ditsopolwa, Tshegetsa JavaScript / Mofuta wa Sekwalwa / Tsibogo / JSX / TSX      

Tsweetswee tsenya leina la nopolo (name)
Tsweetswee tsenya ketapele ya nopolo (prefix)
Tsweetswee tsenya tlhaloso ya nopolo (description)
Tsweetswee tsenya mokwalo wa khoutu (code body)
Mofuta wa Kokomana
Dipholo tsa Nopolo e e Tlhagisitsweng

VSCode Tsela ya go dirisa dinopolo tsa khoutu


Snippets in Visual Studio Code
VS Code snippets ke tsela e e maatla ya go oketsa tlhagiso ya gago ya go tsenya dikhoutu ka go tsenya diboloko tsa khoutu tse di dirisiwang thata ka go itirisa. E ka nna dikatoloso tse di bonolo tsa sekwalwa kgotsa dithempoleite tse di raraaneng thata tse di nang le ditshodi tsa lefelo le diphetogo. Tsela ya go di dirisa ke eno:

Go tlhama Ditsopolwa:

Phitlhelelo ya Dipeakanyo tsa Ditsopolwa: Eya go Faele > Dikgatlhego > Ditsopolo tsa Modirisi (Khoutu > Dikgetho > Ditsopolo tsa Modirisi mo macOS). Go seng jalo, dirisa phalete ya taelo (Ctrl+Shift+P kgotsa Cmd+Shift+P) o bo o thaepa "Dikgatlhegelo: Rulaganya Ditsopolwa tsa Modirisi".

Tlhopha Puo: O tla kopiwa go tlhopha puo ya setlhogo sa gago (ka sekai, javascript.json, python.json, jalo le jalo). Seno se netefatsa gore setlhogo se teng fela mo puong eo e e rileng. Gape o ka tlhama faele ya "Dinopolo tsa Lefatshe Lotlhe" fa o batla gore nopolo e fitlhelege mo dipuong tsotlhe.

Tlhalosa Nopolo: Dinopolo di tlhalosiwa ka fomete ya JSON. Setlhogo sengwe le sengwe se na le leina, ketapele (tlhabanyetso e o tla e thaepang go tlhotlheletsa setlhogo), mmele (khoutu e e tla tsenngwang), le tlhaloso ya boikgethelo.

Sekao (Sekwalwa sa Java):
{
  "For Loop": {
    "prefix": "forl",
    "body": [
      "for (let i = 0; i < $1; i++) {",
      "  $0",
      "}"
    ],
    "description": "For loop with index"
  }
}
Mo sekaong se:

"For Loop": Leina la setlhogo (go nna tshupiso ya gago).
"forl": Ketapele. Go thaepa "forl" le go tobetsa Tab go tla tsenya setlhogo.
"mmele": Khoutu e e tshwanetseng go tsenngwa. $1, $2, jj. ke di-tabstop (ditshwari tsa maemo). $0 ke boemo jwa bofelo jwa sesupo.
"tlhaloso": Tlhaloso ya boikgethelo e e bontshiwang mo ditshitshinyong tsa IntelliSense.
Go dirisa Ditsopolwa:

Thaepa Setlhogo: Mo faeleng ya mofuta o o siameng wa puo, simolola go thaepa setlhogo se o se tlhalositseng (ka sekai, forl).

Tlhopha Setlhogo: IntelliSense ya VS Code e tla akantsha setlhogo. E tlhophe ka dikonopo tsa motsu kgotsa ka go tobetsa.

Dirisa Dithebo: Tobetsa Tab go tsamaya fa gare ga dithebo ($1, $2, jj.) o bo o tlatsa boleng.

Diphetogophetogo:

Ditsopolwa gape di ka dirisa diphetogo tse di jaaka $TM_FILENAME, $CURRENT_YEAR, jj. Go bona lenaane le le feletseng, leba ditokomane tsa Khoutu ya VS.

Sekao ka Diphetogo (Python):
{
  "New Python File": {
    "prefix": "newpy",
    "body": [
      "#!/usr/bin/env python3",
      "# -*- coding: utf-8 -*-",
      "",
      "# ${TM_FILENAME}",
      "# Created by: ${USER} on ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}"
    ]
  }
}
Ka go nna le bokgoni jwa go thaepa ditsopolwa, o ka fokotsa thata go thaepa gangwe le gape le go tlhomamisa gore khoutu ya gago e tlhomama. Leka go itirela ditsopolwa tsa diphethene tsa khoutu tse di dirisiwang thata mme o lebelele bokgoni jwa gago jwa go tsenya dikhoutu bo tlhatloga.