naider 1.7.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/LICENSE +21 -0
- package/README.md +884 -0
- package/SPEC-X.nx +276 -0
- package/SPEC.naide +431 -0
- package/bin/naide.js +519 -0
- package/examples/ai-app.naide +21 -0
- package/examples/ai-app.nx +21 -0
- package/examples/async.naide +50 -0
- package/examples/async.nx +40 -0
- package/examples/crud.naide +79 -0
- package/examples/crud.nx +64 -0
- package/examples/fullapp.naide +74 -0
- package/examples/fullapp.nx +74 -0
- package/examples/hello.naide +33 -0
- package/examples/hello.nx +29 -0
- package/examples/model.naide +44 -0
- package/examples/server.naide +28 -0
- package/examples/server.nx +27 -0
- package/examples/sql-app.naide +23 -0
- package/examples/sql-app.nx +23 -0
- package/examples/todo-api.naide +34 -0
- package/examples/todo-api.nx +31 -0
- package/lsp/server.js +172 -0
- package/package.json +56 -0
- package/src/generator.js +1313 -0
- package/src/index.js +41 -0
- package/src/lexer.js +402 -0
- package/src/parser.js +1671 -0
- package/src/preprocess.js +308 -0
- package/src/runtime.js +969 -0
- package/src/tokens.js +218 -0
- package/vscode-naide/README.md +38 -0
- package/vscode-naide/extension.js +41 -0
- package/vscode-naide/language-configuration-naide.json +32 -0
- package/vscode-naide/language-configuration-nx.json +32 -0
- package/vscode-naide/naide-lang-1.1.0.vsix +0 -0
- package/vscode-naide/node_modules/.bin/semver +16 -0
- package/vscode-naide/node_modules/.bin/semver.cmd +17 -0
- package/vscode-naide/node_modules/.bin/semver.ps1 +28 -0
- package/vscode-naide/node_modules/.package-lock.json +86 -0
- package/vscode-naide/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/vscode-naide/node_modules/balanced-match/LICENSE.md +21 -0
- package/vscode-naide/node_modules/balanced-match/README.md +97 -0
- package/vscode-naide/node_modules/balanced-match/index.js +62 -0
- package/vscode-naide/node_modules/balanced-match/package.json +48 -0
- package/vscode-naide/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
- package/vscode-naide/node_modules/brace-expansion/LICENSE +21 -0
- package/vscode-naide/node_modules/brace-expansion/README.md +157 -0
- package/vscode-naide/node_modules/brace-expansion/index.js +394 -0
- package/vscode-naide/node_modules/brace-expansion/package.json +49 -0
- package/vscode-naide/node_modules/minimatch/LICENSE +15 -0
- package/vscode-naide/node_modules/minimatch/README.md +296 -0
- package/vscode-naide/node_modules/minimatch/changelog.md +35 -0
- package/vscode-naide/node_modules/minimatch/lib/path.js +4 -0
- package/vscode-naide/node_modules/minimatch/minimatch.js +996 -0
- package/vscode-naide/node_modules/minimatch/package.json +35 -0
- package/vscode-naide/node_modules/semver/LICENSE +15 -0
- package/vscode-naide/node_modules/semver/README.md +680 -0
- package/vscode-naide/node_modules/semver/bin/semver.js +195 -0
- package/vscode-naide/node_modules/semver/classes/comparator.js +143 -0
- package/vscode-naide/node_modules/semver/classes/index.js +7 -0
- package/vscode-naide/node_modules/semver/classes/range.js +577 -0
- package/vscode-naide/node_modules/semver/classes/semver.js +350 -0
- package/vscode-naide/node_modules/semver/functions/clean.js +8 -0
- package/vscode-naide/node_modules/semver/functions/cmp.js +54 -0
- package/vscode-naide/node_modules/semver/functions/coerce.js +62 -0
- package/vscode-naide/node_modules/semver/functions/compare-build.js +9 -0
- package/vscode-naide/node_modules/semver/functions/compare-loose.js +5 -0
- package/vscode-naide/node_modules/semver/functions/compare.js +7 -0
- package/vscode-naide/node_modules/semver/functions/diff.js +60 -0
- package/vscode-naide/node_modules/semver/functions/eq.js +5 -0
- package/vscode-naide/node_modules/semver/functions/gt.js +5 -0
- package/vscode-naide/node_modules/semver/functions/gte.js +5 -0
- package/vscode-naide/node_modules/semver/functions/inc.js +21 -0
- package/vscode-naide/node_modules/semver/functions/lt.js +5 -0
- package/vscode-naide/node_modules/semver/functions/lte.js +5 -0
- package/vscode-naide/node_modules/semver/functions/major.js +5 -0
- package/vscode-naide/node_modules/semver/functions/minor.js +5 -0
- package/vscode-naide/node_modules/semver/functions/neq.js +5 -0
- package/vscode-naide/node_modules/semver/functions/parse.js +18 -0
- package/vscode-naide/node_modules/semver/functions/patch.js +5 -0
- package/vscode-naide/node_modules/semver/functions/prerelease.js +8 -0
- package/vscode-naide/node_modules/semver/functions/rcompare.js +5 -0
- package/vscode-naide/node_modules/semver/functions/rsort.js +5 -0
- package/vscode-naide/node_modules/semver/functions/satisfies.js +12 -0
- package/vscode-naide/node_modules/semver/functions/sort.js +5 -0
- package/vscode-naide/node_modules/semver/functions/truncate.js +48 -0
- package/vscode-naide/node_modules/semver/functions/valid.js +8 -0
- package/vscode-naide/node_modules/semver/index.js +93 -0
- package/vscode-naide/node_modules/semver/internal/constants.js +37 -0
- package/vscode-naide/node_modules/semver/internal/debug.js +11 -0
- package/vscode-naide/node_modules/semver/internal/identifiers.js +29 -0
- package/vscode-naide/node_modules/semver/internal/lrucache.js +42 -0
- package/vscode-naide/node_modules/semver/internal/parse-options.js +17 -0
- package/vscode-naide/node_modules/semver/internal/re.js +223 -0
- package/vscode-naide/node_modules/semver/package.json +78 -0
- package/vscode-naide/node_modules/semver/preload.js +4 -0
- package/vscode-naide/node_modules/semver/range.bnf +17 -0
- package/vscode-naide/node_modules/semver/ranges/gtr.js +6 -0
- package/vscode-naide/node_modules/semver/ranges/intersects.js +9 -0
- package/vscode-naide/node_modules/semver/ranges/ltr.js +6 -0
- package/vscode-naide/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/vscode-naide/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/vscode-naide/node_modules/semver/ranges/min-version.js +63 -0
- package/vscode-naide/node_modules/semver/ranges/outside.js +82 -0
- package/vscode-naide/node_modules/semver/ranges/simplify.js +49 -0
- package/vscode-naide/node_modules/semver/ranges/subset.js +249 -0
- package/vscode-naide/node_modules/semver/ranges/to-comparators.js +10 -0
- package/vscode-naide/node_modules/semver/ranges/valid.js +13 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/License.txt +11 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/README.md +69 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/browser.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/browser.js +7 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/browser/main.js +76 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/browser/ril.d.ts +12 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/browser/ril.js +156 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/api.js +81 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/cancellation.js +96 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/connection.d.ts +358 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/connection.js +1212 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/disposable.js +16 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/encoding.js +70 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/events.js +128 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/is.js +35 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/linkedMap.d.ts +53 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +398 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +152 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messageReader.js +197 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +115 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/messages.js +306 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/ral.js +23 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/semaphore.js +68 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +76 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/node/main.d.ts +63 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/node/main.js +257 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/node/ril.d.ts +13 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/lib/node/ril.js +161 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/node.cmd +5 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/node.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/node.js +7 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/package.json +45 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/thirdpartynotices.txt +16 -0
- package/vscode-naide/node_modules/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/vscode-naide/node_modules/vscode-languageclient/License.txt +11 -0
- package/vscode-naide/node_modules/vscode-languageclient/README.md +17 -0
- package/vscode-naide/node_modules/vscode-languageclient/browser.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageclient/browser.js +7 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/browser/main.d.ts +8 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/browser/main.js +37 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/api.d.ts +36 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/api.js +27 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/callHierarchy.d.ts +37 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/callHierarchy.js +97 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/client.d.ts +476 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/client.js +1600 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/codeAction.d.ts +19 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/codeAction.js +99 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/codeConverter.d.ts +78 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/codeConverter.js +876 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/codeLens.d.ts +23 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/codeLens.js +78 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/colorProvider.d.ts +25 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/colorProvider.js +74 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/completion.d.ts +20 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/completion.js +126 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/configuration.d.ts +69 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/configuration.js +209 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/declaration.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/declaration.js +54 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/definition.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/definition.js +55 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/diagnostic.d.ts +122 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/diagnostic.js +814 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/documentHighlight.d.ts +15 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/documentHighlight.js +50 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/documentLink.d.ts +19 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/documentLink.js +71 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/documentSymbol.d.ts +17 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/documentSymbol.js +104 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/executeCommand.d.ts +21 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/executeCommand.js +72 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/features.d.ts +418 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/features.js +291 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/fileOperations.d.ts +116 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/fileOperations.js +333 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.d.ts +18 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js +95 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/foldingRange.d.ts +19 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/foldingRange.js +65 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/formatting.d.ts +39 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/formatting.js +182 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/hover.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/hover.js +58 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/implementation.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/implementation.js +54 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/inlayHint.d.ts +20 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/inlayHint.js +92 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/inlineCompletion.d.ts +18 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/inlineCompletion.js +54 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/inlineValue.d.ts +18 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/inlineValue.js +65 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/linkedEditingRange.d.ts +21 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js +53 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/notebook.d.ts +96 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/notebook.js +851 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/progress.d.ts +11 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/progress.js +44 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/progressPart.d.ts +24 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/progressPart.js +96 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCodeAction.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js +14 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCodeLens.d.ts +5 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js +13 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.d.ts +11 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js +13 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolConverter.d.ts +167 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolConverter.js +1134 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.d.ts +18 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js +25 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.d.ts +5 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js +13 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolInlayHint.d.ts +5 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js +13 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.d.ts +7 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js +18 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/reference.d.ts +20 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/reference.js +53 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/rename.d.ts +27 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/rename.js +113 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/selectionRange.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/selectionRange.js +57 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/semanticTokens.d.ts +33 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/semanticTokens.js +179 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/signatureHelp.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/signatureHelp.js +71 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/textSynchronization.d.ts +101 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/textSynchronization.js +402 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/typeDefinition.d.ts +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/typeDefinition.js +55 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/typeHierarchy.d.ts +31 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/typeHierarchy.js +96 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/utils/async.d.ts +41 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/utils/async.js +276 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/utils/is.d.ts +12 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/utils/is.js +57 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/utils/uuid.d.ts +22 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/utils/uuid.js +97 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/workspaceFolder.d.ts +30 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/workspaceFolder.js +148 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/workspaceSymbol.d.ts +19 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js +79 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/node/main.d.ts +100 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/node/main.js +570 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/node/processes.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/node/processes.js +47 -0
- package/vscode-naide/node_modules/vscode-languageclient/lib/node/terminateProcess.sh +16 -0
- package/vscode-naide/node_modules/vscode-languageclient/node.cmd +5 -0
- package/vscode-naide/node_modules/vscode-languageclient/node.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageclient/node.js +7 -0
- package/vscode-naide/node_modules/vscode-languageclient/package.json +50 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/License.txt +11 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/README.md +16 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/browser.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/browser.js +7 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/browser/main.d.ts +4 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/browser/main.js +28 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/api.d.ts +58 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/api.js +77 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/connection.d.ts +187 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/connection.js +15 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/messages.d.ts +51 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/messages.js +44 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.$.d.ts +1 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.$.js +43 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.d.ts +86 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +42 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.d.ts +66 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +32 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.d.ts +35 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +24 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.d.ts +3252 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.d.ts +37 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +22 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.d.ts +341 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +74 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.d.ts +306 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +101 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.d.ts +109 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +30 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.d.ts +38 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +21 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.d.ts +110 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +43 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.d.ts +57 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +22 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.d.ts +86 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +30 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +943 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.d.ts +52 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +19 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.d.ts +106 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +68 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.d.ts +400 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +214 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.d.ts +107 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +37 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.d.ts +41 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +20 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.d.ts +223 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +57 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.d.ts +72 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +22 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.d.ts +38 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +21 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.d.ts +83 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +42 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.d.ts +74 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +27 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/utils/is.d.ts +9 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +46 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/node/main.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/lib/node/main.js +28 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/metaModel.schema.json +783 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/node.cmd +5 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/node.d.ts +6 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/node.js +7 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/package.json +45 -0
- package/vscode-naide/node_modules/vscode-languageserver-protocol/thirdpartynotices.txt +31 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/License.txt +11 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/README.md +17 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/lib/esm/main.d.ts +3139 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/lib/esm/main.js +2222 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/lib/esm/package.json +3 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/lib/umd/main.d.ts +3139 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/lib/umd/main.js +2272 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/package.json +38 -0
- package/vscode-naide/node_modules/vscode-languageserver-types/thirdpartynotices.txt +16 -0
- package/vscode-naide/package-lock.json +96 -0
- package/vscode-naide/package.json +59 -0
- package/vscode-naide/syntaxes/naide.tmLanguage.json +194 -0
- package/vscode-naide/syntaxes/naidex.tmLanguage.json +287 -0
|
@@ -0,0 +1,876 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* --------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
* ------------------------------------------------------------------------------------------ */
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createConverter = void 0;
|
|
8
|
+
const code = require("vscode");
|
|
9
|
+
const proto = require("vscode-languageserver-protocol");
|
|
10
|
+
const Is = require("./utils/is");
|
|
11
|
+
const async = require("./utils/async");
|
|
12
|
+
const protocolCompletionItem_1 = require("./protocolCompletionItem");
|
|
13
|
+
const protocolCodeLens_1 = require("./protocolCodeLens");
|
|
14
|
+
const protocolDocumentLink_1 = require("./protocolDocumentLink");
|
|
15
|
+
const protocolCodeAction_1 = require("./protocolCodeAction");
|
|
16
|
+
const protocolDiagnostic_1 = require("./protocolDiagnostic");
|
|
17
|
+
const protocolCallHierarchyItem_1 = require("./protocolCallHierarchyItem");
|
|
18
|
+
const protocolTypeHierarchyItem_1 = require("./protocolTypeHierarchyItem");
|
|
19
|
+
const protocolWorkspaceSymbol_1 = require("./protocolWorkspaceSymbol");
|
|
20
|
+
const protocolInlayHint_1 = require("./protocolInlayHint");
|
|
21
|
+
var InsertReplaceRange;
|
|
22
|
+
(function (InsertReplaceRange) {
|
|
23
|
+
function is(value) {
|
|
24
|
+
const candidate = value;
|
|
25
|
+
return candidate && !!candidate.inserting && !!candidate.replacing;
|
|
26
|
+
}
|
|
27
|
+
InsertReplaceRange.is = is;
|
|
28
|
+
})(InsertReplaceRange || (InsertReplaceRange = {}));
|
|
29
|
+
function createConverter(uriConverter) {
|
|
30
|
+
const nullConverter = (value) => value.toString();
|
|
31
|
+
const _uriConverter = uriConverter || nullConverter;
|
|
32
|
+
function asUri(value) {
|
|
33
|
+
return _uriConverter(value);
|
|
34
|
+
}
|
|
35
|
+
function asTextDocumentIdentifier(textDocument) {
|
|
36
|
+
return {
|
|
37
|
+
uri: _uriConverter(textDocument.uri)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function asTextDocumentItem(textDocument) {
|
|
41
|
+
return {
|
|
42
|
+
uri: _uriConverter(textDocument.uri),
|
|
43
|
+
languageId: textDocument.languageId,
|
|
44
|
+
version: textDocument.version,
|
|
45
|
+
text: textDocument.getText()
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function asVersionedTextDocumentIdentifier(textDocument) {
|
|
49
|
+
return {
|
|
50
|
+
uri: _uriConverter(textDocument.uri),
|
|
51
|
+
version: textDocument.version
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function asOpenTextDocumentParams(textDocument) {
|
|
55
|
+
return {
|
|
56
|
+
textDocument: asTextDocumentItem(textDocument)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function isTextDocumentChangeEvent(value) {
|
|
60
|
+
const candidate = value;
|
|
61
|
+
return !!candidate.document && !!candidate.contentChanges;
|
|
62
|
+
}
|
|
63
|
+
function isTextDocument(value) {
|
|
64
|
+
const candidate = value;
|
|
65
|
+
return !!candidate.uri && !!candidate.version;
|
|
66
|
+
}
|
|
67
|
+
function asChangeTextDocumentParams(arg0, arg1, arg2) {
|
|
68
|
+
if (isTextDocument(arg0)) {
|
|
69
|
+
const result = {
|
|
70
|
+
textDocument: {
|
|
71
|
+
uri: _uriConverter(arg0.uri),
|
|
72
|
+
version: arg0.version
|
|
73
|
+
},
|
|
74
|
+
contentChanges: [{ text: arg0.getText() }]
|
|
75
|
+
};
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
else if (isTextDocumentChangeEvent(arg0)) {
|
|
79
|
+
const uri = arg1;
|
|
80
|
+
const version = arg2;
|
|
81
|
+
const result = {
|
|
82
|
+
textDocument: {
|
|
83
|
+
uri: _uriConverter(uri),
|
|
84
|
+
version: version
|
|
85
|
+
},
|
|
86
|
+
contentChanges: arg0.contentChanges.map((change) => {
|
|
87
|
+
const range = change.range;
|
|
88
|
+
return {
|
|
89
|
+
range: {
|
|
90
|
+
start: { line: range.start.line, character: range.start.character },
|
|
91
|
+
end: { line: range.end.line, character: range.end.character }
|
|
92
|
+
},
|
|
93
|
+
rangeLength: change.rangeLength,
|
|
94
|
+
text: change.text
|
|
95
|
+
};
|
|
96
|
+
})
|
|
97
|
+
};
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
throw Error('Unsupported text document change parameter');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function asCloseTextDocumentParams(textDocument) {
|
|
105
|
+
return {
|
|
106
|
+
textDocument: asTextDocumentIdentifier(textDocument)
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function asSaveTextDocumentParams(textDocument, includeContent = false) {
|
|
110
|
+
let result = {
|
|
111
|
+
textDocument: asTextDocumentIdentifier(textDocument)
|
|
112
|
+
};
|
|
113
|
+
if (includeContent) {
|
|
114
|
+
result.text = textDocument.getText();
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
function asTextDocumentSaveReason(reason) {
|
|
119
|
+
switch (reason) {
|
|
120
|
+
case code.TextDocumentSaveReason.Manual:
|
|
121
|
+
return proto.TextDocumentSaveReason.Manual;
|
|
122
|
+
case code.TextDocumentSaveReason.AfterDelay:
|
|
123
|
+
return proto.TextDocumentSaveReason.AfterDelay;
|
|
124
|
+
case code.TextDocumentSaveReason.FocusOut:
|
|
125
|
+
return proto.TextDocumentSaveReason.FocusOut;
|
|
126
|
+
}
|
|
127
|
+
return proto.TextDocumentSaveReason.Manual;
|
|
128
|
+
}
|
|
129
|
+
function asWillSaveTextDocumentParams(event) {
|
|
130
|
+
return {
|
|
131
|
+
textDocument: asTextDocumentIdentifier(event.document),
|
|
132
|
+
reason: asTextDocumentSaveReason(event.reason)
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function asDidCreateFilesParams(event) {
|
|
136
|
+
return {
|
|
137
|
+
files: event.files.map((fileUri) => ({
|
|
138
|
+
uri: _uriConverter(fileUri),
|
|
139
|
+
})),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function asDidRenameFilesParams(event) {
|
|
143
|
+
return {
|
|
144
|
+
files: event.files.map((file) => ({
|
|
145
|
+
oldUri: _uriConverter(file.oldUri),
|
|
146
|
+
newUri: _uriConverter(file.newUri),
|
|
147
|
+
})),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function asDidDeleteFilesParams(event) {
|
|
151
|
+
return {
|
|
152
|
+
files: event.files.map((fileUri) => ({
|
|
153
|
+
uri: _uriConverter(fileUri),
|
|
154
|
+
})),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function asWillCreateFilesParams(event) {
|
|
158
|
+
return {
|
|
159
|
+
files: event.files.map((fileUri) => ({
|
|
160
|
+
uri: _uriConverter(fileUri),
|
|
161
|
+
})),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function asWillRenameFilesParams(event) {
|
|
165
|
+
return {
|
|
166
|
+
files: event.files.map((file) => ({
|
|
167
|
+
oldUri: _uriConverter(file.oldUri),
|
|
168
|
+
newUri: _uriConverter(file.newUri),
|
|
169
|
+
})),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function asWillDeleteFilesParams(event) {
|
|
173
|
+
return {
|
|
174
|
+
files: event.files.map((fileUri) => ({
|
|
175
|
+
uri: _uriConverter(fileUri),
|
|
176
|
+
})),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function asTextDocumentPositionParams(textDocument, position) {
|
|
180
|
+
return {
|
|
181
|
+
textDocument: asTextDocumentIdentifier(textDocument),
|
|
182
|
+
position: asWorkerPosition(position)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function asCompletionTriggerKind(triggerKind) {
|
|
186
|
+
switch (triggerKind) {
|
|
187
|
+
case code.CompletionTriggerKind.TriggerCharacter:
|
|
188
|
+
return proto.CompletionTriggerKind.TriggerCharacter;
|
|
189
|
+
case code.CompletionTriggerKind.TriggerForIncompleteCompletions:
|
|
190
|
+
return proto.CompletionTriggerKind.TriggerForIncompleteCompletions;
|
|
191
|
+
default:
|
|
192
|
+
return proto.CompletionTriggerKind.Invoked;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function asCompletionParams(textDocument, position, context) {
|
|
196
|
+
return {
|
|
197
|
+
textDocument: asTextDocumentIdentifier(textDocument),
|
|
198
|
+
position: asWorkerPosition(position),
|
|
199
|
+
context: {
|
|
200
|
+
triggerKind: asCompletionTriggerKind(context.triggerKind),
|
|
201
|
+
triggerCharacter: context.triggerCharacter
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function asSignatureHelpTriggerKind(triggerKind) {
|
|
206
|
+
switch (triggerKind) {
|
|
207
|
+
case code.SignatureHelpTriggerKind.Invoke:
|
|
208
|
+
return proto.SignatureHelpTriggerKind.Invoked;
|
|
209
|
+
case code.SignatureHelpTriggerKind.TriggerCharacter:
|
|
210
|
+
return proto.SignatureHelpTriggerKind.TriggerCharacter;
|
|
211
|
+
case code.SignatureHelpTriggerKind.ContentChange:
|
|
212
|
+
return proto.SignatureHelpTriggerKind.ContentChange;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function asParameterInformation(value) {
|
|
216
|
+
// We leave the documentation out on purpose since it usually adds no
|
|
217
|
+
// value for the server.
|
|
218
|
+
return {
|
|
219
|
+
label: value.label
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function asParameterInformations(values) {
|
|
223
|
+
return values.map(asParameterInformation);
|
|
224
|
+
}
|
|
225
|
+
function asSignatureInformation(value) {
|
|
226
|
+
// We leave the documentation out on purpose since it usually adds no
|
|
227
|
+
// value for the server.
|
|
228
|
+
return {
|
|
229
|
+
label: value.label,
|
|
230
|
+
parameters: asParameterInformations(value.parameters)
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function asSignatureInformations(values) {
|
|
234
|
+
return values.map(asSignatureInformation);
|
|
235
|
+
}
|
|
236
|
+
function asSignatureHelp(value) {
|
|
237
|
+
if (value === undefined) {
|
|
238
|
+
return value;
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
signatures: asSignatureInformations(value.signatures),
|
|
242
|
+
activeSignature: value.activeSignature,
|
|
243
|
+
activeParameter: value.activeParameter
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function asSignatureHelpParams(textDocument, position, context) {
|
|
247
|
+
return {
|
|
248
|
+
textDocument: asTextDocumentIdentifier(textDocument),
|
|
249
|
+
position: asWorkerPosition(position),
|
|
250
|
+
context: {
|
|
251
|
+
isRetrigger: context.isRetrigger,
|
|
252
|
+
triggerCharacter: context.triggerCharacter,
|
|
253
|
+
triggerKind: asSignatureHelpTriggerKind(context.triggerKind),
|
|
254
|
+
activeSignatureHelp: asSignatureHelp(context.activeSignatureHelp)
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function asWorkerPosition(position) {
|
|
259
|
+
return { line: position.line, character: position.character };
|
|
260
|
+
}
|
|
261
|
+
function asPosition(value) {
|
|
262
|
+
if (value === undefined || value === null) {
|
|
263
|
+
return value;
|
|
264
|
+
}
|
|
265
|
+
return { line: value.line > proto.uinteger.MAX_VALUE ? proto.uinteger.MAX_VALUE : value.line, character: value.character > proto.uinteger.MAX_VALUE ? proto.uinteger.MAX_VALUE : value.character };
|
|
266
|
+
}
|
|
267
|
+
function asPositions(values, token) {
|
|
268
|
+
return async.map(values, asPosition, token);
|
|
269
|
+
}
|
|
270
|
+
function asPositionsSync(values) {
|
|
271
|
+
return values.map(asPosition);
|
|
272
|
+
}
|
|
273
|
+
function asRange(value) {
|
|
274
|
+
if (value === undefined || value === null) {
|
|
275
|
+
return value;
|
|
276
|
+
}
|
|
277
|
+
return { start: asPosition(value.start), end: asPosition(value.end) };
|
|
278
|
+
}
|
|
279
|
+
function asRanges(values) {
|
|
280
|
+
return values.map(asRange);
|
|
281
|
+
}
|
|
282
|
+
function asLocation(value) {
|
|
283
|
+
if (value === undefined || value === null) {
|
|
284
|
+
return value;
|
|
285
|
+
}
|
|
286
|
+
return proto.Location.create(asUri(value.uri), asRange(value.range));
|
|
287
|
+
}
|
|
288
|
+
function asDiagnosticSeverity(value) {
|
|
289
|
+
switch (value) {
|
|
290
|
+
case code.DiagnosticSeverity.Error:
|
|
291
|
+
return proto.DiagnosticSeverity.Error;
|
|
292
|
+
case code.DiagnosticSeverity.Warning:
|
|
293
|
+
return proto.DiagnosticSeverity.Warning;
|
|
294
|
+
case code.DiagnosticSeverity.Information:
|
|
295
|
+
return proto.DiagnosticSeverity.Information;
|
|
296
|
+
case code.DiagnosticSeverity.Hint:
|
|
297
|
+
return proto.DiagnosticSeverity.Hint;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function asDiagnosticTags(tags) {
|
|
301
|
+
if (!tags) {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
let result = [];
|
|
305
|
+
for (let tag of tags) {
|
|
306
|
+
let converted = asDiagnosticTag(tag);
|
|
307
|
+
if (converted !== undefined) {
|
|
308
|
+
result.push(converted);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return result.length > 0 ? result : undefined;
|
|
312
|
+
}
|
|
313
|
+
function asDiagnosticTag(tag) {
|
|
314
|
+
switch (tag) {
|
|
315
|
+
case code.DiagnosticTag.Unnecessary:
|
|
316
|
+
return proto.DiagnosticTag.Unnecessary;
|
|
317
|
+
case code.DiagnosticTag.Deprecated:
|
|
318
|
+
return proto.DiagnosticTag.Deprecated;
|
|
319
|
+
default:
|
|
320
|
+
return undefined;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function asRelatedInformation(item) {
|
|
324
|
+
return {
|
|
325
|
+
message: item.message,
|
|
326
|
+
location: asLocation(item.location)
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function asRelatedInformations(items) {
|
|
330
|
+
return items.map(asRelatedInformation);
|
|
331
|
+
}
|
|
332
|
+
function asDiagnosticCode(value) {
|
|
333
|
+
if (value === undefined || value === null) {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
if (Is.number(value) || Is.string(value)) {
|
|
337
|
+
return value;
|
|
338
|
+
}
|
|
339
|
+
return { value: value.value, target: asUri(value.target) };
|
|
340
|
+
}
|
|
341
|
+
function asDiagnostic(item) {
|
|
342
|
+
const result = proto.Diagnostic.create(asRange(item.range), item.message);
|
|
343
|
+
const protocolDiagnostic = item instanceof protocolDiagnostic_1.ProtocolDiagnostic ? item : undefined;
|
|
344
|
+
if (protocolDiagnostic !== undefined && protocolDiagnostic.data !== undefined) {
|
|
345
|
+
result.data = protocolDiagnostic.data;
|
|
346
|
+
}
|
|
347
|
+
const code = asDiagnosticCode(item.code);
|
|
348
|
+
if (protocolDiagnostic_1.DiagnosticCode.is(code)) {
|
|
349
|
+
if (protocolDiagnostic !== undefined && protocolDiagnostic.hasDiagnosticCode) {
|
|
350
|
+
result.code = code;
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
result.code = code.value;
|
|
354
|
+
result.codeDescription = { href: code.target };
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
result.code = code;
|
|
359
|
+
}
|
|
360
|
+
if (Is.number(item.severity)) {
|
|
361
|
+
result.severity = asDiagnosticSeverity(item.severity);
|
|
362
|
+
}
|
|
363
|
+
if (Array.isArray(item.tags)) {
|
|
364
|
+
result.tags = asDiagnosticTags(item.tags);
|
|
365
|
+
}
|
|
366
|
+
if (item.relatedInformation) {
|
|
367
|
+
result.relatedInformation = asRelatedInformations(item.relatedInformation);
|
|
368
|
+
}
|
|
369
|
+
if (item.source) {
|
|
370
|
+
result.source = item.source;
|
|
371
|
+
}
|
|
372
|
+
return result;
|
|
373
|
+
}
|
|
374
|
+
function asDiagnostics(items, token) {
|
|
375
|
+
if (items === undefined || items === null) {
|
|
376
|
+
return items;
|
|
377
|
+
}
|
|
378
|
+
return async.map(items, asDiagnostic, token);
|
|
379
|
+
}
|
|
380
|
+
function asDiagnosticsSync(items) {
|
|
381
|
+
if (items === undefined || items === null) {
|
|
382
|
+
return items;
|
|
383
|
+
}
|
|
384
|
+
return items.map(asDiagnostic);
|
|
385
|
+
}
|
|
386
|
+
function asDocumentation(format, documentation) {
|
|
387
|
+
switch (format) {
|
|
388
|
+
case '$string':
|
|
389
|
+
return documentation;
|
|
390
|
+
case proto.MarkupKind.PlainText:
|
|
391
|
+
return { kind: format, value: documentation };
|
|
392
|
+
case proto.MarkupKind.Markdown:
|
|
393
|
+
return { kind: format, value: documentation.value };
|
|
394
|
+
default:
|
|
395
|
+
return `Unsupported Markup content received. Kind is: ${format}`;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function asCompletionItemTag(tag) {
|
|
399
|
+
switch (tag) {
|
|
400
|
+
case code.CompletionItemTag.Deprecated:
|
|
401
|
+
return proto.CompletionItemTag.Deprecated;
|
|
402
|
+
}
|
|
403
|
+
return undefined;
|
|
404
|
+
}
|
|
405
|
+
function asCompletionItemTags(tags) {
|
|
406
|
+
if (tags === undefined) {
|
|
407
|
+
return tags;
|
|
408
|
+
}
|
|
409
|
+
const result = [];
|
|
410
|
+
for (let tag of tags) {
|
|
411
|
+
const converted = asCompletionItemTag(tag);
|
|
412
|
+
if (converted !== undefined) {
|
|
413
|
+
result.push(converted);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return result;
|
|
417
|
+
}
|
|
418
|
+
function asCompletionItemKind(value, original) {
|
|
419
|
+
if (original !== undefined) {
|
|
420
|
+
return original;
|
|
421
|
+
}
|
|
422
|
+
return value + 1;
|
|
423
|
+
}
|
|
424
|
+
function asCompletionItem(item, labelDetailsSupport = false) {
|
|
425
|
+
let label;
|
|
426
|
+
let labelDetails;
|
|
427
|
+
if (Is.string(item.label)) {
|
|
428
|
+
label = item.label;
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
label = item.label.label;
|
|
432
|
+
if (labelDetailsSupport && (item.label.detail !== undefined || item.label.description !== undefined)) {
|
|
433
|
+
labelDetails = { detail: item.label.detail, description: item.label.description };
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
let result = { label: label };
|
|
437
|
+
if (labelDetails !== undefined) {
|
|
438
|
+
result.labelDetails = labelDetails;
|
|
439
|
+
}
|
|
440
|
+
let protocolItem = item instanceof protocolCompletionItem_1.default ? item : undefined;
|
|
441
|
+
if (item.detail) {
|
|
442
|
+
result.detail = item.detail;
|
|
443
|
+
}
|
|
444
|
+
// We only send items back we created. So this can't be something else than
|
|
445
|
+
// a string right now.
|
|
446
|
+
if (item.documentation) {
|
|
447
|
+
if (!protocolItem || protocolItem.documentationFormat === '$string') {
|
|
448
|
+
result.documentation = item.documentation;
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
result.documentation = asDocumentation(protocolItem.documentationFormat, item.documentation);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (item.filterText) {
|
|
455
|
+
result.filterText = item.filterText;
|
|
456
|
+
}
|
|
457
|
+
fillPrimaryInsertText(result, item);
|
|
458
|
+
if (Is.number(item.kind)) {
|
|
459
|
+
result.kind = asCompletionItemKind(item.kind, protocolItem && protocolItem.originalItemKind);
|
|
460
|
+
}
|
|
461
|
+
if (item.sortText) {
|
|
462
|
+
result.sortText = item.sortText;
|
|
463
|
+
}
|
|
464
|
+
if (item.additionalTextEdits) {
|
|
465
|
+
result.additionalTextEdits = asTextEdits(item.additionalTextEdits);
|
|
466
|
+
}
|
|
467
|
+
if (item.commitCharacters) {
|
|
468
|
+
result.commitCharacters = item.commitCharacters.slice();
|
|
469
|
+
}
|
|
470
|
+
if (item.command) {
|
|
471
|
+
result.command = asCommand(item.command);
|
|
472
|
+
}
|
|
473
|
+
if (item.preselect === true || item.preselect === false) {
|
|
474
|
+
result.preselect = item.preselect;
|
|
475
|
+
}
|
|
476
|
+
const tags = asCompletionItemTags(item.tags);
|
|
477
|
+
if (protocolItem) {
|
|
478
|
+
if (protocolItem.data !== undefined) {
|
|
479
|
+
result.data = protocolItem.data;
|
|
480
|
+
}
|
|
481
|
+
if (protocolItem.deprecated === true || protocolItem.deprecated === false) {
|
|
482
|
+
if (protocolItem.deprecated === true && tags !== undefined && tags.length > 0) {
|
|
483
|
+
const index = tags.indexOf(code.CompletionItemTag.Deprecated);
|
|
484
|
+
if (index !== -1) {
|
|
485
|
+
tags.splice(index, 1);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
result.deprecated = protocolItem.deprecated;
|
|
489
|
+
}
|
|
490
|
+
if (protocolItem.insertTextMode !== undefined) {
|
|
491
|
+
result.insertTextMode = protocolItem.insertTextMode;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (tags !== undefined && tags.length > 0) {
|
|
495
|
+
result.tags = tags;
|
|
496
|
+
}
|
|
497
|
+
if (result.insertTextMode === undefined && item.keepWhitespace === true) {
|
|
498
|
+
result.insertTextMode = proto.InsertTextMode.adjustIndentation;
|
|
499
|
+
}
|
|
500
|
+
return result;
|
|
501
|
+
}
|
|
502
|
+
function fillPrimaryInsertText(target, source) {
|
|
503
|
+
let format = proto.InsertTextFormat.PlainText;
|
|
504
|
+
let text = undefined;
|
|
505
|
+
let range = undefined;
|
|
506
|
+
if (source.textEdit) {
|
|
507
|
+
text = source.textEdit.newText;
|
|
508
|
+
range = source.textEdit.range;
|
|
509
|
+
}
|
|
510
|
+
else if (source.insertText instanceof code.SnippetString) {
|
|
511
|
+
format = proto.InsertTextFormat.Snippet;
|
|
512
|
+
text = source.insertText.value;
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
text = source.insertText;
|
|
516
|
+
}
|
|
517
|
+
if (source.range) {
|
|
518
|
+
range = source.range;
|
|
519
|
+
}
|
|
520
|
+
target.insertTextFormat = format;
|
|
521
|
+
if (source.fromEdit && text !== undefined && range !== undefined) {
|
|
522
|
+
target.textEdit = asCompletionTextEdit(text, range);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
target.insertText = text;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
function asCompletionTextEdit(newText, range) {
|
|
529
|
+
if (InsertReplaceRange.is(range)) {
|
|
530
|
+
return proto.InsertReplaceEdit.create(newText, asRange(range.inserting), asRange(range.replacing));
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
return { newText, range: asRange(range) };
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function asTextEdit(edit) {
|
|
537
|
+
return { range: asRange(edit.range), newText: edit.newText };
|
|
538
|
+
}
|
|
539
|
+
function asTextEdits(edits) {
|
|
540
|
+
if (edits === undefined || edits === null) {
|
|
541
|
+
return edits;
|
|
542
|
+
}
|
|
543
|
+
return edits.map(asTextEdit);
|
|
544
|
+
}
|
|
545
|
+
function asSymbolKind(item) {
|
|
546
|
+
if (item <= code.SymbolKind.TypeParameter) {
|
|
547
|
+
// Symbol kind is one based in the protocol and zero based in code.
|
|
548
|
+
return (item + 1);
|
|
549
|
+
}
|
|
550
|
+
return proto.SymbolKind.Property;
|
|
551
|
+
}
|
|
552
|
+
function asSymbolTag(item) {
|
|
553
|
+
return item;
|
|
554
|
+
}
|
|
555
|
+
function asSymbolTags(items) {
|
|
556
|
+
return items.map(asSymbolTag);
|
|
557
|
+
}
|
|
558
|
+
function asReferenceParams(textDocument, position, options) {
|
|
559
|
+
return {
|
|
560
|
+
textDocument: asTextDocumentIdentifier(textDocument),
|
|
561
|
+
position: asWorkerPosition(position),
|
|
562
|
+
context: { includeDeclaration: options.includeDeclaration }
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
async function asCodeAction(item, token) {
|
|
566
|
+
let result = proto.CodeAction.create(item.title);
|
|
567
|
+
if (item instanceof protocolCodeAction_1.default && item.data !== undefined) {
|
|
568
|
+
result.data = item.data;
|
|
569
|
+
}
|
|
570
|
+
if (item.kind !== undefined) {
|
|
571
|
+
result.kind = asCodeActionKind(item.kind);
|
|
572
|
+
}
|
|
573
|
+
if (item.diagnostics !== undefined) {
|
|
574
|
+
result.diagnostics = await asDiagnostics(item.diagnostics, token);
|
|
575
|
+
}
|
|
576
|
+
if (item.edit !== undefined) {
|
|
577
|
+
throw new Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);
|
|
578
|
+
}
|
|
579
|
+
if (item.command !== undefined) {
|
|
580
|
+
result.command = asCommand(item.command);
|
|
581
|
+
}
|
|
582
|
+
if (item.isPreferred !== undefined) {
|
|
583
|
+
result.isPreferred = item.isPreferred;
|
|
584
|
+
}
|
|
585
|
+
if (item.disabled !== undefined) {
|
|
586
|
+
result.disabled = { reason: item.disabled.reason };
|
|
587
|
+
}
|
|
588
|
+
return result;
|
|
589
|
+
}
|
|
590
|
+
function asCodeActionSync(item) {
|
|
591
|
+
let result = proto.CodeAction.create(item.title);
|
|
592
|
+
if (item instanceof protocolCodeAction_1.default && item.data !== undefined) {
|
|
593
|
+
result.data = item.data;
|
|
594
|
+
}
|
|
595
|
+
if (item.kind !== undefined) {
|
|
596
|
+
result.kind = asCodeActionKind(item.kind);
|
|
597
|
+
}
|
|
598
|
+
if (item.diagnostics !== undefined) {
|
|
599
|
+
result.diagnostics = asDiagnosticsSync(item.diagnostics);
|
|
600
|
+
}
|
|
601
|
+
if (item.edit !== undefined) {
|
|
602
|
+
throw new Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);
|
|
603
|
+
}
|
|
604
|
+
if (item.command !== undefined) {
|
|
605
|
+
result.command = asCommand(item.command);
|
|
606
|
+
}
|
|
607
|
+
if (item.isPreferred !== undefined) {
|
|
608
|
+
result.isPreferred = item.isPreferred;
|
|
609
|
+
}
|
|
610
|
+
if (item.disabled !== undefined) {
|
|
611
|
+
result.disabled = { reason: item.disabled.reason };
|
|
612
|
+
}
|
|
613
|
+
return result;
|
|
614
|
+
}
|
|
615
|
+
async function asCodeActionContext(context, token) {
|
|
616
|
+
if (context === undefined || context === null) {
|
|
617
|
+
return context;
|
|
618
|
+
}
|
|
619
|
+
let only;
|
|
620
|
+
if (context.only && Is.string(context.only.value)) {
|
|
621
|
+
only = [context.only.value];
|
|
622
|
+
}
|
|
623
|
+
return proto.CodeActionContext.create(await asDiagnostics(context.diagnostics, token), only, asCodeActionTriggerKind(context.triggerKind));
|
|
624
|
+
}
|
|
625
|
+
function asCodeActionContextSync(context) {
|
|
626
|
+
if (context === undefined || context === null) {
|
|
627
|
+
return context;
|
|
628
|
+
}
|
|
629
|
+
let only;
|
|
630
|
+
if (context.only && Is.string(context.only.value)) {
|
|
631
|
+
only = [context.only.value];
|
|
632
|
+
}
|
|
633
|
+
return proto.CodeActionContext.create(asDiagnosticsSync(context.diagnostics), only, asCodeActionTriggerKind(context.triggerKind));
|
|
634
|
+
}
|
|
635
|
+
function asCodeActionTriggerKind(kind) {
|
|
636
|
+
switch (kind) {
|
|
637
|
+
case code.CodeActionTriggerKind.Invoke:
|
|
638
|
+
return proto.CodeActionTriggerKind.Invoked;
|
|
639
|
+
case code.CodeActionTriggerKind.Automatic:
|
|
640
|
+
return proto.CodeActionTriggerKind.Automatic;
|
|
641
|
+
default:
|
|
642
|
+
return undefined;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
function asCodeActionKind(item) {
|
|
646
|
+
if (item === undefined || item === null) {
|
|
647
|
+
return undefined;
|
|
648
|
+
}
|
|
649
|
+
return item.value;
|
|
650
|
+
}
|
|
651
|
+
function asInlineValueContext(context) {
|
|
652
|
+
if (context === undefined || context === null) {
|
|
653
|
+
return context;
|
|
654
|
+
}
|
|
655
|
+
return proto.InlineValueContext.create(context.frameId, asRange(context.stoppedLocation));
|
|
656
|
+
}
|
|
657
|
+
function asInlineCompletionParams(document, position, context) {
|
|
658
|
+
return { context: proto.InlineCompletionContext.create(context.triggerKind, context.selectedCompletionInfo),
|
|
659
|
+
textDocument: asTextDocumentIdentifier(document), position: asPosition(position) };
|
|
660
|
+
}
|
|
661
|
+
function asCommand(item) {
|
|
662
|
+
let result = proto.Command.create(item.title, item.command);
|
|
663
|
+
if (item.arguments) {
|
|
664
|
+
result.arguments = item.arguments;
|
|
665
|
+
}
|
|
666
|
+
return result;
|
|
667
|
+
}
|
|
668
|
+
function asCodeLens(item) {
|
|
669
|
+
let result = proto.CodeLens.create(asRange(item.range));
|
|
670
|
+
if (item.command) {
|
|
671
|
+
result.command = asCommand(item.command);
|
|
672
|
+
}
|
|
673
|
+
if (item instanceof protocolCodeLens_1.default) {
|
|
674
|
+
if (item.data) {
|
|
675
|
+
result.data = item.data;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
return result;
|
|
679
|
+
}
|
|
680
|
+
function asFormattingOptions(options, fileOptions) {
|
|
681
|
+
const result = { tabSize: options.tabSize, insertSpaces: options.insertSpaces };
|
|
682
|
+
if (fileOptions.trimTrailingWhitespace) {
|
|
683
|
+
result.trimTrailingWhitespace = true;
|
|
684
|
+
}
|
|
685
|
+
if (fileOptions.trimFinalNewlines) {
|
|
686
|
+
result.trimFinalNewlines = true;
|
|
687
|
+
}
|
|
688
|
+
if (fileOptions.insertFinalNewline) {
|
|
689
|
+
result.insertFinalNewline = true;
|
|
690
|
+
}
|
|
691
|
+
return result;
|
|
692
|
+
}
|
|
693
|
+
function asDocumentSymbolParams(textDocument) {
|
|
694
|
+
return {
|
|
695
|
+
textDocument: asTextDocumentIdentifier(textDocument)
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function asCodeLensParams(textDocument) {
|
|
699
|
+
return {
|
|
700
|
+
textDocument: asTextDocumentIdentifier(textDocument)
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
function asDocumentLink(item) {
|
|
704
|
+
let result = proto.DocumentLink.create(asRange(item.range));
|
|
705
|
+
if (item.target) {
|
|
706
|
+
result.target = asUri(item.target);
|
|
707
|
+
}
|
|
708
|
+
if (item.tooltip !== undefined) {
|
|
709
|
+
result.tooltip = item.tooltip;
|
|
710
|
+
}
|
|
711
|
+
let protocolItem = item instanceof protocolDocumentLink_1.default ? item : undefined;
|
|
712
|
+
if (protocolItem && protocolItem.data) {
|
|
713
|
+
result.data = protocolItem.data;
|
|
714
|
+
}
|
|
715
|
+
return result;
|
|
716
|
+
}
|
|
717
|
+
function asDocumentLinkParams(textDocument) {
|
|
718
|
+
return {
|
|
719
|
+
textDocument: asTextDocumentIdentifier(textDocument)
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
function asCallHierarchyItem(value) {
|
|
723
|
+
const result = {
|
|
724
|
+
name: value.name,
|
|
725
|
+
kind: asSymbolKind(value.kind),
|
|
726
|
+
uri: asUri(value.uri),
|
|
727
|
+
range: asRange(value.range),
|
|
728
|
+
selectionRange: asRange(value.selectionRange)
|
|
729
|
+
};
|
|
730
|
+
if (value.detail !== undefined && value.detail.length > 0) {
|
|
731
|
+
result.detail = value.detail;
|
|
732
|
+
}
|
|
733
|
+
if (value.tags !== undefined) {
|
|
734
|
+
result.tags = asSymbolTags(value.tags);
|
|
735
|
+
}
|
|
736
|
+
if (value instanceof protocolCallHierarchyItem_1.default && value.data !== undefined) {
|
|
737
|
+
result.data = value.data;
|
|
738
|
+
}
|
|
739
|
+
return result;
|
|
740
|
+
}
|
|
741
|
+
function asTypeHierarchyItem(value) {
|
|
742
|
+
const result = {
|
|
743
|
+
name: value.name,
|
|
744
|
+
kind: asSymbolKind(value.kind),
|
|
745
|
+
uri: asUri(value.uri),
|
|
746
|
+
range: asRange(value.range),
|
|
747
|
+
selectionRange: asRange(value.selectionRange),
|
|
748
|
+
};
|
|
749
|
+
if (value.detail !== undefined && value.detail.length > 0) {
|
|
750
|
+
result.detail = value.detail;
|
|
751
|
+
}
|
|
752
|
+
if (value.tags !== undefined) {
|
|
753
|
+
result.tags = asSymbolTags(value.tags);
|
|
754
|
+
}
|
|
755
|
+
if (value instanceof protocolTypeHierarchyItem_1.default && value.data !== undefined) {
|
|
756
|
+
result.data = value.data;
|
|
757
|
+
}
|
|
758
|
+
return result;
|
|
759
|
+
}
|
|
760
|
+
function asWorkspaceSymbol(item) {
|
|
761
|
+
const result = item instanceof protocolWorkspaceSymbol_1.default
|
|
762
|
+
? { name: item.name, kind: asSymbolKind(item.kind), location: item.hasRange ? asLocation(item.location) : { uri: _uriConverter(item.location.uri) }, data: item.data }
|
|
763
|
+
: { name: item.name, kind: asSymbolKind(item.kind), location: asLocation(item.location) };
|
|
764
|
+
if (item.tags !== undefined) {
|
|
765
|
+
result.tags = asSymbolTags(item.tags);
|
|
766
|
+
}
|
|
767
|
+
if (item.containerName !== '') {
|
|
768
|
+
result.containerName = item.containerName;
|
|
769
|
+
}
|
|
770
|
+
return result;
|
|
771
|
+
}
|
|
772
|
+
function asInlayHint(item) {
|
|
773
|
+
const label = typeof item.label === 'string'
|
|
774
|
+
? item.label
|
|
775
|
+
: item.label.map(asInlayHintLabelPart);
|
|
776
|
+
const result = proto.InlayHint.create(asPosition(item.position), label);
|
|
777
|
+
if (item.kind !== undefined) {
|
|
778
|
+
result.kind = item.kind;
|
|
779
|
+
}
|
|
780
|
+
if (item.textEdits !== undefined) {
|
|
781
|
+
result.textEdits = asTextEdits(item.textEdits);
|
|
782
|
+
}
|
|
783
|
+
if (item.tooltip !== undefined) {
|
|
784
|
+
result.tooltip = asTooltip(item.tooltip);
|
|
785
|
+
}
|
|
786
|
+
if (item.paddingLeft !== undefined) {
|
|
787
|
+
result.paddingLeft = item.paddingLeft;
|
|
788
|
+
}
|
|
789
|
+
if (item.paddingRight !== undefined) {
|
|
790
|
+
result.paddingRight = item.paddingRight;
|
|
791
|
+
}
|
|
792
|
+
if (item instanceof protocolInlayHint_1.default && item.data !== undefined) {
|
|
793
|
+
result.data = item.data;
|
|
794
|
+
}
|
|
795
|
+
return result;
|
|
796
|
+
}
|
|
797
|
+
function asInlayHintLabelPart(item) {
|
|
798
|
+
const result = proto.InlayHintLabelPart.create(item.value);
|
|
799
|
+
if (item.location !== undefined) {
|
|
800
|
+
result.location = asLocation(item.location);
|
|
801
|
+
}
|
|
802
|
+
if (item.command !== undefined) {
|
|
803
|
+
result.command = asCommand(item.command);
|
|
804
|
+
}
|
|
805
|
+
if (item.tooltip !== undefined) {
|
|
806
|
+
result.tooltip = asTooltip(item.tooltip);
|
|
807
|
+
}
|
|
808
|
+
return result;
|
|
809
|
+
}
|
|
810
|
+
function asTooltip(value) {
|
|
811
|
+
if (typeof value === 'string') {
|
|
812
|
+
return value;
|
|
813
|
+
}
|
|
814
|
+
const result = {
|
|
815
|
+
kind: proto.MarkupKind.Markdown,
|
|
816
|
+
value: value.value
|
|
817
|
+
};
|
|
818
|
+
return result;
|
|
819
|
+
}
|
|
820
|
+
return {
|
|
821
|
+
asUri,
|
|
822
|
+
asTextDocumentIdentifier,
|
|
823
|
+
asTextDocumentItem,
|
|
824
|
+
asVersionedTextDocumentIdentifier,
|
|
825
|
+
asOpenTextDocumentParams,
|
|
826
|
+
asChangeTextDocumentParams,
|
|
827
|
+
asCloseTextDocumentParams,
|
|
828
|
+
asSaveTextDocumentParams,
|
|
829
|
+
asWillSaveTextDocumentParams,
|
|
830
|
+
asDidCreateFilesParams,
|
|
831
|
+
asDidRenameFilesParams,
|
|
832
|
+
asDidDeleteFilesParams,
|
|
833
|
+
asWillCreateFilesParams,
|
|
834
|
+
asWillRenameFilesParams,
|
|
835
|
+
asWillDeleteFilesParams,
|
|
836
|
+
asTextDocumentPositionParams,
|
|
837
|
+
asCompletionParams,
|
|
838
|
+
asSignatureHelpParams,
|
|
839
|
+
asWorkerPosition,
|
|
840
|
+
asRange,
|
|
841
|
+
asRanges,
|
|
842
|
+
asPosition,
|
|
843
|
+
asPositions,
|
|
844
|
+
asPositionsSync,
|
|
845
|
+
asLocation,
|
|
846
|
+
asDiagnosticSeverity,
|
|
847
|
+
asDiagnosticTag,
|
|
848
|
+
asDiagnostic,
|
|
849
|
+
asDiagnostics,
|
|
850
|
+
asDiagnosticsSync,
|
|
851
|
+
asCompletionItem,
|
|
852
|
+
asTextEdit,
|
|
853
|
+
asSymbolKind,
|
|
854
|
+
asSymbolTag,
|
|
855
|
+
asSymbolTags,
|
|
856
|
+
asReferenceParams,
|
|
857
|
+
asCodeAction,
|
|
858
|
+
asCodeActionSync,
|
|
859
|
+
asCodeActionContext,
|
|
860
|
+
asCodeActionContextSync,
|
|
861
|
+
asInlineValueContext,
|
|
862
|
+
asCommand,
|
|
863
|
+
asCodeLens,
|
|
864
|
+
asFormattingOptions,
|
|
865
|
+
asDocumentSymbolParams,
|
|
866
|
+
asCodeLensParams,
|
|
867
|
+
asDocumentLink,
|
|
868
|
+
asDocumentLinkParams,
|
|
869
|
+
asCallHierarchyItem,
|
|
870
|
+
asTypeHierarchyItem,
|
|
871
|
+
asInlayHint,
|
|
872
|
+
asWorkspaceSymbol,
|
|
873
|
+
asInlineCompletionParams
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
exports.createConverter = createConverter;
|