@codingame/monaco-editor-wrapper 6.4.0 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_.vsix.js +21 -23
- package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/CHANGELOG.md +16 -0
- package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/package.json +10 -2
- package/dist/assets/{Angular.ng-template-17.1.0.vsix/template.json → Angular.ng-template-17.3.1.vsix/template-tag.json} +2 -25
- package/dist/assets/Angular.ng-template-17.3.1.vsix/template.json +31 -0
- package/dist/assets/{Dart-Code.dart-code-3.81.20240117.vsix → Dart-Code.dart-code-3.87.20240402.vsix}/dart.json +7 -3
- package/dist/assets/{Dart-Code.dart-code-3.81.20240117.vsix → Dart-Code.dart-code-3.87.20240402.vsix}/package.json +200 -24
- package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/CHANGELOG.md +20 -2
- package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/elixir.json +38 -0
- package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/package.json +5 -2
- package/dist/assets/{JuanBlanco.solidity-0.0.165.vsix → JuanBlanco.solidity-0.0.174.vsix}/README.md +424 -416
- package/dist/assets/{JuanBlanco.solidity-0.0.165.vsix → JuanBlanco.solidity-0.0.174.vsix}/package.json +623 -569
- package/dist/assets/JuanBlanco.solidity-0.0.174.vsix/solidity-markdown-injection.json +45 -0
- package/dist/assets/{JuanBlanco.solidity-0.0.165.vsix → JuanBlanco.solidity-0.0.174.vsix}/solidity.configuration.json +31 -31
- package/dist/assets/{JuanBlanco.solidity-0.0.165.vsix → JuanBlanco.solidity-0.0.174.vsix}/solidity.json +1215 -1215
- package/dist/assets/{JuanBlanco.solidity-0.0.165.vsix → JuanBlanco.solidity-0.0.174.vsix}/solidity2.json +213 -213
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/CHANGELOG.md +15 -0
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/README.md +263 -249
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/package.json +263 -263
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/package.nls.json +23 -23
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/package.nls.pt-br.json +23 -23
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/pascal.configuration.json +1 -0
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/pascal.json +414 -414
- package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/pascal.tmLanguage +1 -1
- package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/CHANGELOG.md +26 -0
- package/dist/assets/broadcomMFD.cobol-language-support-2.1.2.vsix/CICS.tmLanguage.json +66 -0
- package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/COBOL.tmLanguage.json +0 -8
- package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/README.md +2 -4
- package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/package.json +13 -15
- package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/CHANGELOG.md +118 -9
- package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/README.md +17 -21
- package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/package.json +13 -24
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/CHANGELOG.md +61 -0
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/aspnetcorerazor.tmLanguage.json +78 -0
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/csharp.json +1 -1
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.json +98 -132
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.cs.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.de.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.es.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.fr.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.it.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.ja.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.ko.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.pl.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.pt-br.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.ru.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.tr.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.zh-cn.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/package.nls.zh-tw.json +2 -4
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/vs2019_dark.json +5 -0
- package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/vs2019_light.json +5 -0
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/README.md +21 -10
- package/dist/assets/ms-python.python-2024.5.11021008.vsix/package.json +1 -0
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.cs.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.de.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.es.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.fr.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.it.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.ja.json +1 -1
- package/dist/assets/ms-python.python-2024.5.11021008.vsix/package.nls.json +1 -0
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.ko.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.pl.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.pt-br.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.qps-ploc.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.ru.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.tr.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.zh-cn.json +1 -1
- package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/package.nls.zh-tw.json +1 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/CHANGELOG.md +124 -35
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.json +181 -7
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.cs.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.de.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.es.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.fr.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.it.json +13 -2
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.ja.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.json +11 -0
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.ko.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.pl.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.pt-br.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.ru.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.tr.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.zh-cn.json +12 -1
- package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/package.nls.zh-tw.json +15 -4
- package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/CHANGELOG.md +35 -1
- package/dist/assets/ocamllabs.ocaml-platform-1.18.1.vsix/ocaml-markdown-codeblock.json +33 -0
- package/dist/assets/ocamllabs.ocaml-platform-1.18.1.vsix/ocamldoc.json +203 -0
- package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/package.json +21 -19
- package/dist/assets/ocamllabs.ocaml-platform-1.18.1.vsix/reason-markdown-codeblock.json +33 -0
- package/dist/assets/{pgourlain.erlang-0.9.8.vsix → pgourlain.erlang-0.9.9.vsix}/CHANGELOG.md +11 -0
- package/dist/assets/pgourlain.erlang-0.9.9.vsix/erlang-fileicon-dark.png +0 -0
- package/dist/assets/pgourlain.erlang-0.9.9.vsix/erlang-fileicon-light.png +0 -0
- package/dist/assets/pgourlain.erlang-0.9.9.vsix/erlang.json +1323 -0
- package/dist/assets/{pgourlain.erlang-0.9.8.vsix → pgourlain.erlang-0.9.9.vsix}/package.json +6 -2
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/CHANGELOG.md +44 -0
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/README.md +8 -7
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/package.json +75 -6
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/package.nls.json +2 -1
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/package.nls.ko.json +2 -1
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/package.nls.zh-cn.json +2 -1
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/package.nls.zh-tw.json +2 -1
- package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/package.schema.json +21 -0
- package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/README.md +1 -1
- package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/package.json +34 -4
- package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/package.json +2 -2
- package/dist/extensions/{Angular.ng-template-17.1.0.vsix.js → Angular.ng-template-17.3.1.vsix.js} +12 -10
- package/dist/extensions/Dart-Code.dart-code-3.87.20240402.vsix.js +20 -0
- package/dist/extensions/{JakeBecker.elixir-ls-0.19.0.vsix.js → JakeBecker.elixir-ls-0.20.0.vsix.js} +10 -10
- package/dist/extensions/JuanBlanco.solidity-0.0.174.vsix.js +22 -0
- package/dist/extensions/{alefragnani.pascal-9.6.0.vsix.js → alefragnani.pascal-9.8.0.vsix.js} +10 -10
- package/dist/extensions/broadcomMFD.cobol-language-support-2.1.2.vsix.js +28 -0
- package/dist/extensions/golang.Go-0.41.2.vsix.js +24 -0
- package/dist/extensions/ms-dotnettools.csharp-2.24.17.vsix.js +54 -0
- package/dist/extensions/ms-python.python-2024.5.11021008.vsix.js +56 -0
- package/dist/extensions/ms-vscode.cpptools-1.20.1.vsix.js +44 -0
- package/dist/extensions/ocamllabs.ocaml-platform-1.18.1.vsix.js +88 -0
- package/dist/extensions/pgourlain.erlang-0.9.9.vsix.js +26 -0
- package/dist/extensions/redhat.java-1.30.2024041208.vsix.js +48 -0
- package/dist/extensions/scalameta.metals-1.29.10.vsix.js +34 -0
- package/dist/extensions/{svelte.svelte-vscode-108.2.1.vsix.js → svelte.svelte-vscode-108.3.4.vsix.js} +19 -19
- package/dist/index.d.ts +2 -2
- package/dist/main.js +1 -1
- package/dist/services.d.ts +2 -0
- package/dist/services.js +7 -2
- package/package.json +93 -94
- package/stats.html +1 -1
- package/dist/assets/broadcomMFD.cobol-language-support-2.1.0.vsix/CICS.tmLanguage.json +0 -66
- package/dist/assets/johnsoncodehk.vscode-angular-1.0.22.vsix/README.md +0 -44
- package/dist/assets/johnsoncodehk.vscode-angular-1.0.22.vsix/angular-directives.json +0 -123
- package/dist/assets/johnsoncodehk.vscode-angular-1.0.22.vsix/angular-interpolations.json +0 -44
- package/dist/assets/johnsoncodehk.vscode-angular-1.0.22.vsix/angular-template-language-configuration.json +0 -8
- package/dist/assets/johnsoncodehk.vscode-angular-1.0.22.vsix/package.json +0 -102
- package/dist/assets/ms-python.python-2023.25.10221012.vsix/package.json +0 -1
- package/dist/assets/ms-python.python-2023.25.10221012.vsix/package.nls.json +0 -1
- package/dist/assets/ocamllabs.ocaml-platform-1.16.1.vsix/ocaml-markdown-codeblock.json +0 -24
- package/dist/assets/ocamllabs.ocaml-platform-1.16.1.vsix/ocamldoc.json +0 -31
- package/dist/assets/ocamllabs.ocaml-platform-1.16.1.vsix/reason-markdown-codeblock.json +0 -24
- package/dist/assets/pgourlain.erlang-0.9.8.vsix/erlang.json +0 -197
- package/dist/extensions/Dart-Code.dart-code-3.81.20240117.vsix.js +0 -20
- package/dist/extensions/JuanBlanco.solidity-0.0.165.vsix.js +0 -20
- package/dist/extensions/broadcomMFD.cobol-language-support-2.1.0.vsix.js +0 -28
- package/dist/extensions/golang.Go-0.40.3.vsix.js +0 -24
- package/dist/extensions/johnsoncodehk.vscode-angular-1.0.22.vsix.js +0 -18
- package/dist/extensions/ms-dotnettools.csharp-2.16.24.vsix.js +0 -54
- package/dist/extensions/ms-python.python-2023.25.10221012.vsix.js +0 -56
- package/dist/extensions/ms-vscode.cpptools-1.19.2.vsix.js +0 -44
- package/dist/extensions/ocamllabs.ocaml-platform-1.16.1.vsix.js +0 -88
- package/dist/extensions/pgourlain.erlang-0.9.8.vsix.js +0 -22
- package/dist/extensions/redhat.java-1.27.2024012608.vsix.js +0 -48
- package/dist/extensions/scalameta.metals-1.27.3.vsix.js +0 -34
- /package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/README.md +0 -0
- /package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/angular.png +0 -0
- /package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/expression.json +0 -0
- /package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/inline-styles.json +0 -0
- /package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/inline-template.json +0 -0
- /package/dist/assets/{Angular.ng-template-17.1.0.vsix → Angular.ng-template-17.3.1.vsix}/template-blocks.json +0 -0
- /package/dist/assets/{Dart-Code.dart-code-3.81.20240117.vsix → Dart-Code.dart-code-3.87.20240402.vsix}/CHANGELOG.md +0 -0
- /package/dist/assets/{Dart-Code.dart-code-3.81.20240117.vsix → Dart-Code.dart-code-3.87.20240402.vsix}/README.md +0 -0
- /package/dist/assets/{Dart-Code.dart-code-3.81.20240117.vsix → Dart-Code.dart-code-3.87.20240402.vsix}/dart-language-configuration.json +0 -0
- /package/dist/assets/{Dart-Code.dart-code-3.81.20240117.vsix → Dart-Code.dart-code-3.87.20240402.vsix}/dart.png +0 -0
- /package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/README.md +0 -0
- /package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/eex-language-configuration.json +0 -0
- /package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/eex.json +0 -0
- /package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/elixir-language-configuration.json +0 -0
- /package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/html-eex.json +0 -0
- /package/dist/assets/{JakeBecker.elixir-ls-0.19.0.vsix → JakeBecker.elixir-ls-0.20.0.vsix}/logo.png +0 -0
- /package/dist/assets/{JuanBlanco.solidity-0.0.165.vsix → JuanBlanco.solidity-0.0.174.vsix}/icon.png +0 -0
- /package/dist/assets/{alefragnani.pascal-9.6.0.vsix → alefragnani.pascal-9.8.0.vsix}/icon.png +0 -0
- /package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/SQL.tmLanguage.json +0 -0
- /package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/lang-config.json +0 -0
- /package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/logo.png +0 -0
- /package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/pgm_conf.schema.json +0 -0
- /package/dist/assets/{broadcomMFD.cobol-language-support-2.1.0.vsix → broadcomMFD.cobol-language-support-2.1.2.vsix}/proc_grps.schema.json +0 -0
- /package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/go-logo-blue.png +0 -0
- /package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/go.json +0 -0
- /package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/go.mod.language-configuration.json +0 -0
- /package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/go.mod.tmGrammar.json +0 -0
- /package/dist/assets/{golang.Go-0.40.3.vsix → golang.Go-0.41.2.vsix}/go.sum.tmGrammar.json +0 -0
- /package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/README.md +0 -0
- /package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/csharpIcon.png +0 -0
- /package/dist/assets/{ms-dotnettools.csharp-2.16.24.vsix → ms-dotnettools.csharp-2.24.17.vsix}/language-configuration.json +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/CHANGELOG.md +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/conda-environment.json +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/conda-meta.json +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/condarc.json +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/icon.png +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/pip-requirements.json +0 -0
- /package/dist/assets/{ms-python.python-2023.25.10221012.vsix → ms-python.python-2024.5.11021008.vsix}/pip-requirements.tmLanguage.json +0 -0
- /package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/LanguageCCPP_color_128x.png +0 -0
- /package/dist/assets/{ms-vscode.cpptools-1.19.2.vsix → ms-vscode.cpptools-1.20.1.vsix}/README.md +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/META.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/META2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/README.md +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/atd.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/cram.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/dune-project.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/dune-project2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/dune-workspace.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/dune.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/dune2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/dune3.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/logo.png +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/menhir-action.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/menhir.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/menhir2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/merlin.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/oasis.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/oasis2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocaml.interface.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocaml.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocaml2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocaml3.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamlbuild.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamlbuild2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamlformat.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamlformat2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamllex.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamllex2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/ocamllex3.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/opam-install.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/opam-install2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/opam.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/opam2.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/reason.json +0 -0
- /package/dist/assets/{ocamllabs.ocaml-platform-1.16.1.vsix → ocamllabs.ocaml-platform-1.18.1.vsix}/reason2.json +0 -0
- /package/dist/assets/{pgourlain.erlang-0.9.8.vsix → pgourlain.erlang-0.9.9.vsix}/Erlang.plist +0 -0
- /package/dist/assets/{pgourlain.erlang-0.9.8.vsix → pgourlain.erlang-0.9.9.vsix}/README.md +0 -0
- /package/dist/assets/{pgourlain.erlang-0.9.8.vsix → pgourlain.erlang-0.9.9.vsix}/erlang.configuration.json +0 -0
- /package/dist/assets/{pgourlain.erlang-0.9.8.vsix → pgourlain.erlang-0.9.9.vsix}/icon.png +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/JavaProperties.tmLanguage.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/icon128.png +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/inline-html.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/inline-json.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/inline-sql.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/inline-xml.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/inline-yaml.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/java-properties-configuration.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/java.tmLanguage.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/kotlin.tmLanguage.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/language-configuration.json +0 -0
- /package/dist/assets/{redhat.java-1.27.2024012608.vsix → redhat.java-1.30.2024041208.vsix}/language-configuration2.json +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/book-dark.svg +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/book-light.svg +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/buildtarget.json +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/file_type_java.svg +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/file_type_scala.svg +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/jvm-bytecode-verbose.json +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/jvm-bytecode.json +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/logo.png +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/scalameta-logo.png +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/semanticdb.json +0 -0
- /package/dist/assets/{scalameta.metals-1.27.3.vsix → scalameta.metals-1.29.10.vsix}/tasty.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/CHANGELOG.md +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/README.md +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/javascript.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/language-configuration.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/logo.png +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/markdown-svelte-css.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/markdown-svelte-js.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/markdown-svelte.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/package-json-schema.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/postcss.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/prettier-options-schema.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/pug-svelte-dotblock.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/pug-svelte-tags.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/pug-svelte.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/svelte.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/svelte.tmLanguage.json +0 -0
- /package/dist/assets/{svelte.svelte-vscode-108.2.1.vsix → svelte.svelte-vscode-108.3.4.vsix}/typescript.json +0 -0
|
@@ -0,0 +1,1323 @@
|
|
|
1
|
+
{
|
|
2
|
+
"module header": {
|
|
3
|
+
"prefix" : "erl-module-header",
|
|
4
|
+
"description" : "Insert module header",
|
|
5
|
+
"body" : [
|
|
6
|
+
"%%% @author ${1:Author_Name} <${2:Author_Email}>",
|
|
7
|
+
"%%% @copyright (C) $CURRENT_YEAR, $1",
|
|
8
|
+
"%%% @doc $0",
|
|
9
|
+
"%%%",
|
|
10
|
+
"%%% @end",
|
|
11
|
+
"%%% Created : $CURRENT_DATE $CURRENT_MONTH_NAME_SHORT $CURRENT_YEAR by $1 <$2>",
|
|
12
|
+
"-module(${3:Module_Name}).",
|
|
13
|
+
""
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
"module header (large)": {
|
|
18
|
+
"prefix" : "erl-module-header-large",
|
|
19
|
+
"description" : "Insert large module header",
|
|
20
|
+
"body" : [
|
|
21
|
+
"%%%-------------------------------------------------------------------",
|
|
22
|
+
"%%% @author ${1:Author_Name} <${2:Author_Email}>",
|
|
23
|
+
"%%% @copyright (C) $CURRENT_YEAR, $1",
|
|
24
|
+
"%%% @doc $0",
|
|
25
|
+
"%%%",
|
|
26
|
+
"%%% @end",
|
|
27
|
+
"%%% Created : $CURRENT_DATE $CURRENT_MONTH_NAME_SHORT $CURRENT_YEAR by $1 <$2>",
|
|
28
|
+
"%%%-------------------------------------------------------------------",
|
|
29
|
+
"-module(${3:Module_Name}).",
|
|
30
|
+
""
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
"gen_server behavior": {
|
|
35
|
+
"prefix": "erl-gen_server",
|
|
36
|
+
"description": "Insert an empty gen_server",
|
|
37
|
+
"body": [
|
|
38
|
+
"-behaviour(gen_server).",
|
|
39
|
+
"",
|
|
40
|
+
"%% API",
|
|
41
|
+
"-export([start/1, stop/1, start_link/1]).",
|
|
42
|
+
"-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).",
|
|
43
|
+
"-record(state, {dummy}).",
|
|
44
|
+
"start(Name) ->",
|
|
45
|
+
" $0_sup:start_child(Name).",
|
|
46
|
+
"",
|
|
47
|
+
"stop(Name) ->",
|
|
48
|
+
" gen_server:call(Name, stop).",
|
|
49
|
+
"",
|
|
50
|
+
"start_link(Name) ->",
|
|
51
|
+
" gen_server:start_link({local, Name}, ?MODULE, [], []).",
|
|
52
|
+
"",
|
|
53
|
+
"init(_Args) ->",
|
|
54
|
+
" {ok, #state{dummy=1}}.",
|
|
55
|
+
"",
|
|
56
|
+
"handle_call(stop, _From, State) ->",
|
|
57
|
+
" {stop, normal, stopped, State};",
|
|
58
|
+
"",
|
|
59
|
+
"handle_call(_Request, _From, State) ->",
|
|
60
|
+
" {reply, ok, State}.",
|
|
61
|
+
"",
|
|
62
|
+
"handle_cast(_Msg, State) ->",
|
|
63
|
+
" {noreply, State}.",
|
|
64
|
+
"",
|
|
65
|
+
"handle_info(_Info, State) ->",
|
|
66
|
+
" {noreply, State}.",
|
|
67
|
+
"",
|
|
68
|
+
"terminate(_Reason, _State) ->",
|
|
69
|
+
" ok.",
|
|
70
|
+
"",
|
|
71
|
+
"code_change(_OldVsn, State, _Extra) ->",
|
|
72
|
+
" {ok, State}.",
|
|
73
|
+
""
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
"gen_server behavior (large)": {
|
|
78
|
+
"prefix": "erl-gen_server-large",
|
|
79
|
+
"description": "Insert an empty gen_server with all the callbacks and decoration",
|
|
80
|
+
"body": [
|
|
81
|
+
"-behaviour(gen_server).",
|
|
82
|
+
"",
|
|
83
|
+
"%% API",
|
|
84
|
+
"-export([start_link/0, stop/0, get_state/0]).",
|
|
85
|
+
"",
|
|
86
|
+
"%% gen_server callbacks",
|
|
87
|
+
"-export([init/1, handle_call/3, handle_cast/2, handle_info/2,",
|
|
88
|
+
" terminate/2, code_change/3, format_status/2]).",
|
|
89
|
+
"",
|
|
90
|
+
"%%%===================================================================",
|
|
91
|
+
"%%% Includes, defines, types and records",
|
|
92
|
+
"%%%===================================================================",
|
|
93
|
+
"",
|
|
94
|
+
"-define(SERVER, ?MODULE).",
|
|
95
|
+
"",
|
|
96
|
+
"-record(state, {}).",
|
|
97
|
+
"",
|
|
98
|
+
"%%%===================================================================",
|
|
99
|
+
"%%% API",
|
|
100
|
+
"%%%===================================================================",
|
|
101
|
+
"",
|
|
102
|
+
"%%--------------------------------------------------------------------",
|
|
103
|
+
"%% @doc Starts the server",
|
|
104
|
+
"%% @end",
|
|
105
|
+
"%%--------------------------------------------------------------------",
|
|
106
|
+
"-spec start_link() -> {ok, Pid :: pid()} |",
|
|
107
|
+
" {error, Error :: {already_started, pid()}} |",
|
|
108
|
+
" {error, Error :: term()} |",
|
|
109
|
+
" ignore.",
|
|
110
|
+
"start_link() ->",
|
|
111
|
+
" gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).",
|
|
112
|
+
"",
|
|
113
|
+
"%%--------------------------------------------------------------------",
|
|
114
|
+
"%% @doc Stops the server",
|
|
115
|
+
"%% @end",
|
|
116
|
+
"%%--------------------------------------------------------------------",
|
|
117
|
+
"-spec stop() -> ok.",
|
|
118
|
+
"stop() ->",
|
|
119
|
+
" gen_server:stop(?SERVER).",
|
|
120
|
+
"",
|
|
121
|
+
"%%--------------------------------------------------------------------",
|
|
122
|
+
"%% @doc Return the server state as a map",
|
|
123
|
+
"%% @end",
|
|
124
|
+
"%%--------------------------------------------------------------------",
|
|
125
|
+
"-spec get_state() -> map().",
|
|
126
|
+
"get_state() ->",
|
|
127
|
+
" maps:from_list(lists:zip(record_info(fields, state),",
|
|
128
|
+
" tl(tuple_to_list(sys:get_state(?SERVER))))).",
|
|
129
|
+
"",
|
|
130
|
+
"%%%===================================================================",
|
|
131
|
+
"%%% gen_server callbacks",
|
|
132
|
+
"%%%===================================================================",
|
|
133
|
+
"",
|
|
134
|
+
"%%--------------------------------------------------------------------",
|
|
135
|
+
"%% @private",
|
|
136
|
+
"%% @doc Initializes the server",
|
|
137
|
+
"%% @end",
|
|
138
|
+
"%%--------------------------------------------------------------------",
|
|
139
|
+
"-spec init(Args :: term()) -> {ok, State :: term()} |",
|
|
140
|
+
" {ok, State :: term(), Timeout :: timeout()} |",
|
|
141
|
+
" {ok, State :: term(), hibernate} |",
|
|
142
|
+
" {stop, Reason :: term()} |",
|
|
143
|
+
" ignore.",
|
|
144
|
+
"init([]) ->",
|
|
145
|
+
" process_flag(trap_exit, true),",
|
|
146
|
+
" {ok, #state{}}.",
|
|
147
|
+
"",
|
|
148
|
+
"%%--------------------------------------------------------------------",
|
|
149
|
+
"%% @private",
|
|
150
|
+
"%% @doc Handling call messages",
|
|
151
|
+
"%% @end",
|
|
152
|
+
"%%--------------------------------------------------------------------",
|
|
153
|
+
"-spec handle_call(Request :: term(), From :: {pid(), term()}, State::term()) ->",
|
|
154
|
+
" {reply, Reply :: term(), NewState :: term()} |",
|
|
155
|
+
" {reply, Reply :: term(), NewState :: term(), Timeout :: timeout()} |",
|
|
156
|
+
" {reply, Reply :: term(), NewState :: term(), hibernate} |",
|
|
157
|
+
" {noreply, NewState :: term()} |",
|
|
158
|
+
" {noreply, NewState :: term(), Timeout :: timeout()} |",
|
|
159
|
+
" {noreply, NewState :: term(), hibernate} |",
|
|
160
|
+
" {stop, Reason :: term(), Reply :: term(), NewState :: term()} |",
|
|
161
|
+
" {stop, Reason :: term(), NewState :: term()}.",
|
|
162
|
+
"handle_call(_Request, _From, State) ->",
|
|
163
|
+
" Reply = ok,",
|
|
164
|
+
" {reply, Reply, State}.",
|
|
165
|
+
"",
|
|
166
|
+
"%%--------------------------------------------------------------------",
|
|
167
|
+
"%% @private",
|
|
168
|
+
"%% @doc Handling cast messages",
|
|
169
|
+
"%% @end",
|
|
170
|
+
"%%--------------------------------------------------------------------",
|
|
171
|
+
"-spec handle_cast(Request :: term(), State :: term()) ->",
|
|
172
|
+
" {noreply, NewState :: term()} |",
|
|
173
|
+
" {noreply, NewState :: term(), Timeout :: timeout()} |",
|
|
174
|
+
" {noreply, NewState :: term(), hibernate} |",
|
|
175
|
+
" {stop, Reason :: term(), NewState :: term()}.",
|
|
176
|
+
"handle_cast(_Request, State) ->",
|
|
177
|
+
" {noreply, State}.",
|
|
178
|
+
"",
|
|
179
|
+
"%%--------------------------------------------------------------------",
|
|
180
|
+
"%% @private",
|
|
181
|
+
"%% @doc Handling all non call/cast messages",
|
|
182
|
+
"%% @end",
|
|
183
|
+
"%%--------------------------------------------------------------------",
|
|
184
|
+
"-spec handle_info(Info :: timeout | term(), State :: term()) ->",
|
|
185
|
+
" {noreply, NewState :: term()} |",
|
|
186
|
+
" {noreply, NewState :: term(), Timeout :: timeout()} |",
|
|
187
|
+
" {noreply, NewState :: term(), hibernate} |",
|
|
188
|
+
" {stop, Reason :: normal | term(), NewState :: term()}.",
|
|
189
|
+
"handle_info(_Info, State) ->",
|
|
190
|
+
" {noreply, State}.",
|
|
191
|
+
"",
|
|
192
|
+
"%%--------------------------------------------------------------------",
|
|
193
|
+
"%% @private",
|
|
194
|
+
"%% @doc This function is called by a gen_server when it is about to",
|
|
195
|
+
"%% terminate. It should be the opposite of Module:init/1 and do any",
|
|
196
|
+
"%% necessary cleaning up. When it returns, the gen_server terminates",
|
|
197
|
+
"%% with Reason. The return value is ignored.",
|
|
198
|
+
"%% @end",
|
|
199
|
+
"%%--------------------------------------------------------------------",
|
|
200
|
+
"-spec terminate(Reason, State :: term()) -> any()",
|
|
201
|
+
" when Reason :: normal | shutdown | {shutdown, term()} | term().",
|
|
202
|
+
"terminate(_Reason, _State) ->",
|
|
203
|
+
" ok.",
|
|
204
|
+
"",
|
|
205
|
+
"%%--------------------------------------------------------------------",
|
|
206
|
+
"%% @private",
|
|
207
|
+
"%% @doc Convert process state when code is changed",
|
|
208
|
+
"%% @end",
|
|
209
|
+
"%%--------------------------------------------------------------------",
|
|
210
|
+
"-spec code_change(OldVsn, State :: term(), Extra :: term()) ->",
|
|
211
|
+
" {ok, NewState :: term()} |",
|
|
212
|
+
" {error, Reason :: term()}",
|
|
213
|
+
" when OldVsn :: term() | {down, term()}.",
|
|
214
|
+
"code_change(_OldVsn, State, _Extra) ->",
|
|
215
|
+
" {ok, State}.",
|
|
216
|
+
"",
|
|
217
|
+
"%%--------------------------------------------------------------------",
|
|
218
|
+
"%% @private",
|
|
219
|
+
"%% @doc This function is called for changing the form and appearance",
|
|
220
|
+
"%% of gen_server status when it is returned from sys:get_status/1,2",
|
|
221
|
+
"%% or when it appears in termination error logs.",
|
|
222
|
+
"%% @end",
|
|
223
|
+
"%%--------------------------------------------------------------------",
|
|
224
|
+
"-spec format_status(Opt :: normal | terminate, Status :: list()) ->",
|
|
225
|
+
" Status :: term().",
|
|
226
|
+
"format_status(_Opt, Status) ->",
|
|
227
|
+
" Status.",
|
|
228
|
+
"",
|
|
229
|
+
"%%%===================================================================",
|
|
230
|
+
"%%% Internal functions",
|
|
231
|
+
"%%%===================================================================",
|
|
232
|
+
"",
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
"application behavior (large)" : {
|
|
237
|
+
"prefix" : "erl-application-large",
|
|
238
|
+
"description" : "Insert an empty application with all the callbacks and decoration",
|
|
239
|
+
"body" : [
|
|
240
|
+
"-behaviour(application).",
|
|
241
|
+
"",
|
|
242
|
+
"%% Application callbacks",
|
|
243
|
+
"-export([start/2, start_phase/3, stop/1, prep_stop/1, config_change/3]).",
|
|
244
|
+
"",
|
|
245
|
+
"%%%===================================================================",
|
|
246
|
+
"%%% Application callbacks",
|
|
247
|
+
"%%%===================================================================",
|
|
248
|
+
"",
|
|
249
|
+
"%%--------------------------------------------------------------------",
|
|
250
|
+
"%% @private",
|
|
251
|
+
"%% @doc This function is called whenever an application is started using",
|
|
252
|
+
"%% `application:start/[1,2]', and should start the processes of the",
|
|
253
|
+
"%% application. If the application is structured according to the OTP",
|
|
254
|
+
"%% design principles as a supervision tree, this means starting the",
|
|
255
|
+
"%% top supervisor of the tree.",
|
|
256
|
+
"%% @end",
|
|
257
|
+
"%%--------------------------------------------------------------------",
|
|
258
|
+
"-spec start(StartType :: normal |",
|
|
259
|
+
" {takeover, Node :: node()} |",
|
|
260
|
+
" {failover, Node :: node()},",
|
|
261
|
+
" StartArgs :: term()) ->",
|
|
262
|
+
" {ok, Pid :: pid()} |",
|
|
263
|
+
" {ok, Pid :: pid(), State :: term()} |",
|
|
264
|
+
" {error, Reason :: term()}.",
|
|
265
|
+
"start(_StartType, _StartArgs) ->",
|
|
266
|
+
" case ${1:Top_Supervisor}:start_link() of",
|
|
267
|
+
" {ok, Pid} ->",
|
|
268
|
+
" {ok, Pid};",
|
|
269
|
+
" Error ->",
|
|
270
|
+
" Error",
|
|
271
|
+
" end.",
|
|
272
|
+
"",
|
|
273
|
+
"%%--------------------------------------------------------------------",
|
|
274
|
+
"%% @private",
|
|
275
|
+
"%% @doc Top supervisor of the tree.",
|
|
276
|
+
"%% Starts an application with included applications, when",
|
|
277
|
+
"%% synchronization is needed between processes in the different",
|
|
278
|
+
"%% applications during startup.",
|
|
279
|
+
"%% @end",
|
|
280
|
+
"%%--------------------------------------------------------------------",
|
|
281
|
+
"-spec start_phase(Phase :: atom(),",
|
|
282
|
+
" StartType :: normal |",
|
|
283
|
+
" {takeover, Node :: node()} |",
|
|
284
|
+
" {failover, Node :: node()},",
|
|
285
|
+
" PhaseArgs :: term()) -> ok | {error, Reason :: term()}.",
|
|
286
|
+
"start_phase(_Phase, _StartType, _PhaseArgs) ->",
|
|
287
|
+
" ok.",
|
|
288
|
+
"",
|
|
289
|
+
"%%--------------------------------------------------------------------",
|
|
290
|
+
"%% @private",
|
|
291
|
+
"%% @doc This function is called whenever an application has stopped. It",
|
|
292
|
+
"%% is intended to be the opposite of `?MODULE:start/2' and should do",
|
|
293
|
+
"%% any necessary cleaning up. The return value is ignored.",
|
|
294
|
+
"%% @end",
|
|
295
|
+
"%%--------------------------------------------------------------------",
|
|
296
|
+
"-spec stop(State :: term()) -> any().",
|
|
297
|
+
"stop(_State) ->",
|
|
298
|
+
" ok.",
|
|
299
|
+
"",
|
|
300
|
+
"%%--------------------------------------------------------------------",
|
|
301
|
+
"%% @private",
|
|
302
|
+
"%% @doc This function is called when an application is about to be stopped,",
|
|
303
|
+
"%% before shutting down the processes of the application.",
|
|
304
|
+
"%% @end",
|
|
305
|
+
"%%--------------------------------------------------------------------",
|
|
306
|
+
"-spec prep_stop(State :: term()) -> NewState :: term().",
|
|
307
|
+
"prep_stop(State) ->",
|
|
308
|
+
" State.",
|
|
309
|
+
"",
|
|
310
|
+
"%%--------------------------------------------------------------------",
|
|
311
|
+
"%% @private",
|
|
312
|
+
"%% @doc This function is called by an application after a code replacement,",
|
|
313
|
+
"%% if the configuration parameters have changed.",
|
|
314
|
+
"%% @end",
|
|
315
|
+
"%%--------------------------------------------------------------------",
|
|
316
|
+
"-spec config_change(Changed :: [{Par :: atom(), Val :: term()}],",
|
|
317
|
+
" New :: [{Par :: atom(), Val :: term()}],",
|
|
318
|
+
" Removed :: [Par :: atom()]) -> ok.",
|
|
319
|
+
"config_change(_Changed, _New, _Removed) ->",
|
|
320
|
+
" ok.",
|
|
321
|
+
"",
|
|
322
|
+
"%%%===================================================================",
|
|
323
|
+
"%%% Internal functions",
|
|
324
|
+
"%%%===================================================================",
|
|
325
|
+
""
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
"supervisor behavior" : {
|
|
330
|
+
"prefix" : "erl-supervisor",
|
|
331
|
+
"description" : "Insert an example of supervisor",
|
|
332
|
+
"body" : [
|
|
333
|
+
"-behaviour(supervisor).",
|
|
334
|
+
"",
|
|
335
|
+
"%% API",
|
|
336
|
+
"-export([start_link/0]).",
|
|
337
|
+
"-export([init/1]).",
|
|
338
|
+
"",
|
|
339
|
+
"start_link() ->",
|
|
340
|
+
" supervisor:start_link({local, ?MODULE}, ?MODULE, []).",
|
|
341
|
+
"",
|
|
342
|
+
"init(_Args) ->",
|
|
343
|
+
" SupervisorSpecification = #{",
|
|
344
|
+
" strategy => one_for_one, % one_for_one | one_for_all | rest_for_one | simple_one_for_one",
|
|
345
|
+
" intensity => 10,",
|
|
346
|
+
" period => 60},",
|
|
347
|
+
"",
|
|
348
|
+
" ChildSpecifications = [",
|
|
349
|
+
" #{",
|
|
350
|
+
" id => ${1:A_Name},",
|
|
351
|
+
" start => {${2:A_Worker_Module}, start_link, []},",
|
|
352
|
+
" restart => permanent, % permanent | transient | temporary",
|
|
353
|
+
" shutdown => 2000, % use 'infinity' for supervisor child",
|
|
354
|
+
" type => worker, % worker | supervisor",
|
|
355
|
+
" modules => [$2]",
|
|
356
|
+
" }",
|
|
357
|
+
" ],",
|
|
358
|
+
"",
|
|
359
|
+
" {ok, {SupervisorSpecification, ChildSpecifications}}.",
|
|
360
|
+
""
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
"supervisor behavior (large)" : {
|
|
365
|
+
"prefix" : "erl-supervisor-large",
|
|
366
|
+
"description" : "Insert an example of supervisor with all the callbacks and decoration",
|
|
367
|
+
"body" : [
|
|
368
|
+
"-behaviour(supervisor).",
|
|
369
|
+
"",
|
|
370
|
+
"%% API",
|
|
371
|
+
"-export([start_link/0]).",
|
|
372
|
+
"",
|
|
373
|
+
"%% Supervisor callbacks",
|
|
374
|
+
"-export([init/1]).",
|
|
375
|
+
"",
|
|
376
|
+
"%%%===================================================================",
|
|
377
|
+
"%%% Includes, defines, types and records",
|
|
378
|
+
"%%%===================================================================",
|
|
379
|
+
"",
|
|
380
|
+
"-define(SERVER, ?MODULE).",
|
|
381
|
+
"",
|
|
382
|
+
"%%%===================================================================",
|
|
383
|
+
"%%% API functions",
|
|
384
|
+
"%%%===================================================================",
|
|
385
|
+
"",
|
|
386
|
+
"%%--------------------------------------------------------------------",
|
|
387
|
+
"%% @doc Starts the supervisor",
|
|
388
|
+
"%% @end",
|
|
389
|
+
"%%--------------------------------------------------------------------",
|
|
390
|
+
"-spec start_link() -> {ok, Pid :: pid()} |",
|
|
391
|
+
" {error, {already_started, Pid :: pid()}} |",
|
|
392
|
+
" {error, {shutdown, term()}} |",
|
|
393
|
+
" {error, term()} |",
|
|
394
|
+
" ignore.",
|
|
395
|
+
"start_link() ->",
|
|
396
|
+
" supervisor:start_link({local, ?SERVER}, ?MODULE, []).",
|
|
397
|
+
"",
|
|
398
|
+
"%%%===================================================================",
|
|
399
|
+
"%%% Supervisor callbacks",
|
|
400
|
+
"%%%===================================================================",
|
|
401
|
+
"",
|
|
402
|
+
"%%--------------------------------------------------------------------",
|
|
403
|
+
"%% @private",
|
|
404
|
+
"%% @doc",
|
|
405
|
+
"%% Whenever a supervisor is started using supervisor:start_link/[2,3],",
|
|
406
|
+
"%% this function is called by the new process to find out about",
|
|
407
|
+
"%% restart strategy, maximum restart intensity, and child",
|
|
408
|
+
"%% specifications.",
|
|
409
|
+
"%% @end",
|
|
410
|
+
"%%--------------------------------------------------------------------",
|
|
411
|
+
"-spec init(Args :: term()) ->",
|
|
412
|
+
" {ok, {SupFlags :: supervisor:sup_flags(),",
|
|
413
|
+
" [ChildSpec :: supervisor:child_spec()]}} |",
|
|
414
|
+
" ignore.",
|
|
415
|
+
"init([]) ->",
|
|
416
|
+
"",
|
|
417
|
+
" SupFlags = #{",
|
|
418
|
+
" strategy => one_for_one, % one_for_one | one_for_all | rest_for_one | simple_one_for_one",
|
|
419
|
+
" intensity => 10,",
|
|
420
|
+
" period => 60",
|
|
421
|
+
" },",
|
|
422
|
+
"",
|
|
423
|
+
" ChildSpecifications = [",
|
|
424
|
+
" #{id => ${1:A_Name},",
|
|
425
|
+
" start => {${2:A_Worker_Module}, start_link, []},",
|
|
426
|
+
" restart => permanent, % permanent | transient | temporary",
|
|
427
|
+
" shutdown => 5000, % use 'infinity' for supervisor child",
|
|
428
|
+
" type => worker,",
|
|
429
|
+
" modules => [$2]}",
|
|
430
|
+
" ],",
|
|
431
|
+
"",
|
|
432
|
+
" {ok, {SupFlags, ChildSpecifications}}.",
|
|
433
|
+
"",
|
|
434
|
+
"%%%===================================================================",
|
|
435
|
+
"%%% Internal functions",
|
|
436
|
+
"%%%===================================================================",
|
|
437
|
+
""
|
|
438
|
+
]
|
|
439
|
+
},
|
|
440
|
+
|
|
441
|
+
"supervisor_bridge behavior (large)" : {
|
|
442
|
+
"prefix" : "erl-supervisor_bridge-large",
|
|
443
|
+
"description" : "Insert an example of supervisor_bridge with all the callbacks and decoration",
|
|
444
|
+
"body" : [
|
|
445
|
+
"-behaviour(supervisor_bridge).",
|
|
446
|
+
"",
|
|
447
|
+
"%% API",
|
|
448
|
+
"-export([start_link/0]).",
|
|
449
|
+
"",
|
|
450
|
+
"%% supervisor_bridge callbacks",
|
|
451
|
+
"-export([init/1, terminate/2]).",
|
|
452
|
+
"",
|
|
453
|
+
"%%%===================================================================",
|
|
454
|
+
"%%% Includes, defines, types and records",
|
|
455
|
+
"%%%===================================================================",
|
|
456
|
+
"",
|
|
457
|
+
"-define(SERVER, ?MODULE).",
|
|
458
|
+
"",
|
|
459
|
+
"-record(state, {}).",
|
|
460
|
+
"",
|
|
461
|
+
"%%%===================================================================",
|
|
462
|
+
"%%% API",
|
|
463
|
+
"%%%===================================================================",
|
|
464
|
+
"",
|
|
465
|
+
"%%--------------------------------------------------------------------",
|
|
466
|
+
"%% @doc",
|
|
467
|
+
"%% Starts the supervisor bridge",
|
|
468
|
+
"%% @end",
|
|
469
|
+
"%%--------------------------------------------------------------------",
|
|
470
|
+
"-spec start_link() -> {ok, Pid :: pid()} |",
|
|
471
|
+
" {error, {already_started, Pid :: pid()}} |",
|
|
472
|
+
" {error, term()} |",
|
|
473
|
+
" ignore.",
|
|
474
|
+
"start_link() ->",
|
|
475
|
+
" supervisor_bridge:start_link({local, ?SERVER}, ?MODULE, []).",
|
|
476
|
+
"",
|
|
477
|
+
"%%%===================================================================",
|
|
478
|
+
"%%% supervisor_bridge callbacks",
|
|
479
|
+
"%%%===================================================================",
|
|
480
|
+
"",
|
|
481
|
+
"%%--------------------------------------------------------------------",
|
|
482
|
+
"%% @private",
|
|
483
|
+
"%% @doc",
|
|
484
|
+
"%% Creates a supervisor_bridge process, linked to the calling process,",
|
|
485
|
+
"%% which calls Module:init/1 to start the subsystem. To ensure a",
|
|
486
|
+
"%% synchronized start-up procedure, this function does not return",
|
|
487
|
+
"%% until Module:init/1 has returned.",
|
|
488
|
+
"%% @end",
|
|
489
|
+
"%%--------------------------------------------------------------------",
|
|
490
|
+
"-spec init(Args :: term()) -> {ok, Pid :: pid(), State :: term()} |",
|
|
491
|
+
" {error, Error :: term()} |",
|
|
492
|
+
" ignore.",
|
|
493
|
+
"init([]) ->",
|
|
494
|
+
" case ${1:A_Worker_Module}:start_link() of",
|
|
495
|
+
" {ok, Pid} ->",
|
|
496
|
+
" {ok, Pid, #state{}};",
|
|
497
|
+
" Error ->",
|
|
498
|
+
" Error",
|
|
499
|
+
" end.",
|
|
500
|
+
"",
|
|
501
|
+
"%%--------------------------------------------------------------------",
|
|
502
|
+
"%% @private",
|
|
503
|
+
"%% @doc",
|
|
504
|
+
"%% This function is called by the supervisor_bridge when it is about",
|
|
505
|
+
"%% to terminate. It should be the opposite of Module:init/1 and stop",
|
|
506
|
+
"%% the subsystem and do any necessary cleaning up.The return value is",
|
|
507
|
+
"%% ignored.",
|
|
508
|
+
"%% @end",
|
|
509
|
+
"%%--------------------------------------------------------------------",
|
|
510
|
+
"-spec terminate(Reason :: shutdown | term(), State :: term()) -> any().",
|
|
511
|
+
"terminate(_Reason, _State) ->",
|
|
512
|
+
" $1:stop(),",
|
|
513
|
+
" ok.",
|
|
514
|
+
"",
|
|
515
|
+
"%%%===================================================================",
|
|
516
|
+
"%%% Internal functions",
|
|
517
|
+
"%%%===================================================================",
|
|
518
|
+
"",
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
|
|
522
|
+
"gen_fsm behavior (DEPRECATED)" : {
|
|
523
|
+
"prefix" : "erl-gen_fsm",
|
|
524
|
+
"description" : "DEPRECATED! Insert an empty gen_fsm. Deprecated and replaced by gen_statem.",
|
|
525
|
+
"body" : [
|
|
526
|
+
"-behaviour(gen_fsm).",
|
|
527
|
+
"",
|
|
528
|
+
"%% API",
|
|
529
|
+
"-export([start/1, stop/1, start_link/1]).",
|
|
530
|
+
"-export([init/1, handle_event/3, handle_sync_event/4, handle_info/3,",
|
|
531
|
+
" terminate/3, code_change/4,",
|
|
532
|
+
" dummy_state/2, dummy_state/3]).",
|
|
533
|
+
"",
|
|
534
|
+
"-record(state, {dummy}).",
|
|
535
|
+
"",
|
|
536
|
+
"start(Name) ->",
|
|
537
|
+
" gen_fsm:start(?MODULE, [Name], []).",
|
|
538
|
+
"",
|
|
539
|
+
"stop(FsmRef) ->",
|
|
540
|
+
" gen_fsm:stop(FsmRef).",
|
|
541
|
+
"",
|
|
542
|
+
"start_link(Name) ->",
|
|
543
|
+
" gen_fsm:start_link({local, Name}, ?MODULE, [Name], []).",
|
|
544
|
+
"",
|
|
545
|
+
"init(_Args) ->",
|
|
546
|
+
" {ok, dummy_state, #state{dummy=1}}.",
|
|
547
|
+
"",
|
|
548
|
+
"dummy_state(_Event, StateData) ->",
|
|
549
|
+
" {next_state, dummy_state, StateData}.",
|
|
550
|
+
"",
|
|
551
|
+
"dummy_state(_Event, From, StateData) ->",
|
|
552
|
+
" gen_fsm:reply(From, ok),",
|
|
553
|
+
" {next_state, dummy_state, StateData}.",
|
|
554
|
+
"",
|
|
555
|
+
"handle_event(_Event, _StateName, StateData) ->",
|
|
556
|
+
" {next_state, dummy_state, StateData}.",
|
|
557
|
+
"",
|
|
558
|
+
"handle_sync_event(_Event, From, _StateName, StateData) ->",
|
|
559
|
+
" gen_fsm:reply(From, ok),",
|
|
560
|
+
" {next_state, dummy_state, StateData}.",
|
|
561
|
+
"",
|
|
562
|
+
"handle_info(_Info, _StateName, StateData) ->",
|
|
563
|
+
" {next_state, dummy_state, StateData}.",
|
|
564
|
+
"",
|
|
565
|
+
"terminate(_Reason, _StateName, _StateData) ->",
|
|
566
|
+
" ok.",
|
|
567
|
+
"",
|
|
568
|
+
"code_change(_OldVersion, _StateName, StateData, _Extra) ->",
|
|
569
|
+
" {ok, dummy_state, StateData}.",
|
|
570
|
+
""
|
|
571
|
+
]
|
|
572
|
+
},
|
|
573
|
+
|
|
574
|
+
"gen_event behavior" : {
|
|
575
|
+
"prefix" : "erl-gen_event",
|
|
576
|
+
"description" : "Insert an empty gen_event",
|
|
577
|
+
"body" : [
|
|
578
|
+
"-behaviour(gen_event).",
|
|
579
|
+
"",
|
|
580
|
+
"-export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]).",
|
|
581
|
+
"",
|
|
582
|
+
"init(_Args) ->",
|
|
583
|
+
" {ok, []}.",
|
|
584
|
+
"",
|
|
585
|
+
"handle_event(_Event, State) ->",
|
|
586
|
+
" {ok, State}.",
|
|
587
|
+
"",
|
|
588
|
+
"handle_call(_Request, State) ->",
|
|
589
|
+
" {ok, no_reply, State}.",
|
|
590
|
+
"",
|
|
591
|
+
"handle_info(_Info, State) ->",
|
|
592
|
+
" {ok, State}.",
|
|
593
|
+
"",
|
|
594
|
+
"terminate(_Args, _State) ->",
|
|
595
|
+
" ok.",
|
|
596
|
+
"",
|
|
597
|
+
"code_change(_OldVsn, State, _Extra) ->",
|
|
598
|
+
" {ok, State}.",
|
|
599
|
+
""
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
|
|
603
|
+
"gen_event behavior (large)" : {
|
|
604
|
+
"prefix" : "erl-gen_event-large",
|
|
605
|
+
"description" : "Insert an empty gen_event with all the callbacks and decoration",
|
|
606
|
+
"body" : [
|
|
607
|
+
"-behaviour(gen_event).",
|
|
608
|
+
"",
|
|
609
|
+
"%% API",
|
|
610
|
+
"-export([start_link/0, add_handler/0]).",
|
|
611
|
+
"",
|
|
612
|
+
"%% gen_event callbacks",
|
|
613
|
+
"-export([init/1, handle_event/2, handle_call/2, handle_info/2,",
|
|
614
|
+
" terminate/2, code_change/3, format_status/2]).",
|
|
615
|
+
"",
|
|
616
|
+
"%%%===================================================================",
|
|
617
|
+
"%%% Includes, defines, types and records",
|
|
618
|
+
"%%%===================================================================",
|
|
619
|
+
"",
|
|
620
|
+
"-define(SERVER, ?MODULE).",
|
|
621
|
+
"",
|
|
622
|
+
"-record(state, {}).",
|
|
623
|
+
"",
|
|
624
|
+
"%%%===================================================================",
|
|
625
|
+
"%%% API",
|
|
626
|
+
"%%%===================================================================",
|
|
627
|
+
"",
|
|
628
|
+
"%%--------------------------------------------------------------------",
|
|
629
|
+
"%% @doc",
|
|
630
|
+
"%% Creates an event manager",
|
|
631
|
+
"%% @end",
|
|
632
|
+
"%%--------------------------------------------------------------------",
|
|
633
|
+
"-spec start_link() -> {ok, Pid :: pid()} |",
|
|
634
|
+
" {error, Error :: {already_started, pid()} | term()}.",
|
|
635
|
+
"start_link() ->",
|
|
636
|
+
" gen_event:start_link({local, ?SERVER}).",
|
|
637
|
+
"",
|
|
638
|
+
"%%--------------------------------------------------------------------",
|
|
639
|
+
"%% @doc",
|
|
640
|
+
"%% Adds an event handler",
|
|
641
|
+
"%% @end",
|
|
642
|
+
"%%--------------------------------------------------------------------",
|
|
643
|
+
"-spec add_handler() -> ok | {'EXIT', Reason :: term()} | term().",
|
|
644
|
+
"add_handler() ->",
|
|
645
|
+
" gen_event:add_handler(?SERVER, ?MODULE, []).",
|
|
646
|
+
"",
|
|
647
|
+
"%%%===================================================================",
|
|
648
|
+
"%%% gen_event callbacks",
|
|
649
|
+
"%%%===================================================================",
|
|
650
|
+
"",
|
|
651
|
+
"%%--------------------------------------------------------------------",
|
|
652
|
+
"%% @private",
|
|
653
|
+
"%% @doc",
|
|
654
|
+
"%% Whenever a new event handler is added to an event manager,",
|
|
655
|
+
"%% this function is called to initialize the event handler.",
|
|
656
|
+
"%% @end",
|
|
657
|
+
"%%--------------------------------------------------------------------",
|
|
658
|
+
"-spec init(Args :: term() | {Args :: term(), Term :: term()}) ->",
|
|
659
|
+
" {ok, State :: term()} |",
|
|
660
|
+
" {ok, State :: term(), hibernate} |",
|
|
661
|
+
" {error, Reason :: term()}.",
|
|
662
|
+
"init([]) ->",
|
|
663
|
+
" {ok, #state{}}.",
|
|
664
|
+
"",
|
|
665
|
+
"%%--------------------------------------------------------------------",
|
|
666
|
+
"%% @private",
|
|
667
|
+
"%% @doc",
|
|
668
|
+
"%% Whenever an event manager receives an event sent using",
|
|
669
|
+
"%% gen_event:notify/2 or gen_event:sync_notify/2, this function is",
|
|
670
|
+
"%% called for each installed event handler to handle the event.",
|
|
671
|
+
"%% @end",
|
|
672
|
+
"%%--------------------------------------------------------------------",
|
|
673
|
+
"-spec handle_event(Event :: term(), State :: term()) ->",
|
|
674
|
+
" {ok, NewState :: term()} |",
|
|
675
|
+
" {ok, NewState :: term(), hibernate} |",
|
|
676
|
+
" remove_handler |",
|
|
677
|
+
" {swap_handler, Args1 :: term(), NewState :: term(),",
|
|
678
|
+
" Handler2 :: atom() | {atom(), term()} , Args2 :: term()}.",
|
|
679
|
+
"handle_event(_Event, State) ->",
|
|
680
|
+
" {ok, State}.",
|
|
681
|
+
"",
|
|
682
|
+
"%%--------------------------------------------------------------------",
|
|
683
|
+
"%% @private",
|
|
684
|
+
"%% @doc",
|
|
685
|
+
"%% Whenever an event manager receives a request sent using",
|
|
686
|
+
"%% gen_event:call/3,4, this function is called for the specified",
|
|
687
|
+
"%% event handler to handle the request.",
|
|
688
|
+
"%% @end",
|
|
689
|
+
"%%--------------------------------------------------------------------",
|
|
690
|
+
"-spec handle_call(Request :: term(), State :: term()) ->",
|
|
691
|
+
" {ok, Reply :: term(), NewState :: term()} |",
|
|
692
|
+
" {ok, Reply :: term(), NewState :: term(), hibernate} |",
|
|
693
|
+
" {remove_handler, Reply :: term()} |",
|
|
694
|
+
" {swap_handler, Reply :: term(), Args1 :: term(), NewState :: term(),",
|
|
695
|
+
" Handler2 :: atom() | {atom(), term()}, Args2 :: term()}.",
|
|
696
|
+
"handle_call(_Request, State) ->",
|
|
697
|
+
" Reply = ok,",
|
|
698
|
+
" {ok, Reply, State}.",
|
|
699
|
+
"",
|
|
700
|
+
"%%--------------------------------------------------------------------",
|
|
701
|
+
"%% @private",
|
|
702
|
+
"%% @doc",
|
|
703
|
+
"%% This function is called for each installed event handler when",
|
|
704
|
+
"%% an event manager receives any other message than an event or a",
|
|
705
|
+
"%% synchronous request (or a system message).",
|
|
706
|
+
"%% @end",
|
|
707
|
+
"%%--------------------------------------------------------------------",
|
|
708
|
+
"-spec handle_info(Info :: term(), State :: term()) ->",
|
|
709
|
+
" {ok, NewState :: term()} |",
|
|
710
|
+
" {ok, NewState :: term(), hibernate} |",
|
|
711
|
+
" remove_handler |",
|
|
712
|
+
" {swap_handler, Args1 :: term(), NewState :: term(),",
|
|
713
|
+
" Handler2 :: atom() | {atom(), term()}, Args2 :: term()}.",
|
|
714
|
+
"handle_info(_Info, State) ->",
|
|
715
|
+
" {ok, State}.",
|
|
716
|
+
"",
|
|
717
|
+
"%%--------------------------------------------------------------------",
|
|
718
|
+
"%% @private",
|
|
719
|
+
"%% @doc",
|
|
720
|
+
"%% Whenever an event handler is deleted from an event manager, this",
|
|
721
|
+
"%% function is called. It should be the opposite of Module:init/1 and",
|
|
722
|
+
"%% do any necessary cleaning up.",
|
|
723
|
+
"%% @end",
|
|
724
|
+
"%%--------------------------------------------------------------------",
|
|
725
|
+
"-spec terminate(Arg :: {stop, Reason :: term()} |",
|
|
726
|
+
" stop |",
|
|
727
|
+
" remove_handler |",
|
|
728
|
+
" {error, {'EXIT', Reason :: term()}} |",
|
|
729
|
+
" {error, Term :: term()} |",
|
|
730
|
+
" term(),",
|
|
731
|
+
" State :: term()) -> any().",
|
|
732
|
+
"terminate(_Arg, _State) ->",
|
|
733
|
+
" ok.",
|
|
734
|
+
"",
|
|
735
|
+
"%%--------------------------------------------------------------------",
|
|
736
|
+
"%% @private",
|
|
737
|
+
"%% @doc",
|
|
738
|
+
"%% Convert process state when code is changed",
|
|
739
|
+
"%% @end",
|
|
740
|
+
"%%--------------------------------------------------------------------",
|
|
741
|
+
"-spec code_change(OldVsn :: term() | {down, term()},",
|
|
742
|
+
" State :: term(),",
|
|
743
|
+
" Extra :: term()) -> {ok, NewState :: term()}.",
|
|
744
|
+
"code_change(_OldVsn, State, _Extra) ->",
|
|
745
|
+
" {ok, State}.",
|
|
746
|
+
"",
|
|
747
|
+
"%%--------------------------------------------------------------------",
|
|
748
|
+
"%% @private",
|
|
749
|
+
"%% @doc",
|
|
750
|
+
"%% This function is called for changing the form and appearance",
|
|
751
|
+
"%% of gen_event status when it is returned from sys:get_status/1,2",
|
|
752
|
+
"%% or when it appears in termination error logs.",
|
|
753
|
+
"%% @end",
|
|
754
|
+
"%%--------------------------------------------------------------------",
|
|
755
|
+
"-spec format_status(Opt :: normal | terminate,",
|
|
756
|
+
" Status :: list()) -> Status :: term().",
|
|
757
|
+
"format_status(_Opt, Status) ->",
|
|
758
|
+
" Status.",
|
|
759
|
+
"",
|
|
760
|
+
"%%%===================================================================",
|
|
761
|
+
"%%% Internal functions",
|
|
762
|
+
"%%%===================================================================",
|
|
763
|
+
"",
|
|
764
|
+
]
|
|
765
|
+
},
|
|
766
|
+
|
|
767
|
+
"gen_statem behavior (handle_event/4)" : {
|
|
768
|
+
"prefix" : "erl-gen_statem-handle_event",
|
|
769
|
+
"description" : "Insert an empty gen_statem with handle_event/4 function",
|
|
770
|
+
"body" : [
|
|
771
|
+
"-behaviour(gen_statem).",
|
|
772
|
+
"",
|
|
773
|
+
"-export([stop/0, start_link/0]).",
|
|
774
|
+
"-export([init/1, callback_mode/0, handle_event/4, terminate/3, code_change/4]).",
|
|
775
|
+
"",
|
|
776
|
+
"stop() ->",
|
|
777
|
+
" gen_statem:stop(?MODULE).",
|
|
778
|
+
"",
|
|
779
|
+
"start_link() ->",
|
|
780
|
+
" gen_statem:start_link({local, ?MODULE}, ?MODULE, [], []).",
|
|
781
|
+
"",
|
|
782
|
+
"init(_Args) ->",
|
|
783
|
+
" {ok, state, []}.",
|
|
784
|
+
"",
|
|
785
|
+
"%% state_functions | handle_event_function | [_, state_enter].",
|
|
786
|
+
"callback_mode() ->",
|
|
787
|
+
" handle_event_function.",
|
|
788
|
+
"",
|
|
789
|
+
"handle_event(enter, _OldState, _State, _Data) ->",
|
|
790
|
+
" keep_state_and_data;",
|
|
791
|
+
"",
|
|
792
|
+
"handle_event(_EventType, _EventContent, _State, _Data) ->",
|
|
793
|
+
" keep_state_and_data.",
|
|
794
|
+
"",
|
|
795
|
+
"terminate(_Reason, _State, _Data) ->",
|
|
796
|
+
" ok.",
|
|
797
|
+
"",
|
|
798
|
+
"code_change(_OldVsn, State, Data, _Extra) ->",
|
|
799
|
+
" {ok, State, Data}.",
|
|
800
|
+
""
|
|
801
|
+
]
|
|
802
|
+
},
|
|
803
|
+
|
|
804
|
+
"gen_statem behavior (handle_event/4, large)" : {
|
|
805
|
+
"prefix" : "erl-gen_statem-handle_event-large",
|
|
806
|
+
"description" : "Insert an empty gen_statem with handle_event/4 function, all the callbacks and decoration",
|
|
807
|
+
"body": [
|
|
808
|
+
"-behaviour(gen_statem).",
|
|
809
|
+
"",
|
|
810
|
+
"%% API",
|
|
811
|
+
"-export([start_link/0]).",
|
|
812
|
+
"",
|
|
813
|
+
"%% gen_statem callbacks",
|
|
814
|
+
"-export([callback_mode/0, init/1, terminate/3, code_change/4]).",
|
|
815
|
+
"-export([handle_event/4]).",
|
|
816
|
+
"",
|
|
817
|
+
"%%%===================================================================",
|
|
818
|
+
"%%% Includes, defines, types and records",
|
|
819
|
+
"%%%===================================================================",
|
|
820
|
+
"",
|
|
821
|
+
"-define(SERVER, ?MODULE).",
|
|
822
|
+
"",
|
|
823
|
+
"-record(data, {}).",
|
|
824
|
+
"",
|
|
825
|
+
"%%%===================================================================",
|
|
826
|
+
"%%% API",
|
|
827
|
+
"%%%===================================================================",
|
|
828
|
+
"",
|
|
829
|
+
"%%--------------------------------------------------------------------",
|
|
830
|
+
"%% @doc",
|
|
831
|
+
"%% Creates a gen_statem process which calls Module:init/1 to",
|
|
832
|
+
"%% initialize. To ensure a synchronized start-up procedure, this",
|
|
833
|
+
"%% function does not return until Module:init/1 has returned.",
|
|
834
|
+
"%% @end",
|
|
835
|
+
"%%--------------------------------------------------------------------",
|
|
836
|
+
"-spec start_link() -> {ok, Pid :: pid()} |",
|
|
837
|
+
" ignore |",
|
|
838
|
+
" {error, Error :: term()}.",
|
|
839
|
+
"start_link() ->",
|
|
840
|
+
" gen_statem:start_link({local, ?SERVER}, ?MODULE, [], []).",
|
|
841
|
+
"",
|
|
842
|
+
"%%%===================================================================",
|
|
843
|
+
"%%% gen_statem callbacks",
|
|
844
|
+
"%%%===================================================================",
|
|
845
|
+
"",
|
|
846
|
+
"%%--------------------------------------------------------------------",
|
|
847
|
+
"%% @private",
|
|
848
|
+
"%% @doc",
|
|
849
|
+
"%% Define the callback_mode() for this callback module.",
|
|
850
|
+
"%% @end",
|
|
851
|
+
"%%--------------------------------------------------------------------",
|
|
852
|
+
"-spec callback_mode() -> gen_statem:callback_mode_result().",
|
|
853
|
+
"callback_mode() -> handle_event_function.",
|
|
854
|
+
"",
|
|
855
|
+
"%%--------------------------------------------------------------------",
|
|
856
|
+
"%% @private",
|
|
857
|
+
"%% @doc",
|
|
858
|
+
"%% Whenever a gen_statem is started using gen_statem:start/[3,4] or",
|
|
859
|
+
"%% gen_statem:start_link/[3,4], this function is called by the new",
|
|
860
|
+
"%% process to initialize.",
|
|
861
|
+
"%% @end",
|
|
862
|
+
"%%--------------------------------------------------------------------",
|
|
863
|
+
"-spec init(Args :: term()) -> gen_statem:init_result(term()).",
|
|
864
|
+
"init([]) ->",
|
|
865
|
+
" process_flag(trap_exit, true),",
|
|
866
|
+
" {ok, state_name, #data{}}.",
|
|
867
|
+
"",
|
|
868
|
+
"%%--------------------------------------------------------------------",
|
|
869
|
+
"%% @private",
|
|
870
|
+
"%% @doc",
|
|
871
|
+
"%% This function is called for every event a gen_statem receives.",
|
|
872
|
+
"%% @end",
|
|
873
|
+
"%%--------------------------------------------------------------------",
|
|
874
|
+
"-spec handle_event('enter',",
|
|
875
|
+
" OldState :: term(),",
|
|
876
|
+
" State :: term(),",
|
|
877
|
+
" Data :: term()) ->",
|
|
878
|
+
" gen_statem:state_enter_result(term());",
|
|
879
|
+
" (gen_statem:event_type(),",
|
|
880
|
+
" Msg :: term(),",
|
|
881
|
+
" State :: term(),",
|
|
882
|
+
" Data :: term()) ->",
|
|
883
|
+
" gen_statem:event_handler_result(term()).",
|
|
884
|
+
"handle_event({call,From}, _Msg, State, Data) ->",
|
|
885
|
+
" {next_state, State, Data, [{reply,From,ok}]}.",
|
|
886
|
+
"",
|
|
887
|
+
"%%--------------------------------------------------------------------",
|
|
888
|
+
"%% @private",
|
|
889
|
+
"%% @doc",
|
|
890
|
+
"%% This function is called by a gen_statem when it is about to",
|
|
891
|
+
"%% terminate. It should be the opposite of Module:init/1 and do any",
|
|
892
|
+
"%% necessary cleaning up. When it returns, the gen_statem terminates with",
|
|
893
|
+
"%% Reason. The return value is ignored.",
|
|
894
|
+
"%% @end",
|
|
895
|
+
"%%--------------------------------------------------------------------",
|
|
896
|
+
"-spec terminate(Reason :: term(), State :: term(), Data :: term()) -> any().",
|
|
897
|
+
"terminate(_Reason, _State, _Data) ->",
|
|
898
|
+
" void.",
|
|
899
|
+
"",
|
|
900
|
+
"%%--------------------------------------------------------------------",
|
|
901
|
+
"%% @private",
|
|
902
|
+
"%% @doc",
|
|
903
|
+
"%% Convert process state when code is changed",
|
|
904
|
+
"%% @end",
|
|
905
|
+
"%%--------------------------------------------------------------------",
|
|
906
|
+
"-spec code_change(OldVsn :: term() | {down,term()},",
|
|
907
|
+
" State :: term(),",
|
|
908
|
+
" Data :: term(),",
|
|
909
|
+
" Extra :: term()) ->",
|
|
910
|
+
" {ok, NewState :: term(), NewData :: term()} |",
|
|
911
|
+
" (Reason :: term()).",
|
|
912
|
+
"code_change(_OldVsn, State, Data, _Extra) ->",
|
|
913
|
+
" {ok, State, Data}.",
|
|
914
|
+
"",
|
|
915
|
+
"%%%===================================================================",
|
|
916
|
+
"%%% Internal functions",
|
|
917
|
+
"%%%===================================================================",
|
|
918
|
+
""
|
|
919
|
+
]
|
|
920
|
+
},
|
|
921
|
+
|
|
922
|
+
"gen_statem behavior (StateName/3)" : {
|
|
923
|
+
"prefix" : "erl-gen_statem-state-name",
|
|
924
|
+
"description" : "Insert an empty gen_statem with StateName/3 functions",
|
|
925
|
+
"body": [
|
|
926
|
+
"-behaviour(gen_statem).",
|
|
927
|
+
"",
|
|
928
|
+
"-export([start_link/0, stop/0]).",
|
|
929
|
+
"-export([callback_mode/0, init/1, terminate/3, code_change/4]).",
|
|
930
|
+
"-export([$1/3]).",
|
|
931
|
+
"",
|
|
932
|
+
"-define(SERVER, ?MODULE).",
|
|
933
|
+
"",
|
|
934
|
+
"-record(data, {}).",
|
|
935
|
+
"",
|
|
936
|
+
"start_link() ->",
|
|
937
|
+
" gen_statem:start_link({local, ?SERVER}, ?MODULE, [], []).",
|
|
938
|
+
"",
|
|
939
|
+
"stop() ->",
|
|
940
|
+
" gen_statem:stop(?MODULE).",
|
|
941
|
+
"",
|
|
942
|
+
"%% state_functions | handle_event_function | [_, state_enter].",
|
|
943
|
+
"callback_mode() -> state_functions.",
|
|
944
|
+
"",
|
|
945
|
+
"init([]) ->",
|
|
946
|
+
" process_flag(trap_exit, true),",
|
|
947
|
+
" {ok, ${1:state_name}, #data{}}.",
|
|
948
|
+
"",
|
|
949
|
+
"$1({call,Caller}, _Msg, Data) ->",
|
|
950
|
+
" {next_state, $1, Data, [{reply,Caller,ok}]}.",
|
|
951
|
+
"",
|
|
952
|
+
"terminate(_Reason, _State, _Data) ->",
|
|
953
|
+
" void.",
|
|
954
|
+
"",
|
|
955
|
+
"code_change(_OldVsn, State, Data, _Extra) ->",
|
|
956
|
+
" {ok, State, Data}.",
|
|
957
|
+
"",
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
|
|
961
|
+
"gen_statem behavior (StateName/3, large)" : {
|
|
962
|
+
"prefix" : "erl-gen_statem-state-name-large",
|
|
963
|
+
"description" : "Insert an empty gen_statem with StateName/3 functions, all the callbacks and decoration",
|
|
964
|
+
"body": [
|
|
965
|
+
"-behaviour(gen_statem).",
|
|
966
|
+
"",
|
|
967
|
+
"%% API",
|
|
968
|
+
"-export([start_link/0]).",
|
|
969
|
+
"",
|
|
970
|
+
"%% gen_statem callbacks",
|
|
971
|
+
"-export([callback_mode/0, init/1, terminate/3, code_change/4]).",
|
|
972
|
+
"-export([$1/3]).",
|
|
973
|
+
"",
|
|
974
|
+
"%%%===================================================================",
|
|
975
|
+
"%%% Includes, defines, types and records",
|
|
976
|
+
"%%%===================================================================",
|
|
977
|
+
"",
|
|
978
|
+
"-define(SERVER, ?MODULE).",
|
|
979
|
+
"",
|
|
980
|
+
"-record(data, {}).",
|
|
981
|
+
"",
|
|
982
|
+
"%%%===================================================================",
|
|
983
|
+
"%%% API",
|
|
984
|
+
"%%%===================================================================",
|
|
985
|
+
"",
|
|
986
|
+
"%%--------------------------------------------------------------------",
|
|
987
|
+
"%% @doc",
|
|
988
|
+
"%% Creates a gen_statem process which calls Module:init/1 to",
|
|
989
|
+
"%% initialize. To ensure a synchronized start-up procedure, this",
|
|
990
|
+
"%% function does not return until Module:init/1 has returned.",
|
|
991
|
+
"%% @end",
|
|
992
|
+
"%%--------------------------------------------------------------------",
|
|
993
|
+
"-spec start_link() -> {ok, Pid :: pid()} |",
|
|
994
|
+
" ignore |",
|
|
995
|
+
" {error, Error :: term()}.",
|
|
996
|
+
"start_link() ->",
|
|
997
|
+
" gen_statem:start_link({local, ?SERVER}, ?MODULE, [], []).",
|
|
998
|
+
"",
|
|
999
|
+
"%%%===================================================================",
|
|
1000
|
+
"%%% gen_statem callbacks",
|
|
1001
|
+
"%%%===================================================================",
|
|
1002
|
+
"",
|
|
1003
|
+
"%%--------------------------------------------------------------------",
|
|
1004
|
+
"%% @private",
|
|
1005
|
+
"%% @doc",
|
|
1006
|
+
"%% Define the callback_mode() for this callback module.",
|
|
1007
|
+
"%% @end",
|
|
1008
|
+
"%%--------------------------------------------------------------------",
|
|
1009
|
+
"-spec callback_mode() -> gen_statem:callback_mode_result().",
|
|
1010
|
+
"callback_mode() -> state_functions.",
|
|
1011
|
+
"",
|
|
1012
|
+
"%%--------------------------------------------------------------------",
|
|
1013
|
+
"%% @private",
|
|
1014
|
+
"%% @doc",
|
|
1015
|
+
"%% Whenever a gen_statem is started using gen_statem:start/[3,4] or",
|
|
1016
|
+
"%% gen_statem:start_link/[3,4], this function is called by the new",
|
|
1017
|
+
"%% process to initialize.",
|
|
1018
|
+
"%% @end",
|
|
1019
|
+
"%%--------------------------------------------------------------------",
|
|
1020
|
+
"-spec init(Args :: term()) -> gen_statem:init_result(atom()).",
|
|
1021
|
+
"init([]) ->",
|
|
1022
|
+
" process_flag(trap_exit, true),",
|
|
1023
|
+
" {ok, ${1:state_name}, #data{}}.",
|
|
1024
|
+
"",
|
|
1025
|
+
"%%--------------------------------------------------------------------",
|
|
1026
|
+
"%% @private",
|
|
1027
|
+
"%% @doc",
|
|
1028
|
+
"%% There should be one function like this for each state name.",
|
|
1029
|
+
"%% Whenever a gen_statem receives an event, the function",
|
|
1030
|
+
"%% with the name of the current state (StateName)",
|
|
1031
|
+
"%% is called to handle the event.",
|
|
1032
|
+
"%% @end",
|
|
1033
|
+
"%%--------------------------------------------------------------------",
|
|
1034
|
+
"-spec $1('enter',",
|
|
1035
|
+
" OldState :: atom(),",
|
|
1036
|
+
" Data :: term()) ->",
|
|
1037
|
+
" gen_statem:state_enter_result('$1');",
|
|
1038
|
+
" (gen_statem:event_type(),",
|
|
1039
|
+
" Msg :: term(),",
|
|
1040
|
+
" Data :: term()) ->",
|
|
1041
|
+
" gen_statem:event_handler_result(atom()).",
|
|
1042
|
+
"$1({call,Caller}, _Msg, Data) ->",
|
|
1043
|
+
" {next_state, $1, Data, [{reply,Caller,ok}]}.",
|
|
1044
|
+
"",
|
|
1045
|
+
"%%--------------------------------------------------------------------",
|
|
1046
|
+
"%% @private",
|
|
1047
|
+
"%% @doc",
|
|
1048
|
+
"%% This function is called by a gen_statem when it is about to",
|
|
1049
|
+
"%% terminate. It should be the opposite of Module:init/1 and do any",
|
|
1050
|
+
"%% necessary cleaning up. When it returns, the gen_statem terminates with",
|
|
1051
|
+
"%% Reason. The return value is ignored.",
|
|
1052
|
+
"%% @end",
|
|
1053
|
+
"%%--------------------------------------------------------------------",
|
|
1054
|
+
"-spec terminate(Reason :: term(), State :: term(), Data :: term()) ->",
|
|
1055
|
+
" any().",
|
|
1056
|
+
"terminate(_Reason, _State, _Data) ->",
|
|
1057
|
+
" void.",
|
|
1058
|
+
"",
|
|
1059
|
+
"%%--------------------------------------------------------------------",
|
|
1060
|
+
"%% @private",
|
|
1061
|
+
"%% @doc",
|
|
1062
|
+
"%% Convert process state when code is changed",
|
|
1063
|
+
"%% @end",
|
|
1064
|
+
"%%--------------------------------------------------------------------",
|
|
1065
|
+
"-spec code_change(OldVsn :: term() | {down,term()},",
|
|
1066
|
+
" State :: term(),",
|
|
1067
|
+
" Data :: term(),",
|
|
1068
|
+
" Extra :: term()) ->",
|
|
1069
|
+
" {ok, NewState :: term(), NewData :: term()} |",
|
|
1070
|
+
" (Reason :: term()).",
|
|
1071
|
+
"code_change(_OldVsn, State, Data, _Extra) ->",
|
|
1072
|
+
" {ok, State, Data}.",
|
|
1073
|
+
"",
|
|
1074
|
+
"%%%===================================================================",
|
|
1075
|
+
"%%% Internal functions",
|
|
1076
|
+
"%%%===================================================================",
|
|
1077
|
+
"",
|
|
1078
|
+
]
|
|
1079
|
+
},
|
|
1080
|
+
|
|
1081
|
+
"wx_object behavior (large)" : {
|
|
1082
|
+
"prefix" : "erl-wx_object-large",
|
|
1083
|
+
"description" : "Insert an empty wx_object with all the callbacks and decoration",
|
|
1084
|
+
"body": [
|
|
1085
|
+
"-behaviour(wx_object).",
|
|
1086
|
+
"",
|
|
1087
|
+
"-include_lib(\"wx/include/wx.hrl\").",
|
|
1088
|
+
"",
|
|
1089
|
+
"%% API",
|
|
1090
|
+
"-export([start_link/0]).",
|
|
1091
|
+
"",
|
|
1092
|
+
"%% wx_object callbacks",
|
|
1093
|
+
"-export([init/1, handle_call/3, handle_cast/2, handle_info/2,",
|
|
1094
|
+
" handle_event/2, terminate/2, code_change/3]).",
|
|
1095
|
+
"",
|
|
1096
|
+
"%%%===================================================================",
|
|
1097
|
+
"%%% Includes, defines, types and records",
|
|
1098
|
+
"%%%===================================================================",
|
|
1099
|
+
"",
|
|
1100
|
+
"-record(state, {}).",
|
|
1101
|
+
"",
|
|
1102
|
+
"%%%===================================================================",
|
|
1103
|
+
"%%% API",
|
|
1104
|
+
"%%%===================================================================",
|
|
1105
|
+
"",
|
|
1106
|
+
"%%--------------------------------------------------------------------",
|
|
1107
|
+
"%% @doc",
|
|
1108
|
+
"%% Starts the server",
|
|
1109
|
+
"%% @end",
|
|
1110
|
+
"%%--------------------------------------------------------------------",
|
|
1111
|
+
"-spec start_link() -> wx:wx_object() | {error, Reason :: term()}.",
|
|
1112
|
+
"start_link() ->",
|
|
1113
|
+
" wx_object:start_link(?MODULE, [], []).",
|
|
1114
|
+
"",
|
|
1115
|
+
"%%%===================================================================",
|
|
1116
|
+
"%%% wx_object callbacks",
|
|
1117
|
+
"%%%===================================================================",
|
|
1118
|
+
"",
|
|
1119
|
+
"%%--------------------------------------------------------------------",
|
|
1120
|
+
"%% @private",
|
|
1121
|
+
"%% @doc",
|
|
1122
|
+
"%% Initializes the server",
|
|
1123
|
+
"%% @end",
|
|
1124
|
+
"%%--------------------------------------------------------------------",
|
|
1125
|
+
"-spec init(Args :: term()) ->",
|
|
1126
|
+
" {wx:wx_object(), State :: term()} |",
|
|
1127
|
+
" {wx:wx_object(), State :: term(), Timeout :: timeout()} |",
|
|
1128
|
+
" ignore |",
|
|
1129
|
+
" {stop, Reason :: term()}.",
|
|
1130
|
+
"init([]) ->",
|
|
1131
|
+
" wx:new(),",
|
|
1132
|
+
" Frame = wxFrame:new(),",
|
|
1133
|
+
" {Frame, #state{}}.",
|
|
1134
|
+
"",
|
|
1135
|
+
"%%--------------------------------------------------------------------",
|
|
1136
|
+
"%% @private",
|
|
1137
|
+
"%% @doc",
|
|
1138
|
+
"%% Handling events",
|
|
1139
|
+
"%% @end",
|
|
1140
|
+
"%%--------------------------------------------------------------------",
|
|
1141
|
+
"-spec handle_event(wxEvtHandler:wx(), State :: term()) ->",
|
|
1142
|
+
" {noreply, State :: term()} |",
|
|
1143
|
+
" {noreply, State :: term(), Timeout :: timeout()} |",
|
|
1144
|
+
" {stop, Reason :: term(), State :: term()}.",
|
|
1145
|
+
"handle_event(#wx{}, State) ->",
|
|
1146
|
+
" {noreply, State}.",
|
|
1147
|
+
"",
|
|
1148
|
+
"%%--------------------------------------------------------------------",
|
|
1149
|
+
"%% @private",
|
|
1150
|
+
"%% @doc",
|
|
1151
|
+
"%% Handling call messages",
|
|
1152
|
+
"%% @end",
|
|
1153
|
+
"%%--------------------------------------------------------------------",
|
|
1154
|
+
"-spec handle_call(Request :: term(), From :: {pid(), term()}, State :: term()) ->",
|
|
1155
|
+
" {reply, Reply :: term(), State :: term()} |",
|
|
1156
|
+
" {reply, Reply :: term(), State :: term(), Timeout :: timeout()} |",
|
|
1157
|
+
" {noreply, State :: term()} |",
|
|
1158
|
+
" {noreply, State :: term(), Timeout :: timeout()} |",
|
|
1159
|
+
" {stop, Reason :: term(), Reply :: term(), State :: term()} |",
|
|
1160
|
+
" {stop, Reason :: term(), State :: term()}.",
|
|
1161
|
+
"handle_call(_Request, _From, State) ->",
|
|
1162
|
+
" Reply = ok,",
|
|
1163
|
+
" {reply, Reply, State}.",
|
|
1164
|
+
"",
|
|
1165
|
+
"%%--------------------------------------------------------------------",
|
|
1166
|
+
"%% @private",
|
|
1167
|
+
"%% @doc",
|
|
1168
|
+
"%% Handling cast messages",
|
|
1169
|
+
"%% @end",
|
|
1170
|
+
"%%--------------------------------------------------------------------",
|
|
1171
|
+
"-spec handle_cast(Msg :: term(), State :: term()) ->",
|
|
1172
|
+
" {noreply, State :: term()} |",
|
|
1173
|
+
" {noreply, State :: term(), Timeout :: timeout()} |",
|
|
1174
|
+
" {stop, Reason :: term(), State :: term()}.",
|
|
1175
|
+
"handle_cast(_Msg, State) ->",
|
|
1176
|
+
" {noreply, State}.",
|
|
1177
|
+
"",
|
|
1178
|
+
"%%--------------------------------------------------------------------",
|
|
1179
|
+
"%% @private",
|
|
1180
|
+
"%% @doc",
|
|
1181
|
+
"%% Handling all non call/cast messages",
|
|
1182
|
+
"%% @end",
|
|
1183
|
+
"%%--------------------------------------------------------------------",
|
|
1184
|
+
"-spec handle_info(Info :: timeout | term(), State :: term()) ->",
|
|
1185
|
+
" {noreply, State :: term()} |",
|
|
1186
|
+
" {noreply, State :: term(), Timeout :: timeout()} |",
|
|
1187
|
+
" {stop, Reason :: term(), State :: term()}.",
|
|
1188
|
+
"handle_info(_Info, State) ->",
|
|
1189
|
+
" {noreply, State}.",
|
|
1190
|
+
"",
|
|
1191
|
+
"%%--------------------------------------------------------------------",
|
|
1192
|
+
"%% @private",
|
|
1193
|
+
"%% @doc",
|
|
1194
|
+
"%% This function is called by a wx_object when it is about to",
|
|
1195
|
+
"%% terminate. It should be the opposite of Module:init/1 and do any",
|
|
1196
|
+
"%% necessary cleaning up. When it returns, the wx_object terminates",
|
|
1197
|
+
"%% with Reason. The return value is ignored.",
|
|
1198
|
+
"%% @end",
|
|
1199
|
+
"%%--------------------------------------------------------------------",
|
|
1200
|
+
"-spec terminate(Reason :: normal | shutdown | {shutdown, term()} | term(),",
|
|
1201
|
+
" State :: term()) -> any().",
|
|
1202
|
+
"terminate(_Reason, _State) ->",
|
|
1203
|
+
" ok.",
|
|
1204
|
+
"",
|
|
1205
|
+
"%%--------------------------------------------------------------------",
|
|
1206
|
+
"%% @private",
|
|
1207
|
+
"%% @doc",
|
|
1208
|
+
"%% Convert process state when code is changed",
|
|
1209
|
+
"%% @end",
|
|
1210
|
+
"%%--------------------------------------------------------------------",
|
|
1211
|
+
"-spec code_change(OldVsn :: term() | {down, term()},",
|
|
1212
|
+
" State :: term(),",
|
|
1213
|
+
" Extra :: term()) ->",
|
|
1214
|
+
" {ok, NewState :: term()} |",
|
|
1215
|
+
" {error, Reason :: term()}.",
|
|
1216
|
+
"code_change(_OldVsn, State, _Extra) ->",
|
|
1217
|
+
" {ok, State}.",
|
|
1218
|
+
"",
|
|
1219
|
+
"%%%===================================================================",
|
|
1220
|
+
"%%% Internal functions",
|
|
1221
|
+
"%%%===================================================================",
|
|
1222
|
+
"",
|
|
1223
|
+
]
|
|
1224
|
+
},
|
|
1225
|
+
|
|
1226
|
+
"library module" : {
|
|
1227
|
+
"prefix" : "erl-library-module",
|
|
1228
|
+
"description" : "Insert an empty library module",
|
|
1229
|
+
"body": [
|
|
1230
|
+
"%%%-------------------------------------------------------------------",
|
|
1231
|
+
"%%% @author ${1:Author_Name} <${2:Author_Email}>",
|
|
1232
|
+
"%%% @copyright (C) $CURRENT_YEAR, $1",
|
|
1233
|
+
"%%% @doc $0",
|
|
1234
|
+
"%%%",
|
|
1235
|
+
"%%% @end",
|
|
1236
|
+
"%%% Created : $CURRENT_DATE $CURRENT_MONTH_NAME_SHORT $CURRENT_YEAR by $1 <$2>",
|
|
1237
|
+
"%%%-------------------------------------------------------------------",
|
|
1238
|
+
"-module(${3:Module_Name}).",
|
|
1239
|
+
"",
|
|
1240
|
+
"%% API",
|
|
1241
|
+
"-export([${4:Function_Name}/0]).",
|
|
1242
|
+
"",
|
|
1243
|
+
"%%%===================================================================",
|
|
1244
|
+
"%%% Includes, defines, types and records",
|
|
1245
|
+
"%%%===================================================================",
|
|
1246
|
+
"",
|
|
1247
|
+
"%%%===================================================================",
|
|
1248
|
+
"%%% API",
|
|
1249
|
+
"%%%===================================================================",
|
|
1250
|
+
"",
|
|
1251
|
+
"%%--------------------------------------------------------------------",
|
|
1252
|
+
"%% @doc",
|
|
1253
|
+
"%% @end",
|
|
1254
|
+
"%%--------------------------------------------------------------------",
|
|
1255
|
+
"-spec $4() -> ok.",
|
|
1256
|
+
"$4() ->",
|
|
1257
|
+
" ok.",
|
|
1258
|
+
"",
|
|
1259
|
+
"%%%===================================================================",
|
|
1260
|
+
"%%% Internal functions",
|
|
1261
|
+
"%%%===================================================================",
|
|
1262
|
+
"",
|
|
1263
|
+
]
|
|
1264
|
+
},
|
|
1265
|
+
|
|
1266
|
+
"Insert EUnit tests": {
|
|
1267
|
+
"scope": "erlang",
|
|
1268
|
+
"prefix": "erl-eunit-tests",
|
|
1269
|
+
"description": "Insert an empty EUnit test",
|
|
1270
|
+
"body": [
|
|
1271
|
+
"-module(${1:Module_Name}_tests).",
|
|
1272
|
+
"",
|
|
1273
|
+
"%%%===================================================================",
|
|
1274
|
+
"%%% Includes, defines, types and records",
|
|
1275
|
+
"%%%===================================================================",
|
|
1276
|
+
"",
|
|
1277
|
+
"-include_lib(\"eunit/include/eunit.hrl\").",
|
|
1278
|
+
"",
|
|
1279
|
+
"%%====================================================================",
|
|
1280
|
+
"%% Test descriptions",
|
|
1281
|
+
"%%====================================================================",
|
|
1282
|
+
"",
|
|
1283
|
+
"${2:Test_Group_Name}_test_() ->",
|
|
1284
|
+
" {\"${3:Title of this test group}\",",
|
|
1285
|
+
" {setup,",
|
|
1286
|
+
" fun $2_setup/0,",
|
|
1287
|
+
" fun $2_cleanup/1,",
|
|
1288
|
+
" [{\"${4:Description of test case}\",",
|
|
1289
|
+
" ?_test($2_first_use_case())}",
|
|
1290
|
+
" ]}}.",
|
|
1291
|
+
"",
|
|
1292
|
+
"%%====================================================================",
|
|
1293
|
+
"%% Setup and cleanup",
|
|
1294
|
+
"%%====================================================================",
|
|
1295
|
+
"",
|
|
1296
|
+
"$2_setup() ->",
|
|
1297
|
+
" ok.",
|
|
1298
|
+
"",
|
|
1299
|
+
"$2_cleanup(_FromSetup) ->",
|
|
1300
|
+
" ok.",
|
|
1301
|
+
"",
|
|
1302
|
+
"%%====================================================================",
|
|
1303
|
+
"%% Unit tests",
|
|
1304
|
+
"%%====================================================================",
|
|
1305
|
+
"",
|
|
1306
|
+
"%%--------------------------------------------------------------------",
|
|
1307
|
+
"%% Test group: $2",
|
|
1308
|
+
"%%",
|
|
1309
|
+
"%% $3",
|
|
1310
|
+
"%%--------------------------------------------------------------------",
|
|
1311
|
+
"",
|
|
1312
|
+
"%% $4",
|
|
1313
|
+
"$2_first_use_case() ->",
|
|
1314
|
+
" ?assertMatch([_|_], $1:module_info()).",
|
|
1315
|
+
"",
|
|
1316
|
+
"%%====================================================================",
|
|
1317
|
+
"%% Helper functions",
|
|
1318
|
+
"%%====================================================================",
|
|
1319
|
+
""
|
|
1320
|
+
]
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
}
|