css-variable-lsp 1.0.0 → 1.0.1
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 +2 -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.js +457 -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/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,814 +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.DiagnosticFeature = exports.DiagnosticPullMode = exports.vsdiag = void 0;
|
|
8
|
-
const minimatch = require("minimatch");
|
|
9
|
-
const vscode_1 = require("vscode");
|
|
10
|
-
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
|
11
|
-
const uuid_1 = require("./utils/uuid");
|
|
12
|
-
const features_1 = require("./features");
|
|
13
|
-
function ensure(target, key) {
|
|
14
|
-
if (target[key] === void 0) {
|
|
15
|
-
target[key] = {};
|
|
16
|
-
}
|
|
17
|
-
return target[key];
|
|
18
|
-
}
|
|
19
|
-
var vsdiag;
|
|
20
|
-
(function (vsdiag) {
|
|
21
|
-
let DocumentDiagnosticReportKind;
|
|
22
|
-
(function (DocumentDiagnosticReportKind) {
|
|
23
|
-
DocumentDiagnosticReportKind["full"] = "full";
|
|
24
|
-
DocumentDiagnosticReportKind["unChanged"] = "unChanged";
|
|
25
|
-
})(DocumentDiagnosticReportKind = vsdiag.DocumentDiagnosticReportKind || (vsdiag.DocumentDiagnosticReportKind = {}));
|
|
26
|
-
})(vsdiag || (exports.vsdiag = vsdiag = {}));
|
|
27
|
-
var DiagnosticPullMode;
|
|
28
|
-
(function (DiagnosticPullMode) {
|
|
29
|
-
DiagnosticPullMode["onType"] = "onType";
|
|
30
|
-
DiagnosticPullMode["onSave"] = "onSave";
|
|
31
|
-
})(DiagnosticPullMode || (exports.DiagnosticPullMode = DiagnosticPullMode = {}));
|
|
32
|
-
var RequestStateKind;
|
|
33
|
-
(function (RequestStateKind) {
|
|
34
|
-
RequestStateKind["active"] = "open";
|
|
35
|
-
RequestStateKind["reschedule"] = "reschedule";
|
|
36
|
-
RequestStateKind["outDated"] = "drop";
|
|
37
|
-
})(RequestStateKind || (RequestStateKind = {}));
|
|
38
|
-
/**
|
|
39
|
-
* Manages the open tabs. We don't directly use the tab API since for
|
|
40
|
-
* diagnostics we need to de-dupe tabs that show the same resources since
|
|
41
|
-
* we pull on the model not the UI.
|
|
42
|
-
*/
|
|
43
|
-
class Tabs {
|
|
44
|
-
constructor() {
|
|
45
|
-
this.open = new Set();
|
|
46
|
-
this._onOpen = new vscode_1.EventEmitter();
|
|
47
|
-
this._onClose = new vscode_1.EventEmitter();
|
|
48
|
-
Tabs.fillTabResources(this.open);
|
|
49
|
-
const openTabsHandler = (event) => {
|
|
50
|
-
if (event.closed.length === 0 && event.opened.length === 0) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const oldTabs = this.open;
|
|
54
|
-
const currentTabs = new Set();
|
|
55
|
-
Tabs.fillTabResources(currentTabs);
|
|
56
|
-
const closed = new Set();
|
|
57
|
-
const opened = new Set(currentTabs);
|
|
58
|
-
for (const tab of oldTabs.values()) {
|
|
59
|
-
if (currentTabs.has(tab)) {
|
|
60
|
-
opened.delete(tab);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
closed.add(tab);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
this.open = currentTabs;
|
|
67
|
-
if (closed.size > 0) {
|
|
68
|
-
const toFire = new Set();
|
|
69
|
-
for (const item of closed) {
|
|
70
|
-
toFire.add(vscode_1.Uri.parse(item));
|
|
71
|
-
}
|
|
72
|
-
this._onClose.fire(toFire);
|
|
73
|
-
}
|
|
74
|
-
if (opened.size > 0) {
|
|
75
|
-
const toFire = new Set();
|
|
76
|
-
for (const item of opened) {
|
|
77
|
-
toFire.add(vscode_1.Uri.parse(item));
|
|
78
|
-
}
|
|
79
|
-
this._onOpen.fire(toFire);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
if (vscode_1.window.tabGroups.onDidChangeTabs !== undefined) {
|
|
83
|
-
this.disposable = vscode_1.window.tabGroups.onDidChangeTabs(openTabsHandler);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
this.disposable = { dispose: () => { } };
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
get onClose() {
|
|
90
|
-
return this._onClose.event;
|
|
91
|
-
}
|
|
92
|
-
get onOpen() {
|
|
93
|
-
return this._onOpen.event;
|
|
94
|
-
}
|
|
95
|
-
dispose() {
|
|
96
|
-
this.disposable.dispose();
|
|
97
|
-
}
|
|
98
|
-
isActive(document) {
|
|
99
|
-
return document instanceof vscode_1.Uri
|
|
100
|
-
? vscode_1.window.activeTextEditor?.document.uri === document
|
|
101
|
-
: vscode_1.window.activeTextEditor?.document === document;
|
|
102
|
-
}
|
|
103
|
-
isVisible(document) {
|
|
104
|
-
const uri = document instanceof vscode_1.Uri ? document : document.uri;
|
|
105
|
-
return this.open.has(uri.toString());
|
|
106
|
-
}
|
|
107
|
-
getTabResources() {
|
|
108
|
-
const result = new Set();
|
|
109
|
-
Tabs.fillTabResources(new Set(), result);
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
static fillTabResources(strings, uris) {
|
|
113
|
-
const seen = strings ?? new Set();
|
|
114
|
-
for (const group of vscode_1.window.tabGroups.all) {
|
|
115
|
-
for (const tab of group.tabs) {
|
|
116
|
-
const input = tab.input;
|
|
117
|
-
let uri;
|
|
118
|
-
if (input instanceof vscode_1.TabInputText) {
|
|
119
|
-
uri = input.uri;
|
|
120
|
-
}
|
|
121
|
-
else if (input instanceof vscode_1.TabInputTextDiff) {
|
|
122
|
-
uri = input.modified;
|
|
123
|
-
}
|
|
124
|
-
else if (input instanceof vscode_1.TabInputCustom) {
|
|
125
|
-
uri = input.uri;
|
|
126
|
-
}
|
|
127
|
-
if (uri !== undefined && !seen.has(uri.toString())) {
|
|
128
|
-
seen.add(uri.toString());
|
|
129
|
-
uris !== undefined && uris.add(uri);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
var PullState;
|
|
136
|
-
(function (PullState) {
|
|
137
|
-
PullState[PullState["document"] = 1] = "document";
|
|
138
|
-
PullState[PullState["workspace"] = 2] = "workspace";
|
|
139
|
-
})(PullState || (PullState = {}));
|
|
140
|
-
var DocumentOrUri;
|
|
141
|
-
(function (DocumentOrUri) {
|
|
142
|
-
function asKey(document) {
|
|
143
|
-
return document instanceof vscode_1.Uri ? document.toString() : document.uri.toString();
|
|
144
|
-
}
|
|
145
|
-
DocumentOrUri.asKey = asKey;
|
|
146
|
-
})(DocumentOrUri || (DocumentOrUri = {}));
|
|
147
|
-
class DocumentPullStateTracker {
|
|
148
|
-
constructor() {
|
|
149
|
-
this.documentPullStates = new Map();
|
|
150
|
-
this.workspacePullStates = new Map();
|
|
151
|
-
}
|
|
152
|
-
track(kind, document, arg1) {
|
|
153
|
-
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
|
|
154
|
-
const [key, uri, version] = document instanceof vscode_1.Uri
|
|
155
|
-
? [document.toString(), document, arg1]
|
|
156
|
-
: [document.uri.toString(), document.uri, document.version];
|
|
157
|
-
let state = states.get(key);
|
|
158
|
-
if (state === undefined) {
|
|
159
|
-
state = { document: uri, pulledVersion: version, resultId: undefined };
|
|
160
|
-
states.set(key, state);
|
|
161
|
-
}
|
|
162
|
-
return state;
|
|
163
|
-
}
|
|
164
|
-
update(kind, document, arg1, arg2) {
|
|
165
|
-
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
|
|
166
|
-
const [key, uri, version, resultId] = document instanceof vscode_1.Uri
|
|
167
|
-
? [document.toString(), document, arg1, arg2]
|
|
168
|
-
: [document.uri.toString(), document.uri, document.version, arg1];
|
|
169
|
-
let state = states.get(key);
|
|
170
|
-
if (state === undefined) {
|
|
171
|
-
state = { document: uri, pulledVersion: version, resultId };
|
|
172
|
-
states.set(key, state);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
state.pulledVersion = version;
|
|
176
|
-
state.resultId = resultId;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
unTrack(kind, document) {
|
|
180
|
-
const key = DocumentOrUri.asKey(document);
|
|
181
|
-
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
|
|
182
|
-
states.delete(key);
|
|
183
|
-
}
|
|
184
|
-
tracks(kind, document) {
|
|
185
|
-
const key = DocumentOrUri.asKey(document);
|
|
186
|
-
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
|
|
187
|
-
return states.has(key);
|
|
188
|
-
}
|
|
189
|
-
getResultId(kind, document) {
|
|
190
|
-
const key = DocumentOrUri.asKey(document);
|
|
191
|
-
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
|
|
192
|
-
return states.get(key)?.resultId;
|
|
193
|
-
}
|
|
194
|
-
getAllResultIds() {
|
|
195
|
-
const result = [];
|
|
196
|
-
for (let [uri, value] of this.workspacePullStates) {
|
|
197
|
-
if (this.documentPullStates.has(uri)) {
|
|
198
|
-
value = this.documentPullStates.get(uri);
|
|
199
|
-
}
|
|
200
|
-
if (value.resultId !== undefined) {
|
|
201
|
-
result.push({ uri, value: value.resultId });
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
class DiagnosticRequestor {
|
|
208
|
-
constructor(client, tabs, options) {
|
|
209
|
-
this.client = client;
|
|
210
|
-
this.tabs = tabs;
|
|
211
|
-
this.options = options;
|
|
212
|
-
this.isDisposed = false;
|
|
213
|
-
this.onDidChangeDiagnosticsEmitter = new vscode_1.EventEmitter();
|
|
214
|
-
this.provider = this.createProvider();
|
|
215
|
-
this.diagnostics = vscode_1.languages.createDiagnosticCollection(options.identifier);
|
|
216
|
-
this.openRequests = new Map();
|
|
217
|
-
this.documentStates = new DocumentPullStateTracker();
|
|
218
|
-
this.workspaceErrorCounter = 0;
|
|
219
|
-
}
|
|
220
|
-
knows(kind, document) {
|
|
221
|
-
const uri = document instanceof vscode_1.Uri ? document : document.uri;
|
|
222
|
-
return this.documentStates.tracks(kind, document) || this.openRequests.has(uri.toString());
|
|
223
|
-
}
|
|
224
|
-
forget(kind, document) {
|
|
225
|
-
this.documentStates.unTrack(kind, document);
|
|
226
|
-
}
|
|
227
|
-
pull(document, cb) {
|
|
228
|
-
if (this.isDisposed) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
const uri = document instanceof vscode_1.Uri ? document : document.uri;
|
|
232
|
-
this.pullAsync(document).then(() => {
|
|
233
|
-
if (cb) {
|
|
234
|
-
cb();
|
|
235
|
-
}
|
|
236
|
-
}, (error) => {
|
|
237
|
-
this.client.error(`Document pull failed for text document ${uri.toString()}`, error, false);
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
async pullAsync(document, version) {
|
|
241
|
-
if (this.isDisposed) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
const isUri = document instanceof vscode_1.Uri;
|
|
245
|
-
const uri = isUri ? document : document.uri;
|
|
246
|
-
const key = uri.toString();
|
|
247
|
-
version = isUri ? version : document.version;
|
|
248
|
-
const currentRequestState = this.openRequests.get(key);
|
|
249
|
-
const documentState = isUri
|
|
250
|
-
? this.documentStates.track(PullState.document, document, version)
|
|
251
|
-
: this.documentStates.track(PullState.document, document);
|
|
252
|
-
if (currentRequestState === undefined) {
|
|
253
|
-
const tokenSource = new vscode_1.CancellationTokenSource();
|
|
254
|
-
this.openRequests.set(key, { state: RequestStateKind.active, document: document, version: version, tokenSource });
|
|
255
|
-
let report;
|
|
256
|
-
let afterState;
|
|
257
|
-
try {
|
|
258
|
-
report = await this.provider.provideDiagnostics(document, documentState.resultId, tokenSource.token) ?? { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };
|
|
259
|
-
}
|
|
260
|
-
catch (error) {
|
|
261
|
-
if (error instanceof features_1.LSPCancellationError && vscode_languageserver_protocol_1.DiagnosticServerCancellationData.is(error.data) && error.data.retriggerRequest === false) {
|
|
262
|
-
afterState = { state: RequestStateKind.outDated, document };
|
|
263
|
-
}
|
|
264
|
-
if (afterState === undefined && error instanceof vscode_1.CancellationError) {
|
|
265
|
-
afterState = { state: RequestStateKind.reschedule, document };
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
throw error;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
afterState = afterState ?? this.openRequests.get(key);
|
|
272
|
-
if (afterState === undefined) {
|
|
273
|
-
// This shouldn't happen. Log it
|
|
274
|
-
this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${key}`);
|
|
275
|
-
this.diagnostics.delete(uri);
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
this.openRequests.delete(key);
|
|
279
|
-
if (!this.tabs.isVisible(document)) {
|
|
280
|
-
this.documentStates.unTrack(PullState.document, document);
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
if (afterState.state === RequestStateKind.outDated) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
// report is only undefined if the request has thrown.
|
|
287
|
-
if (report !== undefined) {
|
|
288
|
-
if (report.kind === vsdiag.DocumentDiagnosticReportKind.full) {
|
|
289
|
-
this.diagnostics.set(uri, report.items);
|
|
290
|
-
}
|
|
291
|
-
documentState.pulledVersion = version;
|
|
292
|
-
documentState.resultId = report.resultId;
|
|
293
|
-
}
|
|
294
|
-
if (afterState.state === RequestStateKind.reschedule) {
|
|
295
|
-
this.pull(document);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
if (currentRequestState.state === RequestStateKind.active) {
|
|
300
|
-
// Cancel the current request and reschedule a new one when the old one returned.
|
|
301
|
-
currentRequestState.tokenSource.cancel();
|
|
302
|
-
this.openRequests.set(key, { state: RequestStateKind.reschedule, document: currentRequestState.document });
|
|
303
|
-
}
|
|
304
|
-
else if (currentRequestState.state === RequestStateKind.outDated) {
|
|
305
|
-
this.openRequests.set(key, { state: RequestStateKind.reschedule, document: currentRequestState.document });
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
forgetDocument(document) {
|
|
310
|
-
const uri = document instanceof vscode_1.Uri ? document : document.uri;
|
|
311
|
-
const key = uri.toString();
|
|
312
|
-
const request = this.openRequests.get(key);
|
|
313
|
-
if (this.options.workspaceDiagnostics) {
|
|
314
|
-
// If we run workspace diagnostic pull a last time for the diagnostics
|
|
315
|
-
// and the rely on getting them from the workspace result.
|
|
316
|
-
if (request !== undefined) {
|
|
317
|
-
this.openRequests.set(key, { state: RequestStateKind.reschedule, document: document });
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
this.pull(document, () => {
|
|
321
|
-
this.forget(PullState.document, document);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
// We have normal pull or inter file dependencies. In this case we
|
|
327
|
-
// clear the diagnostics (to have the same start as after startup).
|
|
328
|
-
// We also cancel outstanding requests.
|
|
329
|
-
if (request !== undefined) {
|
|
330
|
-
if (request.state === RequestStateKind.active) {
|
|
331
|
-
request.tokenSource.cancel();
|
|
332
|
-
}
|
|
333
|
-
this.openRequests.set(key, { state: RequestStateKind.outDated, document: document });
|
|
334
|
-
}
|
|
335
|
-
this.diagnostics.delete(uri);
|
|
336
|
-
this.forget(PullState.document, document);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
pullWorkspace() {
|
|
340
|
-
if (this.isDisposed) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
this.pullWorkspaceAsync().then(() => {
|
|
344
|
-
this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {
|
|
345
|
-
this.pullWorkspace();
|
|
346
|
-
}, 2000);
|
|
347
|
-
}, (error) => {
|
|
348
|
-
if (!(error instanceof features_1.LSPCancellationError) && !vscode_languageserver_protocol_1.DiagnosticServerCancellationData.is(error.data)) {
|
|
349
|
-
this.client.error(`Workspace diagnostic pull failed.`, error, false);
|
|
350
|
-
this.workspaceErrorCounter++;
|
|
351
|
-
}
|
|
352
|
-
if (this.workspaceErrorCounter <= 5) {
|
|
353
|
-
this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {
|
|
354
|
-
this.pullWorkspace();
|
|
355
|
-
}, 2000);
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
async pullWorkspaceAsync() {
|
|
360
|
-
if (!this.provider.provideWorkspaceDiagnostics || this.isDisposed) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
if (this.workspaceCancellation !== undefined) {
|
|
364
|
-
this.workspaceCancellation.cancel();
|
|
365
|
-
this.workspaceCancellation = undefined;
|
|
366
|
-
}
|
|
367
|
-
this.workspaceCancellation = new vscode_1.CancellationTokenSource();
|
|
368
|
-
const previousResultIds = this.documentStates.getAllResultIds().map((item) => {
|
|
369
|
-
return {
|
|
370
|
-
uri: this.client.protocol2CodeConverter.asUri(item.uri),
|
|
371
|
-
value: item.value
|
|
372
|
-
};
|
|
373
|
-
});
|
|
374
|
-
await this.provider.provideWorkspaceDiagnostics(previousResultIds, this.workspaceCancellation.token, (chunk) => {
|
|
375
|
-
if (!chunk || this.isDisposed) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
for (const item of chunk.items) {
|
|
379
|
-
if (item.kind === vsdiag.DocumentDiagnosticReportKind.full) {
|
|
380
|
-
// Favour document pull result over workspace results. So skip if it is tracked
|
|
381
|
-
// as a document result.
|
|
382
|
-
if (!this.documentStates.tracks(PullState.document, item.uri)) {
|
|
383
|
-
this.diagnostics.set(item.uri, item.items);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
this.documentStates.update(PullState.workspace, item.uri, item.version ?? undefined, item.resultId);
|
|
387
|
-
}
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
createProvider() {
|
|
391
|
-
const result = {
|
|
392
|
-
onDidChangeDiagnostics: this.onDidChangeDiagnosticsEmitter.event,
|
|
393
|
-
provideDiagnostics: (document, previousResultId, token) => {
|
|
394
|
-
const provideDiagnostics = (document, previousResultId, token) => {
|
|
395
|
-
const params = {
|
|
396
|
-
identifier: this.options.identifier,
|
|
397
|
-
textDocument: { uri: this.client.code2ProtocolConverter.asUri(document instanceof vscode_1.Uri ? document : document.uri) },
|
|
398
|
-
previousResultId: previousResultId
|
|
399
|
-
};
|
|
400
|
-
if (this.isDisposed === true || !this.client.isRunning()) {
|
|
401
|
-
return { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };
|
|
402
|
-
}
|
|
403
|
-
return this.client.sendRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, params, token).then(async (result) => {
|
|
404
|
-
if (result === undefined || result === null || this.isDisposed || token.isCancellationRequested) {
|
|
405
|
-
return { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };
|
|
406
|
-
}
|
|
407
|
-
if (result.kind === vscode_languageserver_protocol_1.DocumentDiagnosticReportKind.Full) {
|
|
408
|
-
return { kind: vsdiag.DocumentDiagnosticReportKind.full, resultId: result.resultId, items: await this.client.protocol2CodeConverter.asDiagnostics(result.items, token) };
|
|
409
|
-
}
|
|
410
|
-
else {
|
|
411
|
-
return { kind: vsdiag.DocumentDiagnosticReportKind.unChanged, resultId: result.resultId };
|
|
412
|
-
}
|
|
413
|
-
}, (error) => {
|
|
414
|
-
return this.client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, token, error, { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] });
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
const middleware = this.client.middleware;
|
|
418
|
-
return middleware.provideDiagnostics
|
|
419
|
-
? middleware.provideDiagnostics(document, previousResultId, token, provideDiagnostics)
|
|
420
|
-
: provideDiagnostics(document, previousResultId, token);
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
if (this.options.workspaceDiagnostics) {
|
|
424
|
-
result.provideWorkspaceDiagnostics = (resultIds, token, resultReporter) => {
|
|
425
|
-
const convertReport = async (report) => {
|
|
426
|
-
if (report.kind === vscode_languageserver_protocol_1.DocumentDiagnosticReportKind.Full) {
|
|
427
|
-
return {
|
|
428
|
-
kind: vsdiag.DocumentDiagnosticReportKind.full,
|
|
429
|
-
uri: this.client.protocol2CodeConverter.asUri(report.uri),
|
|
430
|
-
resultId: report.resultId,
|
|
431
|
-
version: report.version,
|
|
432
|
-
items: await this.client.protocol2CodeConverter.asDiagnostics(report.items, token)
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
return {
|
|
437
|
-
kind: vsdiag.DocumentDiagnosticReportKind.unChanged,
|
|
438
|
-
uri: this.client.protocol2CodeConverter.asUri(report.uri),
|
|
439
|
-
resultId: report.resultId,
|
|
440
|
-
version: report.version
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
const convertPreviousResultIds = (resultIds) => {
|
|
445
|
-
const converted = [];
|
|
446
|
-
for (const item of resultIds) {
|
|
447
|
-
converted.push({ uri: this.client.code2ProtocolConverter.asUri(item.uri), value: item.value });
|
|
448
|
-
}
|
|
449
|
-
return converted;
|
|
450
|
-
};
|
|
451
|
-
const provideDiagnostics = (resultIds, token) => {
|
|
452
|
-
const partialResultToken = (0, uuid_1.generateUuid)();
|
|
453
|
-
const disposable = this.client.onProgress(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.partialResult, partialResultToken, async (partialResult) => {
|
|
454
|
-
if (partialResult === undefined || partialResult === null) {
|
|
455
|
-
resultReporter(null);
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
const converted = {
|
|
459
|
-
items: []
|
|
460
|
-
};
|
|
461
|
-
for (const item of partialResult.items) {
|
|
462
|
-
try {
|
|
463
|
-
converted.items.push(await convertReport(item));
|
|
464
|
-
}
|
|
465
|
-
catch (error) {
|
|
466
|
-
this.client.error(`Converting workspace diagnostics failed.`, error);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
resultReporter(converted);
|
|
470
|
-
});
|
|
471
|
-
const params = {
|
|
472
|
-
identifier: this.options.identifier,
|
|
473
|
-
previousResultIds: convertPreviousResultIds(resultIds),
|
|
474
|
-
partialResultToken: partialResultToken
|
|
475
|
-
};
|
|
476
|
-
if (this.isDisposed === true || !this.client.isRunning()) {
|
|
477
|
-
return { items: [] };
|
|
478
|
-
}
|
|
479
|
-
return this.client.sendRequest(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.type, params, token).then(async (result) => {
|
|
480
|
-
if (token.isCancellationRequested) {
|
|
481
|
-
return { items: [] };
|
|
482
|
-
}
|
|
483
|
-
const converted = {
|
|
484
|
-
items: []
|
|
485
|
-
};
|
|
486
|
-
for (const item of result.items) {
|
|
487
|
-
converted.items.push(await convertReport(item));
|
|
488
|
-
}
|
|
489
|
-
disposable.dispose();
|
|
490
|
-
resultReporter(converted);
|
|
491
|
-
return { items: [] };
|
|
492
|
-
}, (error) => {
|
|
493
|
-
disposable.dispose();
|
|
494
|
-
return this.client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, token, error, { items: [] });
|
|
495
|
-
});
|
|
496
|
-
};
|
|
497
|
-
const middleware = this.client.middleware;
|
|
498
|
-
return middleware.provideWorkspaceDiagnostics
|
|
499
|
-
? middleware.provideWorkspaceDiagnostics(resultIds, token, resultReporter, provideDiagnostics)
|
|
500
|
-
: provideDiagnostics(resultIds, token, resultReporter);
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
return result;
|
|
504
|
-
}
|
|
505
|
-
dispose() {
|
|
506
|
-
this.isDisposed = true;
|
|
507
|
-
// Cancel and clear workspace pull if present.
|
|
508
|
-
this.workspaceCancellation?.cancel();
|
|
509
|
-
this.workspaceTimeout?.dispose();
|
|
510
|
-
// Cancel all request and mark open requests as outdated.
|
|
511
|
-
for (const [key, request] of this.openRequests) {
|
|
512
|
-
if (request.state === RequestStateKind.active) {
|
|
513
|
-
request.tokenSource.cancel();
|
|
514
|
-
}
|
|
515
|
-
this.openRequests.set(key, { state: RequestStateKind.outDated, document: request.document });
|
|
516
|
-
}
|
|
517
|
-
// cleanup old diagnostics
|
|
518
|
-
this.diagnostics.dispose();
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
class BackgroundScheduler {
|
|
522
|
-
constructor(diagnosticRequestor) {
|
|
523
|
-
this.diagnosticRequestor = diagnosticRequestor;
|
|
524
|
-
this.documents = new vscode_languageserver_protocol_1.LinkedMap();
|
|
525
|
-
this.isDisposed = false;
|
|
526
|
-
}
|
|
527
|
-
add(document) {
|
|
528
|
-
if (this.isDisposed === true) {
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
const key = DocumentOrUri.asKey(document);
|
|
532
|
-
if (this.documents.has(key)) {
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
this.documents.set(key, document, vscode_languageserver_protocol_1.Touch.Last);
|
|
536
|
-
this.trigger();
|
|
537
|
-
}
|
|
538
|
-
remove(document) {
|
|
539
|
-
const key = DocumentOrUri.asKey(document);
|
|
540
|
-
this.documents.delete(key);
|
|
541
|
-
// No more documents. Stop background activity.
|
|
542
|
-
if (this.documents.size === 0) {
|
|
543
|
-
this.stop();
|
|
544
|
-
}
|
|
545
|
-
else if (key === this.endDocumentKey()) {
|
|
546
|
-
// Make sure we have a correct last document. It could have
|
|
547
|
-
this.endDocument = this.documents.last;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
trigger() {
|
|
551
|
-
if (this.isDisposed === true) {
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
// We have a round running. So simply make sure we run up to the
|
|
555
|
-
// last document
|
|
556
|
-
if (this.intervalHandle !== undefined) {
|
|
557
|
-
this.endDocument = this.documents.last;
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
this.endDocument = this.documents.last;
|
|
561
|
-
this.intervalHandle = (0, vscode_languageserver_protocol_1.RAL)().timer.setInterval(() => {
|
|
562
|
-
const document = this.documents.first;
|
|
563
|
-
if (document !== undefined) {
|
|
564
|
-
const key = DocumentOrUri.asKey(document);
|
|
565
|
-
this.diagnosticRequestor.pull(document);
|
|
566
|
-
this.documents.set(key, document, vscode_languageserver_protocol_1.Touch.Last);
|
|
567
|
-
if (key === this.endDocumentKey()) {
|
|
568
|
-
this.stop();
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}, 200);
|
|
572
|
-
}
|
|
573
|
-
dispose() {
|
|
574
|
-
this.isDisposed = true;
|
|
575
|
-
this.stop();
|
|
576
|
-
this.documents.clear();
|
|
577
|
-
}
|
|
578
|
-
stop() {
|
|
579
|
-
this.intervalHandle?.dispose();
|
|
580
|
-
this.intervalHandle = undefined;
|
|
581
|
-
this.endDocument = undefined;
|
|
582
|
-
}
|
|
583
|
-
endDocumentKey() {
|
|
584
|
-
return this.endDocument !== undefined ? DocumentOrUri.asKey(this.endDocument) : undefined;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
class DiagnosticFeatureProviderImpl {
|
|
588
|
-
constructor(client, tabs, options) {
|
|
589
|
-
const diagnosticPullOptions = client.clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false };
|
|
590
|
-
const documentSelector = client.protocol2CodeConverter.asDocumentSelector(options.documentSelector);
|
|
591
|
-
const disposables = [];
|
|
592
|
-
const matchResource = (resource) => {
|
|
593
|
-
const selector = options.documentSelector;
|
|
594
|
-
if (diagnosticPullOptions.match !== undefined) {
|
|
595
|
-
return diagnosticPullOptions.match(selector, resource);
|
|
596
|
-
}
|
|
597
|
-
for (const filter of selector) {
|
|
598
|
-
if (!vscode_languageserver_protocol_1.TextDocumentFilter.is(filter)) {
|
|
599
|
-
continue;
|
|
600
|
-
}
|
|
601
|
-
// The filter is a language id. We can't determine if it matches
|
|
602
|
-
// so we return false.
|
|
603
|
-
if (typeof filter === 'string') {
|
|
604
|
-
return false;
|
|
605
|
-
}
|
|
606
|
-
if (filter.language !== undefined && filter.language !== '*') {
|
|
607
|
-
return false;
|
|
608
|
-
}
|
|
609
|
-
if (filter.scheme !== undefined && filter.scheme !== '*' && filter.scheme !== resource.scheme) {
|
|
610
|
-
return false;
|
|
611
|
-
}
|
|
612
|
-
if (filter.pattern !== undefined) {
|
|
613
|
-
const matcher = new minimatch.Minimatch(filter.pattern, { noext: true });
|
|
614
|
-
if (!matcher.makeRe()) {
|
|
615
|
-
return false;
|
|
616
|
-
}
|
|
617
|
-
if (!matcher.match(resource.fsPath)) {
|
|
618
|
-
return false;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
return true;
|
|
623
|
-
};
|
|
624
|
-
const matches = (document) => {
|
|
625
|
-
return document instanceof vscode_1.Uri
|
|
626
|
-
? matchResource(document)
|
|
627
|
-
: vscode_1.languages.match(documentSelector, document) > 0 && tabs.isVisible(document);
|
|
628
|
-
};
|
|
629
|
-
const isActiveDocument = (document) => {
|
|
630
|
-
return document instanceof vscode_1.Uri
|
|
631
|
-
? this.activeTextDocument?.uri.toString() === document.toString()
|
|
632
|
-
: this.activeTextDocument === document;
|
|
633
|
-
};
|
|
634
|
-
this.diagnosticRequestor = new DiagnosticRequestor(client, tabs, options);
|
|
635
|
-
this.backgroundScheduler = new BackgroundScheduler(this.diagnosticRequestor);
|
|
636
|
-
const addToBackgroundIfNeeded = (document) => {
|
|
637
|
-
if (!matches(document) || !options.interFileDependencies || isActiveDocument(document)) {
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
this.backgroundScheduler.add(document);
|
|
641
|
-
};
|
|
642
|
-
this.activeTextDocument = vscode_1.window.activeTextEditor?.document;
|
|
643
|
-
vscode_1.window.onDidChangeActiveTextEditor((editor) => {
|
|
644
|
-
const oldActive = this.activeTextDocument;
|
|
645
|
-
this.activeTextDocument = editor?.document;
|
|
646
|
-
if (oldActive !== undefined) {
|
|
647
|
-
addToBackgroundIfNeeded(oldActive);
|
|
648
|
-
}
|
|
649
|
-
if (this.activeTextDocument !== undefined) {
|
|
650
|
-
this.backgroundScheduler.remove(this.activeTextDocument);
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
// For pull model diagnostics we pull for documents visible in the UI.
|
|
654
|
-
// From an eventing point of view we still rely on open document events
|
|
655
|
-
// and filter the documents that are not visible in the UI instead of
|
|
656
|
-
// listening to Tab events. Major reason is event timing since we need
|
|
657
|
-
// to ensure that the pull is send after the document open has reached
|
|
658
|
-
// the server.
|
|
659
|
-
// We always pull on open.
|
|
660
|
-
const openFeature = client.getFeature(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method);
|
|
661
|
-
disposables.push(openFeature.onNotificationSent((event) => {
|
|
662
|
-
const textDocument = event.textDocument;
|
|
663
|
-
// We already know about this document. This can happen via a tab open.
|
|
664
|
-
if (this.diagnosticRequestor.knows(PullState.document, textDocument)) {
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
if (matches(textDocument)) {
|
|
668
|
-
this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });
|
|
669
|
-
}
|
|
670
|
-
}));
|
|
671
|
-
disposables.push(tabs.onOpen((opened) => {
|
|
672
|
-
for (const resource of opened) {
|
|
673
|
-
// We already know about this document. This can happen via a document open.
|
|
674
|
-
if (this.diagnosticRequestor.knows(PullState.document, resource)) {
|
|
675
|
-
continue;
|
|
676
|
-
}
|
|
677
|
-
const uriStr = resource.toString();
|
|
678
|
-
let textDocument;
|
|
679
|
-
for (const item of vscode_1.workspace.textDocuments) {
|
|
680
|
-
if (uriStr === item.uri.toString()) {
|
|
681
|
-
textDocument = item;
|
|
682
|
-
break;
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
// In VS Code the event timing is as follows:
|
|
686
|
-
// 1. tab events are fired.
|
|
687
|
-
// 2. open document events are fired and internal data structures like
|
|
688
|
-
// workspace.textDocuments and Window.activeTextEditor are updated.
|
|
689
|
-
//
|
|
690
|
-
// This means: for newly created tab/editors we don't find the underlying
|
|
691
|
-
// document yet. So we do nothing an rely on the underlying open document event
|
|
692
|
-
// to be fired.
|
|
693
|
-
if (textDocument !== undefined && matches(textDocument)) {
|
|
694
|
-
this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}));
|
|
698
|
-
// Pull all diagnostics for documents that are already open
|
|
699
|
-
const pulledTextDocuments = new Set();
|
|
700
|
-
for (const textDocument of vscode_1.workspace.textDocuments) {
|
|
701
|
-
if (matches(textDocument)) {
|
|
702
|
-
this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });
|
|
703
|
-
pulledTextDocuments.add(textDocument.uri.toString());
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
// Pull all tabs if not already pulled as text document
|
|
707
|
-
if (diagnosticPullOptions.onTabs === true) {
|
|
708
|
-
for (const resource of tabs.getTabResources()) {
|
|
709
|
-
if (!pulledTextDocuments.has(resource.toString()) && matches(resource)) {
|
|
710
|
-
this.diagnosticRequestor.pull(resource, () => { addToBackgroundIfNeeded(resource); });
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
// We don't need to pull on tab open since we will receive a document open as well later on
|
|
715
|
-
// and that event allows us to use a document for a match check which will have a set
|
|
716
|
-
// language id.
|
|
717
|
-
if (diagnosticPullOptions.onChange === true) {
|
|
718
|
-
const changeFeature = client.getFeature(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.method);
|
|
719
|
-
disposables.push(changeFeature.onNotificationSent(async (event) => {
|
|
720
|
-
const textDocument = event.textDocument;
|
|
721
|
-
if ((diagnosticPullOptions.filter === undefined || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onType)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {
|
|
722
|
-
this.diagnosticRequestor.pull(textDocument, () => { this.backgroundScheduler.trigger(); });
|
|
723
|
-
}
|
|
724
|
-
}));
|
|
725
|
-
}
|
|
726
|
-
if (diagnosticPullOptions.onSave === true) {
|
|
727
|
-
const saveFeature = client.getFeature(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.method);
|
|
728
|
-
disposables.push(saveFeature.onNotificationSent((event) => {
|
|
729
|
-
const textDocument = event.textDocument;
|
|
730
|
-
if ((diagnosticPullOptions.filter === undefined || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onSave)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {
|
|
731
|
-
this.diagnosticRequestor.pull(event.textDocument, () => { this.backgroundScheduler.trigger(); });
|
|
732
|
-
}
|
|
733
|
-
}));
|
|
734
|
-
}
|
|
735
|
-
// When the document closes clear things up
|
|
736
|
-
const closeFeature = client.getFeature(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.method);
|
|
737
|
-
disposables.push(closeFeature.onNotificationSent((event) => {
|
|
738
|
-
this.cleanUpDocument(event.textDocument);
|
|
739
|
-
}));
|
|
740
|
-
// Same when a tabs closes.
|
|
741
|
-
tabs.onClose((closed) => {
|
|
742
|
-
for (const document of closed) {
|
|
743
|
-
this.cleanUpDocument(document);
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
// We received a did change from the server.
|
|
747
|
-
this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(() => {
|
|
748
|
-
for (const textDocument of vscode_1.workspace.textDocuments) {
|
|
749
|
-
if (matches(textDocument)) {
|
|
750
|
-
this.diagnosticRequestor.pull(textDocument);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
});
|
|
754
|
-
// da348dc5-c30a-4515-9d98-31ff3be38d14 is the test UUID to test the middle ware. So don't auto trigger pulls.
|
|
755
|
-
if (options.workspaceDiagnostics === true && options.identifier !== 'da348dc5-c30a-4515-9d98-31ff3be38d14') {
|
|
756
|
-
this.diagnosticRequestor.pullWorkspace();
|
|
757
|
-
}
|
|
758
|
-
this.disposable = vscode_1.Disposable.from(...disposables, this.backgroundScheduler, this.diagnosticRequestor);
|
|
759
|
-
}
|
|
760
|
-
get onDidChangeDiagnosticsEmitter() {
|
|
761
|
-
return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter;
|
|
762
|
-
}
|
|
763
|
-
get diagnostics() {
|
|
764
|
-
return this.diagnosticRequestor.provider;
|
|
765
|
-
}
|
|
766
|
-
cleanUpDocument(document) {
|
|
767
|
-
if (this.diagnosticRequestor.knows(PullState.document, document)) {
|
|
768
|
-
this.diagnosticRequestor.forgetDocument(document);
|
|
769
|
-
this.backgroundScheduler.remove(document);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
class DiagnosticFeature extends features_1.TextDocumentLanguageFeature {
|
|
774
|
-
constructor(client) {
|
|
775
|
-
super(client, vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type);
|
|
776
|
-
}
|
|
777
|
-
fillClientCapabilities(capabilities) {
|
|
778
|
-
let capability = ensure(ensure(capabilities, 'textDocument'), 'diagnostic');
|
|
779
|
-
capability.dynamicRegistration = true;
|
|
780
|
-
// We first need to decide how a UI will look with related documents.
|
|
781
|
-
// An easy implementation would be to only show related diagnostics for
|
|
782
|
-
// the active editor.
|
|
783
|
-
capability.relatedDocumentSupport = false;
|
|
784
|
-
ensure(ensure(capabilities, 'workspace'), 'diagnostics').refreshSupport = true;
|
|
785
|
-
}
|
|
786
|
-
initialize(capabilities, documentSelector) {
|
|
787
|
-
const client = this._client;
|
|
788
|
-
client.onRequest(vscode_languageserver_protocol_1.DiagnosticRefreshRequest.type, async () => {
|
|
789
|
-
for (const provider of this.getAllProviders()) {
|
|
790
|
-
provider.onDidChangeDiagnosticsEmitter.fire();
|
|
791
|
-
}
|
|
792
|
-
});
|
|
793
|
-
let [id, options] = this.getRegistration(documentSelector, capabilities.diagnosticProvider);
|
|
794
|
-
if (!id || !options) {
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
this.register({ id: id, registerOptions: options });
|
|
798
|
-
}
|
|
799
|
-
clear() {
|
|
800
|
-
if (this.tabs !== undefined) {
|
|
801
|
-
this.tabs.dispose();
|
|
802
|
-
this.tabs = undefined;
|
|
803
|
-
}
|
|
804
|
-
super.clear();
|
|
805
|
-
}
|
|
806
|
-
registerLanguageProvider(options) {
|
|
807
|
-
if (this.tabs === undefined) {
|
|
808
|
-
this.tabs = new Tabs();
|
|
809
|
-
}
|
|
810
|
-
const provider = new DiagnosticFeatureProviderImpl(this._client, this.tabs, options);
|
|
811
|
-
return [provider.disposable, provider];
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
exports.DiagnosticFeature = DiagnosticFeature;
|