@codingame/monaco-editor-wrapper 4.0.0-next.0 → 4.0.0-next.2
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/Angular.ng-template-15.2.1.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/C2Hs-configuration.json.raw.js +3 -0
- package/dist/_virtual/Dart-Code.dart-code-3.63.20230419.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/Hsc2Hs-configuration.json.raw.js +3 -0
- package/dist/_virtual/IMCTradingBV.svlangserver-0.4.1.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/JakeBecker.elixir-ls-0.14.5.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/JuanBlanco.solidity-0.0.152.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/META.json.raw2.js +3 -0
- package/dist/_virtual/REditorSupport.r-2.7.2.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/Rlogo.svg.raw.js +3 -0
- package/dist/{_commonjsHelpers.js → _virtual/_commonjsHelpers.js} +1 -1
- package/dist/_virtual/_monaco-editor.js +6 -0
- package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
- package/dist/_virtual/actions.js +3 -0
- package/dist/_virtual/alefragnani.pascal-9.6.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/angular-template-language-configuration.json.raw.js +3 -0
- package/dist/_virtual/basicInput.js +3 -0
- package/dist/_virtual/batisteo.vscode-django-1.10.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/bitwisecook.tcl-0.4.3.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/book-dark.svg.raw.js +3 -0
- package/dist/_virtual/book-light.svg.raw.js +3 -0
- package/dist/_virtual/broadcomMFD.cobol-language-support-1.2.1.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/cabal-configuration.json.raw.js +3 -0
- package/dist/_virtual/castwide.solargraph-0.24.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/ckolkman.vscode-postgres-1.4.2.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/cm_adapter.js +3 -0
- package/dist/_virtual/commands.js +3 -0
- package/dist/_virtual/conda-environment.json.raw.js +3 -0
- package/dist/_virtual/conda-meta.json.raw.js +3 -0
- package/dist/_virtual/condarc.json.raw.js +3 -0
- package/dist/{css.worker.js → _virtual/css.worker.js} +1 -1
- package/dist/_virtual/d.json.raw2.js +3 -0
- package/dist/_virtual/dart-language-configuration.json.raw.js +3 -0
- package/dist/_virtual/dcf-configuration.json.raw.js +3 -0
- package/dist/_virtual/diet.json.raw3.js +3 -0
- package/dist/_virtual/dub.schema.json.raw.js +3 -0
- package/dist/_virtual/dune.json.raw3.js +3 -0
- package/dist/_virtual/editor.api.js +6 -0
- package/dist/_virtual/editor.worker.js +6 -0
- package/dist/_virtual/eex-language-configuration.json.raw.js +3 -0
- package/dist/_virtual/elixir-language-configuration.json.raw.js +3 -0
- package/dist/_virtual/erlang.configuration.json.raw.js +3 -0
- package/dist/_virtual/file_type_java.svg.raw.js +3 -0
- package/dist/_virtual/file_type_scala.svg.raw.js +3 -0
- package/dist/_virtual/flutter_activity_bar.svg.raw.js +3 -0
- package/dist/_virtual/general.json.raw.js +3 -0
- package/dist/_virtual/go.mod.language-configuration.json.raw.js +3 -0
- package/dist/_virtual/golang.Go-0.38.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/haskell-configuration.json.raw.js +3 -0
- package/dist/{html.worker.js → _virtual/html.worker.js} +1 -1
- package/dist/_virtual/index.js +3 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/index3.js +3 -0
- package/dist/_virtual/java-properties-configuration.json.raw.js +3 -0
- package/dist/_virtual/johnsoncodehk.vscode-angular-1.0.22.vsix_package.json.vsjson.js +3 -0
- package/dist/{json.worker.js → _virtual/json.worker.js} +1 -1
- package/dist/_virtual/justusadam.language-haskell-3.6.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/keymap_vim.js +3 -0
- package/dist/_virtual/kotlin.configuration.json.raw.js +3 -0
- package/dist/_virtual/lang-config.json.raw.js +3 -0
- package/dist/_virtual/language-configuration.json.raw.js +3 -0
- package/dist/_virtual/language-configuration.json.raw2.js +3 -0
- package/dist/_virtual/language-configuration.json.raw3.js +3 -0
- package/dist/_virtual/language-configuration.json.raw4.js +3 -0
- package/dist/_virtual/language-configuration.json.raw5.js +3 -0
- package/dist/_virtual/language-configuration.json.raw6.js +3 -0
- package/dist/_virtual/language-configuration.json.raw7.js +3 -0
- package/dist/_virtual/language-configuration.json.raw8.js +3 -0
- package/dist/_virtual/literate-haskell-configuration.json.raw.js +3 -0
- package/dist/_virtual/logo.svg.raw.js +3 -0
- package/dist/_virtual/mathiasfrohlich.Kotlin-1.7.1.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/menhir.json.raw2.js +3 -0
- package/dist/_virtual/ms-dotnettools.csharp-1.25.4.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/ms-python.python-2023.7.11111009.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/ms-vscode.cpptools-1.15.2.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/oasis.json.raw2.js +3 -0
- package/dist/_virtual/ocaml.json.raw3.js +3 -0
- package/dist/_virtual/ocamlbuild.json.raw2.js +3 -0
- package/dist/_virtual/ocamlformat.json.raw2.js +3 -0
- package/dist/_virtual/ocamllabs.ocaml-platform-1.12.2.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/ocamllex.json.raw3.js +3 -0
- package/dist/_virtual/opam-install.json.raw2.js +3 -0
- package/dist/_virtual/opam.json.raw2.js +3 -0
- package/dist/_virtual/package-json-schema.json.raw.js +3 -0
- package/dist/_virtual/package.schema.json.raw.js +3 -0
- package/dist/_virtual/pascal.configuration.json.raw.js +3 -0
- package/dist/_virtual/pgourlain.erlang-0.8.8.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/pip-requirements.json.raw.js +3 -0
- package/dist/_virtual/postgres-explorer.svg.raw.js +3 -0
- package/dist/_virtual/prettier-options-schema.json.raw.js +3 -0
- package/dist/_virtual/r-configuration.json.raw.js +3 -0
- package/dist/_virtual/rbuildignore-configuration.json.raw.js +3 -0
- package/dist/_virtual/rd-configuration.json.raw.js +3 -0
- package/dist/{reason.json2.js → _virtual/reason.json.raw2.js} +2 -2
- package/dist/_virtual/redhat.java-1.18.2023042204.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/rmd-configuration.json.raw.js +3 -0
- package/dist/_virtual/rnamespace-configuration.json.raw.js +3 -0
- package/dist/_virtual/scala-lang.scala-0.5.6.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/scalameta-logo.png.raw.js +3 -0
- package/dist/_virtual/scalameta.metals-1.23.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/scalameta.svg.raw.js +3 -0
- package/dist/_virtual/schema.json.raw.js +3 -0
- package/dist/_virtual/shiftCommand.js +6 -0
- package/dist/_virtual/solidity.configuration.json.raw.js +3 -0
- package/dist/_virtual/state.js +3 -0
- package/dist/_virtual/statusbar.js +3 -0
- package/dist/_virtual/sumneko.lua-3.6.18.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/svelte.svelte-vscode-107.3.0.vsix_package.json.vsjson.js +3 -0
- package/dist/_virtual/tasks.schema.json.raw.js +3 -0
- package/dist/{ts.worker.js → _virtual/ts.worker.js} +1 -1
- package/dist/_virtual/util.js +3 -0
- package/dist/_virtual/webfreak.code-d-0.23.2.vsix_package.json.vsjson.js +3 -0
- package/dist/configuration/index.js +45 -0
- package/dist/editor/autofold.js +24 -0
- package/dist/editor/cobol.js +67 -0
- package/dist/editor/index.js +9 -0
- package/dist/extensions/Angular.ng-template-15.2.1.vsix.js +15 -0
- package/dist/extensions/Dart-Code.dart-code-3.63.20230419.vsix.js +14 -0
- package/dist/extensions/IMCTradingBV.svlangserver-0.4.1.vsix.js +18 -0
- package/dist/extensions/JakeBecker.elixir-ls-0.14.5.vsix.js +18 -0
- package/dist/extensions/JuanBlanco.solidity-0.0.152.vsix.js +13 -0
- package/dist/extensions/REditorSupport.r-2.7.2.vsix.js +47 -0
- package/dist/extensions/alefragnani.pascal-9.6.0.vsix.js +13 -0
- package/dist/extensions/batisteo.vscode-django-1.10.0.vsix.js +17 -0
- package/dist/extensions/bitwisecook.tcl-0.4.3.vsix.js +13 -0
- package/dist/extensions/broadcomMFD.cobol-language-support-1.2.1.vsix.js +11 -0
- package/dist/extensions/castwide.solargraph-0.24.0.vsix.js +8 -0
- package/dist/extensions/ckolkman.vscode-postgres-1.4.2.vsix.js +14 -0
- package/dist/extensions/golang.Go-0.38.0.vsix.js +17 -0
- package/dist/extensions/johnsoncodehk.vscode-angular-1.0.22.vsix.js +13 -0
- package/dist/extensions/justusadam.language-haskell-3.6.0.vsix.js +41 -0
- package/dist/extensions/mathiasfrohlich.Kotlin-1.7.1.vsix.js +15 -0
- package/dist/extensions/ms-dotnettools.csharp-1.25.4.vsix.js +17 -0
- package/dist/extensions/ms-python.python-2023.7.11111009.vsix.js +20 -0
- package/dist/extensions/ms-vscode.cpptools-1.15.2.vsix.js +8 -0
- package/dist/extensions/ocamllabs.ocaml-platform-1.12.2.vsix.js +92 -0
- package/dist/extensions/pgourlain.erlang-0.8.8.vsix.js +13 -0
- package/dist/extensions/redhat.java-1.18.2023042204.vsix.js +19 -0
- package/dist/extensions/scala-lang.scala-0.5.6.vsix.js +11 -0
- package/dist/extensions/scalameta.metals-1.23.0.vsix.js +34 -0
- package/dist/extensions/sumneko.lua-3.6.18.vsix.js +10 -0
- package/dist/extensions/svelte.svelte-vscode-107.3.0.vsix.js +37 -0
- package/dist/extensions/webfreak.code-d-0.23.2.vsix.js +28 -0
- package/dist/extensions.d.ts +3 -2
- package/dist/features/cssContribution.js +4 -5
- package/dist/features/debug.d.ts +1 -0
- package/dist/features/debug.js +7 -0
- package/dist/features/htmlContribution.js +79 -88
- package/dist/features/jsonContribution.js +10 -12
- package/dist/features/search.d.ts +1 -0
- package/dist/features/search.js +7 -0
- package/dist/features/typescriptContribution.js +27 -15
- package/dist/features/viewPanels.d.ts +1 -0
- package/dist/features/viewPanels.js +9 -0
- package/dist/features/views.d.ts +4 -0
- package/dist/features/views.js +17 -0
- package/dist/keybindings/index.js +36 -0
- package/dist/keybindings/vim.js +82 -0
- package/dist/languages/index.js +40 -0
- package/dist/main.js +6 -1286
- package/dist/monaco.d.ts +0 -1
- package/dist/monaco.js +90 -0
- package/dist/node_modules/@types/node/console.d.js +3 -0
- package/dist/node_modules/@types/node/globals.d.js +3 -0
- package/dist/node_modules/@types/node/process.d.js +3 -0
- package/dist/node_modules/lodash.kebabcase/index.js +439 -0
- package/dist/node_modules/lodash.throttle/index.js +443 -0
- package/dist/node_modules/monaco-emacs/lib/emacs/actions.js +596 -0
- package/dist/node_modules/monaco-emacs/lib/emacs/basicInput.js +113 -0
- package/dist/node_modules/monaco-emacs/lib/emacs/commands.js +184 -0
- package/dist/node_modules/monaco-emacs/lib/emacs/index.js +186 -0
- package/dist/node_modules/monaco-emacs/lib/emacs/state.js +116 -0
- package/dist/node_modules/monaco-emacs/lib/emacs/util.js +112 -0
- package/dist/node_modules/monaco-emacs/lib/index.js +31 -0
- package/dist/{vim.js → node_modules/monaco-vim/lib/cm/keymap_vim.js} +3 -1790
- package/dist/node_modules/monaco-vim/lib/cm_adapter.js +1393 -0
- package/dist/node_modules/monaco-vim/lib/index.js +71 -0
- package/dist/node_modules/monaco-vim/lib/statusbar.js +239 -0
- package/dist/node_modules/tslib/tslib.es6.js +77 -0
- package/dist/services.d.ts +2 -0
- package/dist/services.js +50 -0
- package/dist/style.js +12 -0
- package/dist/theme/index.js +21 -0
- package/dist/tools/EditorOpenHandlerRegistry.js +108 -0
- package/dist/tools.js +235 -0
- package/dist/worker.d.ts +1 -10
- package/dist/worker.js +9 -58
- package/package.json +28 -37
- package/stats.html +1 -1
- package/dist/C2Hs-configuration.json.js +0 -3
- package/dist/Hsc2Hs-configuration.json.js +0 -3
- package/dist/META.json2.js +0 -3
- package/dist/_monaco-editor_commonjs-external.js +0 -39
- package/dist/_rollupPluginBabelHelpers.js +0 -51
- package/dist/add.svg.js +0 -3
- package/dist/add.svg2.js +0 -3
- package/dist/adddep-dark.svg.js +0 -3
- package/dist/adddep-light.svg.js +0 -3
- package/dist/angular-template-language-configuration.json.js +0 -3
- package/dist/arrow-circle-up-dark.svg.js +0 -3
- package/dist/arrow-circle-up-light.svg.js +0 -3
- package/dist/book-dark.svg.js +0 -3
- package/dist/book-light.svg.js +0 -3
- package/dist/book-open-dark.svg.js +0 -3
- package/dist/book-open-light.svg.js +0 -3
- package/dist/cabal-configuration.json.js +0 -3
- package/dist/d.json2.js +0 -3
- package/dist/dart-language-configuration.json.js +0 -3
- package/dist/dcf-configuration.json.js +0 -3
- package/dist/diet.json3.js +0 -3
- package/dist/document-search-dark.svg.js +0 -3
- package/dist/document-search-light.svg.js +0 -3
- package/dist/documentation-inverse.svg.js +0 -3
- package/dist/documentation.svg.js +0 -3
- package/dist/dub-convert-inverse.svg.js +0 -3
- package/dist/dub-convert.svg.js +0 -3
- package/dist/dune.json3.js +0 -3
- package/dist/edit-dub-inverse.svg.js +0 -3
- package/dist/edit-dub.svg.js +0 -3
- package/dist/edit-source-inverse.svg.js +0 -3
- package/dist/edit-source.svg.js +0 -3
- package/dist/eex-language-configuration.json.js +0 -3
- package/dist/elixir-language-configuration.json.js +0 -3
- package/dist/erlang.configuration.json.js +0 -3
- package/dist/extension-web.js.js +0 -3
- package/dist/extension-web.js2.js +0 -3
- package/dist/extension.browser.js.js +0 -3
- package/dist/file_type_java.svg.js +0 -3
- package/dist/file_type_scala.svg.js +0 -3
- package/dist/focus-dark.svg.js +0 -3
- package/dist/focus-light.svg.js +0 -3
- package/dist/general.json.js +0 -3
- package/dist/get-inverse.svg.js +0 -3
- package/dist/get.svg.js +0 -3
- package/dist/go.mod.language-configuration.json.js +0 -3
- package/dist/haskell-configuration.json.js +0 -3
- package/dist/hot-reload-tb.png.js +0 -3
- package/dist/hot-reload.svg.js +0 -3
- package/dist/index.js +0 -2210
- package/dist/index2.js +0 -49
- package/dist/inspector.svg.js +0 -3
- package/dist/java-properties-configuration.json.js +0 -3
- package/dist/kotlin.configuration.json.js +0 -3
- package/dist/lang-config.json.js +0 -3
- package/dist/language-configuration.json.js +0 -3
- package/dist/language-configuration.json2.js +0 -3
- package/dist/language-configuration.json3.js +0 -3
- package/dist/language-configuration.json4.js +0 -3
- package/dist/language-configuration.json5.js +0 -3
- package/dist/language-configuration.json6.js +0 -3
- package/dist/language-configuration.json7.js +0 -3
- package/dist/language-configuration.json8.js +0 -3
- package/dist/literate-haskell-configuration.json.js +0 -3
- package/dist/menhir.json2.js +0 -3
- package/dist/oasis.json2.js +0 -3
- package/dist/ocaml.json3.js +0 -3
- package/dist/ocamlbuild.json2.js +0 -3
- package/dist/ocamlformat.json2.js +0 -3
- package/dist/ocamllex.json3.js +0 -3
- package/dist/opam-install.json2.js +0 -3
- package/dist/opam.json2.js +0 -3
- package/dist/outdated-inverse.svg.js +0 -3
- package/dist/outdated.svg.js +0 -3
- package/dist/pascal.configuration.json.js +0 -3
- package/dist/performance.svg.js +0 -3
- package/dist/pip-requirements.json.js +0 -3
- package/dist/plus-dark.svg.js +0 -3
- package/dist/plus-light.svg.js +0 -3
- package/dist/preview-right-dark.svg.js +0 -3
- package/dist/preview-right-light.svg.js +0 -3
- package/dist/r-configuration.json.js +0 -3
- package/dist/rbuildignore-configuration.json.js +0 -3
- package/dist/rd-configuration.json.js +0 -3
- package/dist/ref-group-by-type-dark.svg.js +0 -3
- package/dist/ref-group-by-type-light.svg.js +0 -3
- package/dist/ref-ungroup-by-type-dark.svg.js +0 -3
- package/dist/ref-ungroup-by-type-light.svg.js +0 -3
- package/dist/refresh-dark.svg.js +0 -3
- package/dist/refresh-dark.svg2.js +0 -3
- package/dist/refresh-light.svg.js +0 -3
- package/dist/refresh-light.svg2.js +0 -3
- package/dist/repl.svg.js +0 -3
- package/dist/repl.svg2.js +0 -3
- package/dist/rmd-configuration.json.js +0 -3
- package/dist/rnamespace-configuration.json.js +0 -3
- package/dist/save.svg.js +0 -3
- package/dist/save.svg2.js +0 -3
- package/dist/scalameta-logo.png.js +0 -3
- package/dist/solidity.configuration.json.js +0 -3
- package/dist/switch-impl-intf.dark.svg.js +0 -3
- package/dist/switch-impl-intf.light.svg.js +0 -3
- package/dist/upgrade-inverse.svg.js +0 -3
- package/dist/upgrade.svg.js +0 -3
- package/dist/x-dark.svg.js +0 -3
- package/dist/x-light.svg.js +0 -3
- /package/dist/{C2Hs.json.js → _virtual/C2Hs.json.raw.js} +0 -0
- /package/dist/{COBOL.tmLanguage.json.js → _virtual/COBOL.tmLanguage.json.raw.js} +0 -0
- /package/dist/{Erlang.plist.js → _virtual/Erlang.plist.raw.js} +0 -0
- /package/dist/{Hsc2Hs.json.js → _virtual/Hsc2Hs.json.raw.js} +0 -0
- /package/dist/{JavaProperties.tmLanguage.json.js → _virtual/JavaProperties.tmLanguage.json.raw.js} +0 -0
- /package/dist/{Kotlin.tmLanguage.js → _virtual/Kotlin.tmLanguage.raw.js} +0 -0
- /package/dist/{META.json.js → _virtual/META.json.raw.js} +0 -0
- /package/dist/{Markdown Redcarpet.json.js → _virtual/Markdown Redcarpet.json.raw.js} +0 -0
- /package/dist/{RMarkdown.json.js → _virtual/RMarkdown.json.raw.js} +0 -0
- /package/dist/{Rcpp.json.js → _virtual/Rcpp.json.raw.js} +0 -0
- /package/dist/{Rd (R Documentation).json.js → _virtual/Rd (R Documentation).json.raw.js} +0 -0
- /package/dist/{Scala.tmLanguage.json.js → _virtual/Scala.tmLanguage.json.raw.js} +0 -0
- /package/dist/{alex.json.js → _virtual/alex.json.raw.js} +0 -0
- /package/dist/{angular-directives.json.js → _virtual/angular-directives.json.raw.js} +0 -0
- /package/dist/{angular-interpolations.json.js → _virtual/angular-interpolations.json.raw.js} +0 -0
- /package/dist/{aspnetcorerazor.tmLanguage.json.js → _virtual/aspnetcorerazor.tmLanguage.json.raw.js} +0 -0
- /package/dist/{atd.json.js → _virtual/atd.json.raw.js} +0 -0
- /package/dist/{buildtarget.json.js → _virtual/buildtarget.json.raw.js} +0 -0
- /package/dist/{cabal.json.js → _virtual/cabal.json.raw.js} +0 -0
- /package/dist/{codeblock-cabal.json.js → _virtual/codeblock-cabal.json.raw.js} +0 -0
- /package/dist/{codeblock-haskell.json.js → _virtual/codeblock-haskell.json.raw.js} +0 -0
- /package/dist/{codeblock-literate-haskell.json.js → _virtual/codeblock-literate-haskell.json.raw.js} +0 -0
- /package/dist/{codeblock.json.js → _virtual/codeblock.json.raw.js} +0 -0
- /package/dist/{codeblock.json2.js → _virtual/codeblock.json.raw2.js} +0 -0
- /package/dist/{cram.json.js → _virtual/cram.json.raw.js} +0 -0
- /package/dist/{csharp.json.js → _virtual/csharp.json.raw.js} +0 -0
- /package/dist/{d.json.js → _virtual/d.json.raw.js} +0 -0
- /package/dist/{dart.json.js → _virtual/dart.json.raw.js} +0 -0
- /package/dist/{dcf.json.js → _virtual/dcf.json.raw.js} +0 -0
- /package/dist/{diet.json.js → _virtual/diet.json.raw.js} +0 -0
- /package/dist/{diet.json2.js → _virtual/diet.json.raw2.js} +0 -0
- /package/dist/{django-html.tmLanguage.json.js → _virtual/django-html.tmLanguage.json.raw.js} +0 -0
- /package/dist/{django-txt.tmLanguage.json.js → _virtual/django-txt.tmLanguage.json.raw.js} +0 -0
- /package/dist/{dml.json.js → _virtual/dml.json.raw.js} +0 -0
- /package/dist/{dune-project.json.js → _virtual/dune-project.json.raw.js} +0 -0
- /package/dist/{dune-project.json2.js → _virtual/dune-project.json.raw2.js} +0 -0
- /package/dist/{dune-workspace.json.js → _virtual/dune-workspace.json.raw.js} +0 -0
- /package/dist/{dune.json.js → _virtual/dune.json.raw.js} +0 -0
- /package/dist/{dune.json2.js → _virtual/dune.json.raw2.js} +0 -0
- /package/dist/{eex.json.js → _virtual/eex.json.raw.js} +0 -0
- /package/dist/{elixir.json.js → _virtual/elixir.json.raw.js} +0 -0
- /package/dist/{erlang.json.js → _virtual/erlang.json.raw.js} +0 -0
- /package/dist/{expression.json.js → _virtual/expression.json.raw.js} +0 -0
- /package/dist/{filters.json.js → _virtual/filters.json.raw.js} +0 -0
- /package/dist/{go.json.js → _virtual/go.json.raw.js} +0 -0
- /package/dist/{go.mod.tmGrammar.json.js → _virtual/go.mod.tmGrammar.json.raw.js} +0 -0
- /package/dist/{go.sum.tmGrammar.json.js → _virtual/go.sum.tmGrammar.json.raw.js} +0 -0
- /package/dist/{govulncheck.tmGrammar.json.js → _virtual/govulncheck.tmGrammar.json.raw.js} +0 -0
- /package/dist/{happy.json.js → _virtual/happy.json.raw.js} +0 -0
- /package/dist/{haskell.json.js → _virtual/haskell.json.raw.js} +0 -0
- /package/dist/{html-eex.json.js → _virtual/html-eex.json.raw.js} +0 -0
- /package/dist/{inline-styles.json.js → _virtual/inline-styles.json.raw.js} +0 -0
- /package/dist/{inline-template.json.js → _virtual/inline-template.json.raw.js} +0 -0
- /package/dist/{java.json.js → _virtual/java.json.raw.js} +0 -0
- /package/dist/{javascript.json.js → _virtual/javascript.json.raw.js} +0 -0
- /package/dist/{jvm-bytecode-verbose.json.js → _virtual/jvm-bytecode-verbose.json.raw.js} +0 -0
- /package/dist/{jvm-bytecode.json.js → _virtual/jvm-bytecode.json.raw.js} +0 -0
- /package/dist/{kotlin.json.js → _virtual/kotlin.json.raw.js} +0 -0
- /package/dist/{literateHaskell.json.js → _virtual/literateHaskell.json.raw.js} +0 -0
- /package/dist/{markdown-svelte-css.json.js → _virtual/markdown-svelte-css.json.raw.js} +0 -0
- /package/dist/{markdown-svelte-js.json.js → _virtual/markdown-svelte-js.json.raw.js} +0 -0
- /package/dist/{markdown-svelte.json.js → _virtual/markdown-svelte.json.raw.js} +0 -0
- /package/dist/{menhir-action.json.js → _virtual/menhir-action.json.raw.js} +0 -0
- /package/dist/{menhir.json.js → _virtual/menhir.json.raw.js} +0 -0
- /package/dist/{merlin.json.js → _virtual/merlin.json.raw.js} +0 -0
- /package/dist/{oasis.json.js → _virtual/oasis.json.raw.js} +0 -0
- /package/dist/{ocaml-markdown-codeblock.json.js → _virtual/ocaml-markdown-codeblock.json.raw.js} +0 -0
- /package/dist/{ocaml.interface.json.js → _virtual/ocaml.interface.json.raw.js} +0 -0
- /package/dist/{ocaml.json.js → _virtual/ocaml.json.raw.js} +0 -0
- /package/dist/{ocaml.json2.js → _virtual/ocaml.json.raw2.js} +0 -0
- /package/dist/{ocamlbuild.json.js → _virtual/ocamlbuild.json.raw.js} +0 -0
- /package/dist/{ocamldoc.json.js → _virtual/ocamldoc.json.raw.js} +0 -0
- /package/dist/{ocamlformat.json.js → _virtual/ocamlformat.json.raw.js} +0 -0
- /package/dist/{ocamllex.json.js → _virtual/ocamllex.json.raw.js} +0 -0
- /package/dist/{ocamllex.json2.js → _virtual/ocamllex.json.raw2.js} +0 -0
- /package/dist/{opam-install.json.js → _virtual/opam-install.json.raw.js} +0 -0
- /package/dist/{opam.json.js → _virtual/opam.json.raw.js} +0 -0
- /package/dist/{pascal.json.js → _virtual/pascal.json.raw.js} +0 -0
- /package/dist/{pascal.tmLanguage.js → _virtual/pascal.tmLanguage.raw.js} +0 -0
- /package/dist/{pgsql.tmLanguage.js → _virtual/pgsql.tmLanguage.raw.js} +0 -0
- /package/dist/{pip-requirements.tmLanguage.json.js → _virtual/pip-requirements.tmLanguage.json.raw.js} +0 -0
- /package/dist/{postcss.json.js → _virtual/postcss.json.raw.js} +0 -0
- /package/dist/{pug-svelte-dotblock.json.js → _virtual/pug-svelte-dotblock.json.raw.js} +0 -0
- /package/dist/{pug-svelte-tags.json.js → _virtual/pug-svelte-tags.json.raw.js} +0 -0
- /package/dist/{pug-svelte.json.js → _virtual/pug-svelte.json.raw.js} +0 -0
- /package/dist/{r-snippets.json.js → _virtual/r-snippets.json.raw.js} +0 -0
- /package/dist/{r.json.js → _virtual/r.json.raw.js} +0 -0
- /package/dist/{rbuildignore.json.js → _virtual/rbuildignore.json.raw.js} +0 -0
- /package/dist/{reason-markdown-codeblock.json.js → _virtual/reason-markdown-codeblock.json.raw.js} +0 -0
- /package/dist/{reason.json.js → _virtual/reason.json.raw.js} +0 -0
- /package/dist/{rmarkdown.json2.js → _virtual/rmarkdown.json.raw2.js} +0 -0
- /package/dist/{rnamespace.json.js → _virtual/rnamespace.json.raw.js} +0 -0
- /package/dist/{sdl.json.js → _virtual/sdl.json.raw.js} +0 -0
- /package/dist/{semanticdb.json.js → _virtual/semanticdb.json.raw.js} +0 -0
- /package/dist/{solidity.json.js → _virtual/solidity.json.raw.js} +0 -0
- /package/dist/{solidity.json2.js → _virtual/solidity.json.raw2.js} +0 -0
- /package/dist/{svelte.json.js → _virtual/svelte.json.raw.js} +0 -0
- /package/dist/{svelte.tmLanguage.json.js → _virtual/svelte.tmLanguage.json.raw.js} +0 -0
- /package/dist/{systemverilog.json.js → _virtual/systemverilog.json.raw.js} +0 -0
- /package/dist/{systemverilog.tmLanguage.json.js → _virtual/systemverilog.tmLanguage.json.raw.js} +0 -0
- /package/dist/{tags.json.js → _virtual/tags.json.raw.js} +0 -0
- /package/dist/{tasty.json.js → _virtual/tasty.json.raw.js} +0 -0
- /package/dist/{tcl.json.js → _virtual/tcl.json.raw.js} +0 -0
- /package/dist/{tcl.json2.js → _virtual/tcl.json.raw2.js} +0 -0
- /package/dist/{template.json.js → _virtual/template.json.raw.js} +0 -0
- /package/dist/{typescript.json.js → _virtual/typescript.json.raw.js} +0 -0
- /package/dist/{vs2019_dark.json.js → _virtual/vs2019_dark.json.raw.js} +0 -0
- /package/dist/{vs2019_light.json.js → _virtual/vs2019_light.json.raw.js} +0 -0
|
@@ -1,1409 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { configurationRegistry, ConfigurationScope } from 'vscode/service-override/configuration';
|
|
5
|
-
import { o as onConfigurationChanged, g as getConfiguration } from './index2.js';
|
|
6
|
-
import 'vscode/services';
|
|
7
|
-
|
|
8
|
-
var lib = {};
|
|
9
|
-
|
|
10
|
-
var keymap_vim = {};
|
|
11
|
-
|
|
12
|
-
var cm_adapter = {};
|
|
13
|
-
|
|
14
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(editor);
|
|
15
|
-
|
|
16
|
-
var require$$1 = /*@__PURE__*/getAugmentedNamespace(shiftCommand);
|
|
17
|
-
|
|
18
|
-
(function (exports) {
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(exports, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
exports["default"] = void 0;
|
|
24
|
-
|
|
25
|
-
var _editor = require$$0;
|
|
26
|
-
|
|
27
|
-
var _shiftCommand = require$$1;
|
|
28
|
-
|
|
29
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
30
|
-
|
|
31
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
-
|
|
33
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
34
|
-
|
|
35
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
36
|
-
|
|
37
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
38
|
-
|
|
39
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
40
|
-
|
|
41
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
42
|
-
|
|
43
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
44
|
-
|
|
45
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
46
|
-
|
|
47
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
48
|
-
|
|
49
|
-
var VerticalRevealType = {
|
|
50
|
-
Bottom: 4
|
|
51
|
-
}; // for monaco 0.19.x where x < 3
|
|
52
|
-
|
|
53
|
-
var EditorOptConstants = {
|
|
54
|
-
readOnly: 65,
|
|
55
|
-
cursorWidth: 20,
|
|
56
|
-
fontInfo: 32
|
|
57
|
-
};
|
|
58
|
-
var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
|
|
59
|
-
|
|
60
|
-
function isWordCharBasic(ch) {
|
|
61
|
-
return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function Pos(line, column) {
|
|
65
|
-
if (!(this instanceof Pos)) {
|
|
66
|
-
return new Pos(line, column);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.line = line;
|
|
70
|
-
this.ch = column;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function signal(cm, signal, args) {
|
|
74
|
-
cm.dispatch(signal, args);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function dummy(key) {
|
|
78
|
-
return function () {// console.log(key, 'dummy function called with', Array.prototype.slice.call(arguments));
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var StringStream = function StringStream(string, tabSize) {
|
|
83
|
-
this.pos = this.start = 0;
|
|
84
|
-
this.string = string;
|
|
85
|
-
this.tabSize = tabSize || 8;
|
|
86
|
-
this.lastColumnPos = this.lastColumnValue = 0;
|
|
87
|
-
this.lineStart = 0;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
StringStream.prototype = {
|
|
91
|
-
eol: function eol() {
|
|
92
|
-
return this.pos >= this.string.length;
|
|
93
|
-
},
|
|
94
|
-
sol: function sol() {
|
|
95
|
-
return this.pos == this.lineStart;
|
|
96
|
-
},
|
|
97
|
-
peek: function peek() {
|
|
98
|
-
return this.string.charAt(this.pos) || undefined;
|
|
99
|
-
},
|
|
100
|
-
next: function next() {
|
|
101
|
-
if (this.pos < this.string.length) return this.string.charAt(this.pos++);
|
|
102
|
-
},
|
|
103
|
-
eat: function eat(match) {
|
|
104
|
-
var ch = this.string.charAt(this.pos);
|
|
105
|
-
if (typeof match == "string") var ok = ch == match;else var ok = ch && (match.test ? match.test(ch) : match(ch));
|
|
106
|
-
|
|
107
|
-
if (ok) {
|
|
108
|
-
++this.pos;
|
|
109
|
-
return ch;
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
eatWhile: function eatWhile(match) {
|
|
113
|
-
var start = this.pos;
|
|
114
|
-
|
|
115
|
-
while (this.eat(match)) {}
|
|
116
|
-
|
|
117
|
-
return this.pos > start;
|
|
118
|
-
},
|
|
119
|
-
eatSpace: function eatSpace() {
|
|
120
|
-
var start = this.pos;
|
|
121
|
-
|
|
122
|
-
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) {
|
|
123
|
-
++this.pos;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return this.pos > start;
|
|
127
|
-
},
|
|
128
|
-
skipToEnd: function skipToEnd() {
|
|
129
|
-
this.pos = this.string.length;
|
|
130
|
-
},
|
|
131
|
-
skipTo: function skipTo(ch) {
|
|
132
|
-
var found = this.string.indexOf(ch, this.pos);
|
|
133
|
-
|
|
134
|
-
if (found > -1) {
|
|
135
|
-
this.pos = found;
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
backUp: function backUp(n) {
|
|
140
|
-
this.pos -= n;
|
|
141
|
-
},
|
|
142
|
-
column: function column() {
|
|
143
|
-
throw "not implemented";
|
|
144
|
-
},
|
|
145
|
-
indentation: function indentation() {
|
|
146
|
-
throw "not implemented";
|
|
147
|
-
},
|
|
148
|
-
match: function match(pattern, consume, caseInsensitive) {
|
|
149
|
-
if (typeof pattern == "string") {
|
|
150
|
-
var cased = function cased(str) {
|
|
151
|
-
return caseInsensitive ? str.toLowerCase() : str;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
var substr = this.string.substr(this.pos, pattern.length);
|
|
155
|
-
|
|
156
|
-
if (cased(substr) == cased(pattern)) {
|
|
157
|
-
if (consume !== false) this.pos += pattern.length;
|
|
158
|
-
return true;
|
|
159
|
-
}
|
|
160
|
-
} else {
|
|
161
|
-
var match = this.string.slice(this.pos).match(pattern);
|
|
162
|
-
if (match && match.index > 0) return null;
|
|
163
|
-
if (match && consume !== false) this.pos += match[0].length;
|
|
164
|
-
return match;
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
current: function current() {
|
|
168
|
-
return this.string.slice(this.start, this.pos);
|
|
169
|
-
},
|
|
170
|
-
hideFirstChars: function hideFirstChars(n, inner) {
|
|
171
|
-
this.lineStart += n;
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
return inner();
|
|
175
|
-
} finally {
|
|
176
|
-
this.lineStart -= n;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
function toCmPos(pos) {
|
|
182
|
-
return new Pos(pos.lineNumber - 1, pos.column - 1);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function toMonacoPos(pos) {
|
|
186
|
-
return new _editor.Position(pos.line + 1, pos.ch + 1);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
var Marker = /*#__PURE__*/function () {
|
|
190
|
-
function Marker(cm, id, line, ch) {
|
|
191
|
-
_classCallCheck(this, Marker);
|
|
192
|
-
|
|
193
|
-
this.cm = cm;
|
|
194
|
-
this.id = id;
|
|
195
|
-
this.lineNumber = line + 1;
|
|
196
|
-
this.column = ch + 1;
|
|
197
|
-
cm.marks[this.id] = this;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
_createClass(Marker, [{
|
|
201
|
-
key: "clear",
|
|
202
|
-
value: function clear() {
|
|
203
|
-
delete this.cm.marks[this.id];
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
key: "find",
|
|
207
|
-
value: function find() {
|
|
208
|
-
return toCmPos(this);
|
|
209
|
-
}
|
|
210
|
-
}]);
|
|
211
|
-
|
|
212
|
-
return Marker;
|
|
213
|
-
}();
|
|
214
|
-
|
|
215
|
-
function monacoToCmKey(e) {
|
|
216
|
-
var skip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
217
|
-
var addQuotes = true;
|
|
218
|
-
var keyName = _editor.KeyCode[e.keyCode];
|
|
219
|
-
|
|
220
|
-
if (e.key) {
|
|
221
|
-
keyName = e.key;
|
|
222
|
-
addQuotes = false;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
var key = keyName;
|
|
226
|
-
var skipOnlyShiftCheck = skip;
|
|
227
|
-
|
|
228
|
-
switch (e.keyCode) {
|
|
229
|
-
case _editor.KeyCode.Shift:
|
|
230
|
-
case _editor.KeyCode.Meta:
|
|
231
|
-
case _editor.KeyCode.Alt:
|
|
232
|
-
case _editor.KeyCode.Ctrl:
|
|
233
|
-
return key;
|
|
234
|
-
|
|
235
|
-
case _editor.KeyCode.Escape:
|
|
236
|
-
skipOnlyShiftCheck = true;
|
|
237
|
-
key = "Esc";
|
|
238
|
-
break;
|
|
239
|
-
|
|
240
|
-
case _editor.KeyCode.Space:
|
|
241
|
-
skipOnlyShiftCheck = true;
|
|
242
|
-
break;
|
|
243
|
-
} // `Key` check for monaco >= 0.30.0
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (keyName.startsWith("Key") || keyName.startsWith("KEY_")) {
|
|
247
|
-
key = keyName[keyName.length - 1].toLowerCase();
|
|
248
|
-
} else if (keyName.startsWith("Digit")) {
|
|
249
|
-
key = keyName.slice(5, 6);
|
|
250
|
-
} else if (keyName.startsWith("Numpad")) {
|
|
251
|
-
key = keyName.slice(6, 7);
|
|
252
|
-
} else if (keyName.endsWith("Arrow")) {
|
|
253
|
-
skipOnlyShiftCheck = true;
|
|
254
|
-
key = keyName.substring(0, keyName.length - 5);
|
|
255
|
-
} else if (keyName.startsWith("US_") || // `Bracket` check for monaco >= 0.30.0
|
|
256
|
-
keyName.startsWith("Bracket") || !key) {
|
|
257
|
-
key = e.browserEvent.key;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (!skipOnlyShiftCheck && !e.altKey && !e.ctrlKey && !e.metaKey) {
|
|
261
|
-
key = e.key || e.browserEvent.key;
|
|
262
|
-
} else {
|
|
263
|
-
if (e.altKey) {
|
|
264
|
-
key = "Alt-".concat(key);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
if (e.ctrlKey) {
|
|
268
|
-
key = "Ctrl-".concat(key);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (e.metaKey) {
|
|
272
|
-
key = "Meta-".concat(key);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (e.shiftKey) {
|
|
276
|
-
key = "Shift-".concat(key);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (key.length === 1 && addQuotes) {
|
|
281
|
-
key = "'".concat(key, "'");
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
return key;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
var CMAdapter = /*#__PURE__*/function () {
|
|
288
|
-
function CMAdapter(editor) {
|
|
289
|
-
_classCallCheck(this, CMAdapter);
|
|
290
|
-
|
|
291
|
-
_initialiseProps.call(this);
|
|
292
|
-
|
|
293
|
-
this.editor = editor;
|
|
294
|
-
this.state = {
|
|
295
|
-
keyMap: "vim"
|
|
296
|
-
};
|
|
297
|
-
this.marks = {};
|
|
298
|
-
this.$uid = 0;
|
|
299
|
-
this.disposables = [];
|
|
300
|
-
this.listeners = {};
|
|
301
|
-
this.curOp = {};
|
|
302
|
-
this.attached = false;
|
|
303
|
-
this.statusBar = null;
|
|
304
|
-
this.options = {};
|
|
305
|
-
this.addLocalListeners();
|
|
306
|
-
this.ctxInsert = this.editor.createContextKey("insertMode", true);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
_createClass(CMAdapter, [{
|
|
310
|
-
key: "attach",
|
|
311
|
-
value: function attach() {
|
|
312
|
-
CMAdapter.keyMap.vim.attach(this);
|
|
313
|
-
}
|
|
314
|
-
}, {
|
|
315
|
-
key: "addLocalListeners",
|
|
316
|
-
value: function addLocalListeners() {
|
|
317
|
-
this.disposables.push(this.editor.onDidChangeCursorPosition(this.handleCursorChange), this.editor.onDidChangeModelContent(this.handleChange), this.editor.onKeyDown(this.handleKeyDown));
|
|
318
|
-
}
|
|
319
|
-
}, {
|
|
320
|
-
key: "handleReplaceMode",
|
|
321
|
-
value: function handleReplaceMode(key, e) {
|
|
322
|
-
var fromReplace = false;
|
|
323
|
-
var _char = key;
|
|
324
|
-
var pos = this.editor.getPosition();
|
|
325
|
-
var range = new _editor.Range(pos.lineNumber, pos.column, pos.lineNumber, pos.column + 1);
|
|
326
|
-
var forceMoveMarkers = true;
|
|
327
|
-
|
|
328
|
-
if (key.startsWith("'")) {
|
|
329
|
-
_char = key[1];
|
|
330
|
-
} else if (_char === "Enter") {
|
|
331
|
-
_char = "\n";
|
|
332
|
-
} else if (_char === "Backspace") {
|
|
333
|
-
var lastItem = this.replaceStack.pop();
|
|
334
|
-
|
|
335
|
-
if (!lastItem) {
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
fromReplace = true;
|
|
340
|
-
_char = lastItem;
|
|
341
|
-
range = new _editor.Range(pos.lineNumber, pos.column, pos.lineNumber, pos.column - 1);
|
|
342
|
-
} else {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
e.preventDefault();
|
|
347
|
-
e.stopPropagation();
|
|
348
|
-
|
|
349
|
-
if (!this.replaceStack) {
|
|
350
|
-
this.replaceStack = [];
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
if (!fromReplace) {
|
|
354
|
-
this.replaceStack.push(this.editor.getModel().getValueInRange(range));
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
this.editor.executeEdits("vim", [{
|
|
358
|
-
text: _char,
|
|
359
|
-
range: range,
|
|
360
|
-
forceMoveMarkers: forceMoveMarkers
|
|
361
|
-
}]);
|
|
362
|
-
|
|
363
|
-
if (fromReplace) {
|
|
364
|
-
this.editor.setPosition(range.getStartPosition());
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}, {
|
|
368
|
-
key: "setOption",
|
|
369
|
-
value: function setOption(key, value) {
|
|
370
|
-
this.state[key] = value;
|
|
371
|
-
|
|
372
|
-
if (key === "theme") {
|
|
373
|
-
_editor.editor.setTheme(value);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}, {
|
|
377
|
-
key: "getConfiguration",
|
|
378
|
-
value: function getConfiguration() {
|
|
379
|
-
var editor = this.editor;
|
|
380
|
-
var opts = EditorOptConstants;
|
|
381
|
-
|
|
382
|
-
if (typeof editor.getConfiguration === "function") {
|
|
383
|
-
return editor.getConfiguration();
|
|
384
|
-
} else if ("EditorOption" in _editor.editor) {
|
|
385
|
-
// for monaco 0.19.3 onwards
|
|
386
|
-
opts = _editor.editor.EditorOption;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
return {
|
|
390
|
-
readOnly: editor.getOption(opts.readOnly),
|
|
391
|
-
viewInfo: {
|
|
392
|
-
cursorWidth: editor.getOption(opts.cursorWidth)
|
|
393
|
-
},
|
|
394
|
-
fontInfo: editor.getOption(opts.fontInfo)
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
}, {
|
|
398
|
-
key: "getOption",
|
|
399
|
-
value: function getOption(key) {
|
|
400
|
-
if (key === "readOnly") {
|
|
401
|
-
return this.getConfiguration().readOnly;
|
|
402
|
-
} else if (key === "firstLineNumber") {
|
|
403
|
-
return this.firstLine() + 1;
|
|
404
|
-
} else if (key === "indentWithTabs") {
|
|
405
|
-
return !this.editor.getModel().getOptions().insertSpaces;
|
|
406
|
-
} else {
|
|
407
|
-
if (typeof this.editor.getConfiguration === "function") {
|
|
408
|
-
return this.editor.getRawConfiguration()[key];
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return this.editor.getRawOptions()[key];
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}, {
|
|
415
|
-
key: "dispatch",
|
|
416
|
-
value: function dispatch(signal) {
|
|
417
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
418
|
-
args[_key - 1] = arguments[_key];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
var listeners = this.listeners[signal];
|
|
422
|
-
|
|
423
|
-
if (!listeners) {
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
listeners.forEach(function (handler) {
|
|
428
|
-
return handler.apply(void 0, args);
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
}, {
|
|
432
|
-
key: "on",
|
|
433
|
-
value: function on(event, handler) {
|
|
434
|
-
if (!this.listeners[event]) {
|
|
435
|
-
this.listeners[event] = [];
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
this.listeners[event].push(handler);
|
|
439
|
-
}
|
|
440
|
-
}, {
|
|
441
|
-
key: "off",
|
|
442
|
-
value: function off(event, handler) {
|
|
443
|
-
var listeners = this.listeners[event];
|
|
444
|
-
|
|
445
|
-
if (!listeners) {
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
this.listeners[event] = listeners.filter(function (l) {
|
|
450
|
-
return l !== handler;
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
}, {
|
|
454
|
-
key: "firstLine",
|
|
455
|
-
value: function firstLine() {
|
|
456
|
-
return 0;
|
|
457
|
-
}
|
|
458
|
-
}, {
|
|
459
|
-
key: "lastLine",
|
|
460
|
-
value: function lastLine() {
|
|
461
|
-
return this.lineCount() - 1;
|
|
462
|
-
}
|
|
463
|
-
}, {
|
|
464
|
-
key: "lineCount",
|
|
465
|
-
value: function lineCount() {
|
|
466
|
-
return this.editor.getModel().getLineCount();
|
|
467
|
-
}
|
|
468
|
-
}, {
|
|
469
|
-
key: "defaultTextHeight",
|
|
470
|
-
value: function defaultTextHeight() {
|
|
471
|
-
return 1;
|
|
472
|
-
}
|
|
473
|
-
}, {
|
|
474
|
-
key: "getLine",
|
|
475
|
-
value: function getLine(line) {
|
|
476
|
-
if (line < 0) {
|
|
477
|
-
return "";
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
var model = this.editor.getModel();
|
|
481
|
-
var maxLines = model.getLineCount();
|
|
482
|
-
|
|
483
|
-
if (line + 1 > maxLines) {
|
|
484
|
-
line = maxLines - 1;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
return this.editor.getModel().getLineContent(line + 1);
|
|
488
|
-
}
|
|
489
|
-
}, {
|
|
490
|
-
key: "getAnchorForSelection",
|
|
491
|
-
value: function getAnchorForSelection(selection) {
|
|
492
|
-
if (selection.isEmpty()) {
|
|
493
|
-
return selection.getPosition();
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
var selDir = selection.getDirection();
|
|
497
|
-
return selDir === _editor.SelectionDirection.LTR ? selection.getStartPosition() : selection.getEndPosition();
|
|
498
|
-
}
|
|
499
|
-
}, {
|
|
500
|
-
key: "getHeadForSelection",
|
|
501
|
-
value: function getHeadForSelection(selection) {
|
|
502
|
-
if (selection.isEmpty()) {
|
|
503
|
-
return selection.getPosition();
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
var selDir = selection.getDirection();
|
|
507
|
-
return selDir === _editor.SelectionDirection.LTR ? selection.getEndPosition() : selection.getStartPosition();
|
|
508
|
-
}
|
|
509
|
-
}, {
|
|
510
|
-
key: "getCursor",
|
|
511
|
-
value: function getCursor() {
|
|
512
|
-
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
513
|
-
|
|
514
|
-
if (!type) {
|
|
515
|
-
return toCmPos(this.editor.getPosition());
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
var sel = this.editor.getSelection();
|
|
519
|
-
var pos;
|
|
520
|
-
|
|
521
|
-
if (sel.isEmpty()) {
|
|
522
|
-
pos = sel.getPosition();
|
|
523
|
-
} else if (type === "anchor") {
|
|
524
|
-
pos = this.getAnchorForSelection(sel);
|
|
525
|
-
} else {
|
|
526
|
-
pos = this.getHeadForSelection(sel);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
return toCmPos(pos);
|
|
530
|
-
}
|
|
531
|
-
}, {
|
|
532
|
-
key: "getRange",
|
|
533
|
-
value: function getRange(start, end) {
|
|
534
|
-
var p1 = toMonacoPos(start);
|
|
535
|
-
var p2 = toMonacoPos(end);
|
|
536
|
-
return this.editor.getModel().getValueInRange(_editor.Range.fromPositions(p1, p2));
|
|
537
|
-
}
|
|
538
|
-
}, {
|
|
539
|
-
key: "getSelection",
|
|
540
|
-
value: function getSelection() {
|
|
541
|
-
var list = [];
|
|
542
|
-
var editor = this.editor;
|
|
543
|
-
editor.getSelections().map(function (sel) {
|
|
544
|
-
list.push(editor.getModel().getValueInRange(sel));
|
|
545
|
-
});
|
|
546
|
-
return list.join("\n");
|
|
547
|
-
}
|
|
548
|
-
}, {
|
|
549
|
-
key: "replaceRange",
|
|
550
|
-
value: function replaceRange(text, start, end) {
|
|
551
|
-
var p1 = toMonacoPos(start);
|
|
552
|
-
var p2 = !end ? p1 : toMonacoPos(end);
|
|
553
|
-
this.editor.executeEdits("vim", [{
|
|
554
|
-
text: text,
|
|
555
|
-
range: _editor.Range.fromPositions(p1, p2)
|
|
556
|
-
}]); // @TODO - Check if this breaks any other expectation
|
|
557
|
-
|
|
558
|
-
this.pushUndoStop();
|
|
559
|
-
}
|
|
560
|
-
}, {
|
|
561
|
-
key: "pushUndoStop",
|
|
562
|
-
value: function pushUndoStop() {
|
|
563
|
-
this.editor.pushUndoStop();
|
|
564
|
-
}
|
|
565
|
-
}, {
|
|
566
|
-
key: "setCursor",
|
|
567
|
-
value: function setCursor(line, ch) {
|
|
568
|
-
var pos = line;
|
|
569
|
-
|
|
570
|
-
if (_typeof(line) !== "object") {
|
|
571
|
-
pos = {};
|
|
572
|
-
pos.line = line;
|
|
573
|
-
pos.ch = ch;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
var monacoPos = this.editor.getModel().validatePosition(toMonacoPos(pos));
|
|
577
|
-
this.editor.setPosition(toMonacoPos(pos));
|
|
578
|
-
this.editor.revealPosition(monacoPos);
|
|
579
|
-
}
|
|
580
|
-
}, {
|
|
581
|
-
key: "somethingSelected",
|
|
582
|
-
value: function somethingSelected() {
|
|
583
|
-
return !this.editor.getSelection().isEmpty();
|
|
584
|
-
}
|
|
585
|
-
}, {
|
|
586
|
-
key: "operation",
|
|
587
|
-
value: function operation(fn, force) {
|
|
588
|
-
return fn();
|
|
589
|
-
}
|
|
590
|
-
}, {
|
|
591
|
-
key: "listSelections",
|
|
592
|
-
value: function listSelections() {
|
|
593
|
-
var _this = this;
|
|
594
|
-
|
|
595
|
-
var selections = this.editor.getSelections();
|
|
596
|
-
|
|
597
|
-
if (!selections.length || this.inVirtualSelectionMode) {
|
|
598
|
-
return [{
|
|
599
|
-
anchor: this.getCursor("anchor"),
|
|
600
|
-
head: this.getCursor("head")
|
|
601
|
-
}];
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
return selections.map(function (sel) {
|
|
605
|
-
sel.getPosition();
|
|
606
|
-
sel.getStartPosition();
|
|
607
|
-
sel.getEndPosition();
|
|
608
|
-
return {
|
|
609
|
-
anchor: _this.clipPos(toCmPos(_this.getAnchorForSelection(sel))),
|
|
610
|
-
head: _this.clipPos(toCmPos(_this.getHeadForSelection(sel)))
|
|
611
|
-
};
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
}, {
|
|
615
|
-
key: "focus",
|
|
616
|
-
value: function focus() {
|
|
617
|
-
this.editor.focus();
|
|
618
|
-
}
|
|
619
|
-
}, {
|
|
620
|
-
key: "setSelections",
|
|
621
|
-
value: function setSelections(selections, primIndex) {
|
|
622
|
-
var hasSel = !!this.editor.getSelections().length;
|
|
623
|
-
var sels = selections.map(function (sel, index) {
|
|
624
|
-
var anchor = sel.anchor,
|
|
625
|
-
head = sel.head;
|
|
626
|
-
|
|
627
|
-
if (hasSel) {
|
|
628
|
-
return _editor.Selection.fromPositions(toMonacoPos(anchor), toMonacoPos(head));
|
|
629
|
-
} else {
|
|
630
|
-
return _editor.Selection.fromPositions(toMonacoPos(head), toMonacoPos(anchor));
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
|
|
634
|
-
if (!primIndex) ; else if (sels[primIndex]) {
|
|
635
|
-
sels.push(sels.splice(primIndex, 1)[0]);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
if (!sels.length) {
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
var sel = sels[0];
|
|
643
|
-
var posToReveal;
|
|
644
|
-
|
|
645
|
-
if (sel.getDirection() === _editor.SelectionDirection.LTR) {
|
|
646
|
-
posToReveal = sel.getEndPosition();
|
|
647
|
-
} else {
|
|
648
|
-
posToReveal = sel.getStartPosition();
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
this.editor.setSelections(sels);
|
|
652
|
-
this.editor.revealPosition(posToReveal);
|
|
653
|
-
}
|
|
654
|
-
}, {
|
|
655
|
-
key: "setSelection",
|
|
656
|
-
value: function setSelection(frm, to) {
|
|
657
|
-
var range = _editor.Range.fromPositions(toMonacoPos(frm), toMonacoPos(to));
|
|
658
|
-
|
|
659
|
-
this.editor.setSelection(range);
|
|
660
|
-
}
|
|
661
|
-
}, {
|
|
662
|
-
key: "getSelections",
|
|
663
|
-
value: function getSelections() {
|
|
664
|
-
var editor = this.editor;
|
|
665
|
-
return editor.getSelections().map(function (sel) {
|
|
666
|
-
return editor.getModel().getValueInRange(sel);
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
}, {
|
|
670
|
-
key: "replaceSelections",
|
|
671
|
-
value: function replaceSelections(texts) {
|
|
672
|
-
var editor = this.editor;
|
|
673
|
-
editor.getSelections().forEach(function (sel, index) {
|
|
674
|
-
editor.executeEdits("vim", [{
|
|
675
|
-
range: sel,
|
|
676
|
-
text: texts[index],
|
|
677
|
-
forceMoveMarkers: false
|
|
678
|
-
}]);
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
|
-
}, {
|
|
682
|
-
key: "toggleOverwrite",
|
|
683
|
-
value: function toggleOverwrite(toggle) {
|
|
684
|
-
if (toggle) {
|
|
685
|
-
this.enterVimMode();
|
|
686
|
-
this.replaceMode = true;
|
|
687
|
-
} else {
|
|
688
|
-
this.leaveVimMode();
|
|
689
|
-
this.replaceMode = false;
|
|
690
|
-
this.replaceStack = [];
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}, {
|
|
694
|
-
key: "charCoords",
|
|
695
|
-
value: function charCoords(pos, mode) {
|
|
696
|
-
return {
|
|
697
|
-
top: pos.line,
|
|
698
|
-
left: pos.ch
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
}, {
|
|
702
|
-
key: "coordsChar",
|
|
703
|
-
value: function coordsChar(pos, mode) {
|
|
704
|
-
}
|
|
705
|
-
}, {
|
|
706
|
-
key: "clipPos",
|
|
707
|
-
value: function clipPos(p) {
|
|
708
|
-
var pos = this.editor.getModel().validatePosition(toMonacoPos(p));
|
|
709
|
-
return toCmPos(pos);
|
|
710
|
-
}
|
|
711
|
-
}, {
|
|
712
|
-
key: "setBookmark",
|
|
713
|
-
value: function setBookmark(cursor, options) {
|
|
714
|
-
var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch);
|
|
715
|
-
|
|
716
|
-
if (!options || !options.insertLeft) {
|
|
717
|
-
bm.$insertRight = true;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
this.marks[bm.id] = bm;
|
|
721
|
-
return bm;
|
|
722
|
-
}
|
|
723
|
-
}, {
|
|
724
|
-
key: "getScrollInfo",
|
|
725
|
-
value: function getScrollInfo() {
|
|
726
|
-
var editor = this.editor;
|
|
727
|
-
|
|
728
|
-
var _editor$getVisibleRan = editor.getVisibleRanges(),
|
|
729
|
-
_editor$getVisibleRan2 = _slicedToArray(_editor$getVisibleRan, 1),
|
|
730
|
-
range = _editor$getVisibleRan2[0];
|
|
731
|
-
|
|
732
|
-
return {
|
|
733
|
-
left: 0,
|
|
734
|
-
top: range.startLineNumber - 1,
|
|
735
|
-
height: editor.getModel().getLineCount(),
|
|
736
|
-
clientHeight: range.endLineNumber - range.startLineNumber + 1
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
}, {
|
|
740
|
-
key: "triggerEditorAction",
|
|
741
|
-
value: function triggerEditorAction(action) {
|
|
742
|
-
this.editor.trigger("vim", action);
|
|
743
|
-
}
|
|
744
|
-
}, {
|
|
745
|
-
key: "dispose",
|
|
746
|
-
value: function dispose() {
|
|
747
|
-
this.dispatch("dispose");
|
|
748
|
-
this.removeOverlay();
|
|
749
|
-
|
|
750
|
-
if (CMAdapter.keyMap.vim) {
|
|
751
|
-
CMAdapter.keyMap.vim.detach(this);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
this.disposables.forEach(function (d) {
|
|
755
|
-
return d.dispose();
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
}, {
|
|
759
|
-
key: "getInputField",
|
|
760
|
-
value: function getInputField() {}
|
|
761
|
-
}, {
|
|
762
|
-
key: "getWrapperElement",
|
|
763
|
-
value: function getWrapperElement() {}
|
|
764
|
-
}, {
|
|
765
|
-
key: "enterVimMode",
|
|
766
|
-
value: function enterVimMode() {
|
|
767
|
-
this.ctxInsert.set(false);
|
|
768
|
-
var config = this.getConfiguration();
|
|
769
|
-
this.initialCursorWidth = config.viewInfo.cursorWidth || 0;
|
|
770
|
-
this.editor.updateOptions({
|
|
771
|
-
cursorWidth: config.fontInfo.typicalFullwidthCharacterWidth,
|
|
772
|
-
cursorBlinking: "solid"
|
|
773
|
-
});
|
|
774
|
-
}
|
|
775
|
-
}, {
|
|
776
|
-
key: "leaveVimMode",
|
|
777
|
-
value: function leaveVimMode() {
|
|
778
|
-
this.ctxInsert.set(true);
|
|
779
|
-
this.editor.updateOptions({
|
|
780
|
-
cursorWidth: this.initialCursorWidth || 0,
|
|
781
|
-
cursorBlinking: "blink"
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
}, {
|
|
785
|
-
key: "virtualSelectionMode",
|
|
786
|
-
value: function virtualSelectionMode() {
|
|
787
|
-
return this.inVirtualSelectionMode;
|
|
788
|
-
}
|
|
789
|
-
}, {
|
|
790
|
-
key: "markText",
|
|
791
|
-
value: function markText() {
|
|
792
|
-
// only used for fat-cursor, not needed
|
|
793
|
-
return {
|
|
794
|
-
clear: function clear() {},
|
|
795
|
-
find: function find() {}
|
|
796
|
-
};
|
|
797
|
-
}
|
|
798
|
-
}, {
|
|
799
|
-
key: "getUserVisibleLines",
|
|
800
|
-
value: function getUserVisibleLines() {
|
|
801
|
-
var ranges = this.editor.getVisibleRanges();
|
|
802
|
-
|
|
803
|
-
if (!ranges.length) {
|
|
804
|
-
return {
|
|
805
|
-
top: 0,
|
|
806
|
-
bottom: 0
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
var res = {
|
|
811
|
-
top: Infinity,
|
|
812
|
-
bottom: 0
|
|
813
|
-
};
|
|
814
|
-
ranges.reduce(function (acc, range) {
|
|
815
|
-
if (range.startLineNumber < acc.top) {
|
|
816
|
-
acc.top = range.startLineNumber;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
if (range.endLineNumber > acc.bottom) {
|
|
820
|
-
acc.bottom = range.endLineNumber;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
return acc;
|
|
824
|
-
}, res);
|
|
825
|
-
res.top -= 1;
|
|
826
|
-
res.bottom -= 1;
|
|
827
|
-
return res;
|
|
828
|
-
}
|
|
829
|
-
}, {
|
|
830
|
-
key: "findPosV",
|
|
831
|
-
value: function findPosV(startPos, amount, unit) {
|
|
832
|
-
var editor = this.editor;
|
|
833
|
-
var finalAmount = amount;
|
|
834
|
-
var finalUnit = unit;
|
|
835
|
-
var pos = toMonacoPos(startPos);
|
|
836
|
-
|
|
837
|
-
if (unit === "page") {
|
|
838
|
-
var editorHeight = editor.getLayoutInfo().height;
|
|
839
|
-
var lineHeight = this.getConfiguration().fontInfo.lineHeight;
|
|
840
|
-
finalAmount = finalAmount * Math.floor(editorHeight / lineHeight);
|
|
841
|
-
finalUnit = "line";
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
if (finalUnit === "line") {
|
|
845
|
-
pos.lineNumber += finalAmount;
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
return toCmPos(pos);
|
|
849
|
-
}
|
|
850
|
-
}, {
|
|
851
|
-
key: "findMatchingBracket",
|
|
852
|
-
value: function findMatchingBracket(pos) {
|
|
853
|
-
var mPos = toMonacoPos(pos);
|
|
854
|
-
var model = this.editor.getModel();
|
|
855
|
-
var res; // for monaco versions >= 0.28.0
|
|
856
|
-
|
|
857
|
-
if (model.bracketPairs) {
|
|
858
|
-
res = model.bracketPairs.matchBracket(mPos);
|
|
859
|
-
} else {
|
|
860
|
-
var _model$matchBracket;
|
|
861
|
-
|
|
862
|
-
res = (_model$matchBracket = model.matchBracket) === null || _model$matchBracket === void 0 ? void 0 : _model$matchBracket.call(model, mPos);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
if (!res || !(res.length === 2)) {
|
|
866
|
-
return {
|
|
867
|
-
to: null
|
|
868
|
-
};
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
return {
|
|
872
|
-
to: toCmPos(res[1].getStartPosition())
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
}, {
|
|
876
|
-
key: "findFirstNonWhiteSpaceCharacter",
|
|
877
|
-
value: function findFirstNonWhiteSpaceCharacter(line) {
|
|
878
|
-
return this.editor.getModel().getLineFirstNonWhitespaceColumn(line + 1) - 1;
|
|
879
|
-
}
|
|
880
|
-
}, {
|
|
881
|
-
key: "scrollTo",
|
|
882
|
-
value: function scrollTo(x, y) {
|
|
883
|
-
if (!x && !y) {
|
|
884
|
-
return;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
if (!x) {
|
|
888
|
-
if (y < 0) {
|
|
889
|
-
y = this.editor.getPosition().lineNumber - y;
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
this.editor.setScrollTop(this.editor.getTopForLineNumber(y + 1));
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}, {
|
|
896
|
-
key: "moveCurrentLineTo",
|
|
897
|
-
value: function moveCurrentLineTo(viewPosition) {
|
|
898
|
-
var _editor$_revealRange;
|
|
899
|
-
|
|
900
|
-
var editor = this.editor;
|
|
901
|
-
var pos = editor.getPosition();
|
|
902
|
-
|
|
903
|
-
var range = _editor.Range.fromPositions(pos, pos);
|
|
904
|
-
|
|
905
|
-
switch (viewPosition) {
|
|
906
|
-
case "top":
|
|
907
|
-
editor.revealRangeAtTop(range);
|
|
908
|
-
return;
|
|
909
|
-
|
|
910
|
-
case "center":
|
|
911
|
-
editor.revealRangeInCenter(range);
|
|
912
|
-
return;
|
|
913
|
-
|
|
914
|
-
case "bottom":
|
|
915
|
-
// private api. no other way
|
|
916
|
-
(_editor$_revealRange = editor._revealRange) === null || _editor$_revealRange === void 0 ? void 0 : _editor$_revealRange.call(editor, range, VerticalRevealType.Bottom);
|
|
917
|
-
return;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
}, {
|
|
921
|
-
key: "getSearchCursor",
|
|
922
|
-
value: function getSearchCursor(query, pos) {
|
|
923
|
-
var matchCase = false;
|
|
924
|
-
var isRegex = false;
|
|
925
|
-
|
|
926
|
-
if (query instanceof RegExp && !query.global) {
|
|
927
|
-
matchCase = !query.ignoreCase;
|
|
928
|
-
query = query.source;
|
|
929
|
-
isRegex = true;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
if (pos.ch == undefined) pos.ch = Number.MAX_VALUE;
|
|
933
|
-
var monacoPos = toMonacoPos(pos);
|
|
934
|
-
var context = this;
|
|
935
|
-
var editor = this.editor;
|
|
936
|
-
var lastSearch = null;
|
|
937
|
-
var model = editor.getModel();
|
|
938
|
-
var matches = model.findMatches(query, false, isRegex, matchCase) || [];
|
|
939
|
-
return {
|
|
940
|
-
getMatches: function getMatches() {
|
|
941
|
-
return matches;
|
|
942
|
-
},
|
|
943
|
-
findNext: function findNext() {
|
|
944
|
-
return this.find(false);
|
|
945
|
-
},
|
|
946
|
-
findPrevious: function findPrevious() {
|
|
947
|
-
return this.find(true);
|
|
948
|
-
},
|
|
949
|
-
jumpTo: function jumpTo(index) {
|
|
950
|
-
if (!matches || !matches.length) {
|
|
951
|
-
return false;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
var match = matches[index];
|
|
955
|
-
lastSearch = match.range;
|
|
956
|
-
context.highlightRanges([lastSearch], "currentFindMatch");
|
|
957
|
-
context.highlightRanges(matches.map(function (m) {
|
|
958
|
-
return m.range;
|
|
959
|
-
}).filter(function (r) {
|
|
960
|
-
return !r.equalsRange(lastSearch);
|
|
961
|
-
}));
|
|
962
|
-
return lastSearch;
|
|
963
|
-
},
|
|
964
|
-
find: function find(back) {
|
|
965
|
-
if (!matches || !matches.length) {
|
|
966
|
-
return false;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
var match;
|
|
970
|
-
|
|
971
|
-
if (back) {
|
|
972
|
-
var _pos = lastSearch ? lastSearch.getStartPosition() : monacoPos;
|
|
973
|
-
|
|
974
|
-
match = model.findPreviousMatch(query, _pos, isRegex, matchCase);
|
|
975
|
-
|
|
976
|
-
if (!match || !match.range.getStartPosition().isBeforeOrEqual(_pos)) {
|
|
977
|
-
return false;
|
|
978
|
-
}
|
|
979
|
-
} else {
|
|
980
|
-
var _pos2 = lastSearch ? model.getPositionAt(model.getOffsetAt(lastSearch.getStartPosition()) + 1) : monacoPos;
|
|
981
|
-
|
|
982
|
-
match = model.findNextMatch(query, _pos2, isRegex, matchCase);
|
|
983
|
-
|
|
984
|
-
if (!match || !_pos2.isBeforeOrEqual(match.range.getStartPosition())) {
|
|
985
|
-
return false;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
lastSearch = match.range;
|
|
990
|
-
context.highlightRanges([lastSearch], "currentFindMatch");
|
|
991
|
-
context.highlightRanges(matches.map(function (m) {
|
|
992
|
-
return m.range;
|
|
993
|
-
}).filter(function (r) {
|
|
994
|
-
return !r.equalsRange(lastSearch);
|
|
995
|
-
}));
|
|
996
|
-
return lastSearch;
|
|
997
|
-
},
|
|
998
|
-
from: function from() {
|
|
999
|
-
return lastSearch && toCmPos(lastSearch.getStartPosition());
|
|
1000
|
-
},
|
|
1001
|
-
to: function to() {
|
|
1002
|
-
return lastSearch && toCmPos(lastSearch.getEndPosition());
|
|
1003
|
-
},
|
|
1004
|
-
replace: function replace(text) {
|
|
1005
|
-
if (lastSearch) {
|
|
1006
|
-
editor.executeEdits("vim", [{
|
|
1007
|
-
range: lastSearch,
|
|
1008
|
-
text: text,
|
|
1009
|
-
forceMoveMarkers: true
|
|
1010
|
-
}]);
|
|
1011
|
-
lastSearch.setEndPosition(editor.getPosition());
|
|
1012
|
-
editor.setPosition(lastSearch.getStartPosition());
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
}, {
|
|
1018
|
-
key: "highlightRanges",
|
|
1019
|
-
value: function highlightRanges(ranges) {
|
|
1020
|
-
var className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "findMatch";
|
|
1021
|
-
var decorationKey = "decoration".concat(className);
|
|
1022
|
-
this[decorationKey] = this.editor.deltaDecorations(this[decorationKey] || [], ranges.map(function (range) {
|
|
1023
|
-
return {
|
|
1024
|
-
range: range,
|
|
1025
|
-
options: {
|
|
1026
|
-
stickiness: _editor.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
1027
|
-
zIndex: 13,
|
|
1028
|
-
className: className,
|
|
1029
|
-
showIfCollapsed: true
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
}));
|
|
1033
|
-
return this[decorationKey];
|
|
1034
|
-
}
|
|
1035
|
-
}, {
|
|
1036
|
-
key: "addOverlay",
|
|
1037
|
-
value: function addOverlay(_ref, hasBoundary, style) {
|
|
1038
|
-
var query = _ref.query;
|
|
1039
|
-
var matchCase = false;
|
|
1040
|
-
var isRegex = false;
|
|
1041
|
-
|
|
1042
|
-
if (query && query instanceof RegExp && !query.global) {
|
|
1043
|
-
isRegex = true;
|
|
1044
|
-
matchCase = !query.ignoreCase;
|
|
1045
|
-
query = query.source;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
var match = this.editor.getModel().findNextMatch(query, this.editor.getPosition(), isRegex, matchCase);
|
|
1049
|
-
|
|
1050
|
-
if (!match || !match.range) {
|
|
1051
|
-
return;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
this.highlightRanges([match.range]);
|
|
1055
|
-
}
|
|
1056
|
-
}, {
|
|
1057
|
-
key: "removeOverlay",
|
|
1058
|
-
value: function removeOverlay() {
|
|
1059
|
-
var _this2 = this;
|
|
1060
|
-
|
|
1061
|
-
["currentFindMatch", "findMatch"].forEach(function (key) {
|
|
1062
|
-
_this2.editor.deltaDecorations(_this2["decoration".concat(key)] || [], []);
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
}, {
|
|
1066
|
-
key: "scrollIntoView",
|
|
1067
|
-
value: function scrollIntoView(pos) {
|
|
1068
|
-
if (!pos) {
|
|
1069
|
-
return;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
this.editor.revealPosition(toMonacoPos(pos));
|
|
1073
|
-
}
|
|
1074
|
-
}, {
|
|
1075
|
-
key: "moveH",
|
|
1076
|
-
value: function moveH(units, type) {
|
|
1077
|
-
if (type !== "char") {
|
|
1078
|
-
return;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
var pos = this.editor.getPosition();
|
|
1082
|
-
this.editor.setPosition(new _editor.Position(pos.lineNumber, pos.column + units));
|
|
1083
|
-
}
|
|
1084
|
-
}, {
|
|
1085
|
-
key: "scanForBracket",
|
|
1086
|
-
value: function scanForBracket(pos, dir, dd, config) {
|
|
1087
|
-
var bracketRegex = config.bracketRegex;
|
|
1088
|
-
var mPos = toMonacoPos(pos);
|
|
1089
|
-
var model = this.editor.getModel();
|
|
1090
|
-
var searchFunc = (dir === -1 ? model.findPreviousMatch : model.findNextMatch).bind(model);
|
|
1091
|
-
var stack = [];
|
|
1092
|
-
var iterations = 0;
|
|
1093
|
-
|
|
1094
|
-
while (true) {
|
|
1095
|
-
if (iterations > 10) {
|
|
1096
|
-
// Searched too far, give up.
|
|
1097
|
-
return undefined;
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
var match = searchFunc(bracketRegex.source, mPos, true, true, null, true);
|
|
1101
|
-
var thisBracket = match.matches[0];
|
|
1102
|
-
|
|
1103
|
-
if (match === undefined) {
|
|
1104
|
-
return undefined;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
var matchingBracket = CMAdapter.matchingBrackets[thisBracket];
|
|
1108
|
-
|
|
1109
|
-
if (matchingBracket && matchingBracket.charAt(1) === ">" == dir > 0) {
|
|
1110
|
-
stack.push(thisBracket);
|
|
1111
|
-
} else if (stack.length === 0) {
|
|
1112
|
-
var res = match.range.getStartPosition();
|
|
1113
|
-
return {
|
|
1114
|
-
pos: toCmPos(res)
|
|
1115
|
-
};
|
|
1116
|
-
} else {
|
|
1117
|
-
stack.pop();
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
mPos = model.getPositionAt(model.getOffsetAt(match.range.getStartPosition()) + dir);
|
|
1121
|
-
iterations += 1;
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
}, {
|
|
1125
|
-
key: "indexFromPos",
|
|
1126
|
-
value: function indexFromPos(pos) {
|
|
1127
|
-
return this.editor.getModel().getOffsetAt(toMonacoPos(pos));
|
|
1128
|
-
}
|
|
1129
|
-
}, {
|
|
1130
|
-
key: "posFromIndex",
|
|
1131
|
-
value: function posFromIndex(offset) {
|
|
1132
|
-
return toCmPos(this.editor.getModel().getPositionAt(offset));
|
|
1133
|
-
}
|
|
1134
|
-
}, {
|
|
1135
|
-
key: "indentLine",
|
|
1136
|
-
value: function indentLine(line) {
|
|
1137
|
-
var indentRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1138
|
-
var editor = this.editor;
|
|
1139
|
-
var cursorConfig; // Monaco >= 0.21.x
|
|
1140
|
-
|
|
1141
|
-
if (editor._getViewModel) {
|
|
1142
|
-
cursorConfig = editor._getViewModel().cursorConfig;
|
|
1143
|
-
} else {
|
|
1144
|
-
cursorConfig = editor._getCursors().context.config;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
var pos = new _editor.Position(line + 1, 1);
|
|
1148
|
-
|
|
1149
|
-
var sel = _editor.Selection.fromPositions(pos, pos); // no other way than to use internal apis to preserve the undoStack for a batch of indents
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
editor.executeCommand("vim", new _shiftCommand.ShiftCommand(sel, {
|
|
1153
|
-
isUnshift: !indentRight,
|
|
1154
|
-
tabSize: cursorConfig.tabSize,
|
|
1155
|
-
indentSize: cursorConfig.indentSize,
|
|
1156
|
-
insertSpaces: cursorConfig.insertSpaces,
|
|
1157
|
-
useTabStops: cursorConfig.useTabStops,
|
|
1158
|
-
autoIndent: cursorConfig.autoIndent
|
|
1159
|
-
}));
|
|
1160
|
-
}
|
|
1161
|
-
}, {
|
|
1162
|
-
key: "setStatusBar",
|
|
1163
|
-
value: function setStatusBar(statusBar) {
|
|
1164
|
-
this.statusBar = statusBar;
|
|
1165
|
-
}
|
|
1166
|
-
}, {
|
|
1167
|
-
key: "openDialog",
|
|
1168
|
-
value: function openDialog(html, callback, options) {
|
|
1169
|
-
if (!this.statusBar) {
|
|
1170
|
-
return;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
return this.statusBar.setSec(html, callback, options);
|
|
1174
|
-
}
|
|
1175
|
-
}, {
|
|
1176
|
-
key: "openNotification",
|
|
1177
|
-
value: function openNotification(html) {
|
|
1178
|
-
if (!this.statusBar) {
|
|
1179
|
-
return;
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
this.statusBar.showNotification(html);
|
|
1183
|
-
}
|
|
1184
|
-
}, {
|
|
1185
|
-
key: "smartIndent",
|
|
1186
|
-
value: function smartIndent() {
|
|
1187
|
-
// Only works if a formatter is added for the current language.
|
|
1188
|
-
// reindentselectedlines does not work here.
|
|
1189
|
-
this.editor.getAction("editor.action.formatSelection").run();
|
|
1190
|
-
}
|
|
1191
|
-
}, {
|
|
1192
|
-
key: "moveCursorTo",
|
|
1193
|
-
value: function moveCursorTo(to) {
|
|
1194
|
-
var newPos = this.editor.getPosition();
|
|
1195
|
-
|
|
1196
|
-
if (to === "start") {
|
|
1197
|
-
newPos.column = 1;
|
|
1198
|
-
} else if (to === "end") {
|
|
1199
|
-
newPos.column = this.editor.getModel().getLineMaxColumn(newPos.lineNumber);
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
this.editor.setPosition(newPos);
|
|
1203
|
-
}
|
|
1204
|
-
}, {
|
|
1205
|
-
key: "execCommand",
|
|
1206
|
-
value: function execCommand(command) {
|
|
1207
|
-
switch (command) {
|
|
1208
|
-
case "goLineLeft":
|
|
1209
|
-
this.moveCursorTo("start");
|
|
1210
|
-
break;
|
|
1211
|
-
|
|
1212
|
-
case "goLineRight":
|
|
1213
|
-
this.moveCursorTo("end");
|
|
1214
|
-
break;
|
|
1215
|
-
|
|
1216
|
-
case "indentAuto":
|
|
1217
|
-
this.smartIndent();
|
|
1218
|
-
break;
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
}]);
|
|
1222
|
-
|
|
1223
|
-
return CMAdapter;
|
|
1224
|
-
}();
|
|
1225
|
-
|
|
1226
|
-
CMAdapter.Pos = Pos;
|
|
1227
|
-
CMAdapter.signal = signal;
|
|
1228
|
-
CMAdapter.on = dummy();
|
|
1229
|
-
CMAdapter.off = dummy();
|
|
1230
|
-
CMAdapter.addClass = dummy();
|
|
1231
|
-
CMAdapter.rmClass = dummy();
|
|
1232
|
-
CMAdapter.defineOption = dummy();
|
|
1233
|
-
CMAdapter.keyMap = {
|
|
1234
|
-
"default": function _default(key) {
|
|
1235
|
-
return function (cm) {
|
|
1236
|
-
return true;
|
|
1237
|
-
};
|
|
1238
|
-
}
|
|
1239
|
-
};
|
|
1240
|
-
CMAdapter.matchingBrackets = {
|
|
1241
|
-
"(": ")>",
|
|
1242
|
-
")": "(<",
|
|
1243
|
-
"[": "]>",
|
|
1244
|
-
"]": "[<",
|
|
1245
|
-
"{": "}>",
|
|
1246
|
-
"}": "{<",
|
|
1247
|
-
"<": ">>",
|
|
1248
|
-
">": "<<"
|
|
1249
|
-
};
|
|
1250
|
-
CMAdapter.isWordChar = isWordCharBasic;
|
|
1251
|
-
CMAdapter.keyName = monacoToCmKey;
|
|
1252
|
-
CMAdapter.StringStream = StringStream;
|
|
1253
|
-
|
|
1254
|
-
CMAdapter.e_stop = function (e) {
|
|
1255
|
-
if (e.stopPropagation) {
|
|
1256
|
-
e.stopPropagation();
|
|
1257
|
-
} else {
|
|
1258
|
-
e.cancelBubble = true;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
CMAdapter.e_preventDefault(e);
|
|
1262
|
-
return false;
|
|
1263
|
-
};
|
|
1264
|
-
|
|
1265
|
-
CMAdapter.e_preventDefault = function (e) {
|
|
1266
|
-
if (e.preventDefault) {
|
|
1267
|
-
e.preventDefault();
|
|
1268
|
-
|
|
1269
|
-
if (e.browserEvent) {
|
|
1270
|
-
e.browserEvent.preventDefault();
|
|
1271
|
-
}
|
|
1272
|
-
} else {
|
|
1273
|
-
e.returnValue = false;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
return false;
|
|
1277
|
-
};
|
|
1278
|
-
|
|
1279
|
-
CMAdapter.commands = {
|
|
1280
|
-
redo: function redo(cm) {
|
|
1281
|
-
cm.editor.getModel().redo();
|
|
1282
|
-
},
|
|
1283
|
-
undo: function undo(cm) {
|
|
1284
|
-
cm.editor.getModel().undo();
|
|
1285
|
-
},
|
|
1286
|
-
newlineAndIndent: function newlineAndIndent(cm) {
|
|
1287
|
-
cm.triggerEditorAction("editor.action.insertLineAfter");
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
|
|
1291
|
-
CMAdapter.lookupKey = function lookupKey(key, map, handle) {
|
|
1292
|
-
if (typeof map === "string") {
|
|
1293
|
-
map = CMAdapter.keyMap[map];
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
var found = typeof map == "function" ? map(key) : map[key];
|
|
1297
|
-
if (found === false) return "nothing";
|
|
1298
|
-
if (found === "...") return "multi";
|
|
1299
|
-
if (found != null && handle(found)) return "handled";
|
|
1300
|
-
|
|
1301
|
-
if (map.fallthrough) {
|
|
1302
|
-
if (!Array.isArray(map.fallthrough)) return lookupKey(key, map.fallthrough, handle);
|
|
1303
|
-
|
|
1304
|
-
for (var i = 0; i < map.fallthrough.length; i++) {
|
|
1305
|
-
var result = lookupKey(key, map.fallthrough[i], handle);
|
|
1306
|
-
if (result) return result;
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
};
|
|
1310
|
-
|
|
1311
|
-
CMAdapter.defineExtension = function (name, fn) {
|
|
1312
|
-
CMAdapter.prototype[name] = fn;
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
var _initialiseProps = function _initialiseProps() {
|
|
1316
|
-
var _this3 = this;
|
|
1317
|
-
|
|
1318
|
-
this.handleKeyDown = function (e) {
|
|
1319
|
-
// Allow previously registered keydown listeners to handle the event and
|
|
1320
|
-
// prevent this extension from also handling it.
|
|
1321
|
-
if (e.browserEvent.defaultPrevented & e.keyCode !== _editor.KeyCode.Escape) {
|
|
1322
|
-
return;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
if (!_this3.attached) {
|
|
1326
|
-
return;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
var key = monacoToCmKey(e);
|
|
1330
|
-
|
|
1331
|
-
if (_this3.replaceMode) {
|
|
1332
|
-
_this3.handleReplaceMode(key, e);
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
if (!key) {
|
|
1336
|
-
return;
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
var keymap = _this3.state.keyMap;
|
|
1340
|
-
|
|
1341
|
-
if (CMAdapter.keyMap[keymap] && CMAdapter.keyMap[keymap].call) {
|
|
1342
|
-
var cmd = CMAdapter.keyMap[keymap].call(key, _this3);
|
|
1343
|
-
|
|
1344
|
-
if (cmd) {
|
|
1345
|
-
e.preventDefault();
|
|
1346
|
-
e.stopPropagation();
|
|
1347
|
-
|
|
1348
|
-
try {
|
|
1349
|
-
cmd();
|
|
1350
|
-
} catch (err) {
|
|
1351
|
-
console.error(err);
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
|
|
1357
|
-
this.handleCursorChange = function (e) {
|
|
1358
|
-
var position = e.position;
|
|
1359
|
-
e.source;
|
|
1360
|
-
var editor = _this3.editor;
|
|
1361
|
-
var selection = editor.getSelection();
|
|
1362
|
-
|
|
1363
|
-
if (!_this3.ctxInsert.get() && e.source === "mouse" && selection.isEmpty()) {
|
|
1364
|
-
var maxCol = editor.getModel().getLineMaxColumn(position.lineNumber);
|
|
1365
|
-
|
|
1366
|
-
if (e.position.column === maxCol) {
|
|
1367
|
-
editor.setPosition(new _editor.Position(e.position.lineNumber, maxCol - 1));
|
|
1368
|
-
return;
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
_this3.dispatch("cursorActivity", _this3, e);
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
this.handleChange = function (e) {
|
|
1376
|
-
var changes = e.changes;
|
|
1377
|
-
var change = {
|
|
1378
|
-
text: changes.reduce(function (acc, change) {
|
|
1379
|
-
acc.push(change.text);
|
|
1380
|
-
return acc;
|
|
1381
|
-
}, []),
|
|
1382
|
-
origin: "+input"
|
|
1383
|
-
};
|
|
1384
|
-
var curOp = _this3.curOp = _this3.curOp || {};
|
|
1385
|
-
|
|
1386
|
-
if (!curOp.changeHandlers) {
|
|
1387
|
-
curOp.changeHandlers = _this3.listeners["change"] && _this3.listeners["change"].slice();
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
if (_this3.virtualSelectionMode()) {
|
|
1391
|
-
return;
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
if (!curOp.lastChange) {
|
|
1395
|
-
curOp.lastChange = curOp.change = change;
|
|
1396
|
-
} else {
|
|
1397
|
-
curOp.lastChange.next = curOp.lastChange = change;
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
|
-
_this3.dispatch("change", _this3, change);
|
|
1401
|
-
};
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
|
-
var _default2 = CMAdapter;
|
|
1405
|
-
exports["default"] = _default2;
|
|
1406
|
-
} (cm_adapter));
|
|
1
|
+
import { __exports as keymap_vim } from '../../../../_virtual/keymap_vim.js';
|
|
2
|
+
import '../cm_adapter.js';
|
|
3
|
+
import { __exports as cm_adapter } from '../../../../_virtual/cm_adapter.js';
|
|
1407
4
|
|
|
1408
5
|
(function (exports) {
|
|
1409
6
|
|
|
@@ -9315,387 +7912,3 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(shiftCommand);
|
|
|
9315
7912
|
var _default = _cm_adapter["default"];
|
|
9316
7913
|
exports["default"] = _default;
|
|
9317
7914
|
} (keymap_vim));
|
|
9318
|
-
|
|
9319
|
-
var statusbar = {};
|
|
9320
|
-
|
|
9321
|
-
(function (exports) {
|
|
9322
|
-
|
|
9323
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9324
|
-
value: true
|
|
9325
|
-
});
|
|
9326
|
-
exports["default"] = void 0;
|
|
9327
|
-
|
|
9328
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9329
|
-
|
|
9330
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
9331
|
-
|
|
9332
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9333
|
-
|
|
9334
|
-
var VimStatusBar = /*#__PURE__*/function () {
|
|
9335
|
-
function VimStatusBar(node, editor) {
|
|
9336
|
-
var _this = this;
|
|
9337
|
-
|
|
9338
|
-
var sanitizer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
9339
|
-
|
|
9340
|
-
_classCallCheck(this, VimStatusBar);
|
|
9341
|
-
|
|
9342
|
-
this.closeInput = function () {
|
|
9343
|
-
_this.removeInputListeners();
|
|
9344
|
-
|
|
9345
|
-
_this.input = null;
|
|
9346
|
-
|
|
9347
|
-
_this.setSec("");
|
|
9348
|
-
|
|
9349
|
-
if (_this.editor) {
|
|
9350
|
-
_this.editor.focus();
|
|
9351
|
-
}
|
|
9352
|
-
};
|
|
9353
|
-
|
|
9354
|
-
this.clear = function () {
|
|
9355
|
-
_this.setInnerHtml_(_this.node, "");
|
|
9356
|
-
};
|
|
9357
|
-
|
|
9358
|
-
this.inputKeyUp = function (e) {
|
|
9359
|
-
var options = _this.input.options;
|
|
9360
|
-
|
|
9361
|
-
if (options && options.onKeyUp) {
|
|
9362
|
-
options.onKeyUp(e, e.target.value, _this.closeInput);
|
|
9363
|
-
}
|
|
9364
|
-
};
|
|
9365
|
-
|
|
9366
|
-
this.inputKeyInput = function (e) {
|
|
9367
|
-
var options = _this.input.options;
|
|
9368
|
-
|
|
9369
|
-
if (options && options.onKeyInput) {
|
|
9370
|
-
options.onKeyUp(e, e.target.value, _this.closeInput);
|
|
9371
|
-
}
|
|
9372
|
-
};
|
|
9373
|
-
|
|
9374
|
-
this.inputBlur = function () {
|
|
9375
|
-
var options = _this.input.options;
|
|
9376
|
-
|
|
9377
|
-
if (options.closeOnBlur) {
|
|
9378
|
-
_this.closeInput();
|
|
9379
|
-
}
|
|
9380
|
-
};
|
|
9381
|
-
|
|
9382
|
-
this.inputKeyDown = function (e) {
|
|
9383
|
-
var _this$input = _this.input,
|
|
9384
|
-
options = _this$input.options,
|
|
9385
|
-
callback = _this$input.callback;
|
|
9386
|
-
|
|
9387
|
-
if (options && options.onKeyDown && options.onKeyDown(e, e.target.value, _this.closeInput)) {
|
|
9388
|
-
return;
|
|
9389
|
-
}
|
|
9390
|
-
|
|
9391
|
-
if (e.keyCode === 27 || options && options.closeOnEnter !== false && e.keyCode == 13) {
|
|
9392
|
-
_this.input.node.blur();
|
|
9393
|
-
|
|
9394
|
-
e.stopPropagation();
|
|
9395
|
-
|
|
9396
|
-
_this.closeInput();
|
|
9397
|
-
}
|
|
9398
|
-
|
|
9399
|
-
if (e.keyCode === 13 && callback) {
|
|
9400
|
-
e.stopPropagation();
|
|
9401
|
-
e.preventDefault();
|
|
9402
|
-
callback(e.target.value);
|
|
9403
|
-
}
|
|
9404
|
-
};
|
|
9405
|
-
|
|
9406
|
-
this.node = node;
|
|
9407
|
-
this.modeInfoNode = document.createElement("span");
|
|
9408
|
-
this.secInfoNode = document.createElement("span");
|
|
9409
|
-
this.notifNode = document.createElement("span");
|
|
9410
|
-
this.notifNode.className = "vim-notification";
|
|
9411
|
-
this.keyInfoNode = document.createElement("span");
|
|
9412
|
-
this.keyInfoNode.setAttribute("style", "float: right");
|
|
9413
|
-
this.node.appendChild(this.modeInfoNode);
|
|
9414
|
-
this.node.appendChild(this.secInfoNode);
|
|
9415
|
-
this.node.appendChild(this.notifNode);
|
|
9416
|
-
this.node.appendChild(this.keyInfoNode);
|
|
9417
|
-
this.toggleVisibility(false);
|
|
9418
|
-
this.editor = editor;
|
|
9419
|
-
this.sanitizer = sanitizer;
|
|
9420
|
-
}
|
|
9421
|
-
|
|
9422
|
-
_createClass(VimStatusBar, [{
|
|
9423
|
-
key: "setMode",
|
|
9424
|
-
value: function setMode(ev) {
|
|
9425
|
-
if (ev.mode === "visual") {
|
|
9426
|
-
if (ev.subMode === "linewise") {
|
|
9427
|
-
this.setText("--VISUAL LINE--");
|
|
9428
|
-
} else if (ev.subMode === "blockwise") {
|
|
9429
|
-
this.setText("--VISUAL BLOCK--");
|
|
9430
|
-
} else {
|
|
9431
|
-
this.setText("--VISUAL--");
|
|
9432
|
-
}
|
|
9433
|
-
|
|
9434
|
-
return;
|
|
9435
|
-
}
|
|
9436
|
-
|
|
9437
|
-
this.setText("--".concat(ev.mode.toUpperCase(), "--"));
|
|
9438
|
-
}
|
|
9439
|
-
}, {
|
|
9440
|
-
key: "setKeyBuffer",
|
|
9441
|
-
value: function setKeyBuffer(key) {
|
|
9442
|
-
this.keyInfoNode.textContent = key;
|
|
9443
|
-
}
|
|
9444
|
-
}, {
|
|
9445
|
-
key: "setSec",
|
|
9446
|
-
value: function setSec(text, callback, options) {
|
|
9447
|
-
this.notifNode.textContent = "";
|
|
9448
|
-
|
|
9449
|
-
if (text === undefined) {
|
|
9450
|
-
return this.closeInput;
|
|
9451
|
-
}
|
|
9452
|
-
|
|
9453
|
-
this.setInnerHtml_(this.secInfoNode, text);
|
|
9454
|
-
var input = this.secInfoNode.querySelector("input");
|
|
9455
|
-
|
|
9456
|
-
if (input) {
|
|
9457
|
-
input.focus();
|
|
9458
|
-
this.input = {
|
|
9459
|
-
callback: callback,
|
|
9460
|
-
options: options,
|
|
9461
|
-
node: input
|
|
9462
|
-
};
|
|
9463
|
-
|
|
9464
|
-
if (options) {
|
|
9465
|
-
if (options.selectValueOnOpen) {
|
|
9466
|
-
input.select();
|
|
9467
|
-
}
|
|
9468
|
-
|
|
9469
|
-
if (options.value) {
|
|
9470
|
-
input.value = options.value;
|
|
9471
|
-
}
|
|
9472
|
-
}
|
|
9473
|
-
|
|
9474
|
-
this.addInputListeners();
|
|
9475
|
-
}
|
|
9476
|
-
|
|
9477
|
-
return this.closeInput;
|
|
9478
|
-
}
|
|
9479
|
-
}, {
|
|
9480
|
-
key: "setText",
|
|
9481
|
-
value: function setText(text) {
|
|
9482
|
-
this.modeInfoNode.textContent = text;
|
|
9483
|
-
}
|
|
9484
|
-
}, {
|
|
9485
|
-
key: "toggleVisibility",
|
|
9486
|
-
value: function toggleVisibility(toggle) {
|
|
9487
|
-
if (toggle) {
|
|
9488
|
-
this.node.style.display = "block";
|
|
9489
|
-
} else {
|
|
9490
|
-
this.node.style.display = "none";
|
|
9491
|
-
}
|
|
9492
|
-
|
|
9493
|
-
if (this.input) {
|
|
9494
|
-
this.removeInputListeners();
|
|
9495
|
-
}
|
|
9496
|
-
|
|
9497
|
-
clearInterval(this.notifTimeout);
|
|
9498
|
-
}
|
|
9499
|
-
}, {
|
|
9500
|
-
key: "addInputListeners",
|
|
9501
|
-
value: function addInputListeners() {
|
|
9502
|
-
var node = this.input.node;
|
|
9503
|
-
node.addEventListener("keyup", this.inputKeyUp);
|
|
9504
|
-
node.addEventListener("keydown", this.inputKeyDown);
|
|
9505
|
-
node.addEventListener("input", this.inputKeyInput);
|
|
9506
|
-
node.addEventListener("blur", this.inputBlur);
|
|
9507
|
-
}
|
|
9508
|
-
}, {
|
|
9509
|
-
key: "removeInputListeners",
|
|
9510
|
-
value: function removeInputListeners() {
|
|
9511
|
-
if (!this.input || !this.input.node) {
|
|
9512
|
-
return;
|
|
9513
|
-
}
|
|
9514
|
-
|
|
9515
|
-
var node = this.input.node;
|
|
9516
|
-
node.removeEventListener("keyup", this.inputKeyUp);
|
|
9517
|
-
node.removeEventListener("keydown", this.inputKeyDown);
|
|
9518
|
-
node.removeEventListener("input", this.inputKeyInput);
|
|
9519
|
-
node.removeEventListener("blur", this.inputBlur);
|
|
9520
|
-
}
|
|
9521
|
-
}, {
|
|
9522
|
-
key: "showNotification",
|
|
9523
|
-
value: function showNotification(text) {
|
|
9524
|
-
var _this2 = this;
|
|
9525
|
-
|
|
9526
|
-
var sp = document.createElement("span");
|
|
9527
|
-
this.setInnerHtml_(sp, text);
|
|
9528
|
-
this.notifNode.textContent = sp.textContent;
|
|
9529
|
-
this.notifTimeout = setTimeout(function () {
|
|
9530
|
-
_this2.notifNode.textContent = "";
|
|
9531
|
-
}, 5000);
|
|
9532
|
-
}
|
|
9533
|
-
}, {
|
|
9534
|
-
key: "setInnerHtml_",
|
|
9535
|
-
value: function setInnerHtml_(element, htmlContents) {
|
|
9536
|
-
// Clear out previous contents first.
|
|
9537
|
-
while (element.childNodes.length) {
|
|
9538
|
-
element.removeChild(element.childNodes[0]);
|
|
9539
|
-
}
|
|
9540
|
-
|
|
9541
|
-
if (!htmlContents) {
|
|
9542
|
-
return;
|
|
9543
|
-
}
|
|
9544
|
-
|
|
9545
|
-
if (this.sanitizer) {
|
|
9546
|
-
element.appendChild(this.sanitizer(htmlContents));
|
|
9547
|
-
} else {
|
|
9548
|
-
element.appendChild(htmlContents);
|
|
9549
|
-
}
|
|
9550
|
-
}
|
|
9551
|
-
}]);
|
|
9552
|
-
|
|
9553
|
-
return VimStatusBar;
|
|
9554
|
-
}();
|
|
9555
|
-
|
|
9556
|
-
exports["default"] = VimStatusBar;
|
|
9557
|
-
} (statusbar));
|
|
9558
|
-
|
|
9559
|
-
(function (exports) {
|
|
9560
|
-
|
|
9561
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9562
|
-
value: true
|
|
9563
|
-
});
|
|
9564
|
-
Object.defineProperty(exports, "StatusBar", {
|
|
9565
|
-
enumerable: true,
|
|
9566
|
-
get: function get() {
|
|
9567
|
-
return _statusbar["default"];
|
|
9568
|
-
}
|
|
9569
|
-
});
|
|
9570
|
-
Object.defineProperty(exports, "VimMode", {
|
|
9571
|
-
enumerable: true,
|
|
9572
|
-
get: function get() {
|
|
9573
|
-
return _keymap_vim["default"];
|
|
9574
|
-
}
|
|
9575
|
-
});
|
|
9576
|
-
exports.initVimMode = initVimMode;
|
|
9577
|
-
|
|
9578
|
-
var _keymap_vim = _interopRequireDefault(keymap_vim);
|
|
9579
|
-
|
|
9580
|
-
var _statusbar = _interopRequireDefault(statusbar);
|
|
9581
|
-
|
|
9582
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9583
|
-
|
|
9584
|
-
function initVimMode(editor) {
|
|
9585
|
-
var statusbarNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
9586
|
-
var StatusBarClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _statusbar["default"];
|
|
9587
|
-
var sanitizer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
9588
|
-
var vimAdapter = new _keymap_vim["default"](editor);
|
|
9589
|
-
|
|
9590
|
-
if (!statusbarNode) {
|
|
9591
|
-
vimAdapter.attach();
|
|
9592
|
-
return vimAdapter;
|
|
9593
|
-
}
|
|
9594
|
-
|
|
9595
|
-
var statusBar = new StatusBarClass(statusbarNode, editor, sanitizer);
|
|
9596
|
-
var keyBuffer = "";
|
|
9597
|
-
vimAdapter.on("vim-mode-change", function (mode) {
|
|
9598
|
-
statusBar.setMode(mode);
|
|
9599
|
-
});
|
|
9600
|
-
vimAdapter.on("vim-keypress", function (key) {
|
|
9601
|
-
if (key === ":") {
|
|
9602
|
-
keyBuffer = "";
|
|
9603
|
-
} else {
|
|
9604
|
-
keyBuffer += key;
|
|
9605
|
-
}
|
|
9606
|
-
|
|
9607
|
-
statusBar.setKeyBuffer(keyBuffer);
|
|
9608
|
-
});
|
|
9609
|
-
vimAdapter.on("vim-command-done", function () {
|
|
9610
|
-
keyBuffer = "";
|
|
9611
|
-
statusBar.setKeyBuffer(keyBuffer);
|
|
9612
|
-
});
|
|
9613
|
-
vimAdapter.on("dispose", function () {
|
|
9614
|
-
statusBar.toggleVisibility(false);
|
|
9615
|
-
statusBar.closeInput();
|
|
9616
|
-
statusBar.clear();
|
|
9617
|
-
});
|
|
9618
|
-
statusBar.toggleVisibility(true);
|
|
9619
|
-
vimAdapter.setStatusBar(statusBar);
|
|
9620
|
-
vimAdapter.attach();
|
|
9621
|
-
return vimAdapter;
|
|
9622
|
-
}
|
|
9623
|
-
} (lib));
|
|
9624
|
-
|
|
9625
|
-
const vimKeybindingsSchema = {
|
|
9626
|
-
type: 'object',
|
|
9627
|
-
properties: {
|
|
9628
|
-
before: {
|
|
9629
|
-
type: 'array',
|
|
9630
|
-
items: {
|
|
9631
|
-
type: 'string'
|
|
9632
|
-
}
|
|
9633
|
-
},
|
|
9634
|
-
after: {
|
|
9635
|
-
type: 'array',
|
|
9636
|
-
items: {
|
|
9637
|
-
type: 'string'
|
|
9638
|
-
}
|
|
9639
|
-
}
|
|
9640
|
-
}
|
|
9641
|
-
};
|
|
9642
|
-
configurationRegistry.registerConfiguration({
|
|
9643
|
-
id: 'vim',
|
|
9644
|
-
order: 5,
|
|
9645
|
-
type: 'object',
|
|
9646
|
-
title: 'Vim',
|
|
9647
|
-
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
|
|
9648
|
-
properties: {
|
|
9649
|
-
'vim.normalModeKeyBindings': {
|
|
9650
|
-
type: 'array',
|
|
9651
|
-
description: 'Remapped keys in Normal mode.',
|
|
9652
|
-
items: vimKeybindingsSchema
|
|
9653
|
-
},
|
|
9654
|
-
'vim.insertModeKeyBindings': {
|
|
9655
|
-
type: 'array',
|
|
9656
|
-
description: 'Remapped keys in Insert mode.',
|
|
9657
|
-
items: vimKeybindingsSchema
|
|
9658
|
-
},
|
|
9659
|
-
'vim.visualModeKeyBindings': {
|
|
9660
|
-
type: 'array',
|
|
9661
|
-
description: 'Remapped keys in Visual mode.',
|
|
9662
|
-
items: vimKeybindingsSchema
|
|
9663
|
-
}
|
|
9664
|
-
}
|
|
9665
|
-
});
|
|
9666
|
-
function mapVimKeyBindings(keybindingConfig, mode) {
|
|
9667
|
-
if (keybindingConfig != null) {
|
|
9668
|
-
for (const item of keybindingConfig) {
|
|
9669
|
-
if (item.after != null && item.before != null) {
|
|
9670
|
-
lib.VimMode.Vim.map(item.before.join(''), item.after.join(''), mode);
|
|
9671
|
-
}
|
|
9672
|
-
}
|
|
9673
|
-
}
|
|
9674
|
-
}
|
|
9675
|
-
function unmapVimKeyBindings(keybindingConfig, mode) {
|
|
9676
|
-
if (keybindingConfig != null) {
|
|
9677
|
-
for (const item of keybindingConfig) {
|
|
9678
|
-
if (item.after != null && item.before != null) {
|
|
9679
|
-
lib.VimMode.Vim.unmap(item.before.join(''), mode);
|
|
9680
|
-
}
|
|
9681
|
-
}
|
|
9682
|
-
}
|
|
9683
|
-
}
|
|
9684
|
-
let unmapPrevious = () => {};
|
|
9685
|
-
onConfigurationChanged(() => {
|
|
9686
|
-
unmapPrevious();
|
|
9687
|
-
const config = getConfiguration(undefined, 'vim');
|
|
9688
|
-
mapVimKeyBindings(config === null || config === void 0 ? void 0 : config.insertModeKeyBindings, 'insert');
|
|
9689
|
-
mapVimKeyBindings(config === null || config === void 0 ? void 0 : config.normalModeKeyBindings, 'normal');
|
|
9690
|
-
mapVimKeyBindings(config === null || config === void 0 ? void 0 : config.visualModeKeyBindings, 'visual');
|
|
9691
|
-
unmapPrevious = () => {
|
|
9692
|
-
unmapVimKeyBindings(config === null || config === void 0 ? void 0 : config.insertModeKeyBindings, 'insert');
|
|
9693
|
-
unmapVimKeyBindings(config === null || config === void 0 ? void 0 : config.normalModeKeyBindings, 'normal');
|
|
9694
|
-
unmapVimKeyBindings(config === null || config === void 0 ? void 0 : config.visualModeKeyBindings, 'visual');
|
|
9695
|
-
};
|
|
9696
|
-
});
|
|
9697
|
-
function initVimMode(editor, statusBarElement) {
|
|
9698
|
-
return lib.initVimMode(editor, statusBarElement);
|
|
9699
|
-
}
|
|
9700
|
-
|
|
9701
|
-
export { initVimMode };
|