css-variable-lsp 1.0.0 → 1.0.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/README.md +5 -9
- package/package.json +5 -2
- package/server/out/cascadeAndInline.test.js +67 -0
- package/server/out/cascadeAndInline.test.js.map +1 -0
- package/server/out/cssVariableManager.js +390 -0
- package/server/out/cssVariableManager.js.map +1 -0
- package/server/out/domTree.js +115 -0
- package/server/out/domTree.js.map +1 -0
- package/server/out/domTree.test.js +77 -0
- package/server/out/domTree.test.js.map +1 -0
- package/server/out/fileLifecycle.test.js +163 -0
- package/server/out/fileLifecycle.test.js.map +1 -0
- package/server/out/fileTypesAndUpdates.test.js +78 -0
- package/server/out/fileTypesAndUpdates.test.js.map +1 -0
- package/server/out/htmlComments.test.js +180 -0
- package/server/out/htmlComments.test.js.map +1 -0
- package/server/out/server/src/server.js +1 -0
- package/server/out/server/src/server.js.map +1 -1
- package/server/out/server.js +458 -0
- package/server/out/server.js.map +1 -0
- package/server/out/specificity.js +138 -0
- package/server/out/specificity.js.map +1 -0
- package/server/out/specificity.test.js +66 -0
- package/server/out/specificity.test.js.map +1 -0
- package/server/out/test.js +112 -0
- package/server/out/test.js.map +1 -0
- package/server/out/tsconfig.tsbuildinfo +1 -1
- package/server/src/server.ts +2 -0
- package/server/tsconfig.tsbuildinfo +1 -0
- package/client/node_modules/.package-lock.json +0 -110
- package/client/node_modules/@types/node/LICENSE +0 -21
- package/client/node_modules/@types/node/README.md +0 -15
- package/client/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/client/node_modules/@types/node/assert.d.ts +0 -1005
- package/client/node_modules/@types/node/async_hooks.d.ts +0 -586
- package/client/node_modules/@types/node/buffer.buffer.d.ts +0 -457
- package/client/node_modules/@types/node/buffer.d.ts +0 -1901
- package/client/node_modules/@types/node/child_process.d.ts +0 -1453
- package/client/node_modules/@types/node/cluster.d.ts +0 -578
- package/client/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/client/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/client/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/client/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/client/node_modules/@types/node/console.d.ts +0 -452
- package/client/node_modules/@types/node/constants.d.ts +0 -21
- package/client/node_modules/@types/node/crypto.d.ts +0 -4504
- package/client/node_modules/@types/node/dgram.d.ts +0 -596
- package/client/node_modules/@types/node/diagnostics_channel.d.ts +0 -551
- package/client/node_modules/@types/node/dns/promises.d.ts +0 -477
- package/client/node_modules/@types/node/dns.d.ts +0 -860
- package/client/node_modules/@types/node/domain.d.ts +0 -170
- package/client/node_modules/@types/node/events.d.ts +0 -863
- package/client/node_modules/@types/node/fs/promises.d.ts +0 -1208
- package/client/node_modules/@types/node/fs.d.ts +0 -4332
- package/client/node_modules/@types/node/globals.d.ts +0 -170
- package/client/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/client/node_modules/@types/node/http.d.ts +0 -1919
- package/client/node_modules/@types/node/http2.d.ts +0 -2580
- package/client/node_modules/@types/node/https.d.ts +0 -549
- package/client/node_modules/@types/node/index.d.ts +0 -92
- package/client/node_modules/@types/node/inspector.generated.d.ts +0 -2775
- package/client/node_modules/@types/node/module.d.ts +0 -503
- package/client/node_modules/@types/node/net.d.ts +0 -924
- package/client/node_modules/@types/node/os.d.ts +0 -480
- package/client/node_modules/@types/node/package.json +0 -145
- package/client/node_modules/@types/node/path.d.ts +0 -191
- package/client/node_modules/@types/node/perf_hooks.d.ts +0 -860
- package/client/node_modules/@types/node/process.d.ts +0 -1632
- package/client/node_modules/@types/node/punycode.d.ts +0 -117
- package/client/node_modules/@types/node/querystring.d.ts +0 -140
- package/client/node_modules/@types/node/readline/promises.d.ts +0 -154
- package/client/node_modules/@types/node/readline.d.ts +0 -715
- package/client/node_modules/@types/node/repl.d.ts +0 -430
- package/client/node_modules/@types/node/stream/consumers.d.ts +0 -38
- package/client/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/client/node_modules/@types/node/stream/web.d.ts +0 -527
- package/client/node_modules/@types/node/stream.d.ts +0 -1680
- package/client/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/client/node_modules/@types/node/test.d.ts +0 -1208
- package/client/node_modules/@types/node/timers/promises.d.ts +0 -108
- package/client/node_modules/@types/node/timers.d.ts +0 -286
- package/client/node_modules/@types/node/tls.d.ts +0 -1204
- package/client/node_modules/@types/node/trace_events.d.ts +0 -171
- package/client/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -455
- package/client/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/client/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/client/node_modules/@types/node/tty.d.ts +0 -206
- package/client/node_modules/@types/node/url.d.ts +0 -957
- package/client/node_modules/@types/node/util.d.ts +0 -2083
- package/client/node_modules/@types/node/v8.d.ts +0 -753
- package/client/node_modules/@types/node/vm.d.ts +0 -704
- package/client/node_modules/@types/node/wasi.d.ts +0 -160
- package/client/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
- package/client/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
- package/client/node_modules/@types/node/web-globals/events.d.ts +0 -81
- package/client/node_modules/@types/node/web-globals/fetch.d.ts +0 -38
- package/client/node_modules/@types/node/worker_threads.d.ts +0 -698
- package/client/node_modules/@types/node/zlib.d.ts +0 -517
- package/client/node_modules/@types/vscode/LICENSE +0 -21
- package/client/node_modules/@types/vscode/README.md +0 -15
- package/client/node_modules/@types/vscode/index.d.ts +0 -21145
- package/client/node_modules/@types/vscode/package.json +0 -26
- package/client/node_modules/balanced-match/.github/FUNDING.yml +0 -2
- package/client/node_modules/balanced-match/LICENSE.md +0 -21
- package/client/node_modules/balanced-match/README.md +0 -97
- package/client/node_modules/balanced-match/index.js +0 -62
- package/client/node_modules/balanced-match/package.json +0 -48
- package/client/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
- package/client/node_modules/brace-expansion/LICENSE +0 -21
- package/client/node_modules/brace-expansion/README.md +0 -135
- package/client/node_modules/brace-expansion/index.js +0 -203
- package/client/node_modules/brace-expansion/package.json +0 -49
- package/client/node_modules/minimatch/LICENSE +0 -15
- package/client/node_modules/minimatch/README.md +0 -259
- package/client/node_modules/minimatch/lib/path.js +0 -4
- package/client/node_modules/minimatch/minimatch.js +0 -944
- package/client/node_modules/minimatch/package.json +0 -35
- package/client/node_modules/semver/LICENSE +0 -15
- package/client/node_modules/semver/README.md +0 -664
- package/client/node_modules/semver/bin/semver.js +0 -191
- package/client/node_modules/semver/classes/comparator.js +0 -143
- package/client/node_modules/semver/classes/index.js +0 -7
- package/client/node_modules/semver/classes/range.js +0 -557
- package/client/node_modules/semver/classes/semver.js +0 -333
- package/client/node_modules/semver/functions/clean.js +0 -8
- package/client/node_modules/semver/functions/cmp.js +0 -54
- package/client/node_modules/semver/functions/coerce.js +0 -62
- package/client/node_modules/semver/functions/compare-build.js +0 -9
- package/client/node_modules/semver/functions/compare-loose.js +0 -5
- package/client/node_modules/semver/functions/compare.js +0 -7
- package/client/node_modules/semver/functions/diff.js +0 -60
- package/client/node_modules/semver/functions/eq.js +0 -5
- package/client/node_modules/semver/functions/gt.js +0 -5
- package/client/node_modules/semver/functions/gte.js +0 -5
- package/client/node_modules/semver/functions/inc.js +0 -21
- package/client/node_modules/semver/functions/lt.js +0 -5
- package/client/node_modules/semver/functions/lte.js +0 -5
- package/client/node_modules/semver/functions/major.js +0 -5
- package/client/node_modules/semver/functions/minor.js +0 -5
- package/client/node_modules/semver/functions/neq.js +0 -5
- package/client/node_modules/semver/functions/parse.js +0 -18
- package/client/node_modules/semver/functions/patch.js +0 -5
- package/client/node_modules/semver/functions/prerelease.js +0 -8
- package/client/node_modules/semver/functions/rcompare.js +0 -5
- package/client/node_modules/semver/functions/rsort.js +0 -5
- package/client/node_modules/semver/functions/satisfies.js +0 -12
- package/client/node_modules/semver/functions/sort.js +0 -5
- package/client/node_modules/semver/functions/valid.js +0 -8
- package/client/node_modules/semver/index.js +0 -91
- package/client/node_modules/semver/internal/constants.js +0 -37
- package/client/node_modules/semver/internal/debug.js +0 -11
- package/client/node_modules/semver/internal/identifiers.js +0 -29
- package/client/node_modules/semver/internal/lrucache.js +0 -42
- package/client/node_modules/semver/internal/parse-options.js +0 -17
- package/client/node_modules/semver/internal/re.js +0 -223
- package/client/node_modules/semver/package.json +0 -78
- package/client/node_modules/semver/preload.js +0 -4
- package/client/node_modules/semver/range.bnf +0 -16
- package/client/node_modules/semver/ranges/gtr.js +0 -6
- package/client/node_modules/semver/ranges/intersects.js +0 -9
- package/client/node_modules/semver/ranges/ltr.js +0 -6
- package/client/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/client/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/client/node_modules/semver/ranges/min-version.js +0 -63
- package/client/node_modules/semver/ranges/outside.js +0 -82
- package/client/node_modules/semver/ranges/simplify.js +0 -49
- package/client/node_modules/semver/ranges/subset.js +0 -249
- package/client/node_modules/semver/ranges/to-comparators.js +0 -10
- package/client/node_modules/semver/ranges/valid.js +0 -13
- package/client/node_modules/undici-types/README.md +0 -6
- package/client/node_modules/undici-types/agent.d.ts +0 -31
- package/client/node_modules/undici-types/api.d.ts +0 -43
- package/client/node_modules/undici-types/balanced-pool.d.ts +0 -18
- package/client/node_modules/undici-types/cache.d.ts +0 -36
- package/client/node_modules/undici-types/client.d.ts +0 -97
- package/client/node_modules/undici-types/connector.d.ts +0 -34
- package/client/node_modules/undici-types/content-type.d.ts +0 -21
- package/client/node_modules/undici-types/cookies.d.ts +0 -28
- package/client/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
- package/client/node_modules/undici-types/dispatcher.d.ts +0 -241
- package/client/node_modules/undici-types/errors.d.ts +0 -128
- package/client/node_modules/undici-types/fetch.d.ts +0 -209
- package/client/node_modules/undici-types/file.d.ts +0 -39
- package/client/node_modules/undici-types/filereader.d.ts +0 -54
- package/client/node_modules/undici-types/formdata.d.ts +0 -108
- package/client/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/client/node_modules/undici-types/global-origin.d.ts +0 -7
- package/client/node_modules/undici-types/handlers.d.ts +0 -9
- package/client/node_modules/undici-types/header.d.ts +0 -4
- package/client/node_modules/undici-types/index.d.ts +0 -63
- package/client/node_modules/undici-types/interceptors.d.ts +0 -5
- package/client/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/client/node_modules/undici-types/mock-client.d.ts +0 -25
- package/client/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/client/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/client/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/client/node_modules/undici-types/package.json +0 -55
- package/client/node_modules/undici-types/patch.d.ts +0 -71
- package/client/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/client/node_modules/undici-types/pool.d.ts +0 -28
- package/client/node_modules/undici-types/proxy-agent.d.ts +0 -30
- package/client/node_modules/undici-types/readable.d.ts +0 -61
- package/client/node_modules/undici-types/webidl.d.ts +0 -220
- package/client/node_modules/undici-types/websocket.d.ts +0 -131
- package/client/node_modules/vscode-jsonrpc/License.txt +0 -11
- package/client/node_modules/vscode-jsonrpc/README.md +0 -69
- package/client/node_modules/vscode-jsonrpc/browser.d.ts +0 -6
- package/client/node_modules/vscode-jsonrpc/browser.js +0 -7
- package/client/node_modules/vscode-jsonrpc/lib/browser/main.d.ts +0 -17
- package/client/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -76
- package/client/node_modules/vscode-jsonrpc/lib/browser/ril.d.ts +0 -12
- package/client/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -156
- package/client/node_modules/vscode-jsonrpc/lib/common/api.d.ts +0 -14
- package/client/node_modules/vscode-jsonrpc/lib/common/api.js +0 -81
- package/client/node_modules/vscode-jsonrpc/lib/common/cancellation.d.ts +0 -32
- package/client/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -96
- package/client/node_modules/vscode-jsonrpc/lib/common/connection.d.ts +0 -358
- package/client/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -1212
- package/client/node_modules/vscode-jsonrpc/lib/common/disposable.d.ts +0 -9
- package/client/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -16
- package/client/node_modules/vscode-jsonrpc/lib/common/encoding.d.ts +0 -52
- package/client/node_modules/vscode-jsonrpc/lib/common/encoding.js +0 -70
- package/client/node_modules/vscode-jsonrpc/lib/common/events.d.ts +0 -39
- package/client/node_modules/vscode-jsonrpc/lib/common/events.js +0 -128
- package/client/node_modules/vscode-jsonrpc/lib/common/is.d.ts +0 -7
- package/client/node_modules/vscode-jsonrpc/lib/common/is.js +0 -35
- package/client/node_modules/vscode-jsonrpc/lib/common/linkedMap.d.ts +0 -53
- package/client/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -398
- package/client/node_modules/vscode-jsonrpc/lib/common/messageBuffer.d.ts +0 -18
- package/client/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -152
- package/client/node_modules/vscode-jsonrpc/lib/common/messageReader.d.ts +0 -77
- package/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -197
- package/client/node_modules/vscode-jsonrpc/lib/common/messageWriter.d.ts +0 -60
- package/client/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -115
- package/client/node_modules/vscode-jsonrpc/lib/common/messages.d.ts +0 -369
- package/client/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -306
- package/client/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +0 -74
- package/client/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -23
- package/client/node_modules/vscode-jsonrpc/lib/common/semaphore.d.ts +0 -10
- package/client/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -68
- package/client/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +0 -15
- package/client/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -76
- package/client/node_modules/vscode-jsonrpc/lib/node/main.d.ts +0 -63
- package/client/node_modules/vscode-jsonrpc/lib/node/main.js +0 -257
- package/client/node_modules/vscode-jsonrpc/lib/node/ril.d.ts +0 -13
- package/client/node_modules/vscode-jsonrpc/lib/node/ril.js +0 -161
- package/client/node_modules/vscode-jsonrpc/node.cmd +0 -5
- package/client/node_modules/vscode-jsonrpc/node.d.ts +0 -6
- package/client/node_modules/vscode-jsonrpc/node.js +0 -7
- package/client/node_modules/vscode-jsonrpc/package.json +0 -45
- package/client/node_modules/vscode-jsonrpc/thirdpartynotices.txt +0 -16
- package/client/node_modules/vscode-jsonrpc/typings/thenable.d.ts +0 -5
- package/client/node_modules/vscode-languageclient/License.txt +0 -11
- package/client/node_modules/vscode-languageclient/README.md +0 -17
- package/client/node_modules/vscode-languageclient/browser.d.ts +0 -6
- package/client/node_modules/vscode-languageclient/browser.js +0 -7
- package/client/node_modules/vscode-languageclient/lib/browser/main.d.ts +0 -8
- package/client/node_modules/vscode-languageclient/lib/browser/main.js +0 -37
- package/client/node_modules/vscode-languageclient/lib/common/api.d.ts +0 -36
- package/client/node_modules/vscode-languageclient/lib/common/api.js +0 -27
- package/client/node_modules/vscode-languageclient/lib/common/callHierarchy.d.ts +0 -37
- package/client/node_modules/vscode-languageclient/lib/common/callHierarchy.js +0 -97
- package/client/node_modules/vscode-languageclient/lib/common/client.d.ts +0 -476
- package/client/node_modules/vscode-languageclient/lib/common/client.js +0 -1600
- package/client/node_modules/vscode-languageclient/lib/common/codeAction.d.ts +0 -19
- package/client/node_modules/vscode-languageclient/lib/common/codeAction.js +0 -99
- package/client/node_modules/vscode-languageclient/lib/common/codeConverter.d.ts +0 -78
- package/client/node_modules/vscode-languageclient/lib/common/codeConverter.js +0 -876
- package/client/node_modules/vscode-languageclient/lib/common/codeLens.d.ts +0 -23
- package/client/node_modules/vscode-languageclient/lib/common/codeLens.js +0 -78
- package/client/node_modules/vscode-languageclient/lib/common/colorProvider.d.ts +0 -25
- package/client/node_modules/vscode-languageclient/lib/common/colorProvider.js +0 -74
- package/client/node_modules/vscode-languageclient/lib/common/completion.d.ts +0 -20
- package/client/node_modules/vscode-languageclient/lib/common/completion.js +0 -126
- package/client/node_modules/vscode-languageclient/lib/common/configuration.d.ts +0 -69
- package/client/node_modules/vscode-languageclient/lib/common/configuration.js +0 -209
- package/client/node_modules/vscode-languageclient/lib/common/declaration.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/declaration.js +0 -54
- package/client/node_modules/vscode-languageclient/lib/common/definition.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/definition.js +0 -55
- package/client/node_modules/vscode-languageclient/lib/common/diagnostic.d.ts +0 -122
- package/client/node_modules/vscode-languageclient/lib/common/diagnostic.js +0 -814
- package/client/node_modules/vscode-languageclient/lib/common/documentHighlight.d.ts +0 -15
- package/client/node_modules/vscode-languageclient/lib/common/documentHighlight.js +0 -50
- package/client/node_modules/vscode-languageclient/lib/common/documentLink.d.ts +0 -19
- package/client/node_modules/vscode-languageclient/lib/common/documentLink.js +0 -71
- package/client/node_modules/vscode-languageclient/lib/common/documentSymbol.d.ts +0 -17
- package/client/node_modules/vscode-languageclient/lib/common/documentSymbol.js +0 -104
- package/client/node_modules/vscode-languageclient/lib/common/executeCommand.d.ts +0 -21
- package/client/node_modules/vscode-languageclient/lib/common/executeCommand.js +0 -72
- package/client/node_modules/vscode-languageclient/lib/common/features.d.ts +0 -418
- package/client/node_modules/vscode-languageclient/lib/common/features.js +0 -291
- package/client/node_modules/vscode-languageclient/lib/common/fileOperations.d.ts +0 -116
- package/client/node_modules/vscode-languageclient/lib/common/fileOperations.js +0 -333
- package/client/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.d.ts +0 -18
- package/client/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js +0 -95
- package/client/node_modules/vscode-languageclient/lib/common/foldingRange.d.ts +0 -19
- package/client/node_modules/vscode-languageclient/lib/common/foldingRange.js +0 -65
- package/client/node_modules/vscode-languageclient/lib/common/formatting.d.ts +0 -39
- package/client/node_modules/vscode-languageclient/lib/common/formatting.js +0 -182
- package/client/node_modules/vscode-languageclient/lib/common/hover.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/hover.js +0 -58
- package/client/node_modules/vscode-languageclient/lib/common/implementation.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/implementation.js +0 -54
- package/client/node_modules/vscode-languageclient/lib/common/inlayHint.d.ts +0 -20
- package/client/node_modules/vscode-languageclient/lib/common/inlayHint.js +0 -92
- package/client/node_modules/vscode-languageclient/lib/common/inlineCompletion.d.ts +0 -18
- package/client/node_modules/vscode-languageclient/lib/common/inlineCompletion.js +0 -54
- package/client/node_modules/vscode-languageclient/lib/common/inlineValue.d.ts +0 -18
- package/client/node_modules/vscode-languageclient/lib/common/inlineValue.js +0 -65
- package/client/node_modules/vscode-languageclient/lib/common/linkedEditingRange.d.ts +0 -21
- package/client/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js +0 -53
- package/client/node_modules/vscode-languageclient/lib/common/notebook.d.ts +0 -96
- package/client/node_modules/vscode-languageclient/lib/common/notebook.js +0 -851
- package/client/node_modules/vscode-languageclient/lib/common/progress.d.ts +0 -11
- package/client/node_modules/vscode-languageclient/lib/common/progress.js +0 -44
- package/client/node_modules/vscode-languageclient/lib/common/progressPart.d.ts +0 -24
- package/client/node_modules/vscode-languageclient/lib/common/progressPart.js +0 -96
- package/client/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.d.ts +0 -6
- package/client/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/protocolCodeAction.d.ts +0 -6
- package/client/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js +0 -14
- package/client/node_modules/vscode-languageclient/lib/common/protocolCodeLens.d.ts +0 -5
- package/client/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js +0 -13
- package/client/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.d.ts +0 -11
- package/client/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js +0 -13
- package/client/node_modules/vscode-languageclient/lib/common/protocolConverter.d.ts +0 -167
- package/client/node_modules/vscode-languageclient/lib/common/protocolConverter.js +0 -1134
- package/client/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.d.ts +0 -18
- package/client/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js +0 -25
- package/client/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.d.ts +0 -5
- package/client/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js +0 -13
- package/client/node_modules/vscode-languageclient/lib/common/protocolInlayHint.d.ts +0 -5
- package/client/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js +0 -13
- package/client/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.d.ts +0 -6
- package/client/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.d.ts +0 -7
- package/client/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js +0 -18
- package/client/node_modules/vscode-languageclient/lib/common/reference.d.ts +0 -20
- package/client/node_modules/vscode-languageclient/lib/common/reference.js +0 -53
- package/client/node_modules/vscode-languageclient/lib/common/rename.d.ts +0 -27
- package/client/node_modules/vscode-languageclient/lib/common/rename.js +0 -113
- package/client/node_modules/vscode-languageclient/lib/common/selectionRange.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/selectionRange.js +0 -57
- package/client/node_modules/vscode-languageclient/lib/common/semanticTokens.d.ts +0 -33
- package/client/node_modules/vscode-languageclient/lib/common/semanticTokens.js +0 -179
- package/client/node_modules/vscode-languageclient/lib/common/signatureHelp.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/signatureHelp.js +0 -71
- package/client/node_modules/vscode-languageclient/lib/common/textSynchronization.d.ts +0 -101
- package/client/node_modules/vscode-languageclient/lib/common/textSynchronization.js +0 -402
- package/client/node_modules/vscode-languageclient/lib/common/typeDefinition.d.ts +0 -16
- package/client/node_modules/vscode-languageclient/lib/common/typeDefinition.js +0 -55
- package/client/node_modules/vscode-languageclient/lib/common/typeHierarchy.d.ts +0 -31
- package/client/node_modules/vscode-languageclient/lib/common/typeHierarchy.js +0 -96
- package/client/node_modules/vscode-languageclient/lib/common/utils/async.d.ts +0 -41
- package/client/node_modules/vscode-languageclient/lib/common/utils/async.js +0 -276
- package/client/node_modules/vscode-languageclient/lib/common/utils/is.d.ts +0 -12
- package/client/node_modules/vscode-languageclient/lib/common/utils/is.js +0 -57
- package/client/node_modules/vscode-languageclient/lib/common/utils/uuid.d.ts +0 -22
- package/client/node_modules/vscode-languageclient/lib/common/utils/uuid.js +0 -97
- package/client/node_modules/vscode-languageclient/lib/common/workspaceFolder.d.ts +0 -30
- package/client/node_modules/vscode-languageclient/lib/common/workspaceFolder.js +0 -148
- package/client/node_modules/vscode-languageclient/lib/common/workspaceSymbol.d.ts +0 -19
- package/client/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js +0 -79
- package/client/node_modules/vscode-languageclient/lib/node/main.d.ts +0 -100
- package/client/node_modules/vscode-languageclient/lib/node/main.js +0 -570
- package/client/node_modules/vscode-languageclient/lib/node/processes.d.ts +0 -6
- package/client/node_modules/vscode-languageclient/lib/node/processes.js +0 -47
- package/client/node_modules/vscode-languageclient/lib/node/terminateProcess.sh +0 -16
- package/client/node_modules/vscode-languageclient/node.cmd +0 -5
- package/client/node_modules/vscode-languageclient/node.d.ts +0 -6
- package/client/node_modules/vscode-languageclient/node.js +0 -7
- package/client/node_modules/vscode-languageclient/package.json +0 -50
- package/client/node_modules/vscode-languageserver-protocol/License.txt +0 -11
- package/client/node_modules/vscode-languageserver-protocol/README.md +0 -16
- package/client/node_modules/vscode-languageserver-protocol/browser.d.ts +0 -6
- package/client/node_modules/vscode-languageserver-protocol/browser.js +0 -7
- package/client/node_modules/vscode-languageserver-protocol/lib/browser/main.d.ts +0 -4
- package/client/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -28
- package/client/node_modules/vscode-languageserver-protocol/lib/common/api.d.ts +0 -58
- package/client/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -77
- package/client/node_modules/vscode-languageserver-protocol/lib/common/connection.d.ts +0 -187
- package/client/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -15
- package/client/node_modules/vscode-languageserver-protocol/lib/common/messages.d.ts +0 -51
- package/client/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -44
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.$.d.ts +0 -1
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.$.js +0 -43
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.d.ts +0 -86
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -42
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.d.ts +0 -66
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -32
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.d.ts +0 -35
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -24
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.d.ts +0 -3252
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.d.ts +0 -37
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -22
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.d.ts +0 -341
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -74
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.d.ts +0 -306
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -101
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.d.ts +0 -109
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -30
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.d.ts +0 -38
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -21
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.d.ts +0 -110
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -43
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.d.ts +0 -57
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +0 -22
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.d.ts +0 -86
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -30
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -943
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.d.ts +0 -52
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -19
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.d.ts +0 -106
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -68
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.d.ts +0 -400
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -214
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.d.ts +0 -107
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -37
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.d.ts +0 -41
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -20
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.d.ts +0 -223
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -57
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.d.ts +0 -72
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -22
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.d.ts +0 -38
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -21
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.d.ts +0 -83
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -42
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.d.ts +0 -74
- package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -27
- package/client/node_modules/vscode-languageserver-protocol/lib/common/utils/is.d.ts +0 -9
- package/client/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -46
- package/client/node_modules/vscode-languageserver-protocol/lib/node/main.d.ts +0 -6
- package/client/node_modules/vscode-languageserver-protocol/lib/node/main.js +0 -28
- package/client/node_modules/vscode-languageserver-protocol/metaModel.schema.json +0 -783
- package/client/node_modules/vscode-languageserver-protocol/node.cmd +0 -5
- package/client/node_modules/vscode-languageserver-protocol/node.d.ts +0 -6
- package/client/node_modules/vscode-languageserver-protocol/node.js +0 -7
- package/client/node_modules/vscode-languageserver-protocol/package.json +0 -45
- package/client/node_modules/vscode-languageserver-protocol/thirdpartynotices.txt +0 -31
- package/client/node_modules/vscode-languageserver-types/License.txt +0 -11
- package/client/node_modules/vscode-languageserver-types/README.md +0 -17
- package/client/node_modules/vscode-languageserver-types/lib/esm/main.d.ts +0 -3139
- package/client/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -2222
- package/client/node_modules/vscode-languageserver-types/lib/esm/package.json +0 -3
- package/client/node_modules/vscode-languageserver-types/lib/umd/main.d.ts +0 -3139
- package/client/node_modules/vscode-languageserver-types/lib/umd/main.js +0 -2272
- package/client/node_modules/vscode-languageserver-types/package.json +0 -38
- package/client/node_modules/vscode-languageserver-types/thirdpartynotices.txt +0 -16
- package/client/package-lock.json +0 -125
- package/client/package.json +0 -42
- package/client/src/extension.ts +0 -56
- package/client/tsconfig.json +0 -12
|
@@ -1,1134 +0,0 @@
|
|
|
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 ls = 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
|
-
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
|
22
|
-
var CodeBlock;
|
|
23
|
-
(function (CodeBlock) {
|
|
24
|
-
function is(value) {
|
|
25
|
-
let candidate = value;
|
|
26
|
-
return candidate && Is.string(candidate.language) && Is.string(candidate.value);
|
|
27
|
-
}
|
|
28
|
-
CodeBlock.is = is;
|
|
29
|
-
})(CodeBlock || (CodeBlock = {}));
|
|
30
|
-
function createConverter(uriConverter, trustMarkdown, supportHtml) {
|
|
31
|
-
const nullConverter = (value) => code.Uri.parse(value);
|
|
32
|
-
const _uriConverter = uriConverter || nullConverter;
|
|
33
|
-
function asUri(value) {
|
|
34
|
-
return _uriConverter(value);
|
|
35
|
-
}
|
|
36
|
-
function asDocumentSelector(selector) {
|
|
37
|
-
const result = [];
|
|
38
|
-
for (const filter of selector) {
|
|
39
|
-
if (typeof filter === 'string') {
|
|
40
|
-
result.push(filter);
|
|
41
|
-
}
|
|
42
|
-
else if (vscode_languageserver_protocol_1.NotebookCellTextDocumentFilter.is(filter)) {
|
|
43
|
-
// We first need to check for the notebook cell filter since a TextDocumentFilter would
|
|
44
|
-
// match both (e.g. the notebook is optional).
|
|
45
|
-
if (typeof filter.notebook === 'string') {
|
|
46
|
-
result.push({ notebookType: filter.notebook, language: filter.language });
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const notebookType = filter.notebook.notebookType ?? '*';
|
|
50
|
-
result.push({ notebookType: notebookType, scheme: filter.notebook.scheme, pattern: filter.notebook.pattern, language: filter.language });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (vscode_languageserver_protocol_1.TextDocumentFilter.is(filter)) {
|
|
54
|
-
result.push({ language: filter.language, scheme: filter.scheme, pattern: filter.pattern });
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
async function asDiagnostics(diagnostics, token) {
|
|
60
|
-
return async.map(diagnostics, asDiagnostic, token);
|
|
61
|
-
}
|
|
62
|
-
function asDiagnosticsSync(diagnostics) {
|
|
63
|
-
const result = new Array(diagnostics.length);
|
|
64
|
-
for (let i = 0; i < diagnostics.length; i++) {
|
|
65
|
-
result[i] = asDiagnostic(diagnostics[i]);
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
function asDiagnostic(diagnostic) {
|
|
70
|
-
let result = new protocolDiagnostic_1.ProtocolDiagnostic(asRange(diagnostic.range), diagnostic.message, asDiagnosticSeverity(diagnostic.severity), diagnostic.data);
|
|
71
|
-
if (diagnostic.code !== undefined) {
|
|
72
|
-
if (typeof diagnostic.code === 'string' || typeof diagnostic.code === 'number') {
|
|
73
|
-
if (ls.CodeDescription.is(diagnostic.codeDescription)) {
|
|
74
|
-
result.code = {
|
|
75
|
-
value: diagnostic.code,
|
|
76
|
-
target: asUri(diagnostic.codeDescription.href)
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
result.code = diagnostic.code;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else if (protocolDiagnostic_1.DiagnosticCode.is(diagnostic.code)) {
|
|
84
|
-
// This is for backwards compatibility of a proposed API.
|
|
85
|
-
// We should remove this at some point.
|
|
86
|
-
result.hasDiagnosticCode = true;
|
|
87
|
-
const diagnosticCode = diagnostic.code;
|
|
88
|
-
result.code = {
|
|
89
|
-
value: diagnosticCode.value,
|
|
90
|
-
target: asUri(diagnosticCode.target)
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (diagnostic.source) {
|
|
95
|
-
result.source = diagnostic.source;
|
|
96
|
-
}
|
|
97
|
-
if (diagnostic.relatedInformation) {
|
|
98
|
-
result.relatedInformation = asRelatedInformation(diagnostic.relatedInformation);
|
|
99
|
-
}
|
|
100
|
-
if (Array.isArray(diagnostic.tags)) {
|
|
101
|
-
result.tags = asDiagnosticTags(diagnostic.tags);
|
|
102
|
-
}
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
function asRelatedInformation(relatedInformation) {
|
|
106
|
-
const result = new Array(relatedInformation.length);
|
|
107
|
-
for (let i = 0; i < relatedInformation.length; i++) {
|
|
108
|
-
const info = relatedInformation[i];
|
|
109
|
-
result[i] = new code.DiagnosticRelatedInformation(asLocation(info.location), info.message);
|
|
110
|
-
}
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
function asDiagnosticTags(tags) {
|
|
114
|
-
if (!tags) {
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
let result = [];
|
|
118
|
-
for (let tag of tags) {
|
|
119
|
-
let converted = asDiagnosticTag(tag);
|
|
120
|
-
if (converted !== undefined) {
|
|
121
|
-
result.push(converted);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return result.length > 0 ? result : undefined;
|
|
125
|
-
}
|
|
126
|
-
function asDiagnosticTag(tag) {
|
|
127
|
-
switch (tag) {
|
|
128
|
-
case ls.DiagnosticTag.Unnecessary:
|
|
129
|
-
return code.DiagnosticTag.Unnecessary;
|
|
130
|
-
case ls.DiagnosticTag.Deprecated:
|
|
131
|
-
return code.DiagnosticTag.Deprecated;
|
|
132
|
-
default:
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function asPosition(value) {
|
|
137
|
-
return value ? new code.Position(value.line, value.character) : undefined;
|
|
138
|
-
}
|
|
139
|
-
function asRange(value) {
|
|
140
|
-
return value ? new code.Range(value.start.line, value.start.character, value.end.line, value.end.character) : undefined;
|
|
141
|
-
}
|
|
142
|
-
async function asRanges(items, token) {
|
|
143
|
-
return async.map(items, (range) => {
|
|
144
|
-
return new code.Range(range.start.line, range.start.character, range.end.line, range.end.character);
|
|
145
|
-
}, token);
|
|
146
|
-
}
|
|
147
|
-
function asDiagnosticSeverity(value) {
|
|
148
|
-
if (value === undefined || value === null) {
|
|
149
|
-
return code.DiagnosticSeverity.Error;
|
|
150
|
-
}
|
|
151
|
-
switch (value) {
|
|
152
|
-
case ls.DiagnosticSeverity.Error:
|
|
153
|
-
return code.DiagnosticSeverity.Error;
|
|
154
|
-
case ls.DiagnosticSeverity.Warning:
|
|
155
|
-
return code.DiagnosticSeverity.Warning;
|
|
156
|
-
case ls.DiagnosticSeverity.Information:
|
|
157
|
-
return code.DiagnosticSeverity.Information;
|
|
158
|
-
case ls.DiagnosticSeverity.Hint:
|
|
159
|
-
return code.DiagnosticSeverity.Hint;
|
|
160
|
-
}
|
|
161
|
-
return code.DiagnosticSeverity.Error;
|
|
162
|
-
}
|
|
163
|
-
function asHoverContent(value) {
|
|
164
|
-
if (Is.string(value)) {
|
|
165
|
-
return asMarkdownString(value);
|
|
166
|
-
}
|
|
167
|
-
else if (CodeBlock.is(value)) {
|
|
168
|
-
let result = asMarkdownString();
|
|
169
|
-
return result.appendCodeblock(value.value, value.language);
|
|
170
|
-
}
|
|
171
|
-
else if (Array.isArray(value)) {
|
|
172
|
-
let result = [];
|
|
173
|
-
for (let element of value) {
|
|
174
|
-
let item = asMarkdownString();
|
|
175
|
-
if (CodeBlock.is(element)) {
|
|
176
|
-
item.appendCodeblock(element.value, element.language);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
item.appendMarkdown(element);
|
|
180
|
-
}
|
|
181
|
-
result.push(item);
|
|
182
|
-
}
|
|
183
|
-
return result;
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
return asMarkdownString(value);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function asDocumentation(value) {
|
|
190
|
-
if (Is.string(value)) {
|
|
191
|
-
return value;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
switch (value.kind) {
|
|
195
|
-
case ls.MarkupKind.Markdown:
|
|
196
|
-
return asMarkdownString(value.value);
|
|
197
|
-
case ls.MarkupKind.PlainText:
|
|
198
|
-
return value.value;
|
|
199
|
-
default:
|
|
200
|
-
return `Unsupported Markup content received. Kind is: ${value.kind}`;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
function asMarkdownString(value) {
|
|
205
|
-
let result;
|
|
206
|
-
if (value === undefined || typeof value === 'string') {
|
|
207
|
-
result = new code.MarkdownString(value);
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
switch (value.kind) {
|
|
211
|
-
case ls.MarkupKind.Markdown:
|
|
212
|
-
result = new code.MarkdownString(value.value);
|
|
213
|
-
break;
|
|
214
|
-
case ls.MarkupKind.PlainText:
|
|
215
|
-
result = new code.MarkdownString();
|
|
216
|
-
result.appendText(value.value);
|
|
217
|
-
break;
|
|
218
|
-
default:
|
|
219
|
-
result = new code.MarkdownString();
|
|
220
|
-
result.appendText(`Unsupported Markup content received. Kind is: ${value.kind}`);
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
result.isTrusted = trustMarkdown;
|
|
225
|
-
result.supportHtml = supportHtml;
|
|
226
|
-
return result;
|
|
227
|
-
}
|
|
228
|
-
function asHover(hover) {
|
|
229
|
-
if (!hover) {
|
|
230
|
-
return undefined;
|
|
231
|
-
}
|
|
232
|
-
return new code.Hover(asHoverContent(hover.contents), asRange(hover.range));
|
|
233
|
-
}
|
|
234
|
-
async function asCompletionResult(value, allCommitCharacters, token) {
|
|
235
|
-
if (!value) {
|
|
236
|
-
return undefined;
|
|
237
|
-
}
|
|
238
|
-
if (Array.isArray(value)) {
|
|
239
|
-
return async.map(value, (item) => asCompletionItem(item, allCommitCharacters), token);
|
|
240
|
-
}
|
|
241
|
-
const list = value;
|
|
242
|
-
const { defaultRange, commitCharacters } = getCompletionItemDefaults(list, allCommitCharacters);
|
|
243
|
-
const converted = await async.map(list.items, (item) => {
|
|
244
|
-
return asCompletionItem(item, commitCharacters, defaultRange, list.itemDefaults?.insertTextMode, list.itemDefaults?.insertTextFormat, list.itemDefaults?.data);
|
|
245
|
-
}, token);
|
|
246
|
-
return new code.CompletionList(converted, list.isIncomplete);
|
|
247
|
-
}
|
|
248
|
-
function getCompletionItemDefaults(list, allCommitCharacters) {
|
|
249
|
-
const rangeDefaults = list.itemDefaults?.editRange;
|
|
250
|
-
const commitCharacters = list.itemDefaults?.commitCharacters ?? allCommitCharacters;
|
|
251
|
-
return ls.Range.is(rangeDefaults)
|
|
252
|
-
? { defaultRange: asRange(rangeDefaults), commitCharacters }
|
|
253
|
-
: rangeDefaults !== undefined
|
|
254
|
-
? { defaultRange: { inserting: asRange(rangeDefaults.insert), replacing: asRange(rangeDefaults.replace) }, commitCharacters }
|
|
255
|
-
: { defaultRange: undefined, commitCharacters };
|
|
256
|
-
}
|
|
257
|
-
function asCompletionItemKind(value) {
|
|
258
|
-
// Protocol item kind is 1 based, codes item kind is zero based.
|
|
259
|
-
if (ls.CompletionItemKind.Text <= value && value <= ls.CompletionItemKind.TypeParameter) {
|
|
260
|
-
return [value - 1, undefined];
|
|
261
|
-
}
|
|
262
|
-
return [code.CompletionItemKind.Text, value];
|
|
263
|
-
}
|
|
264
|
-
function asCompletionItemTag(tag) {
|
|
265
|
-
switch (tag) {
|
|
266
|
-
case ls.CompletionItemTag.Deprecated:
|
|
267
|
-
return code.CompletionItemTag.Deprecated;
|
|
268
|
-
}
|
|
269
|
-
return undefined;
|
|
270
|
-
}
|
|
271
|
-
function asCompletionItemTags(tags) {
|
|
272
|
-
if (tags === undefined || tags === null) {
|
|
273
|
-
return [];
|
|
274
|
-
}
|
|
275
|
-
const result = [];
|
|
276
|
-
for (const tag of tags) {
|
|
277
|
-
const converted = asCompletionItemTag(tag);
|
|
278
|
-
if (converted !== undefined) {
|
|
279
|
-
result.push(converted);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return result;
|
|
283
|
-
}
|
|
284
|
-
function asCompletionItem(item, defaultCommitCharacters, defaultRange, defaultInsertTextMode, defaultInsertTextFormat, defaultData) {
|
|
285
|
-
const tags = asCompletionItemTags(item.tags);
|
|
286
|
-
const label = asCompletionItemLabel(item);
|
|
287
|
-
const result = new protocolCompletionItem_1.default(label);
|
|
288
|
-
if (item.detail) {
|
|
289
|
-
result.detail = item.detail;
|
|
290
|
-
}
|
|
291
|
-
if (item.documentation) {
|
|
292
|
-
result.documentation = asDocumentation(item.documentation);
|
|
293
|
-
result.documentationFormat = Is.string(item.documentation) ? '$string' : item.documentation.kind;
|
|
294
|
-
}
|
|
295
|
-
if (item.filterText) {
|
|
296
|
-
result.filterText = item.filterText;
|
|
297
|
-
}
|
|
298
|
-
const insertText = asCompletionInsertText(item, defaultRange, defaultInsertTextFormat);
|
|
299
|
-
if (insertText) {
|
|
300
|
-
result.insertText = insertText.text;
|
|
301
|
-
result.range = insertText.range;
|
|
302
|
-
result.fromEdit = insertText.fromEdit;
|
|
303
|
-
}
|
|
304
|
-
if (Is.number(item.kind)) {
|
|
305
|
-
let [itemKind, original] = asCompletionItemKind(item.kind);
|
|
306
|
-
result.kind = itemKind;
|
|
307
|
-
if (original) {
|
|
308
|
-
result.originalItemKind = original;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
if (item.sortText) {
|
|
312
|
-
result.sortText = item.sortText;
|
|
313
|
-
}
|
|
314
|
-
if (item.additionalTextEdits) {
|
|
315
|
-
result.additionalTextEdits = asTextEditsSync(item.additionalTextEdits);
|
|
316
|
-
}
|
|
317
|
-
const commitCharacters = item.commitCharacters !== undefined
|
|
318
|
-
? Is.stringArray(item.commitCharacters) ? item.commitCharacters : undefined
|
|
319
|
-
: defaultCommitCharacters;
|
|
320
|
-
if (commitCharacters) {
|
|
321
|
-
result.commitCharacters = commitCharacters.slice();
|
|
322
|
-
}
|
|
323
|
-
if (item.command) {
|
|
324
|
-
result.command = asCommand(item.command);
|
|
325
|
-
}
|
|
326
|
-
if (item.deprecated === true || item.deprecated === false) {
|
|
327
|
-
result.deprecated = item.deprecated;
|
|
328
|
-
if (item.deprecated === true) {
|
|
329
|
-
tags.push(code.CompletionItemTag.Deprecated);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
if (item.preselect === true || item.preselect === false) {
|
|
333
|
-
result.preselect = item.preselect;
|
|
334
|
-
}
|
|
335
|
-
const data = item.data ?? defaultData;
|
|
336
|
-
if (data !== undefined) {
|
|
337
|
-
result.data = data;
|
|
338
|
-
}
|
|
339
|
-
if (tags.length > 0) {
|
|
340
|
-
result.tags = tags;
|
|
341
|
-
}
|
|
342
|
-
const insertTextMode = item.insertTextMode ?? defaultInsertTextMode;
|
|
343
|
-
if (insertTextMode !== undefined) {
|
|
344
|
-
result.insertTextMode = insertTextMode;
|
|
345
|
-
if (insertTextMode === ls.InsertTextMode.asIs) {
|
|
346
|
-
result.keepWhitespace = true;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return result;
|
|
350
|
-
}
|
|
351
|
-
function asCompletionItemLabel(item) {
|
|
352
|
-
if (ls.CompletionItemLabelDetails.is(item.labelDetails)) {
|
|
353
|
-
return {
|
|
354
|
-
label: item.label,
|
|
355
|
-
detail: item.labelDetails.detail,
|
|
356
|
-
description: item.labelDetails.description
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
return item.label;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function asCompletionInsertText(item, defaultRange, defaultInsertTextFormat) {
|
|
364
|
-
const insertTextFormat = item.insertTextFormat ?? defaultInsertTextFormat;
|
|
365
|
-
if (item.textEdit !== undefined || defaultRange !== undefined) {
|
|
366
|
-
const [range, newText] = item.textEdit !== undefined
|
|
367
|
-
? getCompletionRangeAndText(item.textEdit)
|
|
368
|
-
: [defaultRange, item.textEditText ?? item.label];
|
|
369
|
-
if (insertTextFormat === ls.InsertTextFormat.Snippet) {
|
|
370
|
-
return { text: new code.SnippetString(newText), range: range, fromEdit: true };
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
return { text: newText, range: range, fromEdit: true };
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
else if (item.insertText) {
|
|
377
|
-
if (insertTextFormat === ls.InsertTextFormat.Snippet) {
|
|
378
|
-
return { text: new code.SnippetString(item.insertText), fromEdit: false };
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
return { text: item.insertText, fromEdit: false };
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
return undefined;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
function getCompletionRangeAndText(value) {
|
|
389
|
-
if (ls.InsertReplaceEdit.is(value)) {
|
|
390
|
-
return [{ inserting: asRange(value.insert), replacing: asRange(value.replace) }, value.newText];
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
return [asRange(value.range), value.newText];
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
function asTextEdit(edit) {
|
|
397
|
-
if (!edit) {
|
|
398
|
-
return undefined;
|
|
399
|
-
}
|
|
400
|
-
return new code.TextEdit(asRange(edit.range), edit.newText);
|
|
401
|
-
}
|
|
402
|
-
async function asTextEdits(items, token) {
|
|
403
|
-
if (!items) {
|
|
404
|
-
return undefined;
|
|
405
|
-
}
|
|
406
|
-
return async.map(items, asTextEdit, token);
|
|
407
|
-
}
|
|
408
|
-
function asTextEditsSync(items) {
|
|
409
|
-
if (!items) {
|
|
410
|
-
return undefined;
|
|
411
|
-
}
|
|
412
|
-
const result = new Array(items.length);
|
|
413
|
-
for (let i = 0; i < items.length; i++) {
|
|
414
|
-
result[i] = asTextEdit(items[i]);
|
|
415
|
-
}
|
|
416
|
-
return result;
|
|
417
|
-
}
|
|
418
|
-
async function asSignatureHelp(item, token) {
|
|
419
|
-
if (!item) {
|
|
420
|
-
return undefined;
|
|
421
|
-
}
|
|
422
|
-
let result = new code.SignatureHelp();
|
|
423
|
-
if (Is.number(item.activeSignature)) {
|
|
424
|
-
result.activeSignature = item.activeSignature;
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
// activeSignature was optional in the past
|
|
428
|
-
result.activeSignature = 0;
|
|
429
|
-
}
|
|
430
|
-
if (Is.number(item.activeParameter)) {
|
|
431
|
-
result.activeParameter = item.activeParameter;
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
// activeParameter was optional in the past
|
|
435
|
-
result.activeParameter = 0;
|
|
436
|
-
}
|
|
437
|
-
if (item.signatures) {
|
|
438
|
-
result.signatures = await asSignatureInformations(item.signatures, token);
|
|
439
|
-
}
|
|
440
|
-
return result;
|
|
441
|
-
}
|
|
442
|
-
async function asSignatureInformations(items, token) {
|
|
443
|
-
return async.mapAsync(items, asSignatureInformation, token);
|
|
444
|
-
}
|
|
445
|
-
async function asSignatureInformation(item, token) {
|
|
446
|
-
let result = new code.SignatureInformation(item.label);
|
|
447
|
-
if (item.documentation !== undefined) {
|
|
448
|
-
result.documentation = asDocumentation(item.documentation);
|
|
449
|
-
}
|
|
450
|
-
if (item.parameters !== undefined) {
|
|
451
|
-
result.parameters = await asParameterInformations(item.parameters, token);
|
|
452
|
-
}
|
|
453
|
-
if (item.activeParameter !== undefined) {
|
|
454
|
-
result.activeParameter = item.activeParameter;
|
|
455
|
-
}
|
|
456
|
-
{
|
|
457
|
-
return result;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
function asParameterInformations(items, token) {
|
|
461
|
-
return async.map(items, asParameterInformation, token);
|
|
462
|
-
}
|
|
463
|
-
function asParameterInformation(item) {
|
|
464
|
-
let result = new code.ParameterInformation(item.label);
|
|
465
|
-
if (item.documentation) {
|
|
466
|
-
result.documentation = asDocumentation(item.documentation);
|
|
467
|
-
}
|
|
468
|
-
return result;
|
|
469
|
-
}
|
|
470
|
-
function asLocation(item) {
|
|
471
|
-
return item ? new code.Location(_uriConverter(item.uri), asRange(item.range)) : undefined;
|
|
472
|
-
}
|
|
473
|
-
async function asDeclarationResult(item, token) {
|
|
474
|
-
if (!item) {
|
|
475
|
-
return undefined;
|
|
476
|
-
}
|
|
477
|
-
return asLocationResult(item, token);
|
|
478
|
-
}
|
|
479
|
-
async function asDefinitionResult(item, token) {
|
|
480
|
-
if (!item) {
|
|
481
|
-
return undefined;
|
|
482
|
-
}
|
|
483
|
-
return asLocationResult(item, token);
|
|
484
|
-
}
|
|
485
|
-
function asLocationLink(item) {
|
|
486
|
-
if (!item) {
|
|
487
|
-
return undefined;
|
|
488
|
-
}
|
|
489
|
-
let result = {
|
|
490
|
-
targetUri: _uriConverter(item.targetUri),
|
|
491
|
-
targetRange: asRange(item.targetRange),
|
|
492
|
-
originSelectionRange: asRange(item.originSelectionRange),
|
|
493
|
-
targetSelectionRange: asRange(item.targetSelectionRange)
|
|
494
|
-
};
|
|
495
|
-
if (!result.targetSelectionRange) {
|
|
496
|
-
throw new Error(`targetSelectionRange must not be undefined or null`);
|
|
497
|
-
}
|
|
498
|
-
return result;
|
|
499
|
-
}
|
|
500
|
-
async function asLocationResult(item, token) {
|
|
501
|
-
if (!item) {
|
|
502
|
-
return undefined;
|
|
503
|
-
}
|
|
504
|
-
if (Is.array(item)) {
|
|
505
|
-
if (item.length === 0) {
|
|
506
|
-
return [];
|
|
507
|
-
}
|
|
508
|
-
else if (ls.LocationLink.is(item[0])) {
|
|
509
|
-
const links = item;
|
|
510
|
-
return async.map(links, asLocationLink, token);
|
|
511
|
-
}
|
|
512
|
-
else {
|
|
513
|
-
const locations = item;
|
|
514
|
-
return async.map(locations, asLocation, token);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
else if (ls.LocationLink.is(item)) {
|
|
518
|
-
return [asLocationLink(item)];
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
return asLocation(item);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
async function asReferences(values, token) {
|
|
525
|
-
if (!values) {
|
|
526
|
-
return undefined;
|
|
527
|
-
}
|
|
528
|
-
return async.map(values, asLocation, token);
|
|
529
|
-
}
|
|
530
|
-
async function asDocumentHighlights(values, token) {
|
|
531
|
-
if (!values) {
|
|
532
|
-
return undefined;
|
|
533
|
-
}
|
|
534
|
-
return async.map(values, asDocumentHighlight, token);
|
|
535
|
-
}
|
|
536
|
-
function asDocumentHighlight(item) {
|
|
537
|
-
let result = new code.DocumentHighlight(asRange(item.range));
|
|
538
|
-
if (Is.number(item.kind)) {
|
|
539
|
-
result.kind = asDocumentHighlightKind(item.kind);
|
|
540
|
-
}
|
|
541
|
-
return result;
|
|
542
|
-
}
|
|
543
|
-
function asDocumentHighlightKind(item) {
|
|
544
|
-
switch (item) {
|
|
545
|
-
case ls.DocumentHighlightKind.Text:
|
|
546
|
-
return code.DocumentHighlightKind.Text;
|
|
547
|
-
case ls.DocumentHighlightKind.Read:
|
|
548
|
-
return code.DocumentHighlightKind.Read;
|
|
549
|
-
case ls.DocumentHighlightKind.Write:
|
|
550
|
-
return code.DocumentHighlightKind.Write;
|
|
551
|
-
}
|
|
552
|
-
return code.DocumentHighlightKind.Text;
|
|
553
|
-
}
|
|
554
|
-
async function asSymbolInformations(values, token) {
|
|
555
|
-
if (!values) {
|
|
556
|
-
return undefined;
|
|
557
|
-
}
|
|
558
|
-
return async.map(values, asSymbolInformation, token);
|
|
559
|
-
}
|
|
560
|
-
function asSymbolKind(item) {
|
|
561
|
-
if (item <= ls.SymbolKind.TypeParameter) {
|
|
562
|
-
// Symbol kind is one based in the protocol and zero based in code.
|
|
563
|
-
return item - 1;
|
|
564
|
-
}
|
|
565
|
-
return code.SymbolKind.Property;
|
|
566
|
-
}
|
|
567
|
-
function asSymbolTag(value) {
|
|
568
|
-
switch (value) {
|
|
569
|
-
case ls.SymbolTag.Deprecated:
|
|
570
|
-
return code.SymbolTag.Deprecated;
|
|
571
|
-
default:
|
|
572
|
-
return undefined;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function asSymbolTags(items) {
|
|
576
|
-
if (items === undefined || items === null) {
|
|
577
|
-
return undefined;
|
|
578
|
-
}
|
|
579
|
-
const result = [];
|
|
580
|
-
for (const item of items) {
|
|
581
|
-
const converted = asSymbolTag(item);
|
|
582
|
-
if (converted !== undefined) {
|
|
583
|
-
result.push(converted);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
return result.length === 0 ? undefined : result;
|
|
587
|
-
}
|
|
588
|
-
function asSymbolInformation(item) {
|
|
589
|
-
const data = item.data;
|
|
590
|
-
const location = item.location;
|
|
591
|
-
const result = location.range === undefined || data !== undefined
|
|
592
|
-
? new protocolWorkspaceSymbol_1.default(item.name, asSymbolKind(item.kind), item.containerName ?? '', location.range === undefined ? _uriConverter(location.uri) : new code.Location(_uriConverter(item.location.uri), asRange(location.range)), data)
|
|
593
|
-
: new code.SymbolInformation(item.name, asSymbolKind(item.kind), item.containerName ?? '', new code.Location(_uriConverter(item.location.uri), asRange(location.range)));
|
|
594
|
-
fillTags(result, item);
|
|
595
|
-
return result;
|
|
596
|
-
}
|
|
597
|
-
async function asDocumentSymbols(values, token) {
|
|
598
|
-
if (values === undefined || values === null) {
|
|
599
|
-
return undefined;
|
|
600
|
-
}
|
|
601
|
-
return async.map(values, asDocumentSymbol, token);
|
|
602
|
-
}
|
|
603
|
-
function asDocumentSymbol(value) {
|
|
604
|
-
let result = new code.DocumentSymbol(value.name, value.detail || '', asSymbolKind(value.kind), asRange(value.range), asRange(value.selectionRange));
|
|
605
|
-
fillTags(result, value);
|
|
606
|
-
if (value.children !== undefined && value.children.length > 0) {
|
|
607
|
-
let children = [];
|
|
608
|
-
for (let child of value.children) {
|
|
609
|
-
children.push(asDocumentSymbol(child));
|
|
610
|
-
}
|
|
611
|
-
result.children = children;
|
|
612
|
-
}
|
|
613
|
-
return result;
|
|
614
|
-
}
|
|
615
|
-
function fillTags(result, value) {
|
|
616
|
-
result.tags = asSymbolTags(value.tags);
|
|
617
|
-
if (value.deprecated) {
|
|
618
|
-
if (!result.tags) {
|
|
619
|
-
result.tags = [code.SymbolTag.Deprecated];
|
|
620
|
-
}
|
|
621
|
-
else {
|
|
622
|
-
if (!result.tags.includes(code.SymbolTag.Deprecated)) {
|
|
623
|
-
result.tags = result.tags.concat(code.SymbolTag.Deprecated);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
function asCommand(item) {
|
|
629
|
-
let result = { title: item.title, command: item.command };
|
|
630
|
-
if (item.arguments) {
|
|
631
|
-
result.arguments = item.arguments;
|
|
632
|
-
}
|
|
633
|
-
return result;
|
|
634
|
-
}
|
|
635
|
-
async function asCommands(items, token) {
|
|
636
|
-
if (!items) {
|
|
637
|
-
return undefined;
|
|
638
|
-
}
|
|
639
|
-
return async.map(items, asCommand, token);
|
|
640
|
-
}
|
|
641
|
-
const kindMapping = new Map();
|
|
642
|
-
kindMapping.set(ls.CodeActionKind.Empty, code.CodeActionKind.Empty);
|
|
643
|
-
kindMapping.set(ls.CodeActionKind.QuickFix, code.CodeActionKind.QuickFix);
|
|
644
|
-
kindMapping.set(ls.CodeActionKind.Refactor, code.CodeActionKind.Refactor);
|
|
645
|
-
kindMapping.set(ls.CodeActionKind.RefactorExtract, code.CodeActionKind.RefactorExtract);
|
|
646
|
-
kindMapping.set(ls.CodeActionKind.RefactorInline, code.CodeActionKind.RefactorInline);
|
|
647
|
-
kindMapping.set(ls.CodeActionKind.RefactorRewrite, code.CodeActionKind.RefactorRewrite);
|
|
648
|
-
kindMapping.set(ls.CodeActionKind.Source, code.CodeActionKind.Source);
|
|
649
|
-
kindMapping.set(ls.CodeActionKind.SourceOrganizeImports, code.CodeActionKind.SourceOrganizeImports);
|
|
650
|
-
function asCodeActionKind(item) {
|
|
651
|
-
if (item === undefined || item === null) {
|
|
652
|
-
return undefined;
|
|
653
|
-
}
|
|
654
|
-
let result = kindMapping.get(item);
|
|
655
|
-
if (result) {
|
|
656
|
-
return result;
|
|
657
|
-
}
|
|
658
|
-
let parts = item.split('.');
|
|
659
|
-
result = code.CodeActionKind.Empty;
|
|
660
|
-
for (let part of parts) {
|
|
661
|
-
result = result.append(part);
|
|
662
|
-
}
|
|
663
|
-
return result;
|
|
664
|
-
}
|
|
665
|
-
function asCodeActionKinds(items) {
|
|
666
|
-
if (items === undefined || items === null) {
|
|
667
|
-
return undefined;
|
|
668
|
-
}
|
|
669
|
-
return items.map(kind => asCodeActionKind(kind));
|
|
670
|
-
}
|
|
671
|
-
async function asCodeAction(item, token) {
|
|
672
|
-
if (item === undefined || item === null) {
|
|
673
|
-
return undefined;
|
|
674
|
-
}
|
|
675
|
-
let result = new protocolCodeAction_1.default(item.title, item.data);
|
|
676
|
-
if (item.kind !== undefined) {
|
|
677
|
-
result.kind = asCodeActionKind(item.kind);
|
|
678
|
-
}
|
|
679
|
-
if (item.diagnostics !== undefined) {
|
|
680
|
-
result.diagnostics = asDiagnosticsSync(item.diagnostics);
|
|
681
|
-
}
|
|
682
|
-
if (item.edit !== undefined) {
|
|
683
|
-
result.edit = await asWorkspaceEdit(item.edit, token);
|
|
684
|
-
}
|
|
685
|
-
if (item.command !== undefined) {
|
|
686
|
-
result.command = asCommand(item.command);
|
|
687
|
-
}
|
|
688
|
-
if (item.isPreferred !== undefined) {
|
|
689
|
-
result.isPreferred = item.isPreferred;
|
|
690
|
-
}
|
|
691
|
-
if (item.disabled !== undefined) {
|
|
692
|
-
result.disabled = { reason: item.disabled.reason };
|
|
693
|
-
}
|
|
694
|
-
return result;
|
|
695
|
-
}
|
|
696
|
-
function asCodeActionResult(items, token) {
|
|
697
|
-
return async.mapAsync(items, async (item) => {
|
|
698
|
-
if (ls.Command.is(item)) {
|
|
699
|
-
return asCommand(item);
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
return asCodeAction(item, token);
|
|
703
|
-
}
|
|
704
|
-
}, token);
|
|
705
|
-
}
|
|
706
|
-
function asCodeLens(item) {
|
|
707
|
-
if (!item) {
|
|
708
|
-
return undefined;
|
|
709
|
-
}
|
|
710
|
-
let result = new protocolCodeLens_1.default(asRange(item.range));
|
|
711
|
-
if (item.command) {
|
|
712
|
-
result.command = asCommand(item.command);
|
|
713
|
-
}
|
|
714
|
-
if (item.data !== undefined && item.data !== null) {
|
|
715
|
-
result.data = item.data;
|
|
716
|
-
}
|
|
717
|
-
return result;
|
|
718
|
-
}
|
|
719
|
-
async function asCodeLenses(items, token) {
|
|
720
|
-
if (!items) {
|
|
721
|
-
return undefined;
|
|
722
|
-
}
|
|
723
|
-
return async.map(items, asCodeLens, token);
|
|
724
|
-
}
|
|
725
|
-
async function asWorkspaceEdit(item, token) {
|
|
726
|
-
if (!item) {
|
|
727
|
-
return undefined;
|
|
728
|
-
}
|
|
729
|
-
const sharedMetadata = new Map();
|
|
730
|
-
if (item.changeAnnotations !== undefined) {
|
|
731
|
-
const changeAnnotations = item.changeAnnotations;
|
|
732
|
-
await async.forEach(Object.keys(changeAnnotations), (key) => {
|
|
733
|
-
const metaData = asWorkspaceEditEntryMetadata(changeAnnotations[key]);
|
|
734
|
-
sharedMetadata.set(key, metaData);
|
|
735
|
-
}, token);
|
|
736
|
-
}
|
|
737
|
-
const asMetadata = (annotation) => {
|
|
738
|
-
if (annotation === undefined) {
|
|
739
|
-
return undefined;
|
|
740
|
-
}
|
|
741
|
-
else {
|
|
742
|
-
return sharedMetadata.get(annotation);
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
const result = new code.WorkspaceEdit();
|
|
746
|
-
if (item.documentChanges) {
|
|
747
|
-
const documentChanges = item.documentChanges;
|
|
748
|
-
await async.forEach(documentChanges, (change) => {
|
|
749
|
-
if (ls.CreateFile.is(change)) {
|
|
750
|
-
result.createFile(_uriConverter(change.uri), change.options, asMetadata(change.annotationId));
|
|
751
|
-
}
|
|
752
|
-
else if (ls.RenameFile.is(change)) {
|
|
753
|
-
result.renameFile(_uriConverter(change.oldUri), _uriConverter(change.newUri), change.options, asMetadata(change.annotationId));
|
|
754
|
-
}
|
|
755
|
-
else if (ls.DeleteFile.is(change)) {
|
|
756
|
-
result.deleteFile(_uriConverter(change.uri), change.options, asMetadata(change.annotationId));
|
|
757
|
-
}
|
|
758
|
-
else if (ls.TextDocumentEdit.is(change)) {
|
|
759
|
-
const uri = _uriConverter(change.textDocument.uri);
|
|
760
|
-
for (const edit of change.edits) {
|
|
761
|
-
if (ls.AnnotatedTextEdit.is(edit)) {
|
|
762
|
-
result.replace(uri, asRange(edit.range), edit.newText, asMetadata(edit.annotationId));
|
|
763
|
-
}
|
|
764
|
-
else {
|
|
765
|
-
result.replace(uri, asRange(edit.range), edit.newText);
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
else {
|
|
770
|
-
throw new Error(`Unknown workspace edit change received:\n${JSON.stringify(change, undefined, 4)}`);
|
|
771
|
-
}
|
|
772
|
-
}, token);
|
|
773
|
-
}
|
|
774
|
-
else if (item.changes) {
|
|
775
|
-
const changes = item.changes;
|
|
776
|
-
await async.forEach(Object.keys(changes), (key) => {
|
|
777
|
-
result.set(_uriConverter(key), asTextEditsSync(changes[key]));
|
|
778
|
-
}, token);
|
|
779
|
-
}
|
|
780
|
-
return result;
|
|
781
|
-
}
|
|
782
|
-
function asWorkspaceEditEntryMetadata(annotation) {
|
|
783
|
-
if (annotation === undefined) {
|
|
784
|
-
return undefined;
|
|
785
|
-
}
|
|
786
|
-
return { label: annotation.label, needsConfirmation: !!annotation.needsConfirmation, description: annotation.description };
|
|
787
|
-
}
|
|
788
|
-
function asDocumentLink(item) {
|
|
789
|
-
let range = asRange(item.range);
|
|
790
|
-
let target = item.target ? asUri(item.target) : undefined;
|
|
791
|
-
// target must be optional in DocumentLink
|
|
792
|
-
let link = new protocolDocumentLink_1.default(range, target);
|
|
793
|
-
if (item.tooltip !== undefined) {
|
|
794
|
-
link.tooltip = item.tooltip;
|
|
795
|
-
}
|
|
796
|
-
if (item.data !== undefined && item.data !== null) {
|
|
797
|
-
link.data = item.data;
|
|
798
|
-
}
|
|
799
|
-
return link;
|
|
800
|
-
}
|
|
801
|
-
async function asDocumentLinks(items, token) {
|
|
802
|
-
if (!items) {
|
|
803
|
-
return undefined;
|
|
804
|
-
}
|
|
805
|
-
return async.map(items, asDocumentLink, token);
|
|
806
|
-
}
|
|
807
|
-
function asColor(color) {
|
|
808
|
-
return new code.Color(color.red, color.green, color.blue, color.alpha);
|
|
809
|
-
}
|
|
810
|
-
function asColorInformation(ci) {
|
|
811
|
-
return new code.ColorInformation(asRange(ci.range), asColor(ci.color));
|
|
812
|
-
}
|
|
813
|
-
async function asColorInformations(colorInformation, token) {
|
|
814
|
-
if (!colorInformation) {
|
|
815
|
-
return undefined;
|
|
816
|
-
}
|
|
817
|
-
return async.map(colorInformation, asColorInformation, token);
|
|
818
|
-
}
|
|
819
|
-
function asColorPresentation(cp) {
|
|
820
|
-
let presentation = new code.ColorPresentation(cp.label);
|
|
821
|
-
presentation.additionalTextEdits = asTextEditsSync(cp.additionalTextEdits);
|
|
822
|
-
if (cp.textEdit) {
|
|
823
|
-
presentation.textEdit = asTextEdit(cp.textEdit);
|
|
824
|
-
}
|
|
825
|
-
return presentation;
|
|
826
|
-
}
|
|
827
|
-
async function asColorPresentations(colorPresentations, token) {
|
|
828
|
-
if (!colorPresentations) {
|
|
829
|
-
return undefined;
|
|
830
|
-
}
|
|
831
|
-
return async.map(colorPresentations, asColorPresentation, token);
|
|
832
|
-
}
|
|
833
|
-
function asFoldingRangeKind(kind) {
|
|
834
|
-
if (kind) {
|
|
835
|
-
switch (kind) {
|
|
836
|
-
case ls.FoldingRangeKind.Comment:
|
|
837
|
-
return code.FoldingRangeKind.Comment;
|
|
838
|
-
case ls.FoldingRangeKind.Imports:
|
|
839
|
-
return code.FoldingRangeKind.Imports;
|
|
840
|
-
case ls.FoldingRangeKind.Region:
|
|
841
|
-
return code.FoldingRangeKind.Region;
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
return undefined;
|
|
845
|
-
}
|
|
846
|
-
function asFoldingRange(r) {
|
|
847
|
-
return new code.FoldingRange(r.startLine, r.endLine, asFoldingRangeKind(r.kind));
|
|
848
|
-
}
|
|
849
|
-
async function asFoldingRanges(foldingRanges, token) {
|
|
850
|
-
if (!foldingRanges) {
|
|
851
|
-
return undefined;
|
|
852
|
-
}
|
|
853
|
-
return async.map(foldingRanges, asFoldingRange, token);
|
|
854
|
-
}
|
|
855
|
-
function asSelectionRange(selectionRange) {
|
|
856
|
-
return new code.SelectionRange(asRange(selectionRange.range), selectionRange.parent ? asSelectionRange(selectionRange.parent) : undefined);
|
|
857
|
-
}
|
|
858
|
-
async function asSelectionRanges(selectionRanges, token) {
|
|
859
|
-
if (!Array.isArray(selectionRanges)) {
|
|
860
|
-
return [];
|
|
861
|
-
}
|
|
862
|
-
return async.map(selectionRanges, asSelectionRange, token);
|
|
863
|
-
}
|
|
864
|
-
function asInlineValue(inlineValue) {
|
|
865
|
-
if (ls.InlineValueText.is(inlineValue)) {
|
|
866
|
-
return new code.InlineValueText(asRange(inlineValue.range), inlineValue.text);
|
|
867
|
-
}
|
|
868
|
-
else if (ls.InlineValueVariableLookup.is(inlineValue)) {
|
|
869
|
-
return new code.InlineValueVariableLookup(asRange(inlineValue.range), inlineValue.variableName, inlineValue.caseSensitiveLookup);
|
|
870
|
-
}
|
|
871
|
-
else {
|
|
872
|
-
return new code.InlineValueEvaluatableExpression(asRange(inlineValue.range), inlineValue.expression);
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
async function asInlineValues(inlineValues, token) {
|
|
876
|
-
if (!Array.isArray(inlineValues)) {
|
|
877
|
-
return [];
|
|
878
|
-
}
|
|
879
|
-
return async.map(inlineValues, asInlineValue, token);
|
|
880
|
-
}
|
|
881
|
-
async function asInlayHint(value, token) {
|
|
882
|
-
const label = typeof value.label === 'string'
|
|
883
|
-
? value.label
|
|
884
|
-
: await async.map(value.label, asInlayHintLabelPart, token);
|
|
885
|
-
const result = new protocolInlayHint_1.default(asPosition(value.position), label);
|
|
886
|
-
if (value.kind !== undefined) {
|
|
887
|
-
result.kind = value.kind;
|
|
888
|
-
}
|
|
889
|
-
if (value.textEdits !== undefined) {
|
|
890
|
-
result.textEdits = await asTextEdits(value.textEdits, token);
|
|
891
|
-
}
|
|
892
|
-
if (value.tooltip !== undefined) {
|
|
893
|
-
result.tooltip = asTooltip(value.tooltip);
|
|
894
|
-
}
|
|
895
|
-
if (value.paddingLeft !== undefined) {
|
|
896
|
-
result.paddingLeft = value.paddingLeft;
|
|
897
|
-
}
|
|
898
|
-
if (value.paddingRight !== undefined) {
|
|
899
|
-
result.paddingRight = value.paddingRight;
|
|
900
|
-
}
|
|
901
|
-
if (value.data !== undefined) {
|
|
902
|
-
result.data = value.data;
|
|
903
|
-
}
|
|
904
|
-
return result;
|
|
905
|
-
}
|
|
906
|
-
function asInlayHintLabelPart(part) {
|
|
907
|
-
const result = new code.InlayHintLabelPart(part.value);
|
|
908
|
-
if (part.location !== undefined) {
|
|
909
|
-
result.location = asLocation(part.location);
|
|
910
|
-
}
|
|
911
|
-
if (part.tooltip !== undefined) {
|
|
912
|
-
result.tooltip = asTooltip(part.tooltip);
|
|
913
|
-
}
|
|
914
|
-
if (part.command !== undefined) {
|
|
915
|
-
result.command = asCommand(part.command);
|
|
916
|
-
}
|
|
917
|
-
return result;
|
|
918
|
-
}
|
|
919
|
-
function asTooltip(value) {
|
|
920
|
-
if (typeof value === 'string') {
|
|
921
|
-
return value;
|
|
922
|
-
}
|
|
923
|
-
return asMarkdownString(value);
|
|
924
|
-
}
|
|
925
|
-
async function asInlayHints(values, token) {
|
|
926
|
-
if (!Array.isArray(values)) {
|
|
927
|
-
return undefined;
|
|
928
|
-
}
|
|
929
|
-
return async.mapAsync(values, asInlayHint, token);
|
|
930
|
-
}
|
|
931
|
-
function asCallHierarchyItem(item) {
|
|
932
|
-
if (item === null) {
|
|
933
|
-
return undefined;
|
|
934
|
-
}
|
|
935
|
-
const result = new protocolCallHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);
|
|
936
|
-
if (item.tags !== undefined) {
|
|
937
|
-
result.tags = asSymbolTags(item.tags);
|
|
938
|
-
}
|
|
939
|
-
return result;
|
|
940
|
-
}
|
|
941
|
-
async function asCallHierarchyItems(items, token) {
|
|
942
|
-
if (items === null) {
|
|
943
|
-
return undefined;
|
|
944
|
-
}
|
|
945
|
-
return async.map(items, asCallHierarchyItem, token);
|
|
946
|
-
}
|
|
947
|
-
async function asCallHierarchyIncomingCall(item, token) {
|
|
948
|
-
return new code.CallHierarchyIncomingCall(asCallHierarchyItem(item.from), await asRanges(item.fromRanges, token));
|
|
949
|
-
}
|
|
950
|
-
async function asCallHierarchyIncomingCalls(items, token) {
|
|
951
|
-
if (items === null) {
|
|
952
|
-
return undefined;
|
|
953
|
-
}
|
|
954
|
-
return async.mapAsync(items, asCallHierarchyIncomingCall, token);
|
|
955
|
-
}
|
|
956
|
-
async function asCallHierarchyOutgoingCall(item, token) {
|
|
957
|
-
return new code.CallHierarchyOutgoingCall(asCallHierarchyItem(item.to), await asRanges(item.fromRanges, token));
|
|
958
|
-
}
|
|
959
|
-
async function asCallHierarchyOutgoingCalls(items, token) {
|
|
960
|
-
if (items === null) {
|
|
961
|
-
return undefined;
|
|
962
|
-
}
|
|
963
|
-
return async.mapAsync(items, asCallHierarchyOutgoingCall, token);
|
|
964
|
-
}
|
|
965
|
-
async function asSemanticTokens(value, _token) {
|
|
966
|
-
if (value === undefined || value === null) {
|
|
967
|
-
return undefined;
|
|
968
|
-
}
|
|
969
|
-
return new code.SemanticTokens(new Uint32Array(value.data), value.resultId);
|
|
970
|
-
}
|
|
971
|
-
function asSemanticTokensEdit(value) {
|
|
972
|
-
return new code.SemanticTokensEdit(value.start, value.deleteCount, value.data !== undefined ? new Uint32Array(value.data) : undefined);
|
|
973
|
-
}
|
|
974
|
-
async function asSemanticTokensEdits(value, _token) {
|
|
975
|
-
if (value === undefined || value === null) {
|
|
976
|
-
return undefined;
|
|
977
|
-
}
|
|
978
|
-
return new code.SemanticTokensEdits(value.edits.map(asSemanticTokensEdit), value.resultId);
|
|
979
|
-
}
|
|
980
|
-
function asSemanticTokensLegend(value) {
|
|
981
|
-
return value;
|
|
982
|
-
}
|
|
983
|
-
async function asLinkedEditingRanges(value, token) {
|
|
984
|
-
if (value === null || value === undefined) {
|
|
985
|
-
return undefined;
|
|
986
|
-
}
|
|
987
|
-
return new code.LinkedEditingRanges(await asRanges(value.ranges, token), asRegularExpression(value.wordPattern));
|
|
988
|
-
}
|
|
989
|
-
function asRegularExpression(value) {
|
|
990
|
-
if (value === null || value === undefined) {
|
|
991
|
-
return undefined;
|
|
992
|
-
}
|
|
993
|
-
return new RegExp(value);
|
|
994
|
-
}
|
|
995
|
-
function asTypeHierarchyItem(item) {
|
|
996
|
-
if (item === null) {
|
|
997
|
-
return undefined;
|
|
998
|
-
}
|
|
999
|
-
let result = new protocolTypeHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);
|
|
1000
|
-
if (item.tags !== undefined) {
|
|
1001
|
-
result.tags = asSymbolTags(item.tags);
|
|
1002
|
-
}
|
|
1003
|
-
return result;
|
|
1004
|
-
}
|
|
1005
|
-
async function asTypeHierarchyItems(items, token) {
|
|
1006
|
-
if (items === null) {
|
|
1007
|
-
return undefined;
|
|
1008
|
-
}
|
|
1009
|
-
return async.map(items, asTypeHierarchyItem, token);
|
|
1010
|
-
}
|
|
1011
|
-
function asGlobPattern(pattern) {
|
|
1012
|
-
if (Is.string(pattern)) {
|
|
1013
|
-
return pattern;
|
|
1014
|
-
}
|
|
1015
|
-
if (ls.RelativePattern.is(pattern)) {
|
|
1016
|
-
if (ls.URI.is(pattern.baseUri)) {
|
|
1017
|
-
return new code.RelativePattern(asUri(pattern.baseUri), pattern.pattern);
|
|
1018
|
-
}
|
|
1019
|
-
else if (ls.WorkspaceFolder.is(pattern.baseUri)) {
|
|
1020
|
-
const workspaceFolder = code.workspace.getWorkspaceFolder(asUri(pattern.baseUri.uri));
|
|
1021
|
-
return workspaceFolder !== undefined ? new code.RelativePattern(workspaceFolder, pattern.pattern) : undefined;
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
return undefined;
|
|
1025
|
-
}
|
|
1026
|
-
async function asInlineCompletionResult(value, token) {
|
|
1027
|
-
if (!value) {
|
|
1028
|
-
return undefined;
|
|
1029
|
-
}
|
|
1030
|
-
if (Array.isArray(value)) {
|
|
1031
|
-
return async.map(value, (item) => asInlineCompletionItem(item), token);
|
|
1032
|
-
}
|
|
1033
|
-
const list = value;
|
|
1034
|
-
const converted = await async.map(list.items, (item) => {
|
|
1035
|
-
return asInlineCompletionItem(item);
|
|
1036
|
-
}, token);
|
|
1037
|
-
return new code.InlineCompletionList(converted);
|
|
1038
|
-
}
|
|
1039
|
-
function asInlineCompletionItem(item) {
|
|
1040
|
-
let insertText;
|
|
1041
|
-
if (typeof item.insertText === 'string') {
|
|
1042
|
-
insertText = item.insertText;
|
|
1043
|
-
}
|
|
1044
|
-
else {
|
|
1045
|
-
insertText = new code.SnippetString(item.insertText.value);
|
|
1046
|
-
}
|
|
1047
|
-
let command = undefined;
|
|
1048
|
-
if (item.command) {
|
|
1049
|
-
command = asCommand(item.command);
|
|
1050
|
-
}
|
|
1051
|
-
const inlineCompletionItem = new code.InlineCompletionItem(insertText, asRange(item.range), command);
|
|
1052
|
-
if (item.filterText) {
|
|
1053
|
-
inlineCompletionItem.filterText = item.filterText;
|
|
1054
|
-
}
|
|
1055
|
-
return inlineCompletionItem;
|
|
1056
|
-
}
|
|
1057
|
-
return {
|
|
1058
|
-
asUri,
|
|
1059
|
-
asDocumentSelector,
|
|
1060
|
-
asDiagnostics,
|
|
1061
|
-
asDiagnostic,
|
|
1062
|
-
asRange,
|
|
1063
|
-
asRanges,
|
|
1064
|
-
asPosition,
|
|
1065
|
-
asDiagnosticSeverity,
|
|
1066
|
-
asDiagnosticTag,
|
|
1067
|
-
asHover,
|
|
1068
|
-
asCompletionResult,
|
|
1069
|
-
asCompletionItem,
|
|
1070
|
-
asTextEdit,
|
|
1071
|
-
asTextEdits,
|
|
1072
|
-
asSignatureHelp,
|
|
1073
|
-
asSignatureInformations,
|
|
1074
|
-
asSignatureInformation,
|
|
1075
|
-
asParameterInformations,
|
|
1076
|
-
asParameterInformation,
|
|
1077
|
-
asDeclarationResult,
|
|
1078
|
-
asDefinitionResult,
|
|
1079
|
-
asLocation,
|
|
1080
|
-
asReferences,
|
|
1081
|
-
asDocumentHighlights,
|
|
1082
|
-
asDocumentHighlight,
|
|
1083
|
-
asDocumentHighlightKind,
|
|
1084
|
-
asSymbolKind,
|
|
1085
|
-
asSymbolTag,
|
|
1086
|
-
asSymbolTags,
|
|
1087
|
-
asSymbolInformations,
|
|
1088
|
-
asSymbolInformation,
|
|
1089
|
-
asDocumentSymbols,
|
|
1090
|
-
asDocumentSymbol,
|
|
1091
|
-
asCommand,
|
|
1092
|
-
asCommands,
|
|
1093
|
-
asCodeAction,
|
|
1094
|
-
asCodeActionKind,
|
|
1095
|
-
asCodeActionKinds,
|
|
1096
|
-
asCodeActionResult,
|
|
1097
|
-
asCodeLens,
|
|
1098
|
-
asCodeLenses,
|
|
1099
|
-
asWorkspaceEdit,
|
|
1100
|
-
asDocumentLink,
|
|
1101
|
-
asDocumentLinks,
|
|
1102
|
-
asFoldingRangeKind,
|
|
1103
|
-
asFoldingRange,
|
|
1104
|
-
asFoldingRanges,
|
|
1105
|
-
asColor,
|
|
1106
|
-
asColorInformation,
|
|
1107
|
-
asColorInformations,
|
|
1108
|
-
asColorPresentation,
|
|
1109
|
-
asColorPresentations,
|
|
1110
|
-
asSelectionRange,
|
|
1111
|
-
asSelectionRanges,
|
|
1112
|
-
asInlineValue,
|
|
1113
|
-
asInlineValues,
|
|
1114
|
-
asInlayHint,
|
|
1115
|
-
asInlayHints,
|
|
1116
|
-
asSemanticTokensLegend,
|
|
1117
|
-
asSemanticTokens,
|
|
1118
|
-
asSemanticTokensEdit,
|
|
1119
|
-
asSemanticTokensEdits,
|
|
1120
|
-
asCallHierarchyItem,
|
|
1121
|
-
asCallHierarchyItems,
|
|
1122
|
-
asCallHierarchyIncomingCall,
|
|
1123
|
-
asCallHierarchyIncomingCalls,
|
|
1124
|
-
asCallHierarchyOutgoingCall,
|
|
1125
|
-
asCallHierarchyOutgoingCalls,
|
|
1126
|
-
asLinkedEditingRanges: asLinkedEditingRanges,
|
|
1127
|
-
asTypeHierarchyItem,
|
|
1128
|
-
asTypeHierarchyItems,
|
|
1129
|
-
asGlobPattern,
|
|
1130
|
-
asInlineCompletionResult,
|
|
1131
|
-
asInlineCompletionItem
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
exports.createConverter = createConverter;
|