From 40b4cb305fa344c62c69ad8eb0dd791c1b608c2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:23:10 -0400 Subject: [PATCH 001/647] Bump peaceiris/actions-label-commenter from 1.9.1 to 1.10.0 (#620) Bumps [peaceiris/actions-label-commenter](https://github.com/peaceiris/actions-label-commenter) from 1.9.1 to 1.10.0. - [Release notes](https://github.com/peaceiris/actions-label-commenter/releases) - [Changelog](https://github.com/peaceiris/actions-label-commenter/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-label-commenter/compare/v1.9.1...v1.10.0) --- updated-dependencies: - dependency-name: peaceiris/actions-label-commenter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml index 49e9b2efd..96fb03bb2 100644 --- a/.github/workflows/dependabot-merge.yml +++ b/.github/workflows/dependabot-merge.yml @@ -31,7 +31,7 @@ jobs: - name: Dependabot Commenter if: | (github.event.label.name == 'merge') && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]') - uses: peaceiris/actions-label-commenter@v1.9.1 + uses: peaceiris/actions-label-commenter@v1.10.0 with: github_token: ${{ secrets.OMNISHARP_BOT_TOKEN }} config_file: .github/label-commenter-dependabot.yml From e45de84810f99ab52df2fb4f7c29aa6eb3b85aeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:23:21 -0400 Subject: [PATCH 002/647] Bump lint-staged from 10.5.4 to 11.1.2 (#630) Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.5.4 to 11.1.2. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](https://github.com/okonet/lint-staged/compare/v10.5.4...v11.1.2) --- updated-dependencies: - dependency-name: lint-staged dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 230 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 95 insertions(+), 137 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc8cb820c..2d9310230 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3,27 +3,27 @@ "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", "dev": true, "requires": { - "@babel/highlight": "^7.12.13" + "@babel/highlight": "^7.14.5" } }, "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", + "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", "dev": true }, "@babel/highlight": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", - "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -103,12 +103,12 @@ "dev": true }, "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "requires": { - "type-fest": "^0.11.0" + "type-fest": "^0.21.3" } }, "ansi-regex": { @@ -148,9 +148,9 @@ "dev": true }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -197,10 +197,16 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true }, "cosmiconfig": { @@ -228,35 +234,20 @@ } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { "ms": "2.1.2" } }, - "dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", - "dev": true - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, "enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", @@ -282,31 +273,22 @@ "dev": true }, "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -323,13 +305,10 @@ "dev": true }, "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true }, "has-flag": { "version": "4.0.0", @@ -338,9 +317,9 @@ "dev": true }, "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, "husky": { @@ -396,9 +375,15 @@ "dev": true }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, "isexe": { @@ -426,22 +411,21 @@ "dev": true }, "lint-staged": { - "version": "10.5.4", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.4.tgz", - "integrity": "sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==", + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-11.1.2.tgz", + "integrity": "sha512-6lYpNoA9wGqkL6Hew/4n1H6lRqF3qCsujVT0Oq5Z4hiSAM7S6NksPJ3gnr7A7R52xCtiZMcEUNNQ6d6X5Bvh9w==", "dev": true, "requires": { - "chalk": "^4.1.0", + "chalk": "^4.1.1", "cli-truncate": "^2.1.0", - "commander": "^6.2.0", + "commander": "^7.2.0", "cosmiconfig": "^7.0.0", - "debug": "^4.2.0", - "dedent": "^0.7.0", + "debug": "^4.3.1", "enquirer": "^2.3.6", - "execa": "^4.1.0", - "listr2": "^3.2.2", - "log-symbols": "^4.0.0", - "micromatch": "^4.0.2", + "execa": "^5.0.0", + "listr2": "^3.8.2", + "log-symbols": "^4.1.0", + "micromatch": "^4.0.4", "normalize-path": "^3.0.0", "please-upgrade-node": "^3.2.0", "string-argv": "0.3.1", @@ -449,29 +433,28 @@ } }, "listr2": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.3.4.tgz", - "integrity": "sha512-b0lhLAvXSr63AtPF9Dgn6tyxm8Kiz6JXpVGM0uZJdnDcZp02jt7FehgAnMfA9R7riQimOKjQgLknBTdz2nmXwQ==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.11.0.tgz", + "integrity": "sha512-XLJVe2JgXCyQTa3FbSv11lkKExYmEyA4jltVo8z4FX10Vt1Yj8IMekBfwim0BSOM9uj1QMTJvDQQpHyuPbB/dQ==", "dev": true, "requires": { - "chalk": "^4.1.0", "cli-truncate": "^2.1.0", - "figures": "^3.2.0", - "indent-string": "^4.0.0", + "colorette": "^1.2.2", "log-update": "^4.0.0", "p-map": "^4.0.0", - "rxjs": "^6.6.6", + "rxjs": "^6.6.7", "through": "^2.3.8", "wrap-ansi": "^7.0.0" } }, "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "log-update": { @@ -517,13 +500,13 @@ "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", "dev": true, "requires": { "braces": "^3.0.1", - "picomatch": "^2.0.5" + "picomatch": "^2.2.3" } }, "mimic-fn": { @@ -553,15 +536,6 @@ "path-key": "^3.0.0" } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, "onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -614,9 +588,9 @@ "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "please-upgrade-node": { @@ -634,16 +608,6 @@ "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "dev": true }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -661,9 +625,9 @@ } }, "rxjs": { - "version": "6.6.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.6.tgz", - "integrity": "sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg==", + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -714,9 +678,9 @@ "dev": true }, "string-width": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.1.tgz", - "integrity": "sha512-LL0OLyN6AnfV9xqGQpDBwedT2Rt63737LxvsRxbcwpa2aIeynBApG2Sm//F3TaLHIR1aJBN52DWklc06b94o5Q==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -781,9 +745,9 @@ "dev": true }, "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true }, "which": { @@ -806,16 +770,10 @@ "strip-ansi": "^6.0.0" } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, "yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true } } diff --git a/package.json b/package.json index 31a2396f6..c44df22ff 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "devDependencies": { "husky": "^6.0.0", - "lint-staged": "^10.5.4", + "lint-staged": "^11.1.2", "prettier": "^2.2.1" } } From 0a225d7c827044739f4bcb978ecae3e408967fd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:24:05 -0400 Subject: [PATCH 003/647] Bump gittools/actions from 0.9.9 to 0.9.10 (#611) Bumps [gittools/actions](https://github.com/gittools/actions) from 0.9.9 to 0.9.10. - [Release notes](https://github.com/gittools/actions/releases) - [Commits](https://github.com/gittools/actions/compare/v0.9.9...v0.9.10) --- updated-dependencies: - dependency-name: gittools/actions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 5e00c096f..49f33052c 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -13,18 +13,18 @@ jobs: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.9 + uses: gittools/actions/gitversion/setup@v0.9.10 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.9 + uses: gittools/actions/gitreleasemanager/setup@v0.9.10 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.9 + uses: gittools/actions/gitversion/execute@v0.9.10 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index ff25987c9..1fe0cc50e 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -18,18 +18,18 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.9 + uses: gittools/actions/gitversion/setup@v0.9.10 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.9 + uses: gittools/actions/gitreleasemanager/setup@v0.9.10 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.9 + uses: gittools/actions/gitversion/execute@v0.9.10 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 From a8ebeef3d6c731d382989646cb7c309d5f329e91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:24:21 -0400 Subject: [PATCH 004/647] Bump DryIoc.Internal from 4.7.6 to 4.8.1 (#610) Bumps [DryIoc.Internal](https://github.com/dadhi/DryIoc) from 4.7.6 to 4.8.1. - [Release notes](https://github.com/dadhi/DryIoc/releases) - [Commits](https://github.com/dadhi/DryIoc/compare/v4.7.6...v4.8.1) --- updated-dependencies: - dependency-name: DryIoc.Internal dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index ab0e21d4c..dc4806012 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -48,6 +48,6 @@ - + From 7580902c9031b3e308cd2b4e5aa0c14fdfe19795 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:25:02 -0400 Subject: [PATCH 005/647] Bump actions/setup-dotnet from 1.7.2 to 1.8.1 (#606) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 1.7.2 to 1.8.1. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v1.7.2...v1.8.1) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9e2da22d..52bd59cbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,15 +45,15 @@ jobs: run: | git fetch --prune - name: πŸ”¨ Use .NET Core 2.1 SDK - uses: actions/setup-dotnet@v1.7.2 + uses: actions/setup-dotnet@v1.8.1 with: dotnet-version: '2.1.x' - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v1.7.2 + uses: actions/setup-dotnet@v1.8.1 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 5.0 SDK - uses: actions/setup-dotnet@v1.7.2 + uses: actions/setup-dotnet@v1.8.1 with: dotnet-version: '5.0.x' - name: 🎁 dotnet tool restore From 1c278ed4bcd54acb10e736ff9e13ead828ddf06e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:25:09 -0400 Subject: [PATCH 006/647] Bump actions/checkout from 2 to 2.3.4 (#585) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/dependabot-merge.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52bd59cbc..677ae4f85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.3.4 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 49f33052c..5d59734f6 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.3.4 with: fetch-depth: 0 diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml index 96fb03bb2..28515c4a5 100644 --- a/.github/workflows/dependabot-merge.yml +++ b/.github/workflows/dependabot-merge.yml @@ -25,7 +25,7 @@ jobs: env: RUNNER_CONTEXT: ${{ toJson(runner) }} run: echo "$RUNNER_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.3.4 with: ref: master - name: Dependabot Commenter diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 1fe0cc50e..bf4430144 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.3.4 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 6c1f1ca52..c6ec4b475 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.3.4 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 82fa74756..120c6e1c8 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.3.4 - name: sync milestones uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.4 From 7bb9db878a608ae5283db295edf65dab21cdd332 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:25:15 -0400 Subject: [PATCH 007/647] Bump Microsoft.NETFramework.ReferenceAssemblies from 1.0.0 to 1.0.2 (#580) Bumps [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet) from 1.0.0 to 1.0.2. - [Release notes](https://github.com/Microsoft/dotnet/releases) - [Commits](https://github.com/Microsoft/dotnet/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index dc4806012..b3b04c3f8 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -8,7 +8,7 @@ - + From be635744a11c30e2b8011057652067a6286fd931 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 19:54:46 +0000 Subject: [PATCH 008/647] Bump prettier from 2.2.1 to 2.3.2 (#607) Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2d9310230..e978dbd9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -603,9 +603,9 @@ } }, "prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true }, "resolve-from": { diff --git a/package.json b/package.json index c44df22ff..543e15ca3 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "devDependencies": { "husky": "^6.0.0", "lint-staged": "^11.1.2", - "prettier": "^2.2.1" + "prettier": "^2.3.2" } } From cd64dd4119275a862118a34f97715bcbebed0bb7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 20:16:04 +0000 Subject: [PATCH 009/647] Bump Microsoft.NET.Test.Sdk from 16.9.4 to 16.11.0 (#637) --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index b3b04c3f8..90a5f37bb 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -25,7 +25,7 @@ - + From 89a97d19f5abff2995dad9f145cb3e2a8f1fb984 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 20:21:22 +0000 Subject: [PATCH 010/647] Bump husky from 6.0.0 to 7.0.1 (#612) Bumps [husky](https://github.com/typicode/husky) from 6.0.0 to 7.0.1. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v6.0.0...v7.0.1) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e978dbd9c..873e8e3c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -323,9 +323,9 @@ "dev": true }, "husky": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz", - "integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.1.tgz", + "integrity": "sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA==", "dev": true }, "import-fresh": { diff --git a/package.json b/package.json index 543e15ca3..1cdc6213f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "husky": "^6.0.0", + "husky": "^7.0.1", "lint-staged": "^11.1.2", "prettier": "^2.3.2" } From de1591e91a176fb88442ecf7e2e30f7a2174e6c0 Mon Sep 17 00:00:00 2001 From: ycholette <88855895+ycholette@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:57:08 -0400 Subject: [PATCH 011/647] Fix potential unobserved exception in InputHandler.cs (#635) Co-authored-by: Yannick Cholette --- src/JsonRpc/InputHandler.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/JsonRpc/InputHandler.cs b/src/JsonRpc/InputHandler.cs index 6d267c101..caa294af8 100644 --- a/src/JsonRpc/InputHandler.cs +++ b/src/JsonRpc/InputHandler.cs @@ -110,9 +110,16 @@ IScheduler scheduler public void Start() { _disposable.Add( - Observable.FromAsync(() => ProcessInputStream(_stopProcessing.Token)) - .Do(_ => { }, e => _logger.LogCritical(e, "unhandled exception")) - .Subscribe(_inputActive) + Observable.FromAsync(async () => { + try + { + await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false); + } + catch (Exception e) + { + _logger.LogCritical(e, "unhandled exception"); + } + }).Subscribe(_inputActive) ); _disposable.Add( _inputQueue From a361160028fd36e9faf36cabd77da74d99f7d645 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 27 Aug 2021 07:05:35 -0700 Subject: [PATCH 012/647] Refactor request invocation to be extensible. (#641) * Refactor request invocation to be extensible. - The initial motivation for this change spawned from an investigation in the Razor language server where transitioning from Parallel -> Serial tasks would wait on Parallel work to finish. In scenarios when that parallel work took a long time this could result in significant editor delays in completion where you'd have Parallel (long) -> Serial -> Parallel (completion, short). I played around with changing the System.Reactive bits to have an option to not "wait" for the parallel stacks but System.Reatcive as a library wasn't truly built to handle that type of "change your mind after-the-fact" flow. - Prior to this change the routing & scheduling aspects of the JsonRpc stack are bound to our ProcessScheduler & InputHandler.RouteRequest & InputHandler.RouteNotification endspoints. This change allows that entire stack to be extensible so consumers can plug & play. - Added a `RequestInvoker` type which represents the core logic of how the framework invokes a handler for a request. This encapsulates the control flow for invoking, scheduling and handling fallout from invoking a handler. - Added a `RequestInvokerOptions` type to represent what sort of settings should be applied for the request invoker paradigm. - Expanded `InputHandler` & `Connection` to have two new constructors that take in a request invoker and obsoleted the old ones. Updated tests to account for this. - Registered the default request invoker type (the one that uses System.Reactive) if a request invoker was not already registered. * Make existing request response types fully public - For consumers who are creating their own `RequestInvoker` they need to manually construct many of our response types. Therefore, the constructors need to also be puclic. * Fix test. * Addressed code review comments --- src/JsonRpc/Connection.cs | 41 +++- src/JsonRpc/ContentModified.cs | 6 +- src/JsonRpc/DefaultRequestInvoker.cs | 181 ++++++++++++++++ src/JsonRpc/InputHandler.cs | 202 +++++------------- ...sonRpcServerServiceCollectionExtensions.cs | 20 +- src/JsonRpc/RequestCancelled.cs | 6 +- src/JsonRpc/RequestInvocationHandle.cs | 35 +++ src/JsonRpc/RequestInvoker.cs | 15 ++ src/JsonRpc/RequestInvokerOptions.cs | 23 ++ src/JsonRpc/TimeLoggerExtensions.cs | 2 +- test/JsonRpc.Tests/InputHandlerTests.cs | 59 +++-- .../TypedCompletionTests.cs | 3 +- 12 files changed, 394 insertions(+), 199 deletions(-) create mode 100644 src/JsonRpc/DefaultRequestInvoker.cs create mode 100644 src/JsonRpc/RequestInvocationHandle.cs create mode 100644 src/JsonRpc/RequestInvoker.cs create mode 100644 src/JsonRpc/RequestInvokerOptions.cs diff --git a/src/JsonRpc/Connection.cs b/src/JsonRpc/Connection.cs index 546328a9e..27018bd86 100644 --- a/src/JsonRpc/Connection.cs +++ b/src/JsonRpc/Connection.cs @@ -11,6 +11,7 @@ public class Connection : IDisposable private readonly InputHandler _inputHandler; public bool IsOpen { get; private set; } + [Obsolete("Use the other constructor that takes a request invoker")] public Connection( PipeReader input, IOutputHandler outputHandler, @@ -25,21 +26,49 @@ public Connection( int concurrency, IScheduler scheduler, CreateResponseExceptionHandler? getException = null + ) : this( + input, + outputHandler, + receiver, + requestRouter, + responseRouter, + new DefaultRequestInvoker( + requestRouter, + outputHandler, + requestProcessIdentifier, + new RequestInvokerOptions( + requestTimeout, + supportContentModified, + concurrency), + loggerFactory, + scheduler), + loggerFactory, + onUnhandledException, + getException) + { + } + + public Connection( + PipeReader input, + IOutputHandler outputHandler, + IReceiver receiver, + IRequestRouter requestRouter, + IResponseRouter responseRouter, + RequestInvoker requestInvoker, + ILoggerFactory loggerFactory, + OnUnhandledExceptionHandler onUnhandledException, + CreateResponseExceptionHandler? getException = null ) => _inputHandler = new InputHandler( input, outputHandler, receiver, - requestProcessIdentifier, requestRouter, responseRouter, + requestInvoker, loggerFactory, onUnhandledException, - getException, - requestTimeout, - supportContentModified, - concurrency > 1 ? (int?) concurrency : null, - scheduler + getException ); public void Open() diff --git a/src/JsonRpc/ContentModified.cs b/src/JsonRpc/ContentModified.cs index 9407faca7..b5b8c821a 100644 --- a/src/JsonRpc/ContentModified.cs +++ b/src/JsonRpc/ContentModified.cs @@ -1,15 +1,15 @@ -ο»Ώusing OmniSharp.Extensions.JsonRpc.Server; +using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Server.Messages; namespace OmniSharp.Extensions.JsonRpc { public class ContentModified : RpcError { - internal ContentModified(string method) : base(null, method, new ErrorMessage(ErrorCodes.ContentModified, "Content Modified")) + public ContentModified(string method) : base(null, method, new ErrorMessage(ErrorCodes.ContentModified, "Content Modified")) { } - internal ContentModified(object id, string method) : base(id, method, new ErrorMessage(ErrorCodes.ContentModified, "Content Modified")) + public ContentModified(object id, string method) : base(id, method, new ErrorMessage(ErrorCodes.ContentModified, "Content Modified")) { } } diff --git a/src/JsonRpc/DefaultRequestInvoker.cs b/src/JsonRpc/DefaultRequestInvoker.cs new file mode 100644 index 000000000..f4657dc97 --- /dev/null +++ b/src/JsonRpc/DefaultRequestInvoker.cs @@ -0,0 +1,181 @@ +using System; +using System.Reactive; +using System.Reactive.Concurrency; +using System.Reactive.Disposables; +using System.Reactive.Linq; +using Microsoft.Extensions.Logging; +using OmniSharp.Extensions.JsonRpc.Server; +using OmniSharp.Extensions.JsonRpc.Server.Messages; +using Notification = OmniSharp.Extensions.JsonRpc.Server.Notification; + +namespace OmniSharp.Extensions.JsonRpc +{ + public class DefaultRequestInvoker : RequestInvoker + { + private readonly IRequestRouter _requestRouter; + private readonly IOutputHandler _outputHandler; + private readonly ProcessScheduler _processScheduler; + private readonly IRequestProcessIdentifier _requestProcessIdentifier; + private readonly RequestInvokerOptions _options; + private readonly ILogger _logger; + + public DefaultRequestInvoker( + IRequestRouter requestRouter, + IOutputHandler outputHandler, + IRequestProcessIdentifier requestProcessIdentifier, + RequestInvokerOptions options, + ILoggerFactory loggerFactory, + IScheduler scheduler) + { + _requestRouter = requestRouter; + _outputHandler = outputHandler; + _requestProcessIdentifier = requestProcessIdentifier; + _options = options; + _processScheduler = new ProcessScheduler(loggerFactory, _options.SupportContentModified, _options.Concurrency, scheduler); + _logger = loggerFactory.CreateLogger(); + } + + public override RequestInvocationHandle InvokeRequest(IRequestDescriptor descriptor, Request request) + { + if (descriptor.Default is null) + { + throw new ArgumentNullException(nameof(descriptor.Default)); + } + + var handle = new RequestInvocationHandle(request); + var type = _requestProcessIdentifier.Identify(descriptor.Default); + + var schedulerDelegate = RouteRequest(descriptor, request, handle); + _processScheduler.Add(type, $"{request.Method}:{request.Id}", schedulerDelegate); + + return handle; + } + + public override void InvokeNotification(IRequestDescriptor descriptor, Notification notification) + { + if (descriptor.Default is null) + { + throw new ArgumentNullException(nameof(descriptor.Default)); + } + + var type = _requestProcessIdentifier.Identify(descriptor.Default); + var schedulerDelegate = RouteNotification(descriptor, notification); + _processScheduler.Add(type, notification.Method, schedulerDelegate); + } + + public override void Dispose() + { + _processScheduler.Dispose(); + } + + private SchedulerDelegate RouteRequest( + IRequestDescriptor descriptor, + Request request, + RequestInvocationHandle handle) + { + var cts = handle.CancellationTokenSource; + return (contentModifiedToken, scheduler) => + Observable.Create( + observer => { + // ITS A RACE! + var sub = Observable.Amb( + contentModifiedToken.Select( + _ => { + _logger.LogTrace( + "Request {Id} was abandoned due to content be modified", request.Id + ); + return new ErrorResponse( + new ContentModified(request.Id, request.Method) + ); + } + ), + Observable.Timer(_options.RequestTimeout, scheduler).Select( + _ => new ErrorResponse(new RequestCancelled(request.Id, request.Method)) + ), + Observable.FromAsync( + async ct => { + using var timer = _logger.TimeDebug( + "Processing request {Method} {ResponseId}", request.Method, + request.Id + ); + ct.Register(cts.Cancel); + // ObservableToToken(contentModifiedToken).Register(cts.Cancel); + try + { + var result = await _requestRouter.RouteRequest( + descriptor, request, cts.Token + ).ConfigureAwait(false); + return result; + } + catch (OperationCanceledException) + { + _logger.LogTrace("Request {Id} was cancelled", request.Id); + return new RequestCancelled(request.Id, request.Method); + } + catch (RpcErrorException e) + { + _logger.LogCritical( + Events.UnhandledRequest, e, + "Failed to handle request {Method} {RequestId}", request.Method, + request.Id + ); + return new RpcError( + request.Id, request.Method, + new ErrorMessage(e.Code, e.Message, e.Error) + ); + } + catch (Exception e) + { + _logger.LogCritical( + Events.UnhandledRequest, e, + "Failed to handle request {Method} {RequestId}", request.Method, + request.Id + ); + return new InternalError(request.Id, request.Method, e.ToString()); + } + } + ) + ) + .Subscribe(observer); + return new CompositeDisposable(sub, handle); + } + ) + .Select( + response => { + _outputHandler.Send(response.Value); + return Unit.Default; + } + ); + } + + private SchedulerDelegate RouteNotification( + IRequestDescriptor descriptors, + Notification notification) => + (_, scheduler) => + // ITS A RACE! + Observable.Amb( + Observable.Timer(_options.RequestTimeout, scheduler) + .Select(_ => Unit.Default) + .Do( + _ => _logger.LogTrace("Notification was cancelled due to timeout") + ), + Observable.FromAsync( + async ct => { + using var timer = _logger.TimeDebug("Processing notification {Method}", notification.Method); + try + { + await _requestRouter.RouteNotification(descriptors, notification, ct).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _logger.LogTrace("Notification was cancelled"); + } + catch (Exception e) + { + _logger.LogCritical(Events.UnhandledRequest, e, "Failed to handle request {Method}", notification.Method); + } + } + ) + ); + } +} diff --git a/src/JsonRpc/InputHandler.cs b/src/JsonRpc/InputHandler.cs index caa294af8..d2f9cdfdb 100644 --- a/src/JsonRpc/InputHandler.cs +++ b/src/JsonRpc/InputHandler.cs @@ -19,32 +19,29 @@ using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Server.Messages; -using Notification = OmniSharp.Extensions.JsonRpc.Server.Notification; namespace OmniSharp.Extensions.JsonRpc { public class InputHandler : IInputHandler, IDisposable { public static readonly byte[] HeadersFinished = - new[] { (byte) '\r', (byte) '\n', (byte) '\r', (byte) '\n' }.ToArray(); + new[] { (byte)'\r', (byte)'\n', (byte)'\r', (byte)'\n' }.ToArray(); public const int HeadersFinishedLength = 4; public static readonly char[] HeaderKeys = { '\r', '\n', ':' }; public const short MinBuffer = 21; // Minimum size of the buffer "Content-Length: X\r\n\r\n" - public static readonly byte[] ContentLength = "Content-Length".Select(x => (byte) x).ToArray(); + public static readonly byte[] ContentLength = "Content-Length".Select(x => (byte)x).ToArray(); public static readonly int ContentLengthLength = 14; private readonly PipeReader _pipeReader; private readonly IOutputHandler _outputHandler; private readonly IReceiver _receiver; - private readonly IRequestProcessIdentifier _requestProcessIdentifier; private readonly IRequestRouter _requestRouter; private readonly IResponseRouter _responseRouter; private readonly OnUnhandledExceptionHandler _unhandledInputProcessException; private readonly CreateResponseExceptionHandler? _getException; - private readonly TimeSpan _requestTimeout; private readonly ILogger _logger; - private readonly ProcessScheduler _scheduler; + private readonly RequestInvoker _requestInvoker; private readonly Memory _headersBuffer; private readonly Memory _contentLengthBuffer; private readonly byte[] _contentLengthValueBuffer; @@ -53,11 +50,12 @@ public class InputHandler : IInputHandler, IDisposable private readonly CompositeDisposable _disposable; private readonly AsyncSubject _inputActive; - private readonly ConcurrentDictionary descriptor)> _requests = - new ConcurrentDictionary descriptor)>(); + private readonly ConcurrentDictionary _requests = + new ConcurrentDictionary(); private readonly Subject> _inputQueue; + [Obsolete("Use the other constructor that takes a request invoker")] public InputHandler( PipeReader pipeReader, IOutputHandler outputHandler, @@ -72,24 +70,49 @@ public InputHandler( bool supportContentModified, int? concurrency, IScheduler scheduler + ) : this( + pipeReader, + outputHandler, + receiver, + requestRouter, + responseRouter, + new DefaultRequestInvoker( + requestRouter, + outputHandler, + requestProcessIdentifier, + new RequestInvokerOptions( + requestTimeout, + supportContentModified, + concurrency ?? 0), + loggerFactory, + scheduler), + loggerFactory, + unhandledInputProcessException, + getException) + { + } + + public InputHandler( + PipeReader pipeReader, + IOutputHandler outputHandler, + IReceiver receiver, + IRequestRouter requestRouter, + IResponseRouter responseRouter, + RequestInvoker requestInvoker, + ILoggerFactory loggerFactory, + OnUnhandledExceptionHandler unhandledInputProcessException, + CreateResponseExceptionHandler? getException ) { _pipeReader = pipeReader; _outputHandler = outputHandler; _receiver = receiver; - _requestProcessIdentifier = requestProcessIdentifier; _requestRouter = requestRouter; _responseRouter = responseRouter; + _requestInvoker = requestInvoker; _unhandledInputProcessException = unhandledInputProcessException; _getException = getException; - _requestTimeout = requestTimeout; _logger = loggerFactory.CreateLogger(); - _scheduler = new ProcessScheduler( - loggerFactory, - supportContentModified, - concurrency, - scheduler - ); _headersBuffer = new Memory(new byte[HeadersFinishedLength]); _contentLengthBuffer = new Memory(new byte[ContentLengthLength]); _contentLengthValueBuffer = new byte[20]; // Max string length of the long value @@ -100,7 +123,7 @@ IScheduler scheduler _disposable = new CompositeDisposable { Disposable.Create(() => _stopProcessing.Cancel()), _stopProcessing, - _scheduler, + _requestInvoker, }; _inputActive = new AsyncSubject(); @@ -153,7 +176,7 @@ private bool TryParseHeaders(ref ReadOnlySequence buffer, out ReadOnlySequ var rentedSpan = _headersBuffer.Span; - var start = buffer.PositionOf((byte) '\r'); + var start = buffer.PositionOf((byte)'\r'); do { if (!start.HasValue) @@ -178,7 +201,7 @@ private bool TryParseHeaders(ref ReadOnlySequence buffer, out ReadOnlySequ return true; } - start = buffer.Slice(buffer.GetPosition(HeadersFinishedLength, start.Value)).PositionOf((byte) '\r'); + start = buffer.Slice(buffer.GetPosition(HeadersFinishedLength, start.Value)).PositionOf((byte)'\r'); } while (start.HasValue && buffer.Length > MinBuffer); line = default; @@ -220,7 +243,7 @@ private bool TryParseContentLength(ref ReadOnlySequence buffer, out long l { do { - var colon = buffer.PositionOf((byte) ':'); + var colon = buffer.PositionOf((byte)':'); if (!colon.HasValue) { length = -1; @@ -239,7 +262,7 @@ private bool TryParseContentLength(ref ReadOnlySequence buffer, out long l { foreach (var t in memory.Span) { - if (t == (byte) ' ') + if (t == (byte)' ') { offset++; continue; @@ -251,10 +274,10 @@ private bool TryParseContentLength(ref ReadOnlySequence buffer, out long l var lengthSlice = buffer.Slice( buffer.GetPosition(offset, colon.Value), - buffer.PositionOf((byte) '\r') ?? buffer.End + buffer.PositionOf((byte)'\r') ?? buffer.End ); - var whitespacePosition = lengthSlice.PositionOf((byte) ' '); + var whitespacePosition = lengthSlice.PositionOf((byte)' '); if (whitespacePosition.HasValue) { lengthSlice = lengthSlice.Slice(0, whitespacePosition!.Value); @@ -275,7 +298,7 @@ private bool TryParseContentLength(ref ReadOnlySequence buffer, out long l return false; } - buffer = buffer.Slice(buffer.GetPosition(1, buffer.PositionOf((byte) '\n') ?? buffer.End)); + buffer = buffer.Slice(buffer.GetPosition(1, buffer.PositionOf((byte)'\n') ?? buffer.End)); } while (true); } @@ -429,8 +452,10 @@ private void HandleRequest(in ReadOnlySequence request) return; } - var type = _requestProcessIdentifier.Identify(descriptor.Default); - _scheduler.Add(type, $"{item.Request.Method}:{item.Request.Id}", RouteRequest(descriptor, item.Request)); + var requestHandle = _requestInvoker.InvokeRequest(descriptor, item.Request); + + _requests.TryAdd(requestHandle.Request.Id, requestHandle); + requestHandle.OnComplete += (request) => _requests.TryRemove(request.Id, out _); } catch (JsonReaderException e) { @@ -460,9 +485,9 @@ private void HandleRequest(in ReadOnlySequence request) } _logger.LogDebug("Cancelling pending request", item.Notification.Method); - if (_requests.TryGetValue(cancelParams.Id, out var d)) + if (_requests.TryGetValue(cancelParams.Id, out var requestHandle)) { - d.cancellationTokenSource.Cancel(); + requestHandle.CancellationTokenSource.Cancel(); } continue; @@ -478,9 +503,7 @@ private void HandleRequest(in ReadOnlySequence request) return; } - var type = _requestProcessIdentifier.Identify(descriptor.Default); - _scheduler.Add(type, item.Notification.Method, RouteNotification(descriptor, item.Notification)); - + _requestInvoker.InvokeNotification(descriptor, item.Notification); } catch (JsonReaderException e) { @@ -499,123 +522,6 @@ private void HandleRequest(in ReadOnlySequence request) } } - private SchedulerDelegate RouteRequest(IRequestDescriptor descriptors, Request request) - { - // start request, create cts, etc - var cts = new CancellationTokenSource(); - _requests.TryAdd(request.Id, ( cts, descriptors )); - - return (contentModifiedToken, scheduler) => - Observable.Create( - observer => { - // ITS A RACE! - var sub = Observable.Amb( - contentModifiedToken.Select( - _ => { - _logger.LogTrace( - "Request {Id} was abandoned due to content be modified", request.Id - ); - return new ErrorResponse( - new ContentModified(request.Id, request.Method) - ); - } - ), - Observable.Timer(_requestTimeout, scheduler).Select( - _ => new ErrorResponse(new RequestCancelled(request.Id, request.Method)) - ), - Observable.FromAsync( - async ct => { - using var timer = _logger.TimeDebug( - "Processing request {Method} {ResponseId}", request.Method, - request.Id - ); - ct.Register(cts.Cancel); - // ObservableToToken(contentModifiedToken).Register(cts.Cancel); - try - { - return await _requestRouter.RouteRequest( - descriptors, request, cts.Token - ).ConfigureAwait(false); - } - catch (OperationCanceledException) - { - _logger.LogTrace("Request {Id} was cancelled", request.Id); - return new RequestCancelled(request.Id, request.Method); - } - catch (RpcErrorException e) - { - _logger.LogCritical( - Events.UnhandledRequest, e, - "Failed to handle request {Method} {RequestId}", request.Method, - request.Id - ); - return new RpcError( - request.Id, request.Method, - new ErrorMessage(e.Code, e.Message, e.Error) - ); - } - catch (Exception e) - { - _logger.LogCritical( - Events.UnhandledRequest, e, - "Failed to handle request {Method} {RequestId}", request.Method, - request.Id - ); - return new InternalError(request.Id, request.Method, e.ToString()); - } - } - ) - ) - .Subscribe(observer); - return new CompositeDisposable { - sub, - Disposable.Create( - () => { - if (_requests.TryRemove(request.Id, out var v)) - { - v.cancellationTokenSource.Dispose(); - } - } - ) - }; - } - ) - .Select( - response => { - _outputHandler.Send(response.Value); - return Unit.Default; - } - ); - } - - private SchedulerDelegate RouteNotification(IRequestDescriptor descriptors, Notification notification) => - (_, scheduler) => - // ITS A RACE! - Observable.Amb( - Observable.Timer(_requestTimeout, scheduler) - .Select(_ => Unit.Default) - .Do( - _ => _logger.LogTrace("Notification was cancelled due to timeout") - ), - Observable.FromAsync( - async ct => { - using var timer = _logger.TimeDebug("Processing notification {Method}", notification.Method); - try - { - await _requestRouter.RouteNotification(descriptors, notification, ct).ConfigureAwait(false); - } - catch (OperationCanceledException) - { - _logger.LogTrace("Notification was cancelled"); - } - catch (Exception e) - { - _logger.LogCritical(Events.UnhandledRequest, e, "Failed to handle request {Method}", notification.Method); - } - } - ) - ); - private static Exception DefaultErrorParser(string? method, ServerError error, CreateResponseExceptionHandler? customHandler) => error.Error.Code switch { ErrorCodes.ServerNotInitialized => new ServerNotInitializedException(error.Id), diff --git a/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs b/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs index 1859fd078..e61f8059c 100644 --- a/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs +++ b/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs @@ -47,13 +47,25 @@ internal static IContainer AddJsonRpcServerCore(this IContainer container, Js .Type(serviceKey: nameof(options.OutputScheduler)), reuse: Reuse.Singleton ); + + container.Register( + made: new Made.TypedMade().Parameters + .Type(serviceKey: nameof(options.MaximumRequestTimeout)) + .Type(serviceKey: nameof(options.SupportsContentModified)) + .Name("concurrency", serviceKey: nameof(options.Concurrency)), + reuse: Reuse.Singleton); + + if (!container.IsRegistered()) + { + container.Register( + made: new Made.TypedMade().Parameters + .Type(serviceKey: nameof(options.InputScheduler)), + reuse: Reuse.Singleton); + } + container.Register( made: new Made.TypedMade().Parameters .Type(serviceKey: nameof(options.Input)) - .Type(serviceKey: nameof(options.MaximumRequestTimeout)) - .Type(serviceKey: nameof(options.SupportsContentModified)) - .Name("concurrency", serviceKey: nameof(options.Concurrency)) - .Type(serviceKey: nameof(options.InputScheduler)) , reuse: Reuse.Singleton ); diff --git a/src/JsonRpc/RequestCancelled.cs b/src/JsonRpc/RequestCancelled.cs index 6bda757ef..a01c991f0 100644 --- a/src/JsonRpc/RequestCancelled.cs +++ b/src/JsonRpc/RequestCancelled.cs @@ -1,15 +1,15 @@ -ο»Ώusing OmniSharp.Extensions.JsonRpc.Server; +using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Server.Messages; namespace OmniSharp.Extensions.JsonRpc { public class RequestCancelled : RpcError { - internal RequestCancelled(string method) : base(null, method, new ErrorMessage(ErrorCodes.RequestCancelled, "Request Cancelled")) + public RequestCancelled(string method) : base(null, method, new ErrorMessage(ErrorCodes.RequestCancelled, "Request Cancelled")) { } - internal RequestCancelled(object id, string method) : base(id, method, new ErrorMessage(ErrorCodes.RequestCancelled, "Request Cancelled")) + public RequestCancelled(object id, string method) : base(id, method, new ErrorMessage(ErrorCodes.RequestCancelled, "Request Cancelled")) { } } diff --git a/src/JsonRpc/RequestInvocationHandle.cs b/src/JsonRpc/RequestInvocationHandle.cs new file mode 100644 index 000000000..9377a8886 --- /dev/null +++ b/src/JsonRpc/RequestInvocationHandle.cs @@ -0,0 +1,35 @@ +ο»Ώusing System; +using System.Threading; +using OmniSharp.Extensions.JsonRpc.Server; + +namespace OmniSharp.Extensions.JsonRpc +{ + public class RequestInvocationHandle : IDisposable + { + private bool _disposed; + + public event Action? OnComplete; + + public RequestInvocationHandle(Request request) + { + Request = request; + CancellationTokenSource = new CancellationTokenSource(); + } + + public Request Request { get; } + + public CancellationTokenSource CancellationTokenSource { get; } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + + OnComplete?.Invoke(Request); + } + } +} diff --git a/src/JsonRpc/RequestInvoker.cs b/src/JsonRpc/RequestInvoker.cs new file mode 100644 index 000000000..51b721100 --- /dev/null +++ b/src/JsonRpc/RequestInvoker.cs @@ -0,0 +1,15 @@ +using System; +using OmniSharp.Extensions.JsonRpc.Server; +using Notification = OmniSharp.Extensions.JsonRpc.Server.Notification; + +namespace OmniSharp.Extensions.JsonRpc +{ + public abstract class RequestInvoker : IDisposable + { + public abstract RequestInvocationHandle InvokeRequest(IRequestDescriptor descriptor, Request request); + + public abstract void InvokeNotification(IRequestDescriptor descriptor, Notification notification); + + public abstract void Dispose(); + } +} diff --git a/src/JsonRpc/RequestInvokerOptions.cs b/src/JsonRpc/RequestInvokerOptions.cs new file mode 100644 index 000000000..47e88c0ec --- /dev/null +++ b/src/JsonRpc/RequestInvokerOptions.cs @@ -0,0 +1,23 @@ +ο»Ώusing System; + +namespace OmniSharp.Extensions.JsonRpc +{ + public sealed class RequestInvokerOptions + { + public RequestInvokerOptions( + TimeSpan requestTimeout, + bool supportContentModified, + int concurrency) + { + RequestTimeout = requestTimeout; + SupportContentModified = supportContentModified; + Concurrency = concurrency > 1 ? concurrency : null; + } + + public TimeSpan RequestTimeout { get; } + + public bool SupportContentModified { get; } + + public int? Concurrency { get; } + } +} diff --git a/src/JsonRpc/TimeLoggerExtensions.cs b/src/JsonRpc/TimeLoggerExtensions.cs index 3a8066ac6..7a84b9b0d 100644 --- a/src/JsonRpc/TimeLoggerExtensions.cs +++ b/src/JsonRpc/TimeLoggerExtensions.cs @@ -5,7 +5,7 @@ namespace OmniSharp.Extensions.JsonRpc { - internal static class TimeLoggerExtensions + public static class TimeLoggerExtensions { private class Disposable : IDisposable { diff --git a/test/JsonRpc.Tests/InputHandlerTests.cs b/test/JsonRpc.Tests/InputHandlerTests.cs index 4eb72aac5..6efb24bdf 100644 --- a/test/JsonRpc.Tests/InputHandlerTests.cs +++ b/test/JsonRpc.Tests/InputHandlerTests.cs @@ -33,26 +33,21 @@ private InputHandler NewHandler( PipeReader inputStream, IOutputHandler outputHandler, IReceiver receiver, - IRequestProcessIdentifier requestProcessIdentifier, IRequestRouter requestRouter, ILoggerFactory loggerFactory, IResponseRouter responseRouter, - IScheduler? scheduler = null + RequestInvoker requestInvoker ) => new InputHandler( inputStream, outputHandler, receiver, - requestProcessIdentifier, requestRouter, responseRouter, + requestInvoker, loggerFactory, _unhandledException, - null, - TimeSpan.FromSeconds(30), - true, - null, - scheduler ?? TaskPoolScheduler.Default + null ); [Fact] @@ -65,9 +60,9 @@ public async Task Should_Pass_In_Requests() using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); await pipe.Writer.WriteAsync(Encoding.UTF8.GetBytes("Content-Length: 2\r\n\r\n{}")); @@ -91,9 +86,9 @@ public async Task Should_Handle_Multiple_Requests_At_Once() using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); await pipe.Writer.WriteAsync( Encoding.UTF8.GetBytes("Content-Length: 2\r\n\r\n{}") @@ -133,9 +128,9 @@ public async Task Should_Handle_Different_Additional_Headers_and_Whitespace(stri using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); await pipe.Writer.WriteAsync(Encoding.UTF8.GetBytes(data)); @@ -161,9 +156,9 @@ public async Task Should_Handle_Multiple_Requests_Back_To_Back() using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); var cts = new CancellationTokenSource(); @@ -194,9 +189,9 @@ public async Task Should_Handle_Multiple_Requests_In_Pieces() using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); var cts = new CancellationTokenSource(); @@ -237,9 +232,9 @@ public async Task Should_Handle_Multiple_Chunked_Requests(string content) using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); var cts = new CancellationTokenSource(); @@ -270,9 +265,9 @@ public async Task Should_Handle_Header_Terminiator_Being_Incomplete() using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); var cts = new CancellationTokenSource(); @@ -323,9 +318,9 @@ public async Task ShouldPassAdditionalUtf8EncodedRequests(string data) using var handler = NewHandler( pipe.Reader, outputHandler, receiver, - Substitute.For(), Substitute.For>(), - _loggerFactory, Substitute.For() + _loggerFactory, Substitute.For(), + Substitute.For() ); var cts = new CancellationTokenSource(); @@ -363,13 +358,14 @@ public async Task Should_Parse_Logs(string name, Func createPipeRead var incomingRequestRouter = Substitute.For>(); var outputHandler = Substitute.For(); var responseRouter = Substitute.For(); + var requestInvoker = Substitute.For(); using var handler = NewHandler( reader, outputHandler, receiver, - new ParallelRequestProcessIdentifier(), incomingRequestRouter, _loggerFactory, - responseRouter + responseRouter, + requestInvoker ); var cts = new CancellationTokenSource(); @@ -382,20 +378,17 @@ public async Task Should_Parse_Logs(string name, Func createPipeRead { { var count = group.Count(x => x == "request"); - await incomingRequestRouter.Received(count).RouteRequest( + requestInvoker.Received(count).InvokeRequest( Arg.Any>(), - Arg.Is(n => group.Key == n.Method), - Arg.Any() + Arg.Is(n => group.Key == n.Method) ); } - { var count = group.Count(x => x == "notification"); - await incomingRequestRouter.Received(count).RouteNotification( + requestInvoker.Received(count).InvokeNotification( Arg.Any>(), - Arg.Is(n => group.Key == n.Method), - Arg.Any() + Arg.Is(n => group.Key == n.Method) ); } } diff --git a/test/Lsp.Integration.Tests/TypedCompletionTests.cs b/test/Lsp.Integration.Tests/TypedCompletionTests.cs index e39147815..ac238921a 100644 --- a/test/Lsp.Integration.Tests/TypedCompletionTests.cs +++ b/test/Lsp.Integration.Tests/TypedCompletionTests.cs @@ -228,7 +228,8 @@ public async Task Should_Resolve_With_Partial_Data_Capability() } ); - var item = await client.RequestCompletion(new CompletionParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + var completionList = await client.RequestCompletion(new CompletionParams()); + var item = completionList.First(); item = await client.ResolveCompletion(item); item.Detail.Should().Be("resolved"); From d3898cf413fa89553877a0a986fd9b535661f3d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Aug 2021 10:49:24 -0400 Subject: [PATCH 013/647] Bump husky from 7.0.1 to 7.0.2 (#643) Bumps [husky](https://github.com/typicode/husky) from 7.0.1 to 7.0.2. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v7.0.1...v7.0.2) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 873e8e3c5..c5e6bd47e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -323,9 +323,9 @@ "dev": true }, "husky": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.1.tgz", - "integrity": "sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", + "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", "dev": true }, "import-fresh": { diff --git a/package.json b/package.json index 1cdc6213f..37ba0bf64 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "husky": "^7.0.1", + "husky": "^7.0.2", "lint-staged": "^11.1.2", "prettier": "^2.3.2" } From 112f24001e9d7c7929c60fd92dcaa3ca2025ba1e Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sat, 28 Aug 2021 10:54:02 -0400 Subject: [PATCH 014/647] Updated dotnet tools (#646) --- .config/dotnet-tools.json | 78 +++++++++++++++++------------ .github/workflows/draft-release.yml | 2 +- .vscode/tasks.json | 17 ++++--- .vscode/tasks.json.old | 16 ++++++ 4 files changed, 74 insertions(+), 39 deletions(-) create mode 100644 .vscode/tasks.json.old diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 23dd823b5..19029998d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,34 +1,48 @@ { - "version": 1, - "isRoot": true, - "tools": { - "cake.tool": { - "version": "0.38.4", - "commands": ["dotnet-cake"] - }, - "gitversion.tool": { - "version": "5.3.7", - "commands": ["dotnet-gitversion"] - }, - "dotnet-reportgenerator-globaltool": { - "version": "4.6.4", - "commands": ["reportgenerator"] - }, - "codecov.tool": { - "version": "1.12.1", - "commands": ["codecov"] - }, - "nuke.globaltool": { - "version": "0.24.11", - "commands": ["nuke"] - }, - "nukeeper": { - "version": "0.33.0", - "commands": ["nukeeper"] - }, - "jetbrains.resharper.globaltools": { - "version": "2020.2.0-eap09", - "commands": ["jb"] - } + "version": 1, + "isRoot": true, + "tools": { + "cake.tool": { + "version": "1.1.0", + "commands": [ + "dotnet-cake" + ] + }, + "gitversion.tool": { + "version": "5.7.0", + "commands": [ + "dotnet-gitversion" + ] + }, + "dotnet-reportgenerator-globaltool": { + "version": "4.8.12", + "commands": [ + "reportgenerator" + ] + }, + "codecov.tool": { + "version": "1.13.0", + "commands": [ + "codecov" + ] + }, + "nuke.globaltool": { + "version": "5.3.0", + "commands": [ + "nuke" + ] + }, + "nukeeper": { + "version": "0.34.0", + "commands": [ + "nukeeper" + ] + }, + "jetbrains.resharper.globaltools": { + "version": "2021.2.1", + "commands": [ + "jb" + ] } -} + } +} \ No newline at end of file diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index bf4430144..315e6f01b 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -25,7 +25,7 @@ jobs: - name: Install GitReleaseManager uses: gittools/actions/gitreleasemanager/setup@v0.9.10 with: - versionSpec: '0.11.x' + versionSpec: '0.12.x' - name: Use GitVersion id: gitversion diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 24a22a8c6..7b49a73a6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,16 +1,21 @@ { - "version": "0.1.0", + "version": "2.0.0", "command": "dotnet", - "isShellCommand": true, "args": [], "tasks": [ { - "taskName": "build", + "label": "build", + "type": "shell", + "command": "dotnet", "args": [ + "build", "${workspaceRoot}/sample/SampleServer/SampleServer.csproj" ], - "isBuildCommand": true, - "problemMatcher": "$msCompile" + "problemMatcher": "$msCompile", + "group": { + "_id": "build", + "isDefault": false + } } ] -} \ No newline at end of file +} diff --git a/.vscode/tasks.json.old b/.vscode/tasks.json.old new file mode 100644 index 000000000..24a22a8c6 --- /dev/null +++ b/.vscode/tasks.json.old @@ -0,0 +1,16 @@ +{ + "version": "0.1.0", + "command": "dotnet", + "isShellCommand": true, + "args": [], + "tasks": [ + { + "taskName": "build", + "args": [ + "${workspaceRoot}/sample/SampleServer/SampleServer.csproj" + ], + "isBuildCommand": true, + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file From a99b6fd1130b9218466997301046bbe93c00a28c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 23:33:41 -0500 Subject: [PATCH 015/647] Bump actions/checkout from 2.3.4 to 2.4.0 (#683) Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.4.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/dependabot-merge.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 677ae4f85..5c9fd8d46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 5d59734f6..543e7ae76 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 with: fetch-depth: 0 diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml index 28515c4a5..25aeaa680 100644 --- a/.github/workflows/dependabot-merge.yml +++ b/.github/workflows/dependabot-merge.yml @@ -25,7 +25,7 @@ jobs: env: RUNNER_CONTEXT: ${{ toJson(runner) }} run: echo "$RUNNER_CONTEXT" - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2.4.0 with: ref: master - name: Dependabot Commenter diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 315e6f01b..72ecf5fe5 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index c6ec4b475..77fcaefb3 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 120c6e1c8..7ba09e71f 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: sync milestones uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.4 From ad4dedab9e9832db4a0de9b7a83ce7d43c3b8863 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 23:34:02 -0500 Subject: [PATCH 016/647] Bump Bogus from 33.0.2 to 34.0.1 (#700) Bumps [Bogus](https://github.com/bchavez/Bogus) from 33.0.2 to 34.0.1. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v33.0.2...v34.0.1) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 90a5f37bb..50e19ac9f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -41,7 +41,7 @@ - + From a18ab25a88a3d628fa9e3d6d237372588652a7d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 23:34:10 -0500 Subject: [PATCH 017/647] Bump actions/setup-dotnet from 1.8.1 to 1.9.0 (#701) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 1.8.1 to 1.9.0. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v1.8.1...v1.9.0) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c9fd8d46..e7351596b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,15 +45,15 @@ jobs: run: | git fetch --prune - name: πŸ”¨ Use .NET Core 2.1 SDK - uses: actions/setup-dotnet@v1.8.1 + uses: actions/setup-dotnet@v1.9.0 with: dotnet-version: '2.1.x' - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v1.8.1 + uses: actions/setup-dotnet@v1.9.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 5.0 SDK - uses: actions/setup-dotnet@v1.8.1 + uses: actions/setup-dotnet@v1.9.0 with: dotnet-version: '5.0.x' - name: 🎁 dotnet tool restore From bb864d738e70972188f4196423a6937bd0f69fd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 23:34:15 -0500 Subject: [PATCH 018/647] Bump prettier from 2.3.2 to 2.5.1 (#704) Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.5.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.5.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c5e6bd47e..0108fd203 100644 --- a/package-lock.json +++ b/package-lock.json @@ -603,9 +603,9 @@ } }, "prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true }, "resolve-from": { diff --git a/package.json b/package.json index 37ba0bf64..434e4b243 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "devDependencies": { "husky": "^7.0.2", "lint-staged": "^11.1.2", - "prettier": "^2.3.2" + "prettier": "^2.5.1" } } From 9ddacc09969aaf0a68a4e86ce0f85c52ba4c8877 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 23:34:30 -0500 Subject: [PATCH 019/647] Bump gittools/actions from 0.9.10 to 0.9.11 (#691) Bumps [gittools/actions](https://github.com/gittools/actions) from 0.9.10 to 0.9.11. - [Release notes](https://github.com/gittools/actions/releases) - [Commits](https://github.com/gittools/actions/compare/v0.9.10...v0.9.11) --- updated-dependencies: - dependency-name: gittools/actions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 543e7ae76..d0e2bc2c9 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -13,18 +13,18 @@ jobs: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.10 + uses: gittools/actions/gitversion/setup@v0.9.11 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.10 + uses: gittools/actions/gitreleasemanager/setup@v0.9.11 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.10 + uses: gittools/actions/gitversion/execute@v0.9.11 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 72ecf5fe5..c8ebd826a 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -18,18 +18,18 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.10 + uses: gittools/actions/gitversion/setup@v0.9.11 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.10 + uses: gittools/actions/gitreleasemanager/setup@v0.9.11 with: versionSpec: '0.12.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.10 + uses: gittools/actions/gitversion/execute@v0.9.11 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 From 19d3536bad3de783ed47b7cf0a869009a07b5bd5 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 20 Feb 2022 14:57:58 -0500 Subject: [PATCH 020/647] Move to .net 6 (#757) * Updated build and test dependencies to the latest * fixed failing generation tests, broken by formatting differences * migrated to use incremental source generators and remove cache infrastructure! * Removed nuke temp * Ignore nuke temp * Updated image path locations --- .build/.build.csproj | 3 +- .build/Build.cs | 3 +- .build/Solution.cs | 73 +- .config/dotnet-tools.json | 98 +- .editorconfig | 1193 ++++++++++++++--- .github/workflows/ci.yml | 39 +- .gitignore | 1 + .husky/pre-commit | 9 + .huskyrc | 5 - .lintstagedrc | 8 - .lintstagedrc.js | 28 + .nuke | 2 - .nuke/build.schema.json | 157 +++ .nuke/parameters.json | 4 + .prettierignore | 2 + Directory.Build.props | 8 +- Directory.Build.targets | 99 +- azure-pipelines.nuke.yml | 2 +- benchmarks/Pipeline/Pipeline.csproj | 2 +- build.cmd | 7 + build.ps1 | 45 +- build.sh | 38 +- global.json | 5 + package.json | 10 +- sample/SampleServer/SampleServer.csproj | 4 +- ...AssemblyCapabilityKeyAttributeGenerator.cs | 149 +- ...semblyJsonRpcHandlersAttributeGenerator.cs | 157 +-- .../AutoImplementParamsGenerator.cs | 178 ++- .../Cache/AddCacheSource.cs | 13 - .../Cache/CacheContainer.cs | 36 - .../Cache/CacheKeyHasher.cs | 134 -- .../Cache/CachedSourceGenerator.cs | 66 - .../Cache/IReceiverCache.cs | 18 - .../Cache/SourceTextCache.cs | 9 - .../Cache/SyntaxReceiverCache.cs | 125 -- .../Contexts/DapAttributes.cs | 8 +- .../Contexts/ExtensionMethodContext.cs | 3 +- .../Contexts/GeneratorData.cs | 45 +- .../Contexts/JsonRpcAttributes.cs | 161 ++- .../Contexts/LspAttributes.cs | 18 +- .../Contexts/NotificationItem.cs | 4 +- .../Contexts/RegistrationOptionAttributes.cs | 14 +- .../Contexts/RequestItem.cs | 4 +- .../EnumLikeStringGenerator.cs | 126 +- .../GenerateHandlerMethodsGenerator.cs | 320 ++--- .../ICompilationUnitGeneratorStrategy.cs | 3 +- ...ExtensionMethodContextGeneratorStrategy.cs | 3 +- .../IExtensionMethodGeneratorStrategy.cs | 3 +- .../JsonRpc.Generators.csproj | 6 +- .../RegistrationOptionsGenerator.cs | 551 ++++---- .../Strategies/EnsureNamespaceStrategy.cs | 3 +- .../ExtensionMethodGeneratorStrategy.cs | 4 +- .../Strategies/HandlerGeneratorStrategy.cs | 2 +- ...dlerRegistryActionContextRunnerStrategy.cs | 12 +- ...eneratorWithRegistrationOptionsStrategy.cs | 3 +- ...ratorWithoutRegistrationOptionsStrategy.cs | 3 +- ...eneratorWithRegistrationOptionsStrategy.cs | 2 +- ...ratorWithoutRegistrationOptionsStrategy.cs | 2 +- ...eneratorWithRegistrationOptionsStrategy.cs | 2 +- ...ratorWithoutRegistrationOptionsStrategy.cs | 2 +- ...RequestProxyActionContextRunnerStrategy.cs | 12 +- .../SendMethodNotificationStrategy.cs | 3 +- .../Strategies/SendMethodRequestStrategy.cs | 2 +- .../TypedDelegatingHandlerStrategy.cs | 3 +- ...rnIfResponseRouterIsNotProvidedStrategy.cs | 4 +- .../StronglyTypedGenerator.cs | 568 ++++---- .../Generation/GenerateContainerAttribute.cs | 3 +- .../Generation/GenerateTypedDataAttribute.cs | 3 +- test/Client.Tests/Client.Tests.csproj | 2 +- test/Dap.Tests/Dap.Tests.csproj | 2 +- .../AutoImplementParamsGeneratorTests.cs | 15 +- .../EnumLikeStringGeneratorTests.cs | 3 - .../GeneratedRegistrationOptionsTests.cs | 88 +- test/Generation.Tests/Generation.Tests.csproj | 3 +- test/Generation.Tests/GenerationHelpers.cs | 34 +- .../JsonRpcGenerationTests.cs | 2 - test/Generation.Tests/LspFeatureTests.cs | 28 +- .../TypedCanBeResolvedTests.cs | 224 ++-- test/JsonRpc.Tests/JsonRpc.Tests.csproj | 2 +- .../Lsp.Integration.Tests.csproj | 2 +- test/Lsp.Tests/Lsp.Tests.csproj | 2 +- 81 files changed, 2758 insertions(+), 2281 deletions(-) create mode 100644 .husky/pre-commit delete mode 100644 .huskyrc delete mode 100644 .lintstagedrc create mode 100644 .lintstagedrc.js delete mode 100644 .nuke create mode 100644 .nuke/build.schema.json create mode 100644 .nuke/parameters.json create mode 100755 build.cmd create mode 100644 global.json delete mode 100644 src/JsonRpc.Generators/Cache/AddCacheSource.cs delete mode 100644 src/JsonRpc.Generators/Cache/CacheContainer.cs delete mode 100644 src/JsonRpc.Generators/Cache/CacheKeyHasher.cs delete mode 100644 src/JsonRpc.Generators/Cache/CachedSourceGenerator.cs delete mode 100644 src/JsonRpc.Generators/Cache/IReceiverCache.cs delete mode 100644 src/JsonRpc.Generators/Cache/SourceTextCache.cs delete mode 100644 src/JsonRpc.Generators/Cache/SyntaxReceiverCache.cs diff --git a/.build/.build.csproj b/.build/.build.csproj index b3e4dba53..7233e8972 100644 --- a/.build/.build.csproj +++ b/.build/.build.csproj @@ -2,11 +2,12 @@ Exe - net5.0 + net6.0 false False CS0649;CS0169 + 1 diff --git a/.build/Build.cs b/.build/Build.cs index 836d1713f..f98da474f 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -28,8 +28,7 @@ public partial class Solution : NukeBuild, IGenerateCodeCoverageReport, IGenerateCodeCoverageSummary, IGenerateCodeCoverageBadges, - IHaveConfiguration, - ICanLint + IHaveConfiguration { /// /// Support plugins are available for: diff --git a/.build/Solution.cs b/.build/Solution.cs index 47f084d9a..5b98afc89 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -11,11 +11,11 @@ InvokeTargets = new[] { nameof(Default) }, NonEntryTargets = new[] { nameof(ICIEnvironment.CIEnvironment), - nameof(ITriggerCodeCoverageReports.Trigger_Code_Coverage_Reports), - nameof(ITriggerCodeCoverageReports.Generate_Code_Coverage_Report_Cobertura), - nameof(IGenerateCodeCoverageBadges.Generate_Code_Coverage_Badges), - nameof(IGenerateCodeCoverageReport.Generate_Code_Coverage_Report), - nameof(IGenerateCodeCoverageSummary.Generate_Code_Coverage_Summary), + nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports), + nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura), + nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges), + nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport), + nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary), nameof(Default) }, ExcludedTargets = new[] @@ -26,20 +26,24 @@ } )] [GitHubActionsSteps( - "ci", GitHubActionsImage.MacOsLatest, GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, + "ci", + GitHubActionsImage.MacOsLatest, + GitHubActionsImage.WindowsLatest, + GitHubActionsImage.UbuntuLatest, AutoGenerate = false, On = new[] { GitHubActionsTrigger.Push }, OnPushTags = new[] { "v*" }, - OnPushBranches = new[] { "master", "next" }, - OnPullRequestBranches = new[] { "master", "next" }, + OnPushBranches = new[] { "master", "main", "next" }, + OnPullRequestBranches = new[] { "master", "main", "next" }, InvokedTargets = new[] { nameof(Default) }, - NonEntryTargets = new[] { + NonEntryTargets = new[] + { nameof(ICIEnvironment.CIEnvironment), - nameof(ITriggerCodeCoverageReports.Trigger_Code_Coverage_Reports), - nameof(ITriggerCodeCoverageReports.Generate_Code_Coverage_Report_Cobertura), - nameof(IGenerateCodeCoverageBadges.Generate_Code_Coverage_Badges), - nameof(IGenerateCodeCoverageReport.Generate_Code_Coverage_Report), - nameof(IGenerateCodeCoverageSummary.Generate_Code_Coverage_Summary), + nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports), + nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura), + nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges), + nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport), + nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary), nameof(Default) }, ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) }, @@ -48,27 +52,40 @@ [PrintBuildVersion] [PrintCIEnvironment] [UploadLogs] +[TitleEvents] public partial class Solution { public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGitHubActionsConfiguration configuration) { - var buildJob = configuration.Jobs.First(z => z.Name == "Build"); + var buildJob = configuration.Jobs.OfType().First(z => z.Name == "Build"); + buildJob.FailFast = false; var checkoutStep = buildJob.Steps.OfType().Single(); // For fetch all checkoutStep.FetchDepth = 0; + buildJob.Environment["NUGET_PACKAGES"] = "${{ github.workspace }}/.nuget/packages"; buildJob.Steps.InsertRange( buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] { new RunStep("Fetch all history for all tags and branches") { Run = "git fetch --prune" }, - new SetupDotNetStep("Use .NET Core 2.1 SDK") { - DotNetVersion = "2.1.x" + new UsingStep("NuGet Cache") + { + Uses = "actions/cache@v2", + With = + { + ["path"] = "${{ github.workspace }}/.nuget/packages", + // keep in mind using central package versioning here + ["key"] = + "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Build.targets', '**/Directory.Build.props', '**/*.csproj') }}", + ["restore-keys"] = @"| + ${{ runner.os }}-nuget-" + } }, new SetupDotNetStep("Use .NET Core 3.1 SDK") { DotNetVersion = "3.1.x" }, - new SetupDotNetStep("Use .NET Core 5.0 SDK") { - DotNetVersion = "5.0.x" + new SetupDotNetStep("Use .NET Core 6.0 SDK") { + DotNetVersion = "6.0.x" }, } ); @@ -115,24 +132,6 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi } ); - - /* - - - publish: "${{ parameters.Artifacts }}/logs/" - displayName: Publish Logs - artifact: "Logs${{ parameters.Postfix }}" - condition: always() - - - publish: ${{ parameters.Coverage }} - displayName: Publish Coverage - artifact: "Coverage${{ parameters.Postfix }}" - condition: always() - - - publish: "${{ parameters.Artifacts }}/nuget/" - displayName: Publish NuGet Artifacts - artifact: "NuGet${{ parameters.Postfix }}" - condition: always() - */ return configuration; } } diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 19029998d..74333ac0c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,48 +1,54 @@ { - "version": 1, - "isRoot": true, - "tools": { - "cake.tool": { - "version": "1.1.0", - "commands": [ - "dotnet-cake" - ] - }, - "gitversion.tool": { - "version": "5.7.0", - "commands": [ - "dotnet-gitversion" - ] - }, - "dotnet-reportgenerator-globaltool": { - "version": "4.8.12", - "commands": [ - "reportgenerator" - ] - }, - "codecov.tool": { - "version": "1.13.0", - "commands": [ - "codecov" - ] - }, - "nuke.globaltool": { - "version": "5.3.0", - "commands": [ - "nuke" - ] - }, - "nukeeper": { - "version": "0.34.0", - "commands": [ - "nukeeper" - ] - }, - "jetbrains.resharper.globaltools": { - "version": "2021.2.1", - "commands": [ - "jb" - ] + "version": 1, + "isRoot": true, + "tools": { + "dotnet-outdated": { + "version": "2.11.0", + "commands": [ + "dotnet-outdated" + ] + }, + "gitversion.tool": { + "version": "5.8.2", + "commands": [ + "dotnet-gitversion" + ] + }, + "dotnet-reportgenerator-globaltool": { + "version": "5.0.4", + "commands": [ + "reportgenerator" + ] + }, + "nuke.globaltool": { + "version": "6.0.1", + "commands": [ + "nuke" + ] + }, + "codecov.tool": { + "version": "1.13.0", + "commands": [ + "codecov" + ] + }, + "jetbrains.resharper.globaltools": { + "version": "2021.3.3", + "commands": [ + "jb" + ] + }, + "dotnet-format": { + "version": "5.1.250801", + "commands": [ + "dotnet-format" + ] + }, + "nukeeper": { + "version": "0.35.0", + "commands": [ + "nukeeper" + ] + } } - } -} \ No newline at end of file +} diff --git a/.editorconfig b/.editorconfig index 81d812533..737469427 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,132 +1,1013 @@ -root=true +root = true + +[*.{cs, cshtml}] +charset = utf-8 +indent_style = space +indent_size = 4 +max_line_length = 160 +insert_final_newline = true + +[*.{js, ts, vue}] +indent_style = space +indent_size = 4 +insert_final_newline = true +max_line_length = 160 + +[*.{json, xml, yml, yaml}] +indent_style = space +indent_size = 2 +insert_final_newline = true +max_line_length = 160 + [*] -charset=utf-8 -indent_style=space -indent_size=4 -trim_trailing_whitespace=true -insert_final_newline=true -max_line_length=180 -end_of_line=crlf +#### .NET Coding Conventions #### -# Microsoft .NET properties -csharp_new_line_before_members_in_object_initializers=false -csharp_new_line_before_open_brace=types,methods,properties,indexers,events,event_accessors,control_blocks,anonymous_types,object_collections,array_initializers,local_functions -csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion -csharp_space_between_parentheses=expressions -csharp_style_expression_bodied_accessors=true:suggestion -csharp_style_expression_bodied_constructors=true:none -csharp_style_expression_bodied_indexers=true:none -csharp_style_expression_bodied_methods=true:none -csharp_style_expression_bodied_operators=true:none -csharp_style_expression_bodied_properties=true:suggestion -csharp_style_var_elsewhere=true:warning -csharp_style_var_for_built_in_types=true:warning -csharp_style_var_when_type_is_apparent=true:warning -dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:warning -dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:warning -dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:warning -dotnet_style_predefined_type_for_locals_parameters_members=true:error -dotnet_style_predefined_type_for_member_access=true:error -dotnet_style_qualification_for_event=false:warning -dotnet_style_qualification_for_field=false:warning -dotnet_style_qualification_for_method=false:warning -dotnet_style_qualification_for_property=false:warning -dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion -# Sort using and Import directives with System.* appearing first -dotnet_sort_system_directives_first=true -# Suggest more modern language features when available -dotnet_style_coalesce_expression=true:error -dotnet_style_collection_initializer=true:suggestion -dotnet_style_explicit_tuple_names=true:error -dotnet_style_null_propagation=true:warning -dotnet_style_object_initializer=true:warning - -# Naming Conventions: -# Pascal Casing -#dotnet_naming_symbols.method_and_property_symbols.applicable_kinds= method,property,enum -#dotnet_naming_symbols.method_and_property_symbols.applicable_accessibilities = * -#dotnet_naming_style.pascal_case_style.capitalization = pascal_case -csharp_style_conditional_delegate_call=true:suggestion -csharp_style_inlined_variable_declaration=true:error -csharp_style_pattern_matching_over_as_with_null_check=true:error -csharp_style_pattern_matching_over_is_with_cast_check=true:error -csharp_style_throw_expression=true:suggestion -csharp_new_line_before_catch=true -csharp_new_line_before_else=true -csharp_new_line_before_finally=true -csharp_new_line_before_members_in_anonymous_types=true +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion + +# Expression-level preferences +csharp_style_deconstructed_variable_declaration = true:warning +csharp_style_inlined_variable_declaration = true:warning +csharp_style_throw_expression = true:warning +dotnet_style_coalesce_expression = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_null_propagation = true:warning +dotnet_style_object_initializer = true:warning +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_return = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning + +# Field preferences +dotnet_style_readonly_field = true:warning + +# Parameter preferences +dotnet_code_quality_unused_parameters = non_public:suggestion + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:suggestion +csharp_style_expression_bodied_constructors = true:suggestion +csharp_style_expression_bodied_indexers = true:suggestion +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = true:suggestion +csharp_style_expression_bodied_methods = true:suggestion +csharp_style_expression_bodied_operators = true:suggestion +csharp_style_expression_bodied_properties = true:suggestion + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:warning +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_prefer_switch_expression = true:warning + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:warning + +# Modifier preferences +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public, private, protected, internal, new, abstract, virtual, sealed, static, readonly, override, extern, unsafe, volatile, async:suggestion + +# Code-block preferences +csharp_prefer_braces = true:none +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning +csharp_style_prefer_index_operator = true:warning +csharp_style_prefer_range_operator = true:warning +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion + +# 'using' directive preferences + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = false +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = no_change +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = expressions +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.type_parameter_should_be_begins_with_t.severity = suggestion +dotnet_naming_rule.type_parameter_should_be_begins_with_t.symbols = type_parameter +dotnet_naming_rule.type_parameter_should_be_begins_with_t.style = begins_with_t + +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion +dotnet_naming_rule.locals_should_be_camel_case.symbols = local +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case + +dotnet_naming_rule.static_field_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field +dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.const_field_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.const_field_should_be_pascal_case.symbols = const_field +dotnet_naming_rule.const_field_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.private_field_members_should_be_underscore_camel_case.severity = suggestion +dotnet_naming_rule.private_field_members_should_be_underscore_camel_case.symbols = private_field +dotnet_naming_rule.private_field_members_should_be_underscore_camel_case.style = _camel_case + +dotnet_naming_rule.field_should_be_camel_case.severity = suggestion +dotnet_naming_rule.field_should_be_camel_case.symbols = field +dotnet_naming_rule.field_should_be_camel_case.style = camel_case + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = * +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.local.applicable_kinds = local, local_function +dotnet_naming_symbols.local.applicable_accessibilities = * +dotnet_naming_symbols.local.required_modifiers = +dotnet_naming_symbols.type_parameter.applicable_kinds = type_parameter +dotnet_naming_symbols.type_parameter.applicable_accessibilities = * +dotnet_naming_symbols.type_parameter.required_modifiers = +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum, delegate +dotnet_naming_symbols.types.applicable_accessibilities = * +dotnet_naming_symbols.types.required_modifiers = +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = * +dotnet_naming_symbols.non_field_members.required_modifiers = +dotnet_naming_symbols.private_field.applicable_kinds = field +dotnet_naming_symbols.private_field.applicable_accessibilities = private, private_protected +dotnet_naming_symbols.private_field.required_modifiers = +dotnet_naming_symbols.field.applicable_kinds = field +dotnet_naming_symbols.field.applicable_accessibilities = public, protected, internal, protected_internal, private_protected +dotnet_naming_symbols.field.required_modifiers = +dotnet_naming_symbols.static_field.applicable_kinds = field +dotnet_naming_symbols.static_field.applicable_accessibilities = +dotnet_naming_symbols.static_field.required_modifiers = static + +dotnet_naming_symbols.const_field.applicable_kinds = field +dotnet_naming_symbols.const_field.applicable_accessibilities = * +dotnet_naming_symbols.const_field.required_modifiers = const + +# Naming styles + +# dotnet_naming_style.pascal_case.required_prefix = +# dotnet_naming_style.pascal_case.required_suffix = +# dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +# dotnet_naming_style.camel_case.required_prefix = +# dotnet_naming_style.camel_case.required_suffix = +# dotnet_naming_style.camel_case.word_separator = +dotnet_naming_style.camel_case.capitalization = camel_case + +dotnet_naming_style._camel_case.required_prefix = _ +# dotnet_naming_style._camel_case.required_suffix = +# dotnet_naming_style._camel_case.word_separator = +dotnet_naming_style._camel_case.capitalization = camel_case + +dotnet_naming_style.begins_with_i.required_prefix = I +# dotnet_naming_style.begins_with_i.required_suffix = +# dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.begins_with_t.required_prefix = T +# dotnet_naming_style.begins_with_t.required_suffix = +# dotnet_naming_style.begins_with_t.word_separator = +dotnet_naming_style.begins_with_t.capitalization = pascal_case + +dotnet_diagnostic.ide0058.severity = none + +# CodeQuality +# CA1000: Do not declare static members on generic types +# dotnet_diagnostic.CA1000.severity = warning + +# CA1001: Types that own disposable fields should be disposable +# dotnet_diagnostic.CA1001.severity = warning + +# CA1003: Use generic event handler instances +# dotnet_diagnostic.CA1003.severity = none + +# CA1008: Enums should have zero value +# dotnet_diagnostic.CA1008.severity = none + +# CA1010: Collections should implement generic interface +# dotnet_diagnostic.CA1010.severity = warning + +# CA1012: Abstract types should not have constructors +# dotnet_diagnostic.CA1012.severity = none + +# CA1014: Mark assemblies with CLSCompliant +# dotnet_diagnostic.CA1014.severity = none + +# CA1016: Mark assemblies with assembly version +# dotnet_diagnostic.CA1016.severity = warning + +# CA1017: Mark assemblies with ComVisible +# dotnet_diagnostic.CA1017.severity = none + +# CA1018: Mark attributes with AttributeUsageAttribute +# dotnet_diagnostic.CA1018.severity = warning + +# CA1019: Define accessors for attribute arguments +# dotnet_diagnostic.CA1019.severity = none + +# CA1024: Use properties where appropriate +# dotnet_diagnostic.CA1024.severity = none + +# CA1027: Mark enums with FlagsAttribute +# dotnet_diagnostic.CA1027.severity = none + +# CA1028: Enum Storage should be Int32 +# dotnet_diagnostic.CA1028.severity = warning + +# CA1030: Use events where appropriate +# dotnet_diagnostic.CA1030.severity = warning + +# CA1031: Do not catch general exception types +# dotnet_diagnostic.CA1031.severity = warning + +# CA1032: Implement standard exception constructors +# dotnet_diagnostic.CA1032.severity = warning + +# CA1033: Interface methods should be callable by child types +# dotnet_diagnostic.CA1033.severity = none + +# CA1034: Nested types should not be visible +# dotnet_diagnostic.CA1034.severity = warning + +# CA1036: Override methods on comparable types +# dotnet_diagnostic.CA1036.severity = warning + +# CA1040: Avoid empty interfaces +# dotnet_diagnostic.CA1040.severity = warning + +# CA1041: Provide ObsoleteAttribute message +# dotnet_diagnostic.CA1041.severity = warning + +# CA1043: Use Integral Or String Argument For Indexers +# dotnet_diagnostic.CA1043.severity = warning + +# CA1044: Properties should not be write only +# dotnet_diagnostic.CA1044.severity = warning + +# CA1050: Declare types in namespaces +# dotnet_diagnostic.CA1050.severity = none + +# CA1051: Do not declare visible instance fields +# dotnet_diagnostic.CA1051.severity = warning + +# CA1052: Static holder types should be Static or NotInheritable +# dotnet_diagnostic.CA1052.severity = warning + +# CA1054: Uri parameters should not be strings +# dotnet_diagnostic.CA1054.severity = warning + +# CA1055: Uri return values should not be strings +# dotnet_diagnostic.CA1055.severity = warning + +# CA1056: Uri properties should not be strings +# dotnet_diagnostic.CA1056.severity = warning + +# CA1060: Move pinvokes to native methods class +# dotnet_diagnostic.CA1060.severity = none + +# CA1061: Do not hide base class methods +# dotnet_diagnostic.CA1061.severity = warning + +# CA1062: Validate arguments of public methods +dotnet_diagnostic.ca1062.severity = none + +# CA1063: Implement IDisposable Correctly +# dotnet_diagnostic.CA1063.severity = none + +# CA1064: Exceptions should be public +# dotnet_diagnostic.CA1064.severity = warning + +# CA1065: Do not raise exceptions in unexpected locations +# dotnet_diagnostic.CA1065.severity = warning + +# CA1066: Type {0} should implement IEquatable because it overrides Equals +# dotnet_diagnostic.CA1066.severity = warning + +# CA1067: Override Object.Equals(object) when implementing IEquatable +# dotnet_diagnostic.CA1067.severity = warning + +# CA1068: CancellationToken parameters must come last +# dotnet_diagnostic.CA1068.severity = warning + +# CA1200: Avoid using cref tags with a prefix +# dotnet_diagnostic.CA1200.severity = warning + +# CA1501: Avoid excessive inheritance +# dotnet_diagnostic.CA1501.severity = none + +# CA1502: Avoid excessive complexity +# dotnet_diagnostic.CA1502.severity = none + +# CA1505: Avoid unmaintainable code +# dotnet_diagnostic.CA1505.severity = none + +# CA1506: Avoid excessive class coupling +# dotnet_diagnostic.CA1506.severity = none + +# CA1507: Use nameof to express symbol names +# dotnet_diagnostic.CA1507.severity = warning + +# CA1508: Avoid dead conditional code +# dotnet_diagnostic.CA1508.severity = none + +# CA1509: Invalid entry in code metrics rule specification file +# dotnet_diagnostic.CA1509.severity = none + +# CA1707: Identifiers should not contain underscores +# dotnet_diagnostic.CA1707.severity = none + +# CA1708: Identifiers should differ by more than case +# dotnet_diagnostic.CA1708.severity = none + +# CA1710: Identifiers should have correct suffix +# dotnet_diagnostic.CA1710.severity = warning + +# CA1711: Identifiers should not have incorrect suffix +# dotnet_diagnostic.CA1711.severity = none + +# CA1712: Do not prefix enum values with type name +# dotnet_diagnostic.CA1712.severity = warning + +# CA1714: Flags enums should have plural names +# dotnet_diagnostic.CA1714.severity = warning + +# CA1715: Identifiers should have correct prefix +# dotnet_diagnostic.CA1715.severity = warning + +# CA1716: Identifiers should not match keywords +# dotnet_diagnostic.CA1716.severity = warning + +# CA1717: Only FlagsAttribute enums should have plural names +# dotnet_diagnostic.CA1717.severity = warning + +# CA1720: Identifier contains type name +# dotnet_diagnostic.CA1720.severity = warning + +# CA1721: Property names should not match get methods +# dotnet_diagnostic.CA1721.severity = warning + +# CA1724: Type names should not match namespaces +# dotnet_diagnostic.CA1724.severity = warning + +# CA1725: Parameter names should match base declaration +# dotnet_diagnostic.CA1725.severity = none + +# CA1801: Review unused parameters +# dotnet_diagnostic.CA1801.severity = warning + +# CA1802: Use literals where appropriate +# dotnet_diagnostic.CA1802.severity = warning + +# CA1806: Do not ignore method results +# dotnet_diagnostic.CA1806.severity = warning + +# CA1812: Avoid uninstantiated internal classes +# dotnet_diagnostic.CA1812.severity = none + +# CA1814: Prefer jagged arrays over multidimensional +# dotnet_diagnostic.CA1814.severity = warning + +# CA1815: Override equals and operator equals on value types +# dotnet_diagnostic.CA1815.severity = warning + +# CA1819: Properties should not return arrays +# dotnet_diagnostic.CA1819.severity = warning + +# CA1821: Remove empty Finalizers +# dotnet_diagnostic.CA1821.severity = warning + +# CA1822: Mark members as static +# dotnet_diagnostic.CA1822.severity = warning + +# CA1823: Avoid unused private fields +# dotnet_diagnostic.CA1823.severity = warning + +# CA2007: Consider calling ConfigureAwait on the awaited task +dotnet_diagnostic.ca2007.severity = none + +# CA2119: Seal methods that satisfy private interfaces +# dotnet_diagnostic.CA2119.severity = warning + +# CA2200: Rethrow to preserve stack details. +# dotnet_diagnostic.CA2200.severity = warning + +# CA2211: Non-constant fields should not be visible +# dotnet_diagnostic.CA2211.severity = warning + +# CA2214: Do not call overridable methods in constructors +# dotnet_diagnostic.CA2214.severity = warning + +# CA2217: Do not mark enums with FlagsAttribute +# dotnet_diagnostic.CA2217.severity = none + +# CA2218: Override GetHashCode on overriding Equals +# dotnet_diagnostic.CA2218.severity = warning + +# CA2219: Do not raise exceptions in finally clauses +# dotnet_diagnostic.CA2219.severity = warning + +# CA2224: Override Equals on overloading operator equals +# dotnet_diagnostic.CA2224.severity = warning + +# CA2225: Operator overloads have named alternates +# dotnet_diagnostic.CA2225.severity = warning + +# CA2226: Operators should have symmetrical overloads +# dotnet_diagnostic.CA2226.severity = warning + +# CA2227: Collection properties should be read only +# dotnet_diagnostic.CA2227.severity = warning + +# CA2231: Overload operator equals on overriding value type Equals +# dotnet_diagnostic.CA2231.severity = warning + +# CA2234: Pass system uri objects instead of strings +# dotnet_diagnostic.CA2234.severity = warning + +# CA2244: Do not duplicate indexed element initializations +# dotnet_diagnostic.CA2244.severity = warning + +# CA2245: Do not assign a property to itself. +# dotnet_diagnostic.CA2245.severity = warning + +# CA2246: Assigning symbol and its member in the same statement. +# dotnet_diagnostic.CA2246.severity = warning + +# NetCore + +# CA1303: Do not pass literals as localized parameters +# dotnet_diagnostic.CA1303.severity = none + +# CA1304: Specify CultureInfo +# dotnet_diagnostic.CA1304.severity = none + +# CA1305: Specify IFormatProvider +# dotnet_diagnostic.CA1305.severity = none + +# CA1307: Specify StringComparison +# dotnet_diagnostic.CA1307.severity = warning + +# CA1308: Normalize strings to uppercase +# dotnet_diagnostic.CA1308.severity = warning + +# CA1309: Use ordinal stringcomparison +# dotnet_diagnostic.CA1309.severity = none + +# CA1401: P/Invokes should not be visible +# dotnet_diagnostic.CA1401.severity = warning + +# CA1810: Initialize reference type static fields inline +# dotnet_diagnostic.CA1810.severity = warning + +# CA1813: Avoid unsealed attributes +# dotnet_diagnostic.CA1813.severity = none + +# CA1816: Dispose methods should call SuppressFinalize +# dotnet_diagnostic.CA1816.severity = none + +# CA1820: Test for empty strings using string length +# dotnet_diagnostic.CA1820.severity = warning + +# CA1824: Mark assemblies with NeutralResourcesLanguageAttribute +# dotnet_diagnostic.CA1824.severity = warning + +# CA1825: Avoid zero-length array allocations. +# dotnet_diagnostic.CA1825.severity = warning + +# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly +# dotnet_diagnostic.CA1826.severity = warning + +# CA1827: Do not use Count() or LongCount() when Any() can be used +# dotnet_diagnostic.CA1827.severity = warning + +# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used +# dotnet_diagnostic.CA1828.severity = warning + +# CA1829: Use Length/Count property instead of Count() when available +# dotnet_diagnostic.CA1829.severity = warning + +# CA2000: Dispose objects before losing scope +# dotnet_diagnostic.CA2000.severity = warning + +# CA2002: Do not lock on objects with weak identity +# dotnet_diagnostic.CA2002.severity = warning + +# CA2008: Do not create tasks without passing a TaskScheduler +# dotnet_diagnostic.CA2008.severity = warning + +# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value +# dotnet_diagnostic.CA2009.severity = warning + +# CA2010: Always consume the value returned by methods marked with PreserveSigAttribute +# dotnet_diagnostic.CA2010.severity = warning + +# CA2100: Review SQL queries for security vulnerabilities +# dotnet_diagnostic.CA2100.severity = warning + +# CA2101: Specify marshaling for P/Invoke string arguments +# dotnet_diagnostic.CA2101.severity = warning + +# CA2201: Do not raise reserved exception types +# dotnet_diagnostic.CA2201.severity = none + +# CA2207: Initialize value type static fields inline +# dotnet_diagnostic.CA2207.severity = warning + +# CA2208: Instantiate argument exceptions correctly +# dotnet_diagnostic.CA2208.severity = warning + +# CA2213: Disposable fields should be disposed +# dotnet_diagnostic.CA2213.severity = warning + +# CA2216: Disposable types should declare finalizer +# dotnet_diagnostic.CA2216.severity = warning + +# CA2229: Implement serialization constructors +# dotnet_diagnostic.CA2229.severity = warning + +# CA2235: Mark all non-serializable fields +# dotnet_diagnostic.CA2235.severity = warning + +# CA2237: Mark ISerializable types with serializable +# dotnet_diagnostic.CA2237.severity = warning + +# CA2241: Provide correct arguments to formatting methods +# dotnet_diagnostic.CA2241.severity = warning + +# CA2242: Test for NaN correctly +# dotnet_diagnostic.CA2242.severity = warning + +# CA2243: Attribute string literals should parse correctly +# dotnet_diagnostic.CA2243.severity = warning + +# CA2300: Do not use insecure deserializer BinaryFormatter +# dotnet_diagnostic.CA2300.severity = none + +# CA2301: Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder +# dotnet_diagnostic.CA2301.severity = none + +# CA2302: Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize +# dotnet_diagnostic.CA2302.severity = none + +# CA2305: Do not use insecure deserializer LosFormatter +# dotnet_diagnostic.CA2305.severity = none + +# CA2310: Do not use insecure deserializer NetDataContractSerializer +# dotnet_diagnostic.CA2310.severity = none + +# CA2311: Do not deserialize without first setting NetDataContractSerializer.Binder +# dotnet_diagnostic.CA2311.severity = none + +# CA2312: Ensure NetDataContractSerializer.Binder is set before deserializing +# dotnet_diagnostic.CA2312.severity = none + +# CA2315: Do not use insecure deserializer ObjectStateFormatter +# dotnet_diagnostic.CA2315.severity = none + +# CA2321: Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver +# dotnet_diagnostic.CA2321.severity = none + +# CA2322: Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing +# dotnet_diagnostic.CA2322.severity = none + +# CA2326: Do not use TypeNameHandling values other than None +# dotnet_diagnostic.CA2326.severity = none + +# CA2327: Do not use insecure JsonSerializerSettings +# dotnet_diagnostic.CA2327.severity = none + +# CA2328: Ensure that JsonSerializerSettings are secure +# dotnet_diagnostic.CA2328.severity = none + +# CA2329: Do not deserialize with JsonSerializer using an insecure configuration +# dotnet_diagnostic.CA2329.severity = none + +# CA2330: Ensure that JsonSerializer has a secure configuration when deserializing +# dotnet_diagnostic.CA2330.severity = none + +# CA3001: Review code for SQL injection vulnerabilities +# dotnet_diagnostic.CA3001.severity = none + +# CA3002: Review code for XSS vulnerabilities +# dotnet_diagnostic.CA3002.severity = none + +# CA3003: Review code for file path injection vulnerabilities +# dotnet_diagnostic.CA3003.severity = none + +# CA3004: Review code for information disclosure vulnerabilities +# dotnet_diagnostic.CA3004.severity = none + +# CA3005: Review code for LDAP injection vulnerabilities +# dotnet_diagnostic.CA3005.severity = none + +# CA3006: Review code for process command injection vulnerabilities +# dotnet_diagnostic.CA3006.severity = none + +# CA3007: Review code for open redirect vulnerabilities +# dotnet_diagnostic.CA3007.severity = none + +# CA3008: Review code for XPath injection vulnerabilities +# dotnet_diagnostic.CA3008.severity = none + +# CA3009: Review code for XML injection vulnerabilities +# dotnet_diagnostic.CA3009.severity = none + +# CA3010: Review code for XAML injection vulnerabilities +# dotnet_diagnostic.CA3010.severity = none + +# CA3011: Review code for DLL injection vulnerabilities +# dotnet_diagnostic.CA3011.severity = none + +# CA3012: Review code for regex injection vulnerabilities +# dotnet_diagnostic.CA3012.severity = none + +# CA3061: Do Not Add Schema By URL +# dotnet_diagnostic.CA3061.severity = warning + +# CA5350: Do Not Use Weak Cryptographic Algorithms +# dotnet_diagnostic.CA5350.severity = warning + +# CA5351: Do Not Use Broken Cryptographic Algorithms +# dotnet_diagnostic.CA5351.severity = warning + +# CA5358: Do Not Use Unsafe Cipher Modes +# dotnet_diagnostic.CA5358.severity = none + +# CA5359: Do Not Disable Certificate Validation +# dotnet_diagnostic.CA5359.severity = warning + +# CA5360: Do Not Call Dangerous Methods In Deserialization +# dotnet_diagnostic.CA5360.severity = warning + +# CA5361: Do Not Disable SChannel Use of Strong Crypto +# dotnet_diagnostic.CA5361.severity = warning + +# CA5362: Do Not Refer Self In Serializable Class +# dotnet_diagnostic.CA5362.severity = none + +# CA5363: Do Not Disable Request Validation +# dotnet_diagnostic.CA5363.severity = warning + +# CA5364: Do Not Use Deprecated Security Protocols +# dotnet_diagnostic.CA5364.severity = warning + +# CA5365: Do Not Disable HTTP Header Checking +# dotnet_diagnostic.CA5365.severity = warning + +# CA5366: Use XmlReader For DataSet Read Xml +# dotnet_diagnostic.CA5366.severity = warning + +# CA5367: Do Not Serialize Types With Pointer Fields +# dotnet_diagnostic.CA5367.severity = none + +# CA5368: Set ViewStateUserKey For Classes Derived From Page +# dotnet_diagnostic.CA5368.severity = warning + +# CA5369: Use XmlReader For Deserialize +# dotnet_diagnostic.CA5369.severity = warning + +# CA5370: Use XmlReader For Validating Reader +# dotnet_diagnostic.CA5370.severity = warning + +# CA5371: Use XmlReader For Schema Read +# dotnet_diagnostic.CA5371.severity = warning + +# CA5372: Use XmlReader For XPathDocument +# dotnet_diagnostic.CA5372.severity = warning + +# CA5373: Do not use obsolete key derivation function +# dotnet_diagnostic.CA5373.severity = warning + +# CA5374: Do Not Use XslTransform +# dotnet_diagnostic.CA5374.severity = warning + +# CA5375: Do Not Use Account Shared Access Signature +# dotnet_diagnostic.CA5375.severity = none + +# CA5376: Use SharedAccessProtocol HttpsOnly +# dotnet_diagnostic.CA5376.severity = warning + +# CA5377: Use Container Level Access Policy +# dotnet_diagnostic.CA5377.severity = warning + +# CA5378: Do not disable ServicePointManagerSecurityProtocols +# dotnet_diagnostic.CA5378.severity = warning + +# CA5379: Do Not Use Weak Key Derivation Function Algorithm +# dotnet_diagnostic.CA5379.severity = warning + +# CA5380: Do Not Add Certificates To Root Store +# dotnet_diagnostic.CA5380.severity = warning + +# CA5381: Ensure Certificates Are Not Added To Root Store +# dotnet_diagnostic.CA5381.severity = warning + +# CA5382: Use Secure Cookies In ASP.Net Core +# dotnet_diagnostic.CA5382.severity = none + +# CA5383: Ensure Use Secure Cookies In ASP.Net Core +# dotnet_diagnostic.CA5383.severity = none + +# CA5384: Do Not Use Digital Signature Algorithm (DSA) +# dotnet_diagnostic.CA5384.severity = warning + +# CA5385: Use Rivest–Shamir–Adleman (RSA) Algorithm With Sufficient Key Size +# dotnet_diagnostic.CA5385.severity = warning + +# CA5386: Avoid hardcoding SecurityProtocolType value +# dotnet_diagnostic.CA5386.severity = none + +# CA5387: Do Not Use Weak Key Derivation Function With Insufficient Iteration Count +# dotnet_diagnostic.CA5387.severity = none + +# CA5388: Ensure Sufficient Iteration Count When Using Weak Key Derivation Function +# dotnet_diagnostic.CA5388.severity = none + +# CA5389: Do Not Add Archive Item's Path To The Target File System Path +# dotnet_diagnostic.CA5389.severity = none + +# CA5390: Do not hard-code encryption key +# dotnet_diagnostic.CA5390.severity = none + +# CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers +# dotnet_diagnostic.CA5391.severity = none + +# CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes +# dotnet_diagnostic.CA5392.severity = none + +# CA5393: Do not use unsafe DllImportSearchPath value +# dotnet_diagnostic.CA5393.severity = none + +# CA5394: Do not use insecure randomness +# dotnet_diagnostic.CA5394.severity = none + +# CA5395: Miss HttpVerb attribute for action methods +# dotnet_diagnostic.CA5395.severity = none + +# CA5396: Set HttpOnly to true for HttpCookie +# dotnet_diagnostic.CA5396.severity = none + +# CA5397: Do not use deprecated SslProtocols values +# dotnet_diagnostic.CA5397.severity = warning + +# CA5398: Avoid hardcoded SslProtocols values +# dotnet_diagnostic.CA5398.severity = none + +# CA5399: HttpClients should enable certificate revocation list checks +# dotnet_diagnostic.CA5399.severity = none + +# CA5400: Ensure HttpClient certificate revocation list check is not disabled +# dotnet_diagnostic.CA5400.severity = none + +# CA5401: Do not use CreateEncryptor with non-default IV +# dotnet_diagnostic.CA5401.severity = none + +# CA5402: Use CreateEncryptor with the default IV +# dotnet_diagnostic.CA5402.severity = none + +# CA5403: Do not hard-code certificate +# dotnet_diagnostic.CA5403.severity = none + +# NetFramework + +# CA1058: Types should not extend certain base types +# dotnet_diagnostic.CA1058.severity = warning + +# CA2153: Do Not Catch Corrupted State Exceptions +# dotnet_diagnostic.CA2153.severity = warning + +# CA3075: Insecure DTD processing in XML +# dotnet_diagnostic.CA3075.severity = warning + +# CA3076: Insecure XSLT script processing. +# dotnet_diagnostic.CA3076.severity = warning + +# CA3077: Insecure Processing in API Design, XmlDocument and XmlTextReader +# dotnet_diagnostic.CA3077.severity = warning + +# CA3147: Mark Verb Handlers With Validate Antiforgery Token +# dotnet_diagnostic.CA3147.severity = warning + +# PublicApi + +# RS0016: Add public types and members to the declared API +# dotnet_diagnostic.RS0016.severity = warning + +# RS0017: Remove deleted types and members from the declared API +# dotnet_diagnostic.RS0017.severity = warning + +# RS0022: Constructor make noninheritable base class inheritable +# dotnet_diagnostic.RS0022.severity = warning + +# RS0024: The contents of the public API files are invalid +# dotnet_diagnostic.RS0024.severity = warning + +# RS0025: Do not duplicate symbols in public API files +# dotnet_diagnostic.RS0025.severity = warning + +# RS0026: Do not add multiple public overloads with optional parameters +# dotnet_diagnostic.RS0026.severity = warning + +# RS0027: Public API with optional parameter(s) should have the most parameters amongst its public overloads. +# dotnet_diagnostic.RS0027.severity = warning # ReSharper properties -resharper_accessor_declaration_braces=end_of_line -resharper_align_linq_query=true -resharper_align_multiline_argument=true -resharper_align_multiline_calls_chain=true -resharper_align_multiline_extends_list=true -resharper_align_multiline_for_stmt=true -resharper_align_multiline_parameter=true -resharper_align_multiple_declaration=true -resharper_align_multline_type_parameter_constrains=true -resharper_align_multline_type_parameter_list=true -resharper_align_tuple_components=true -resharper_autodetect_indent_settings=true -resharper_constructor_or_destructor_body=expression_body -resharper_csharp_anonymous_method_declaration_braces=end_of_line -resharper_csharp_outdent_commas=true -resharper_csharp_outdent_dots=true -resharper_csharp_space_within_parentheses=true -resharper_csharp_wrap_after_declaration_lpar=true -resharper_csharp_wrap_after_invocation_lpar=true -resharper_csharp_wrap_before_binary_opsign=true -resharper_csharp_wrap_before_declaration_rpar=true -resharper_csharp_wrap_before_invocation_rpar=true -resharper_enforce_line_ending_style=true -resharper_initializer_braces=end_of_line -resharper_int_align_switch_expressions=true -resharper_int_align_switch_sections=true -resharper_keep_existing_enum_arrangement=true -resharper_keep_existing_switch_expression_arrangement=false -resharper_max_initializer_elements_on_line=2 -resharper_method_or_operator_body=expression_body -resharper_outdent_binary_ops=true -resharper_place_comments_at_first_column=true -resharper_place_simple_enum_on_single_line=true -resharper_space_around_arrow_op=true -resharper_space_within_single_line_array_initializer_braces=true -resharper_use_heuristics_for_body_style=false -resharper_use_indent_from_vs=false -resharper_wrap_lines=true -resharper_xmldoc_allow_far_alignment=true -resharper_xmldoc_attribute_style=on_single_line -resharper_xmldoc_indent_text=ZeroIndent -resharper_xmldoc_max_blank_lines_between_tags=1 -resharper_xmldoc_pi_attribute_style=on_single_line -resharper_xmldoc_space_after_last_pi_attribute=true +resharper_align_linq_query = true +resharper_align_multiline_argument = true +resharper_align_multiline_array_and_object_initializer = false +resharper_align_multiline_binary_expressions_chain = false +resharper_align_multiline_calls_chain = true +resharper_align_multiline_expression = true +resharper_align_multiline_extends_list = true +resharper_align_multiline_for_stmt = true +resharper_align_multiline_parameter = true +resharper_align_multiline_switch_expression = false +resharper_align_multiple_declaration = true +resharper_align_multline_type_parameter_constrains = true +resharper_align_multline_type_parameter_list = true +resharper_align_tuple_components = true +resharper_arguments_anonymous_function = positional +resharper_autodetect_indent_settings = true +resharper_braces_for_for = not_required +resharper_braces_for_foreach = not_required +resharper_braces_for_ifelse = not_required_for_both +resharper_braces_for_while = not_required +resharper_braces_redundant = false +resharper_constructor_or_destructor_body = block_body +resharper_continuous_indent_multiplier = 1 +resharper_cpp_empty_block_style = multiline +resharper_cpp_outdent_commas = false +resharper_cpp_outdent_dots = false +resharper_cpp_wrap_after_declaration_lpar = false +resharper_cpp_wrap_after_invocation_lpar = false +resharper_cpp_wrap_before_declaration_rpar = false +resharper_cpp_wrap_before_invocation_rpar = false +resharper_csharp_align_multiline_argument = true +resharper_csharp_align_multiline_binary_expressions_chain = true +resharper_csharp_align_multiline_expression = false +resharper_csharp_brace_style = next_line +resharper_csharp_empty_block_style = multiline +resharper_csharp_outdent_commas = true +resharper_csharp_outdent_dots = true +resharper_csharp_place_comments_at_first_column = true +resharper_csharp_wrap_after_declaration_lpar = true +resharper_csharp_wrap_after_invocation_lpar = true +resharper_csharp_wrap_before_binary_opsign = true +resharper_csharp_wrap_before_declaration_rpar = true +resharper_csharp_wrap_before_invocation_rpar = true +resharper_csharp_wrap_multiple_declaration_style = chop_if_long +resharper_empty_block_style = together_same_line +resharper_indent_anonymous_method_block = false +resharper_int_align_switch_expressions = true +resharper_int_align_switch_sections = true +resharper_keep_existing_declaration_block_arrangement = false +resharper_keep_existing_embedded_block_arrangement = false +resharper_keep_existing_enum_arrangement = true +resharper_keep_existing_invocation_parens_arrangement = true +resharper_keep_existing_linebreaks = true +resharper_keep_existing_switch_expression_arrangement = false +resharper_keep_user_linebreaks = true +resharper_max_initializer_elements_on_line = 2 +resharper_method_or_operator_body = block_body +resharper_outdent_binary_ops = true +resharper_outdent_commas = true +resharper_outdent_dots = true +resharper_space_around_arrow_op = true +resharper_space_within_single_line_array_initializer_braces = true +resharper_use_heuristics_for_body_style = true +resharper_use_indent_from_vs = false +resharper_wrap_after_declaration_lpar = true +resharper_wrap_after_invocation_lpar = true +resharper_wrap_arguments_style = wrap_if_long +resharper_wrap_before_declaration_rpar = true +resharper_wrap_before_invocation_rpar = true +resharper_wrap_chained_method_calls = wrap_if_long +resharper_wrap_multiple_declaration_style = chop_if_long +resharper_wrap_object_and_collection_initializer_style = chop_if_long +resharper_xmldoc_attribute_style = on_single_line +resharper_xmldoc_pi_attribute_style = on_single_line +resharper_xmldoc_space_after_last_pi_attribute = true +resharper_xmldoc_space_before_self_closing = true # ReSharper inspection severities -resharper_annotate_can_be_null_parameter_highlighting=warning -resharper_annotate_can_be_null_type_member_highlighting=warning -resharper_arrange_missing_parentheses_highlighting=warning -resharper_arrange_this_qualifier_highlighting=warning -resharper_built_in_type_reference_style_for_member_access_highlighting=error -resharper_built_in_type_reference_style_highlighting=error -resharper_enforce_do_while_statement_braces_highlighting=warning -resharper_enforce_fixed_statement_braces_highlighting=warning -resharper_enforce_foreach_statement_braces_highlighting=warning -resharper_enforce_for_statement_braces_highlighting=warning -resharper_enforce_if_statement_braces_highlighting=warning -resharper_enforce_lock_statement_braces_highlighting=warning -resharper_enforce_using_statement_braces_highlighting=warning -resharper_enforce_while_statement_braces_highlighting=warning -resharper_redundant_default_member_initializer_highlighting=hint -resharper_remove_redundant_braces_highlighting=warning -resharper_suggest_var_or_type_built_in_types_highlighting=warning -resharper_suggest_var_or_type_elsewhere_highlighting=warning -resharper_suggest_var_or_type_simple_types_highlighting=warning -resharper_unnecessary_whitespace_highlighting=warning -resharper_use_null_propagation_when_possible_highlighting=suggestion -resharper_web_config_module_not_resolved_highlighting=warning -resharper_web_config_type_not_resolved_highlighting=warning -resharper_web_config_wrong_module_highlighting=warning +resharper_annotate_can_be_null_parameter_highlighting = warning +resharper_annotate_can_be_null_type_member_highlighting = warning +resharper_arrange_constructor_or_destructor_body_highlighting = none +resharper_arrange_method_or_operator_body_highlighting = none +resharper_arrange_redundant_parentheses_highlighting = hint +resharper_arrange_this_qualifier_highlighting = hint +resharper_arrange_type_member_modifiers_highlighting = hint +resharper_arrange_type_modifiers_highlighting = hint +resharper_built_in_type_reference_style_for_member_access_highlighting = hint +resharper_built_in_type_reference_style_highlighting = hint +resharper_enforce_do_while_statement_braces_highlighting = warning +resharper_enforce_fixed_statement_braces_highlighting = warning +resharper_enforce_foreach_statement_braces_highlighting = warning +resharper_enforce_for_statement_braces_highlighting = warning +resharper_enforce_if_statement_braces_highlighting = warning +resharper_enforce_lock_statement_braces_highlighting = warning +resharper_enforce_using_statement_braces_highlighting = warning +resharper_enforce_while_statement_braces_highlighting = warning +resharper_redundant_base_qualifier_highlighting = warning +resharper_redundant_default_member_initializer_highlighting = hint +resharper_remove_redundant_braces_highlighting = warning +resharper_suggest_var_or_type_built_in_types_highlighting = hint +resharper_suggest_var_or_type_elsewhere_highlighting = hint +resharper_suggest_var_or_type_simple_types_highlighting = hint +resharper_unnecessary_whitespace_highlighting = warning +resharper_use_null_propagation_when_possible_highlighting = suggestion +resharper_web_config_module_not_resolved_highlighting = warning +resharper_web_config_type_not_resolved_highlighting = warning +resharper_web_config_wrong_module_highlighting = warning +resharper_partial_type_with_single_part_highlighting = none # .NET Analzyer settings # VSTHRD200: Use "Async" suffix for awaitable methods @@ -134,35 +1015,37 @@ dotnet_diagnostic.VSTHRD200.severity = none # CA2007: Do not directly await a Task dotnet_diagnostic.CA2007.severity = error -[*.{cs,cshtml}] -charset=utf-8 -indent_style=space -indent_size=4 -insert_final_newline=true - -[*.{js,ts,vue}] -indent_style=space -indent_size=4 -insert_final_newline=true - -[*.{xml,yml,yaml}] -indent_style=space -indent_size=2 -insert_final_newline=true - -[*.json] -indent_style=space -indent_size=4 -insert_final_newline=true - -[*.{xml,csproj,props,targets}] -indent_style=space - -[{*.har,*.inputactions,*.jsb2,*.jsb3,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}] -indent_style=space -indent_size=2 - -[*.{appxmanifest,asax,ascx,aspx,build,cg,cginc,compute,cs,cshtml,dtd,fs,fsi,fsscript,fsx,hlsl,hlsli,hlslinc,master,ml,mli,nuspec,razor,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}] -indent_style=space -indent_size=4 -tab_width=4 +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = true +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = true +ij_xml_text_wrap = off + +# Microsoft .NET properties +dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True +dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field +dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef +dotnet_naming_rule.unity_serialized_field_rule.severity = warning +dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style +dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols +dotnet_naming_style.lower_camel_case_style.capitalization = camel_case +dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = * +dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds = +dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field +dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance + +[*.{appxmanifest,asax,ascx,aspx,axaml,build,cg,cginc,compute,dtd,fs,fsi,fsscript,fsx,hlsl,hlsli,hlslinc,master,ml,mli,nuspec,paml,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}] +indent_style = space +indent_size = 4 +tab_width = 4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7351596b..dc540b305 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,17 +19,21 @@ name: ci on: push: branches: - - master - - next + - 'master' + - 'main' + - 'next' tags: - - v* + - 'v*' pull_request: branches: - - master - - next + - 'master' + - 'main' + - 'next' jobs: Build: + env: + NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages' strategy: fail-fast: false matrix: @@ -44,18 +48,21 @@ jobs: - name: Fetch all history for all tags and branches run: | git fetch --prune - - name: πŸ”¨ Use .NET Core 2.1 SDK - uses: actions/setup-dotnet@v1.9.0 + - name: NuGet Cache + uses: actions/cache@v2 with: - dotnet-version: '2.1.x' + path: '${{ github.workspace }}/.nuget/packages' + key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Build.targets', '**/Directory.Build.props', '**/*.csproj') }}" + restore-keys: | + ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK uses: actions/setup-dotnet@v1.9.0 with: dotnet-version: '3.1.x' - - name: πŸ”¨ Use .NET Core 5.0 SDK + - name: πŸ”¨ Use .NET Core 6.0 SDK uses: actions/setup-dotnet@v1.9.0 with: - dotnet-version: '5.0.x' + dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore run: | dotnet tool restore @@ -67,7 +74,7 @@ jobs: dotnet nuke Build --skip - name: 🚦 Test run: | - dotnet nuke Test Trigger_Code_Coverage_Reports Generate_Code_Coverage_Report_Cobertura Generate_Code_Coverage_Badges Generate_Code_Coverage_Summary Generate_Code_Coverage_Report --skip + dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip - name: πŸ“¦ Pack run: | dotnet nuke Pack --skip @@ -78,21 +85,18 @@ jobs: fail_ci_if_error: 'true' - name: 🏺 Publish logs if: always() - continue-on-error: true uses: actions/upload-artifact@v2 with: name: 'logs' path: 'artifacts/logs/' - name: 🏺 Publish coverage data if: always() - continue-on-error: true uses: actions/upload-artifact@v2 with: name: 'coverage' path: 'coverage/' - name: 🏺 Publish test data if: always() - continue-on-error: true uses: actions/upload-artifact@v2 with: name: 'test data' @@ -103,3 +107,10 @@ jobs: with: name: 'nuget' path: 'artifacts/nuget/' + Publish: + needs: + - Build + secrets: + RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}' + RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}' + uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.0 diff --git a/.gitignore b/.gitignore index 97caab569..f2f6f24b6 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ coverage.json coverage.info /codealike.json .tmp/ +.nuke/temp/ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..c6d920851 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,9 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged -d -r +dotnet nuke --generate-configuration GitHubActions_ci --host GitHubActions +git add .github/workflows/ci.yml +dotnet nuke --generate-configuration GitHubActions_ci-ignore --host GitHubActions +git add .github/workflows/ci-ignore.yml +git add .nuke/build.schema.json \ No newline at end of file diff --git a/.huskyrc b/.huskyrc deleted file mode 100644 index 80f5453bb..000000000 --- a/.huskyrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "hooks": { - "pre-commit": "lint-staged" - } -} \ No newline at end of file diff --git a/.lintstagedrc b/.lintstagedrc deleted file mode 100644 index 3dff2b2fb..000000000 --- a/.lintstagedrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "*.{cs,vb}": [ - "dotnet nuke lint --no-logo --lint-files" - ], - "*.{js,ts,jsx,tsx,json,yml,yaml}": [ - "prettier --write" - ] -} diff --git a/.lintstagedrc.js b/.lintstagedrc.js new file mode 100644 index 000000000..8403c0104 --- /dev/null +++ b/.lintstagedrc.js @@ -0,0 +1,28 @@ +function forEachChunk(chunks, callback, chunkSize = 50) { + var mappedFiles = []; + var files = chunks.concat(); + while (files.length > 0) { + var chunk = files.splice(0, chunkSize); + mappedFiles = mappedFiles.concat(callback(chunk)); + } + return mappedFiles; +} + +function cleanupcode(filenames) { + var sln = require('./.nuke/parameters.json').Solution; + return forEachChunk(filenames, chunk => [ + `dotnet jb cleanupcode ${sln} "--profile=Full Cleanup" "--disable-settings-layers=GlobalAll;GlobalPerProduct;SolutionPersonal;ProjectPersonal" "--include=${chunk.join( + ';' + )}"`, + ]); +} + +module.exports = { + '*.cs': filenames => { + return [`echo "'${filenames.join(`' '`)}'" | dotnet format --include -`].concat(cleanupcode(filenames)); + }, + '*.{csproj,targets,props,xml}': filenames => + forEachChunk(filenames, chunk => [`prettier --write '${chunk.join(`' '`)}'`]), + '*.{js,ts,jsx,tsx,json,yml,yaml}': filenames => + forEachChunk(filenames, chunk => [`prettier --write '${chunk.join(`' '`)}'`]), +}; diff --git a/.nuke b/.nuke deleted file mode 100644 index d1bf89faf..000000000 --- a/.nuke +++ /dev/null @@ -1,2 +0,0 @@ -ο»ΏLSP.sln - diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 000000000..f99d257e6 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,157 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Build Schema", + "$ref": "#/definitions/build", + "definitions": { + "build": { + "type": "object", + "properties": { + "Artifacts": { + "type": "string", + "description": "The directory where artifacts are to be dropped" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build", + "enum": [ + "Debug", + "Release" + ] + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "Coverage": { + "type": "string", + "description": "The directory where coverage artifacts are to be dropped" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "type": "string", + "description": "Host for execution. Default is 'automatic'", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "Build", + "BuildVersion", + "Clean", + "CoreBuild", + "CorePack", + "CoreRestore", + "CoreTest", + "Default", + "DotnetToolRestore", + "Generate_Code_Coverage_Badges", + "Generate_Code_Coverage_Report", + "Generate_Code_Coverage_Report_Cobertura", + "Generate_Code_Coverage_Summary", + "GenerateCodeCoverageBadges", + "GenerateCodeCoverageReport", + "GenerateCodeCoverageReportCobertura", + "GenerateCodeCoverageSummary", + "GenerateReadme", + "Pack", + "Restore", + "Test", + "Trigger_Code_Coverage_Reports", + "TriggerCodeCoverageReports" + ] + } + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "Build", + "BuildVersion", + "Clean", + "CoreBuild", + "CorePack", + "CoreRestore", + "CoreTest", + "Default", + "DotnetToolRestore", + "Generate_Code_Coverage_Badges", + "Generate_Code_Coverage_Report", + "Generate_Code_Coverage_Report_Cobertura", + "Generate_Code_Coverage_Summary", + "GenerateCodeCoverageBadges", + "GenerateCodeCoverageReport", + "GenerateCodeCoverageReportCobertura", + "GenerateCodeCoverageSummary", + "GenerateReadme", + "Pack", + "Restore", + "Test", + "Trigger_Code_Coverage_Reports", + "TriggerCodeCoverageReports" + ] + } + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + } + } + } + } +} \ No newline at end of file diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 000000000..2d4a451b6 --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,4 @@ +{ + "$schema": "./build.schema.json", + "Solution": "LSP.sln" +} \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 2faf38352..33227515d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,4 @@ azure-pipelines.nuke.yml .github/workflows/ci.yml +.github/workflows/ci-ignore.yml +.nuke/build.schema.json diff --git a/Directory.Build.props b/Directory.Build.props index 2b19c9ec0..0eaf54839 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -28,7 +28,13 @@ true - + diff --git a/Directory.Build.targets b/Directory.Build.targets index 50e19ac9f..c40b47dd6 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,53 +1,52 @@ ο»Ώ - - $(BaseIntermediateOutputPath)\GeneratedFiles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + $(BaseIntermediateOutputPath)\GeneratedFiles + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/azure-pipelines.nuke.yml b/azure-pipelines.nuke.yml index 633418b1c..308824ac0 100644 --- a/azure-pipelines.nuke.yml +++ b/azure-pipelines.nuke.yml @@ -23,7 +23,7 @@ parameters: steps: - pwsh: dotnet nuke Build --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' displayName: 'βš™ Build' - - pwsh: dotnet nuke Test Trigger_Code_Coverage_Reports Generate_Code_Coverage_Report_Cobertura Generate_Code_Coverage_Badges Generate_Code_Coverage_Summary Generate_Code_Coverage_Report --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' + - pwsh: dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' displayName: '🚦 Test' - pwsh: dotnet nuke Pack --skip --artifacts '${{ parameters.Artifacts }}' --coverage '${{ parameters.Coverage }}' --configuration '${{ parameters.Configuration }}' --verbosity '${{ parameters.Verbosity }}' displayName: 'πŸ“¦ Pack' diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 15cca63e3..0027f64e2 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -9,7 +9,7 @@ - + diff --git a/build.cmd b/build.cmd new file mode 100755 index 000000000..b08cc590f --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? + +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 index 91f068d7d..9f908eb3d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,9 +4,9 @@ Param( [string[]]$BuildArguments ) -Write-Output "Windows PowerShell $($Host.Version)" +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" -Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { exit 1 } +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent ########################################################################### @@ -14,14 +14,15 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent ########################################################################### $BuildProjectFile = "$PSScriptRoot\.build\.build.csproj" -$TempDirectory = "$PSScriptRoot\\.tmp" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" $DotNetGlobalFile = "$PSScriptRoot\\global.json" -$DotNetInstallUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" $DotNetChannel = "Current" $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_MULTILEVEL_LOOKUP = 0 ########################################################################### # EXECUTION @@ -32,37 +33,37 @@ function ExecSafe([scriptblock] $cmd) { if ($LASTEXITCODE) { exit $LASTEXITCODE } } -# If global.json exists, load expected version -if (Test-Path $DotNetGlobalFile) { - $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) - if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { - $DotNetVersion = $DotNetGlobal.sdk.version - } -} - -# If dotnet is installed locally, and expected version is not set or installation matches the expected version -if ((Get-Command "dotnet" -ErrorAction SilentlyContinue) -ne $null -and ` - (!(Test-Path variable:DotNetVersion) -or $(& dotnet --version) -eq $DotNetVersion)) { +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { $env:DOTNET_EXE = (Get-Command "dotnet").Path } else { - $DotNetDirectory = "$TempDirectory\dotnet-win" - $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" - # Download install script $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" - md -force $TempDirectory > $null + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" if (!(Test-Path variable:DotNetVersion)) { - ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } } else { - ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" } Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)" -ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false } +ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh index 25b34f4c2..75f7d9930 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -echo $(bash --version 2>&1 | head -n 1) +bash --version 2>&1 | head -n 1 set -eo pipefail SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) @@ -10,53 +10,53 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) ########################################################################### BUILD_PROJECT_FILE="$SCRIPT_DIR/.build/.build.csproj" -TEMP_DIRECTORY="$SCRIPT_DIR//.tmp" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" -DOTNET_INSTALL_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh" +DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" DOTNET_CHANNEL="Current" export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_MULTILEVEL_LOOKUP=0 ########################################################################### # EXECUTION ########################################################################### function FirstJsonValue { - perl -nle 'print $1 if m{"'$1'": "([^"\-]+)",?}' <<< ${@:2} + perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" } -# If global.json exists, load expected version -if [ -f "$DOTNET_GLOBAL_FILE" ]; then - DOTNET_VERSION=$(FirstJsonValue "version" $(cat "$DOTNET_GLOBAL_FILE")) - if [ "$DOTNET_VERSION" == "" ]; then - unset DOTNET_VERSION - fi -fi - -# If dotnet is installed locally, and expected version is not set or installation matches the expected version -if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") ]]; then +# If dotnet CLI is installed globally and it matches requested version, use for execution +if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then export DOTNET_EXE="$(command -v dotnet)" else - DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" - export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" - # Download install script DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" mkdir -p "$TEMP_DIRECTORY" curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" chmod +x "$DOTNET_INSTALL_FILE" + # If global.json exists, load expected version + if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then + DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") + if [[ "$DOTNET_VERSION" == "" ]]; then + unset DOTNET_VERSION + fi + fi + # Install by channel or version - if [ -z ${DOTNET_VERSION+x} ]; then + DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" + if [[ -z ${DOTNET_VERSION+x} ]]; then "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path else "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path fi + export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" fi echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)" -"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false +"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet "$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/global.json b/global.json new file mode 100644 index 000000000..403171d04 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "6.0.200" + } +} \ No newline at end of file diff --git a/package.json b/package.json index 434e4b243..f731e5687 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,12 @@ { "private": true, "devDependencies": { - "husky": "^7.0.2", - "lint-staged": "^11.1.2", - "prettier": "^2.5.1" + "@prettier/plugin-xml": "1.2.0", + "husky": "7.0.4", + "lint-staged": "12.3.4", + "prettier": "2.5.1" + }, + "scripts": { + "prepare": "husky install" } } diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index ce86be19e..2f6296f5d 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs b/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs index 55dd9ae7a..538a04a54 100644 --- a/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs +++ b/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs @@ -1,113 +1,84 @@ using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class AssemblyCapabilityKeyAttributeGenerator : CachedSourceGenerator + public class AssemblyCapabilityKeyAttributeGenerator : IIncrementalGenerator { - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) + public void Initialize(IncrementalGeneratorInitializationContext context) { - var namespaces = new HashSet() { "OmniSharp.Extensions.LanguageServer.Protocol" }; - var types = syntaxReceiver.FoundNodes - .Concat(syntaxReceiver.Handlers) - .Select( - options => { - var semanticModel = context.Compilation.GetSemanticModel(options.SyntaxTree); - foreach (var item in options.SyntaxTree.GetCompilationUnitRoot() - .Usings - .Where(z => z.Alias == null) - .Select(z => z.Name.ToFullString())) - { - namespaces.Add(item); - } - - var typeSymbol = semanticModel.GetDeclaredSymbol(options)!; + var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => + { + if (syntaxNode.Parent is TypeDeclarationSyntax) return false; + if (syntaxNode is TypeDeclarationSyntax { Arity: 0, BaseList: { } bl } typeDeclarationSyntax + and (ClassDeclarationSyntax or RecordDeclarationSyntax) + && !typeDeclarationSyntax.Modifiers.Any(SyntaxKind.AbstractKeyword) + && typeDeclarationSyntax.AttributeLists.ContainsAttribute("CapabilityKey") + && bl.Types.Any( + z => z.Type switch + { + SimpleNameSyntax + { + Identifier: { Text: "ICapability" or "DynamicCapability" or "IDynamicCapability" or "LinkSupportCapability" }, Arity: 0 + } => true, + _ => false + } + )) + { + return true; + } - return SyntaxFactory.Attribute( - SyntaxFactory.IdentifierName("AssemblyCapabilityKey"), SyntaxFactory.AttributeArgumentList( - SyntaxFactory.SeparatedList( - new[] { - SyntaxFactory.AttributeArgument( - SyntaxFactory.TypeOfExpression(SyntaxFactory.ParseName(typeSymbol.ToDisplayString())) - ), - }.Concat(options.AttributeLists.GetAttribute("CapabilityKey")!.ArgumentList!.Arguments) - ) - ) - ); - } - ) - .ToArray(); - if (types.Any()) - { - var cu = SyntaxFactory.CompilationUnit() - .WithUsings(SyntaxFactory.List(namespaces.OrderBy(z => z).Select(z => SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(z))))) - .AddAttributeLists( - SyntaxFactory.AttributeList( - target: SyntaxFactory.AttributeTargetSpecifier(SyntaxFactory.Token(SyntaxKind.AssemblyKeyword)), SyntaxFactory.SeparatedList(types) - ) - ) - .WithLeadingTrivia(SyntaxFactory.Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed); + return false; + }, + transform: (syntaxContext, token) => + { + var namespaces = new HashSet() { "OmniSharp.Extensions.LanguageServer.Protocol" }; + var tds = (TypeDeclarationSyntax)syntaxContext.Node; + + foreach (var item in syntaxContext.Node.SyntaxTree.GetCompilationUnitRoot() + .Usings.Where(z => z.Alias == null) + .Select(z => z.Name.ToFullString())) + { + namespaces.Add(item); + } - context.AddSource("AssemblyCapabilityKeys.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); - } - } + var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node)!; - public AssemblyCapabilityKeyAttributeGenerator() : base(() => new SyntaxReceiver(Cache)) - { + return (namespaces, Attribute(IdentifierName("AssemblyCapabilityKey"), AttributeArgumentList(SeparatedList(new[] { AttributeArgument(TypeOfExpression(ParseName(typeSymbol.ToDisplayString()))), }.Concat(tds.AttributeLists.GetAttribute("CapabilityKey")!.ArgumentList!.Arguments))))); + } + ).Collect(); + + context.RegisterSourceOutput(syntaxProvider, GenerateAssemblyCapabilityKeys); } - public static CacheContainer Cache = new(); - - public class SyntaxReceiver : SyntaxReceiverCache + private void GenerateAssemblyCapabilityKeys(SourceProductionContext context, ImmutableArray<(HashSet namespaces, AttributeSyntax attribute)> types) { - public List Handlers { get; } = new(); - - public override string? GetKey(TypeDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(TypeDeclarationSyntax syntaxNode) - { - if (syntaxNode.Parent is TypeDeclarationSyntax) return; - if (syntaxNode is ClassDeclarationSyntax or RecordDeclarationSyntax - && syntaxNode.Arity == 0 - && !syntaxNode.Modifiers.Any(SyntaxKind.AbstractKeyword) - && syntaxNode.AttributeLists.ContainsAttribute("CapabilityKey") - && syntaxNode.BaseList is { } bl && bl.Types.Any( - z => z.Type switch { - SimpleNameSyntax { Identifier: { Text: "ICapability" or "DynamicCapability" or "IDynamicCapability" or "LinkSupportCapability" }, Arity: 0 } => true, - _ => false - } - )) + var namespaces = types.Aggregate( + new HashSet(), (set, tuple) => { - Handlers.Add(syntaxNode); - } - } + foreach (var name in tuple.namespaces) + { + set.Add(name); + } - public SyntaxReceiver(CacheContainer cache) : base(cache) + return set; + } + ); + if (types.Any()) { + var cu = CompilationUnit() + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) + .AddAttributeLists(AttributeList(target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SeparatedList(types.Select(z => z.attribute)))); + + context.AddSource("AssemblyCapabilityKeys.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); } } } diff --git a/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs b/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs index 81b6f97df..9871cd1bb 100644 --- a/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs +++ b/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs @@ -1,122 +1,89 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; -using OmniSharp.Extensions.JsonRpc.Generators.Contexts; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class AssemblyJsonRpcHandlersAttributeGenerator : CachedSourceGenerator + public class AssemblyJsonRpcHandlersAttributeGenerator : IIncrementalGenerator { - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) + public void Initialize(IncrementalGeneratorInitializationContext context) { - var namespaces = new HashSet() { "OmniSharp.Extensions.JsonRpc" }; - var types = syntaxReceiver.FoundNodes - .Concat(syntaxReceiver.Handlers) - .Select( - options => { - var semanticModel = context.Compilation.GetSemanticModel(options.SyntaxTree); - var typeSymbol = semanticModel.GetDeclaredSymbol(options)!; + var syntaxProvider = context + .SyntaxProvider + .CreateSyntaxProvider( + predicate: (syntaxNode, token) => + { + if (syntaxNode.Parent is TypeDeclarationSyntax) return false; + if (syntaxNode is TypeDeclarationSyntax { Arity: 0, BaseList: { } bl } typeDeclarationSyntax + and (ClassDeclarationSyntax or RecordDeclarationSyntax) + && !typeDeclarationSyntax.Modifiers.Any(SyntaxKind.AbstractKeyword) + && typeDeclarationSyntax.AttributeLists.ContainsAttribute("Method") + && bl.Types.Any( + z => z.Type switch + { + SimpleNameSyntax { Identifier: { Text: "IJsonRpcNotificationHandler" }, Arity: 0 or 1 } => true, + SimpleNameSyntax { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => true, + SimpleNameSyntax { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 or 2 } => true, + SimpleNameSyntax { Identifier: { Text: "IJsonRpcHandler" }, Arity: 0 } => true, + _ => false + } + )) + { + return true; + } - return AttributeArgument(TypeOfExpression(ParseName(typeSymbol.ToDisplayString()))); - } - ) - .ToArray(); - if (types.Any()) - { - var cu = CompilationUnit() - .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); - while (types.Length > 0) - { - var innerTypes = types.Take(10).ToArray(); - types = types.Skip(10).ToArray(); - cu = cu.AddAttributeLists( - AttributeList( - target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), - SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))) - ) - ); - } - context.AddSource("AssemblyJsonRpcHandlers.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); - } - } + if (syntaxNode is InterfaceDeclarationSyntax { Arity: 0, BaseList: { } bl2 } interfaceDeclarationSyntax + && interfaceDeclarationSyntax.AttributeLists.ContainsAttribute("Method") + && bl2.Types.Any( + z => z.Type switch + { + SimpleNameSyntax { Identifier: { Text: "IJsonRpcNotificationHandler" }, Arity: 0 or 1 } => true, + SimpleNameSyntax { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => true, + SimpleNameSyntax { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 or 2 } => true, + SimpleNameSyntax { Identifier: { Text: "IJsonRpcHandler" }, Arity: 0 } => true, + _ => false + } + )) + { + return true; + } - public AssemblyJsonRpcHandlersAttributeGenerator() : base(() => new SyntaxReceiver(Cache)) - { - } + return false; + }, + transform: (syntaxContext, token) => AttributeArgument( + TypeOfExpression( + ParseName(syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node)!.ToDisplayString()) + ) + ) + ) + .Collect(); - public static CacheContainer Cache = new(); + context.RegisterSourceOutput(syntaxProvider, GenerateAssemblyJsonRpcHandlers); + } - public class SyntaxReceiver : SyntaxReceiverCache + private void GenerateAssemblyJsonRpcHandlers(SourceProductionContext context, ImmutableArray types) { - public List Handlers { get; } = new(); - - public override string? GetKey(TypeDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(TypeDeclarationSyntax syntaxNode) + var namespaces = new HashSet() { "OmniSharp.Extensions.JsonRpc" }; + if (types.Any()) { - if (syntaxNode.Parent is TypeDeclarationSyntax) return; - if (syntaxNode is ClassDeclarationSyntax or RecordDeclarationSyntax - && syntaxNode.Arity == 0 - && !syntaxNode.Modifiers.Any(SyntaxKind.AbstractKeyword) - && syntaxNode.AttributeLists.ContainsAttribute("Method") - && syntaxNode.BaseList is { } bl && bl.Types.Any( - z => z.Type switch { - SimpleNameSyntax { Identifier: { Text: "IJsonRpcNotificationHandler" }, Arity: 0 or 1 } => true, - SimpleNameSyntax { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => true, - SimpleNameSyntax { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 or 2 } => true, - SimpleNameSyntax { Identifier: { Text: "IJsonRpcHandler" }, Arity: 0 } => true, - _ => false - } - )) - { - Handlers.Add(syntaxNode); - } - - if (syntaxNode is InterfaceDeclarationSyntax - && syntaxNode.Arity == 0 - && syntaxNode.AttributeLists.ContainsAttribute("Method") - && syntaxNode.BaseList is { } bl2 && bl2.Types.Any( - z => z.Type switch { - SimpleNameSyntax { Identifier: { Text: "IJsonRpcNotificationHandler" }, Arity: 0 or 1 } => true, - SimpleNameSyntax { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => true, - SimpleNameSyntax { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 or 2 } => true, - SimpleNameSyntax { Identifier: { Text: "IJsonRpcHandler" }, Arity: 0 } => true, - _ => false - } - )) + var cu = CompilationUnit() + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))); + while (types.Length > 0) { - Handlers.Add(syntaxNode); + var innerTypes = types.Take(10).ToArray(); + types = types.Skip(10).ToImmutableArray(); + cu = cu.AddAttributeLists(AttributeList(target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))))); } - } - public SyntaxReceiver(CacheContainer cache) : base(cache) - { + context.AddSource("AssemblyJsonRpcHandlers.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); } } } diff --git a/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs b/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs index 541aa1c2b..74287848d 100644 --- a/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs +++ b/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -5,69 +6,84 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using static OmniSharp.Extensions.JsonRpc.Generators.CommonElements; namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class AutoImplementParamsGenerator : CachedSourceGenerator + public class AutoImplementParamsGenerator : IIncrementalGenerator { - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) + public void Initialize(IncrementalGeneratorInitializationContext context) { - foreach (var candidate in syntaxReceiver.Candidates) - { - var members = new List(); - var model = context.Compilation.GetSemanticModel(candidate.SyntaxTree); - var symbol = model.GetDeclaredSymbol(candidate); - if (symbol is null) continue; + var _attributes = "Method,RegistrationOptions"; + var _interfaces = "IPartialItemsRequest,IPartialItemRequest,IWorkDoneProgressParams,IHandlerIdentity"; - var autoImplementProperties = AutoImplementInterfaces(candidate, symbol).ToArray(); - if (autoImplementProperties is { Length: > 0 }) + var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => { - var extendedParams = candidate - .WithAttributeLists(List()) - .WithMembers(List(autoImplementProperties)) - .WithConstraintClauses(List()) - .WithBaseList(null); - members.Add(extendedParams); - } + if (syntaxNode is TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) + && ( typeDeclarationSyntax.AttributeLists.ContainsAttribute(_attributes) + || typeDeclarationSyntax.BaseList?.Types.Any(type => type.Type.GetSyntaxName() is { } n && _interfaces.Contains(n)) == true + ) + ) + { + return true; + } - if (members.Count == 0) continue; + return false; + }, transform: (syntaxContext, token) => { return syntaxContext; } + ); - if (!candidate.Modifiers.Any(z => z.IsKind(SyntaxKind.PartialKeyword))) - { - cacheDiagnostic(candidate, static c => Diagnostic.Create(GeneratorDiagnostics.MustBePartial, c.Identifier.GetLocation(), c.Identifier.Text)); - } - var cu = CompilationUnit( - List(), - List(candidate.SyntaxTree.GetCompilationUnitRoot().Usings), - List(), - SingletonList( - NamespaceDeclaration(ParseName(symbol.ContainingNamespace.ToDisplayString())) - .WithMembers(List(members)) - ) - ) - .AddUsings(UsingDirective(ParseName("OmniSharp.Extensions.LanguageServer.Protocol.Serialization"))) - .WithLeadingTrivia() - .WithTrailingTrivia() - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool), Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true))) - .WithTrailingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)), CarriageReturnLineFeed); + context.RegisterSourceOutput(syntaxProvider, GenerateAutoImplementedInterfaces); + } - addCacheSource( - $"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}{( candidate.Arity > 0 ? candidate.Arity.ToString() : "" )}.cs", - candidate, - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); + private static void GenerateAutoImplementedInterfaces(SourceProductionContext context, GeneratorSyntaxContext syntaxContext) + { + var candidate = (TypeDeclarationSyntax)syntaxContext.Node; + var members = new List(); + var model = syntaxContext.SemanticModel; + var symbol = model.GetDeclaredSymbol(candidate); + if (symbol is null) return; + + var autoImplementProperties = AutoImplementInterfaces(candidate, symbol).ToArray(); + if (autoImplementProperties is { Length: > 0 }) + { + var extendedParams = candidate.WithAttributeLists(List()) + .WithMembers(List(autoImplementProperties)) + .WithConstraintClauses(List()) + .WithBaseList(null); + members.Add(extendedParams); } + + if (members.Count == 0) return; + + if (!candidate.Modifiers.Any(z => z.IsKind(SyntaxKind.PartialKeyword))) + { + context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.MustBePartial, candidate.Identifier.GetLocation(), candidate.Identifier.Text)); + } + + var cu = CompilationUnit( + List(), List(candidate.SyntaxTree.GetCompilationUnitRoot().Usings), List(), + SingletonList( + NamespaceDeclaration(ParseName(symbol.ContainingNamespace.ToDisplayString())) + .WithMembers(List(members)) + ) + ) + .AddUsings(UsingDirective(ParseName("OmniSharp.Extensions.LanguageServer.Protocol.Serialization"))) + .WithLeadingTrivia() + .WithTrailingTrivia() + .WithLeadingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true))) + .WithTrailingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true))); + + context.AddSource( + $"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}{( candidate.Arity > 0 ? candidate.Arity.ToString() : "" )}.cs", + cu.NormalizeWhitespace().GetText(Encoding.UTF8) + ); } - private static IEnumerable AutoImplementInterfaces(TypeDeclarationSyntax syntax, INamedTypeSymbol symbol) + private static IEnumerable AutoImplementInterfaces(BaseTypeDeclarationSyntax syntax, INamedTypeSymbol symbol) { if (syntax.BaseList?.Types.Any(z => z.Type.GetSyntaxName() is "IWorkDoneProgressParams") == true && symbol.GetMembers("WorkDoneToken").IsEmpty) @@ -93,19 +109,27 @@ private static IEnumerable AutoImplementInterfaces(Type yield return PropertyDeclaration(PredefinedType(Token(SyntaxKind.StringKeyword)), Identifier("__identity")) .WithAttributeLists( List( - new[] { + new[] + { AttributeList( SeparatedList( - new[] { + new[] + { Attribute(IdentifierName("JsonProperty")) .WithArgumentList( AttributeArgumentList( SeparatedList( - new[] { - AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal("$$__handler_id__$$"))), + new[] + { + AttributeArgument( + LiteralExpression( + SyntaxKind.StringLiteralExpression, Literal("$$__handler_id__$$") + ) + ), AttributeArgument( MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, IdentifierName("DefaultValueHandling"), + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("DefaultValueHandling"), IdentifierName("Ignore") ) ) @@ -137,57 +161,5 @@ private static IEnumerable AutoImplementInterfaces(Type .WithAccessorList(GetInitAccessor); } } - - public AutoImplementParamsGenerator() : base(() => new SyntaxReceiver(Cache)) - { - } - - public static CacheContainer Cache = new(); - - public class SyntaxReceiver : SyntaxReceiverCache - { - private readonly string _attributes; - private readonly string _interfaces; - public List Candidates { get; } = new(); - - public SyntaxReceiver(CacheContainer cacheContainer) : base(cacheContainer) - { - _attributes = "Method,RegistrationOptions"; - _interfaces = "IPartialItemsRequest,IPartialItemRequest,IWorkDoneProgressParams,IHandlerIdentity"; - } - - public override string? GetKey(TypeDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - foreach (var item in syntax.Members.OfType().Select(z => z.Identifier.Text)) - { - hasher.Append(item); - } - - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(TypeDeclarationSyntax syntaxNode) - { - // any field with at least one attribute is a candidate for property generation - if (syntaxNode is ClassDeclarationSyntax or RecordDeclarationSyntax - && ( syntaxNode.AttributeLists.ContainsAttribute(_attributes) - || syntaxNode.BaseList?.Types.Any(type => type.Type.GetSyntaxName() is { } n && _interfaces.Contains(n)) == true - ) - ) - { - Candidates.Add(syntaxNode); - } - } - } } } diff --git a/src/JsonRpc.Generators/Cache/AddCacheSource.cs b/src/JsonRpc.Generators/Cache/AddCacheSource.cs deleted file mode 100644 index e593a0c81..000000000 --- a/src/JsonRpc.Generators/Cache/AddCacheSource.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - public delegate void AddCacheSource(string hintName, T syntaxNode, SourceText sourceText) where T : SyntaxNode; - - public delegate void ReportCacheDiagnostic(T syntaxNode, CacheDiagnosticFactory diagnostic) where T : SyntaxNode; - - public delegate Diagnostic CacheDiagnosticFactory(T syntaxNode) where T : SyntaxNode; - - public delegate Location LocationFactory(T syntaxNode) where T : SyntaxNode; -} diff --git a/src/JsonRpc.Generators/Cache/CacheContainer.cs b/src/JsonRpc.Generators/Cache/CacheContainer.cs deleted file mode 100644 index 7b8084630..000000000 --- a/src/JsonRpc.Generators/Cache/CacheContainer.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Immutable; -using System.Threading; -using Microsoft.CodeAnalysis; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - public class CacheContainer where T : SyntaxNode - { - private ImmutableDictionary> _sourceTexts; - private ImmutableDictionary>> _cacheDiagnostics; - - public CacheContainer() - { - _sourceTexts = ImmutableDictionary>.Empty; - _cacheDiagnostics = ImmutableDictionary>>.Empty; - } - - public ImmutableDictionary> SourceTexts => _sourceTexts; - public ImmutableDictionary>> Diagnostics => _cacheDiagnostics; - - public void Swap( - ImmutableDictionary.Builder sources)>.Builder foundCache, - ImmutableDictionary>.Builder>.Builder diagnosticFactories - ) - { - Interlocked.Exchange( - ref _sourceTexts, - foundCache.ToImmutableDictionary(z => z.Key, z => z.Value.sources.ToImmutable()) - ); - Interlocked.Exchange( - ref _cacheDiagnostics, - diagnosticFactories.ToImmutableDictionary(z => z.Key, z => z.Value.ToImmutable()) - ); - } - } -} diff --git a/src/JsonRpc.Generators/Cache/CacheKeyHasher.cs b/src/JsonRpc.Generators/Cache/CacheKeyHasher.cs deleted file mode 100644 index 2061cbbee..000000000 --- a/src/JsonRpc.Generators/Cache/CacheKeyHasher.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - class CacheKeyHasher : IDisposable - { - public static bool Cache = true; - private readonly SHA1 _hasher; - - public CacheKeyHasher() - { - _hasher = SHA1.Create(); - } - - public void Append(string textToHash) - { - var inputBuffer = Encoding.UTF8.GetBytes(textToHash); - _hasher.TransformBlock(inputBuffer, 0, inputBuffer.Length, inputBuffer, 0); - } - - public void Append(TypeSyntax? typeSyntax) - { - if (typeSyntax?.GetSyntaxName() is { } a) - { - Append(a); - } - - if (typeSyntax is GenericNameSyntax gns) - { - foreach (var item in gns.TypeArgumentList.Arguments) - { - Append(item); - } - } - } - - public void Append(TypeParameterListSyntax? typeParameterListSyntax) - { - if (typeParameterListSyntax is null or { Parameters: { Count: 0 } }) return; - foreach (var item in typeParameterListSyntax.Parameters) - { - Append(item.Identifier.Text); - Append(item.AttributeLists); - } - } - - public void Append(BaseListSyntax? baseListSyntax) - { - if (baseListSyntax is null) return; - foreach (var item in baseListSyntax.Types) - { - Append(item.Type); - } - } - - public void Append(SyntaxList attributeList) - { - foreach (var item in attributeList) - { - Append(item); - } - } - - public void Append(SyntaxList items) - where T : MemberDeclarationSyntax - { - if (items is { Count: 0 }) return; - foreach (var item in items.OfType()) - { - Append(item.AttributeLists); - if (item is PropertyDeclarationSyntax p) - { - Append(p.Identifier.Text); - Append(p.Type); - } - } - } - - public void Append(AttributeListSyntax attributeList) - { - if (attributeList is { Attributes: { Count: 0 } }) return; - foreach (var item in attributeList.Attributes) - { - Append(item); - } - } - - public void Append(AttributeSyntax attribute) - { - Append(attribute.Name.GetSyntaxName() ?? string.Empty); - if (attribute.ArgumentList?.Arguments is { Count: > 0 } arguments) - { - foreach (var item in arguments) - { - if (item.NameEquals is { }) - { - Append(item.NameEquals.Name.GetSyntaxName() ?? string.Empty); - } - - Append( - item switch { - { Expression: TypeOfExpressionSyntax tyof } => tyof.Type.GetSyntaxName() is { Length: > 0 } name ? name : string.Empty, - { Expression: LiteralExpressionSyntax { } literal } => literal.Token.Text, - _ => string.Empty - } - ); - } - } - } - - private string ConvertByteArrayToString() - { - _hasher.TransformFinalBlock(Array.Empty(), 0, 0); - var sb = new StringBuilder(); - foreach (var b in _hasher.Hash) - { - sb.Append(b.ToString("X2")); - } - - return sb.ToString(); - } - - public override string ToString() => ConvertByteArrayToString(); - - public static implicit operator string(CacheKeyHasher value) => value.ToString(); - - public void Dispose() => _hasher.Dispose(); - } -} diff --git a/src/JsonRpc.Generators/Cache/CachedSourceGenerator.cs b/src/JsonRpc.Generators/Cache/CachedSourceGenerator.cs deleted file mode 100644 index 1f1cd0c42..000000000 --- a/src/JsonRpc.Generators/Cache/CachedSourceGenerator.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using Microsoft.CodeAnalysis; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - /// - /// We're not supposed to do this... but in realistic. - /// - public abstract class CachedSourceGenerator : ISourceGenerator - where T : ISyntaxReceiver, IReceiverCache - where TSyntax : SyntaxNode - { - private readonly Func _syntaxReceiverFactory; - - public CachedSourceGenerator(Func syntaxReceiverFactory) - { - _syntaxReceiverFactory = syntaxReceiverFactory; - } - - public void Initialize(GeneratorInitializationContext context) - { - context.RegisterForSyntaxNotifications(() => _syntaxReceiverFactory()); - } - - public void Execute(GeneratorExecutionContext context) - { - if (!( context.SyntaxReceiver is T syntaxReceiver )) return; - - syntaxReceiver.Start(context); - Execute( - context, syntaxReceiver, - (name, node, text) => { - context.AddSource(name, text); - - if (CacheKeyHasher.Cache) - { - syntaxReceiver.AddCacheSource(name, node, text); - } - }, - (node, diagnostic) => { - context.ReportDiagnostic(diagnostic(node)); - - if (CacheKeyHasher.Cache) - { - syntaxReceiver.ReportCacheDiagnostic(node, diagnostic); - } - } - ); - foreach (var item in syntaxReceiver.CachedSources) - { - context.AddSource(item.Name, item.SourceText); - } - - foreach (var item in syntaxReceiver.CachedDiagnostics) - { - context.ReportDiagnostic(item); - } - - syntaxReceiver.Finish(context); - } - - protected abstract void Execute( - GeneratorExecutionContext context, T syntaxReceiver, AddCacheSource addCacheSource, ReportCacheDiagnostic cacheDiagnostic - ); - } -} diff --git a/src/JsonRpc.Generators/Cache/IReceiverCache.cs b/src/JsonRpc.Generators/Cache/IReceiverCache.cs deleted file mode 100644 index d1e72827e..000000000 --- a/src/JsonRpc.Generators/Cache/IReceiverCache.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - public interface IReceiverCache - where T : SyntaxNode - { - string? GetKey(T syntax); - void Start(GeneratorExecutionContext context); - void Finish(GeneratorExecutionContext context); - IEnumerable CachedSources { get; } - IEnumerable CachedDiagnostics { get; } - void AddCacheSource(string hintName, T syntaxNode, SourceText sourceText); - void ReportCacheDiagnostic(T syntaxNode, CacheDiagnosticFactory diagnostic); - } -} diff --git a/src/JsonRpc.Generators/Cache/SourceTextCache.cs b/src/JsonRpc.Generators/Cache/SourceTextCache.cs deleted file mode 100644 index 6abdd658f..000000000 --- a/src/JsonRpc.Generators/Cache/SourceTextCache.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Immutable; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - public record SourceTextCache(string Name, SourceText SourceText); - public record DiagnosticCache(ImmutableArray> Diagnostics) where T : SyntaxNode; -} diff --git a/src/JsonRpc.Generators/Cache/SyntaxReceiverCache.cs b/src/JsonRpc.Generators/Cache/SyntaxReceiverCache.cs deleted file mode 100644 index 5620f5b6b..000000000 --- a/src/JsonRpc.Generators/Cache/SyntaxReceiverCache.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; - -namespace OmniSharp.Extensions.JsonRpc.Generators.Cache -{ - public abstract class SyntaxReceiverCache : IReceiverCache, ISyntaxReceiver - where T : SyntaxNode - { - private readonly CacheContainer _cache; - private readonly ImmutableDictionary.Builder sources)>.Builder _foundSourceTexts; - private readonly ImmutableDictionary>.Builder>.Builder _foundDiagnosticFactories; - private readonly List _cachedSources = new(); - private readonly List _cachedDiagnostics = new(); - private readonly List _foundNodes = new(); - - protected SyntaxReceiverCache(CacheContainer cache) - { - _cache = cache; - _foundSourceTexts = ImmutableDictionary.Builder sources)>.Empty.ToBuilder(); - _foundDiagnosticFactories = ImmutableDictionary>.Builder>.Empty.ToBuilder(); - } - - public abstract string? GetKey(T syntax); - - public void Start(GeneratorExecutionContext context) - { - // TODO: Check if options disable cache - try - { - // check stuff - _cache.Swap(_foundSourceTexts, _foundDiagnosticFactories); - } - catch - { - _cachedSources.Clear(); - _cachedDiagnostics.Clear(); - foreach (var found in _foundSourceTexts.Values) - { - OnVisitNode(found.Item1); - } - } - } - - public void Finish(GeneratorExecutionContext context) - { - // TODO: Check if options disable cache - try - { - // check stuff - _cache.Swap(_foundSourceTexts, _foundDiagnosticFactories); - } - catch - { - _cache.Swap( - ImmutableDictionary.Builder sources)>.Empty.ToBuilder(), - ImmutableDictionary>.Builder>.Empty.ToBuilder() - ); - } - } - - public IEnumerable CachedSources => _cachedSources; - public IEnumerable CachedDiagnostics => _cachedDiagnostics; - public IEnumerable FoundNodes => _foundNodes; - - public void OnVisitSyntaxNode(SyntaxNode syntaxNode) - { - if (syntaxNode is not T v) return; - if (GetKey(v) is { } key) - { - if (_cache.SourceTexts.TryGetValue(key, out var cacheValue)) - { - _foundSourceTexts.Add(key, ( v, cacheValue.ToBuilder() )); - _cachedSources.AddRange(cacheValue); - } - - if (_cache.Diagnostics.TryGetValue(key, out var diagnostics)) - { - _foundDiagnosticFactories.Add(key, diagnostics.ToBuilder()); - _cachedDiagnostics.AddRange(diagnostics.Select(f => f(v))); - } - - if (_foundSourceTexts.ContainsKey(key) || _foundDiagnosticFactories.ContainsKey(key)) - { - _foundNodes.Add(v); - return; - } - } - - OnVisitNode(v); - } - - public void AddCacheSource(string hintName, T syntaxNode, SourceText sourceText) - { - if (GetKey(syntaxNode) is not { } key) return; - if (!_foundSourceTexts.TryGetValue(key, out var data)) - { - var array = ImmutableArray.Create(new SourceTextCache(hintName, sourceText)).ToBuilder(); - _foundSourceTexts.Add(key, ( syntaxNode, array )); - } - else - { - data.sources.Add(new SourceTextCache(hintName, sourceText)); - } - } - - public void ReportCacheDiagnostic(T syntaxNode, CacheDiagnosticFactory diagnostic) - { - if (GetKey(syntaxNode) is not { } key) return; - if (!_foundDiagnosticFactories.TryGetValue(key, out var array)) - { - array = ImmutableArray.Create(diagnostic).ToBuilder(); - _foundDiagnosticFactories.Add(key, array); - } - else - { - array.Add(diagnostic); - } - } - - public abstract void OnVisitNode(T syntaxNode); - } -} diff --git a/src/JsonRpc.Generators/Contexts/DapAttributes.cs b/src/JsonRpc.Generators/Contexts/DapAttributes.cs index 1f55ce153..d081deade 100644 --- a/src/JsonRpc.Generators/Contexts/DapAttributes.cs +++ b/src/JsonRpc.Generators/Contexts/DapAttributes.cs @@ -1,16 +1,14 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; namespace OmniSharp.Extensions.JsonRpc.Generators.Contexts { record DapAttributes { public static DapAttributes? Parse( - GeneratorExecutionContext context, - AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic, - TypeDeclarationSyntax syntax, + Compilation compilation, + TypeDeclarationSyntax candidateClass, + SemanticModel model, INamedTypeSymbol symbol ) { diff --git a/src/JsonRpc.Generators/Contexts/ExtensionMethodContext.cs b/src/JsonRpc.Generators/Contexts/ExtensionMethodContext.cs index 3dc33a5df..49e08ae49 100644 --- a/src/JsonRpc.Generators/Contexts/ExtensionMethodContext.cs +++ b/src/JsonRpc.Generators/Contexts/ExtensionMethodContext.cs @@ -9,8 +9,7 @@ record ExtensionMethodContext( TypeDeclarationSyntax TypeDeclaration, INamedTypeSymbol TypeSymbol, TypeSyntax Item, - ImmutableArray RelatedItems, - GeneratorExecutionContext Context + ImmutableArray RelatedItems ) { public bool IsProxy { get; init; } diff --git a/src/JsonRpc.Generators/Contexts/GeneratorData.cs b/src/JsonRpc.Generators/Contexts/GeneratorData.cs index a5cd7f311..8af0444e6 100644 --- a/src/JsonRpc.Generators/Contexts/GeneratorData.cs +++ b/src/JsonRpc.Generators/Contexts/GeneratorData.cs @@ -1,10 +1,9 @@ +using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Text; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using static OmniSharp.Extensions.JsonRpc.Generators.Helpers; namespace OmniSharp.Extensions.JsonRpc.Generators.Contexts @@ -21,38 +20,23 @@ abstract record GeneratorData( HashSet AdditionalUsings, List AssemblyJsonRpcHandlersAttributeArguments, SemanticModel Model, - GeneratorExecutionContext Context + Compilation Compilation ) { - private AddCacheSource AddCacheSourceDelegate { get; init; } - private ReportCacheDiagnostic CacheDiagnosticDelegate { get; init; } - - public void AddSource(string hintName, SourceText sourceText) - { - AddCacheSourceDelegate(hintName, TypeDeclaration, sourceText); - } - - public void ReportDiagnostic(CacheDiagnosticFactory diagnostic) - { - CacheDiagnosticDelegate(TypeDeclaration, diagnostic); - } - public static GeneratorData? Create( - GeneratorExecutionContext context, + Compilation compilation, TypeDeclarationSyntax candidateClass, - AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic, + SemanticModel model, HashSet additionalUsings ) { - var model = context.Compilation.GetSemanticModel(candidateClass.SyntaxTree); - var symbol = model.GetDeclaredSymbol(candidateClass); + var symbol = model.GetDeclaredSymbol(candidateClass) is { } nts ? nts : null; if (symbol == null) return null; var requestType = GetRequestType(candidateClass, symbol); if (requestType == null) return null; - var jsonRpcAttributes = JsonRpcAttributes.Parse(context, addCacheSource, cacheDiagnostic, candidateClass, symbol, additionalUsings); - var lspAttributes = LspAttributes.Parse(context, addCacheSource, cacheDiagnostic, candidateClass, symbol); - var dapAttributes = DapAttributes.Parse(context, addCacheSource, cacheDiagnostic, candidateClass, symbol); + var jsonRpcAttributes = JsonRpcAttributes.Parse(compilation, candidateClass, model, symbol, additionalUsings); + var lspAttributes = LspAttributes.Parse(compilation, candidateClass, model, symbol); + var dapAttributes = DapAttributes.Parse(compilation, candidateClass, model, symbol); additionalUsings.Add(jsonRpcAttributes.HandlerNamespace); additionalUsings.Add(jsonRpcAttributes.ModelNamespace); @@ -75,9 +59,8 @@ HashSet additionalUsings GetPartialItems(candidateClass, symbol, requestType), additionalUsings, new List(), - model, - context - ) { CacheDiagnosticDelegate = cacheDiagnostic, AddCacheSourceDelegate = addCacheSource }; + model, compilation + ); } if (IsNotification(candidateClass)) @@ -93,9 +76,8 @@ HashSet additionalUsings GetRegistrationOptions(candidateClass, symbol, lspAttributes), additionalUsings, new List(), - model, - context - ) { CacheDiagnosticDelegate = cacheDiagnostic, AddCacheSourceDelegate = addCacheSource }; + model, compilation + ); } return null; @@ -109,8 +91,7 @@ HashSet additionalUsings && tds.AttributeLists.ContainsAttribute("GenerateHandler") )?.GetSyntax() is TypeDeclarationSyntax declarationSyntax) { - return Create(parent.Context, declarationSyntax, parent.AddCacheSourceDelegate, parent.CacheDiagnosticDelegate, parent.AdditionalUsings) as RequestItem; - } + return Create(parent.Compilation, declarationSyntax, parent.Compilation.GetSemanticModel(declarationSyntax.SyntaxTree), parent.AdditionalUsings) as RequestItem; } return null; } diff --git a/src/JsonRpc.Generators/Contexts/JsonRpcAttributes.cs b/src/JsonRpc.Generators/Contexts/JsonRpcAttributes.cs index f72061692..17b5c6adb 100644 --- a/src/JsonRpc.Generators/Contexts/JsonRpcAttributes.cs +++ b/src/JsonRpc.Generators/Contexts/JsonRpcAttributes.cs @@ -5,18 +5,19 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; namespace OmniSharp.Extensions.JsonRpc.Generators.Contexts { record JsonRpcAttributes( SyntaxAttributeData? GenerateHandlerMethods, ImmutableArray HandlerRegistries, + ImmutableArray HandlerRegistryDiagnostics, string HandlerMethodName, string PartialHandlerMethodName, bool AllowDerivedRequests, SyntaxAttributeData? GenerateRequestMethods, ImmutableArray RequestProxies, + ImmutableArray RequestProxyDiagnostics, string RequestMethodName, SyntaxAttributeData? GenerateHandler, string HandlerNamespace, @@ -25,27 +26,30 @@ string ModelNamespace ) { public static JsonRpcAttributes Parse( - GeneratorExecutionContext context, - AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic, + Compilation compilation, TypeDeclarationSyntax syntax, + SemanticModel model, INamedTypeSymbol symbol, HashSet additionalUsings ) { - var generateHandlerMethodsAttributeSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.JsonRpc.Generation.GenerateHandlerMethodsAttribute"); - var generateRequestMethodsAttributeSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.JsonRpc.Generation.GenerateRequestMethodsAttribute"); - var generateHandlerAttributeSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.JsonRpc.Generation.GenerateHandlerAttribute"); + var generateHandlerMethodsAttributeSymbol = + compilation.GetTypeByMetadataName("OmniSharp.Extensions.JsonRpc.Generation.GenerateHandlerMethodsAttribute"); + var generateRequestMethodsAttributeSymbol = + compilation.GetTypeByMetadataName("OmniSharp.Extensions.JsonRpc.Generation.GenerateRequestMethodsAttribute"); + var generateHandlerAttributeSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.JsonRpc.Generation.GenerateHandlerAttribute"); var handlerName = Helpers.SpecialCasedHandlerName(symbol).Split('.').Last(); var attributes = new JsonRpcAttributes( null, ImmutableArray.Empty, + ImmutableArray.Empty, GetHandlerMethodName(symbol, handlerName), GetPartialHandlerMethodName(symbol, handlerName), false, null, ImmutableArray.Empty, + ImmutableArray.Empty, GetRequestMethodName(syntax, symbol, handlerName), null, symbol.ContainingNamespace.ToDisplayString(), @@ -55,70 +59,92 @@ HashSet additionalUsings if (symbol.GetAttribute(generateHandlerAttributeSymbol) is { } generateHandlerData) { - attributes = attributes with { + attributes = attributes with + { GenerateHandler = SyntaxAttributeData.Parse(generateHandlerData), AllowDerivedRequests = generateHandlerData .NamedArguments .Select(z => z is { Key: "AllowDerivedRequests", Value: { Value: true } }) .Count(z => z) is > 0, - HandlerNamespace = generateHandlerData is { ConstructorArguments: { Length: >=1 } arguments } + HandlerNamespace = generateHandlerData is { ConstructorArguments: { Length: >= 1 } arguments } ? arguments[0].Value as string ?? attributes.HandlerNamespace : attributes.HandlerNamespace, HandlerName = generateHandlerData is { NamedArguments: { Length: >= 1 } namedArguments } ? namedArguments .Select(z => z is { Key: "Name", Value: { Value: string str } } ? str : null) - .FirstOrDefault(z => z is { Length: >0 }) ?? attributes.HandlerName + .FirstOrDefault(z => z is { Length: > 0 }) ?? attributes.HandlerName : attributes.HandlerName - }; + }; - attributes = attributes with { + attributes = attributes with + { HandlerMethodName = GetHandlerMethodName(symbol, attributes.HandlerName), PartialHandlerMethodName = GetPartialHandlerMethodName(symbol, attributes.HandlerName), RequestMethodName = GetRequestMethodName(syntax, symbol, attributes.HandlerName) - }; + }; } if (symbol.GetAttribute(generateHandlerMethodsAttributeSymbol) is { } generateHandlerMethodsData) { var data = SyntaxAttributeData.Parse(generateHandlerMethodsData); - attributes = attributes with { + var diagnostics = new List(); + var syntaxes = new List(); + foreach (var registry in GetHandlerRegistries( + syntax, + generateHandlerMethodsData, + symbol, + additionalUsings + )) + { + if (registry.diagnostic is { }) diagnostics.Add(registry.diagnostic); + if (registry.typeSyntax is { }) syntaxes.Add(registry.typeSyntax); + } + + attributes = attributes with + { GenerateHandlerMethods = data, HandlerMethodName = generateHandlerMethodsData .NamedArguments .Select(z => z is { Key: "MethodName", Value: { Value: string value } } ? value : null) .FirstOrDefault(z => z is not null) ?? attributes.HandlerMethodName, - HandlerRegistries = GetHandlerRegistries( - a => cacheDiagnostic(syntax, a), - generateHandlerMethodsData, - symbol, - additionalUsings - ).ToImmutableArray() - }; + HandlerRegistries = syntaxes.ToImmutableArray(), + HandlerRegistryDiagnostics = diagnostics.ToImmutableArray() + }; } if (symbol.GetAttribute(generateRequestMethodsAttributeSymbol) is { } generateRequestMethodsData) { var data = SyntaxAttributeData.Parse(generateRequestMethodsData); - attributes = attributes with { + var diagnostics = new List(); + var syntaxes = new List(); + foreach (var registry in GetRequestProxies( + syntax, + generateRequestMethodsData, + symbol, + additionalUsings + )) + { + if (registry.diagnostic is { }) diagnostics.Add(registry.diagnostic); + if (registry.typeSyntax is { }) syntaxes.Add(registry.typeSyntax); + } + + attributes = attributes with + { GenerateRequestMethods = data, RequestMethodName = generateRequestMethodsData .NamedArguments .Select(z => z is { Key: "MethodName", Value: { Value: string value } } ? value : null) .FirstOrDefault(z => z is not null) ?? attributes.RequestMethodName, - RequestProxies = GetRequestProxies( - (a) => cacheDiagnostic(syntax, a), - generateRequestMethodsData, - symbol, - additionalUsings - ).ToImmutableArray() - }; + RequestProxies = syntaxes.ToImmutableArray(), + RequestProxyDiagnostics = diagnostics.ToImmutableArray() + }; } return attributes; } - private static IEnumerable GetHandlerRegistries( - Action> cacheDiagnostic, + private static IEnumerable<(TypeSyntax? typeSyntax, Diagnostic? diagnostic)> GetHandlerRegistries( + TypeDeclarationSyntax typeDeclarationSyntax, AttributeData attributeData, INamedTypeSymbol interfaceType, HashSet additionalUsings @@ -130,7 +156,7 @@ HashSet additionalUsings { if (item.Expression is TypeOfExpressionSyntax typeOfExpressionSyntax) { - yield return typeOfExpressionSyntax.Type; + yield return ( typeOfExpressionSyntax.Type, null ); foundValue = true; } } @@ -142,11 +168,15 @@ HashSet additionalUsings var attribute = interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute"); if (attribute.ConstructorArguments.Length < 2) { - cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.MissingDirection, c.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation())); + yield return ( null, Diagnostic.Create( + GeneratorDiagnostics.MissingDirection, + typeDeclarationSyntax.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation() + ) + ); yield break; } - var direction = (int) interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute").ConstructorArguments[1].Value!; + var direction = (int)interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute").ConstructorArguments[1].Value!; /* Unspecified = 0b0000, @@ -160,12 +190,12 @@ HashSet additionalUsings additionalUsings.Add("OmniSharp.Extensions.LanguageServer.Protocol.Server"); if (( direction & 0b0001 ) == 0b0001) { - yield return LanguageProtocolServerToClientRegistry; + yield return ( LanguageProtocolServerToClientRegistry, null ); } if (( direction & 0b0010 ) == 0b0010) { - yield return LanguageProtocolClientToServerRegistry; + yield return ( LanguageProtocolClientToServerRegistry, null ); } yield break; @@ -176,11 +206,16 @@ HashSet additionalUsings var attribute = interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute"); if (attribute.ConstructorArguments.Length < 2) { - cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.MissingDirection, c.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation())); + yield return ( + null, + Diagnostic.Create( + GeneratorDiagnostics.MissingDirection, typeDeclarationSyntax.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation() + ) + ); yield break; } - var direction = (int) interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute").ConstructorArguments[1].Value!; + var direction = (int)interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute").ConstructorArguments[1].Value!; /* Unspecified = 0b0000, @@ -194,18 +229,23 @@ HashSet additionalUsings additionalUsings.Add("OmniSharp.Extensions.DebugAdapter.Protocol.Server"); if (( direction & 0b0001 ) == 0b0001) { - yield return DebugProtocolServerToClientRegistry; + yield return ( DebugProtocolServerToClientRegistry, null ); } if (( direction & 0b0010 ) == 0b0010) { - yield return DebugProtocolClientToServerRegistry; + yield return ( DebugProtocolClientToServerRegistry, null ); } yield break; } - cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.CouldNotInferRequestRouter, c.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation())); + yield return ( + null, + Diagnostic.Create( + GeneratorDiagnostics.CouldNotInferRequestRouter, typeDeclarationSyntax.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation() + ) + ); } private static NameSyntax LanguageProtocolServerToClientRegistry { get; } = @@ -221,8 +261,8 @@ HashSet additionalUsings SyntaxFactory.IdentifierName("IDebugAdapterServerRegistry"); - private static IEnumerable GetRequestProxies( - Action> cacheDiagnostic, + private static IEnumerable<(TypeSyntax? typeSyntax, Diagnostic? diagnostic)> GetRequestProxies( + TypeDeclarationSyntax typeDeclarationSyntax, AttributeData attributeData, INamedTypeSymbol interfaceType, HashSet additionalUsings @@ -234,7 +274,7 @@ HashSet additionalUsings { if (item.Expression is TypeOfExpressionSyntax typeOfExpressionSyntax) { - yield return typeOfExpressionSyntax.Type; + yield return ( typeOfExpressionSyntax.Type, null ); foundValue = true; } } @@ -246,11 +286,16 @@ HashSet additionalUsings var attribute = interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute"); if (attribute.ConstructorArguments.Length < 2) { - cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.MissingDirection, c.AttributeLists.GetAttribute("GenerateRequestMethods")?.GetLocation())); + yield return ( null, + Diagnostic.Create( + GeneratorDiagnostics.MissingDirection, + typeDeclarationSyntax.AttributeLists.GetAttribute("GenerateRequestMethods")?.GetLocation() + ) + ); yield break; } - var direction = (int) interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute")!.ConstructorArguments[1].Value!; + var direction = (int)interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute")!.ConstructorArguments[1].Value!; /* Unspecified = 0b0000, @@ -265,12 +310,12 @@ HashSet additionalUsings additionalUsings.Add("OmniSharp.Extensions.LanguageServer.Protocol.Client"); if (( direction & 0b0001 ) == 0b0001) { - yield return LanguageProtocolServerToClient; + yield return ( LanguageProtocolServerToClient, null ); } if (( direction & 0b0010 ) == 0b0010) { - yield return LanguageProtocolClientToServer; + yield return ( LanguageProtocolClientToServer, null ); } yield break; @@ -281,11 +326,16 @@ HashSet additionalUsings var attribute = interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute"); if (attribute.ConstructorArguments.Length < 2) { - cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.MissingDirection, c.AttributeLists.GetAttribute("GenerateRequestMethods")?.GetLocation())); + yield return ( null, + Diagnostic.Create( + GeneratorDiagnostics.MissingDirection, + typeDeclarationSyntax.AttributeLists.GetAttribute("GenerateRequestMethods")?.GetLocation() + ) + ); yield break; } - var direction = (int) interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute").ConstructorArguments[1].Value!; + var direction = (int)interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute").ConstructorArguments[1].Value!; /* Unspecified = 0b0000, @@ -298,18 +348,23 @@ HashSet additionalUsings if (( direction & 0b0001 ) == 0b0001) { - yield return DebugProtocolServerToClient; + yield return ( DebugProtocolServerToClient, null ); } if (( direction & 0b0010 ) == 0b0010) { - yield return DebugProtocolClientToServer; + yield return ( DebugProtocolClientToServer, null ); } yield break; } - cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.CouldNotInferRequestRouter, c.AttributeLists.GetAttribute("GenerateRequestMethods")?.GetLocation())); + yield return ( null, + Diagnostic.Create( + GeneratorDiagnostics.CouldNotInferRequestRouter, + typeDeclarationSyntax.AttributeLists.GetAttribute("GenerateRequestMethods")?.GetLocation() + ) + ); } private static NameSyntax LanguageProtocolServerToClient { get; } = diff --git a/src/JsonRpc.Generators/Contexts/LspAttributes.cs b/src/JsonRpc.Generators/Contexts/LspAttributes.cs index 4c55f36e2..3dda28f14 100644 --- a/src/JsonRpc.Generators/Contexts/LspAttributes.cs +++ b/src/JsonRpc.Generators/Contexts/LspAttributes.cs @@ -1,7 +1,6 @@ using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; namespace OmniSharp.Extensions.JsonRpc.Generators.Contexts { @@ -23,10 +22,9 @@ bool CanHaveData ) { public static LspAttributes? Parse( - GeneratorExecutionContext context, - AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic, + Compilation compilation, TypeDeclarationSyntax syntax, + SemanticModel model, INamedTypeSymbol symbol) { var prefix = "OmniSharp.Extensions.LanguageServer.Protocol.Generation"; @@ -40,7 +38,7 @@ bool CanHaveData }; { - var attributeSymbol = context.Compilation.GetTypeByMetadataName($"{prefix}.GenerateTypedDataAttribute"); + var attributeSymbol = compilation.GetTypeByMetadataName($"{prefix}.GenerateTypedDataAttribute"); if (symbol.GetAttribute(attributeSymbol) is { } data && data.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax attributeSyntax) { attributes = attributes with { @@ -50,7 +48,7 @@ bool CanHaveData } } { - var attributeSymbol = context.Compilation.GetTypeByMetadataName($"{prefix}.GenerateContainerAttribute"); + var attributeSymbol = compilation.GetTypeByMetadataName($"{prefix}.GenerateContainerAttribute"); if (symbol.GetAttribute(attributeSymbol) is { } data && data.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax attributeSyntax) { attributes = attributes with { @@ -60,7 +58,7 @@ bool CanHaveData } } { - var attributeSymbol = context.Compilation.GetTypeByMetadataName($"{prefix}.RegistrationOptionsKeyAttribute"); + var attributeSymbol = compilation.GetTypeByMetadataName($"{prefix}.RegistrationOptionsKeyAttribute"); if (symbol.GetAttribute(attributeSymbol) is { ConstructorArguments: { Length: >=1 } arguments } data && arguments[0].Kind is TypedConstantKind.Primitive && arguments[0].Value is string value && data.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax attributeSyntax) @@ -72,21 +70,21 @@ bool CanHaveData } } { - var (syntaxAttributeData, syntaxSymbol) = ExtractAttributeTypeData(symbol, context.Compilation.GetTypeByMetadataName($"{prefix}.CapabilityAttribute")); + var (syntaxAttributeData, syntaxSymbol) = ExtractAttributeTypeData(symbol, compilation.GetTypeByMetadataName($"{prefix}.CapabilityAttribute")); attributes = attributes with { CapabilityAttribute = syntaxAttributeData, Capability = syntaxSymbol }; } { - var (syntaxAttributeData, syntaxSymbol) = ExtractAttributeTypeData(symbol, context.Compilation.GetTypeByMetadataName($"{prefix}.ResolverAttribute")); + var (syntaxAttributeData, syntaxSymbol) = ExtractAttributeTypeData(symbol, compilation.GetTypeByMetadataName($"{prefix}.ResolverAttribute")); attributes = attributes with { ResolverAttribute = syntaxAttributeData, Resolver = syntaxSymbol }; } { - var (syntaxAttributeData, syntaxSymbol) = ExtractAttributeTypeData(symbol, context.Compilation.GetTypeByMetadataName($"{prefix}.RegistrationOptionsAttribute")); + var (syntaxAttributeData, syntaxSymbol) = ExtractAttributeTypeData(symbol, compilation.GetTypeByMetadataName($"{prefix}.RegistrationOptionsAttribute")); attributes = attributes with { RegistrationOptionsAttribute = syntaxAttributeData, RegistrationOptions = syntaxSymbol diff --git a/src/JsonRpc.Generators/Contexts/NotificationItem.cs b/src/JsonRpc.Generators/Contexts/NotificationItem.cs index 6d9d7a111..24b2eab64 100644 --- a/src/JsonRpc.Generators/Contexts/NotificationItem.cs +++ b/src/JsonRpc.Generators/Contexts/NotificationItem.cs @@ -16,10 +16,10 @@ record NotificationItem( HashSet AdditionalUsings, List AssemblyJsonRpcHandlersAttributeArguments, SemanticModel Model, - GeneratorExecutionContext Context + Compilation Compilation ) : GeneratorData( TypeDeclaration, TypeSymbol, JsonRpcAttributes, LspAttributes, DapAttributes, Request, Capability, RegistrationOptions, - AdditionalUsings, AssemblyJsonRpcHandlersAttributeArguments, Model, Context + AdditionalUsings, AssemblyJsonRpcHandlersAttributeArguments, Model, Compilation ); } diff --git a/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs b/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs index f94a2844d..dd19d8100 100644 --- a/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs +++ b/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs @@ -20,18 +20,18 @@ record RegistrationOptionAttributes( bool ImplementsStaticRegistrationOptions ) { - public static RegistrationOptionAttributes? Parse(GeneratorExecutionContext context, TypeDeclarationSyntax syntax, INamedTypeSymbol symbol) + public static RegistrationOptionAttributes? Parse(Compilation compilation, TypeDeclarationSyntax syntax, INamedTypeSymbol symbol) { var registrationOptionsAttributeSymbol = - context.Compilation.GetTypeByMetadataName($"OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateRegistrationOptionsAttribute"); + compilation.GetTypeByMetadataName($"OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateRegistrationOptionsAttribute"); var registrationOptionsConverterAttributeSymbol = - context.Compilation.GetTypeByMetadataName($"OmniSharp.Extensions.LanguageServer.Protocol.RegistrationOptionsConverterAttribute"); -// var registrationOptionsInterfaceSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions"); + compilation.GetTypeByMetadataName($"OmniSharp.Extensions.LanguageServer.Protocol.RegistrationOptionsConverterAttribute"); +// var registrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions"); var textDocumentRegistrationOptionsInterfaceSymbol = - context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions"); - var workDoneProgressOptionsInterfaceSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions"); + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions"); + var workDoneProgressOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions"); var staticRegistrationOptionsInterfaceSymbol = - context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions"); + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions"); if (!( symbol.GetAttribute(registrationOptionsAttributeSymbol) is { } data )) return null; if (!( data.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax attributeSyntax )) return null; diff --git a/src/JsonRpc.Generators/Contexts/RequestItem.cs b/src/JsonRpc.Generators/Contexts/RequestItem.cs index 109d2ab88..3b5103243 100644 --- a/src/JsonRpc.Generators/Contexts/RequestItem.cs +++ b/src/JsonRpc.Generators/Contexts/RequestItem.cs @@ -20,11 +20,11 @@ record RequestItem( HashSet AdditionalUsings, List AssemblyJsonRpcHandlersAttributeArguments, SemanticModel Model, - GeneratorExecutionContext Context + Compilation Compilation ) : GeneratorData( TypeDeclaration, TypeSymbol, JsonRpcAttributes, LspAttributes, DapAttributes, Request, Capability, RegistrationOptions, - AdditionalUsings, AssemblyJsonRpcHandlersAttributeArguments, Model, Context + AdditionalUsings, AssemblyJsonRpcHandlersAttributeArguments, Model, Compilation ); // record PartialItem(TypeSyntax Syntax, INamedTypeSymbol Symbol, SyntaxSymbol Item) : SyntaxSymbol(Syntax, Symbol); diff --git a/src/JsonRpc.Generators/EnumLikeStringGenerator.cs b/src/JsonRpc.Generators/EnumLikeStringGenerator.cs index bef33165e..25d2b6e42 100644 --- a/src/JsonRpc.Generators/EnumLikeStringGenerator.cs +++ b/src/JsonRpc.Generators/EnumLikeStringGenerator.cs @@ -5,67 +5,55 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class EnumLikeStringGenerator : CachedSourceGenerator + public class EnumLikeStringGenerator : IIncrementalGenerator { - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) + public void Initialize(IncrementalGeneratorInitializationContext context) { - foreach (var candidate in syntaxReceiver.Candidates) - { - var model = context.Compilation.GetSemanticModel(candidate.SyntaxTree); - var symbol = model.GetDeclaredSymbol(candidate); - if (symbol is null) continue; + var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (node, token) => node is StructDeclarationSyntax tds && tds.AttributeLists.ContainsAttribute("StringEnum"), + transform: (syntaxContext, token) => syntaxContext + ); + + context.RegisterSourceOutput(syntaxProvider, GenerateEnum); + } - if (!candidate.Modifiers.Any(z => z.IsKind(SyntaxKind.PartialKeyword))) - { - cacheDiagnostic(candidate, static c => Diagnostic.Create(GeneratorDiagnostics.MustBePartial, c.Identifier.GetLocation(), c.Identifier.Text)); - continue; - } + private void GenerateEnum(SourceProductionContext context, GeneratorSyntaxContext syntaxContext) + { + var candidate = (StructDeclarationSyntax)syntaxContext.Node; + var model = syntaxContext.SemanticModel; + var symbol = model.GetDeclaredSymbol(syntaxContext.Node); + if (symbol is null) return; - if (!candidate.Modifiers.Any(z => z.IsKind(SyntaxKind.ReadOnlyKeyword))) - { - cacheDiagnostic(candidate, static c => Diagnostic.Create(GeneratorDiagnostics.MustBeReadOnly, c.Identifier.GetLocation(), c.Identifier.Text)); - continue; - } + if (!candidate.Modifiers.Any(z => z.IsKind(SyntaxKind.PartialKeyword))) + { + context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.MustBePartial, candidate.Identifier.GetLocation(), candidate.Identifier.Text)); + return; + } - var cu = CompilationUnit( - List(), - List(), - List(), - SingletonList( - NamespaceDeclaration(ParseName(symbol.ContainingNamespace.ToDisplayString())) - .WithMembers(SingletonList(GetImplementation(candidate))) - ) - ) - .AddUsings( - UsingDirective(ParseName("System")), - UsingDirective(ParseName("System.Collections.Generic")), - UsingDirective(ParseName("System.Diagnostics")), - UsingDirective(ParseName("System.Linq")), - UsingDirective(ParseName("System.Reflection")), - UsingDirective(ParseName("Newtonsoft.Json")), - UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc")), - UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc.Serialization.Converters")) + if (!candidate.Modifiers.Any(z => z.IsKind(SyntaxKind.ReadOnlyKeyword))) + { + context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.MustBeReadOnly, candidate.Identifier.GetLocation(), candidate.Identifier.Text)); + return; + } + + var cu = CompilationUnit( + List(), List(), List(), SingletonList( + NamespaceDeclaration(ParseName(symbol.ContainingNamespace.ToDisplayString())) + .WithMembers(SingletonList(GetImplementation(candidate))) ) - .WithLeadingTrivia() - .WithTrailingTrivia() - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool), Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true))) - .WithTrailingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)), CarriageReturnLineFeed); + ) + .AddUsings(UsingDirective(ParseName("System")), UsingDirective(ParseName("System.Collections.Generic")), UsingDirective(ParseName("System.Diagnostics")), UsingDirective(ParseName("System.Linq")), UsingDirective(ParseName("System.Reflection")), UsingDirective(ParseName("Newtonsoft.Json")), UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc")), UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc.Serialization.Converters"))) + .WithLeadingTrivia() + .WithTrailingTrivia() + .WithLeadingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true))) + .WithTrailingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true))); - addCacheSource( - $"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}{( candidate.Arity > 0 ? candidate.Arity.ToString() : "" )}.cs", - candidate, - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); - } + context.AddSource($"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}{( candidate.Arity > 0 ? candidate.Arity.ToString() : "" )}.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); } private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax syntax) @@ -862,45 +850,5 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) ; } - - public EnumLikeStringGenerator() : base(() => new SyntaxReceiver(Cache)) - { - } - - public static CacheContainer Cache = new(); - - public class SyntaxReceiver : SyntaxReceiverCache - { - public List Candidates { get; } = new(); - - public SyntaxReceiver(CacheContainer cacheContainer) : base(cacheContainer) - { - } - - public override string? GetKey(StructDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(StructDeclarationSyntax syntaxNode) - { - // any field with at least one attribute is a candidate for property generation - if (syntaxNode.AttributeLists.ContainsAttribute("StringEnum")) - { - Candidates.Add(syntaxNode); - } - } - } } } diff --git a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs index a07d42697..9f954c748 100644 --- a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs +++ b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; using OmniSharp.Extensions.JsonRpc.Generators.Strategies; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; @@ -15,155 +14,167 @@ namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class GenerateHandlerMethodsGenerator : CachedSourceGenerator + public class GenerateHandlerMethodsGenerator : IIncrementalGenerator { - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) + public void Initialize(IncrementalGeneratorInitializationContext context) { - var handlers = new List(); - foreach (var candidateClass in syntaxReceiver.Candidates) + var _attributes = "GenerateHandler,GenerateRequestMethods,GenerateHandlerMethods"; + var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => + syntaxNode is TypeDeclarationSyntax tds + and (ClassDeclarationSyntax or RecordDeclarationSyntax or InterfaceDeclarationSyntax) + && tds.AttributeLists.ContainsAttribute(_attributes), transform: (syntaxContext, token) => syntaxContext + ) + .Combine(context.CompilationProvider) + .Select( + (tuple, token) => + { + var (syntaxContext, compilaiton) = tuple; + var additionalUsings = new HashSet + { + "System", + "System.Collections.Generic", + "System.Threading", + "System.Threading.Tasks", + "MediatR", + "Microsoft.Extensions.DependencyInjection" + }; + + GeneratorData? actionItem = null; + Diagnostic? diagnostic = null; + + try + { + actionItem = GeneratorData.Create( + compilaiton, (TypeDeclarationSyntax)syntaxContext.Node, syntaxContext.SemanticModel, additionalUsings + ); + } + catch (Exception e) + { + diagnostic = Diagnostic.Create( + GeneratorDiagnostics.Exception, syntaxContext.Node.GetLocation(), e.Message, + e.StackTrace ?? string.Empty + ); + Debug.WriteLine(e); + Debug.WriteLine(e.StackTrace); + } + + return ( actionItem, diagnostic, additionalUsings ); + } + ); + + context.RegisterSourceOutput(syntaxProvider, GenerateHandlerMethods); + context.RegisterSourceOutput(syntaxProvider.Where(z => z.actionItem is {}).SelectMany((z, _) => z.actionItem!.AssemblyJsonRpcHandlersAttributeArguments).Collect(), GenerateAssemblyJsonRpcHandlers); + } + + private void GenerateHandlerMethods(SourceProductionContext context, (GeneratorData? actionItem, Diagnostic? diagnostic, HashSet additionalUsings) valueTuple) + { + var (actionItem, diagnostic, additionalUsings) = valueTuple; + // context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.Message, null, $"candidate: {candidateClass.Identifier.ToFullString()}")); + // can this be async??? + context.CancellationToken.ThrowIfCancellationRequested(); + + if (actionItem is null) { -// context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.Message, null, $"candidate: {candidateClass.Identifier.ToFullString()}")); - // can this be async??? - context.CancellationToken.ThrowIfCancellationRequested(); - - var additionalUsings = new HashSet { - "System", - "System.Collections.Generic", - "System.Threading", - "System.Threading.Tasks", - "MediatR", - "Microsoft.Extensions.DependencyInjection" - }; - - GeneratorData? actionItem = null; - - try - { - actionItem = GeneratorData.Create(context, candidateClass, addCacheSource, cacheDiagnostic, additionalUsings); - } - catch (Exception e) - { - context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.Exception, candidateClass.GetLocation(), e.Message, e.StackTrace ?? string.Empty)); - Debug.WriteLine(e); - Debug.WriteLine(e.StackTrace); - } + context.ReportDiagnostic(diagnostic!); + return; + } - if (actionItem is null) continue; - - var members = CompilationUnitGeneratorStrategies.Aggregate( - new List(), (m, strategy) => { - try - { - m.AddRange(strategy.Apply(actionItem)); - } - catch (Exception e) - { - context.ReportDiagnostic( - Diagnostic.Create( - GeneratorDiagnostics.Exception, candidateClass.GetLocation(), $"Strategy {strategy.GetType().FullName} failed!" + " - " + e.Message, - e.StackTrace ?? string.Empty - ) - ); - Debug.WriteLine($"Strategy {strategy.GetType().FullName} failed!"); - Debug.WriteLine(e); - Debug.WriteLine(e.StackTrace); - } - - return m; - } - ); - - if (!members.Any()) continue; - - var namespacesMapping = new Dictionary() { - ["OmniSharp.Extensions.DebugAdapter"] = new[] { - "OmniSharp.Extensions.DebugAdapter.Protocol", - "OmniSharp.Extensions.DebugAdapter.Protocol.Models", - "OmniSharp.Extensions.DebugAdapter.Protocol.Events", - "OmniSharp.Extensions.DebugAdapter.Protocol.Requests" - }, - ["OmniSharp.Extensions.LanguageProtocol"] = new[] { - "OmniSharp.Extensions.LanguageServer.Protocol", - "OmniSharp.Extensions.LanguageServer.Protocol.Models" - }, - }; - - foreach (var assembly in actionItem.Context.Compilation.References - .Select(actionItem.Context.Compilation.GetAssemblyOrModuleSymbol) - .OfType() - .Concat(new[] { actionItem.Context.Compilation.Assembly })) + var candidateClass = actionItem.TypeDeclaration; + + var members = CompilationUnitGeneratorStrategies.Aggregate( + new List(), (m, strategy) => { - if (namespacesMapping.TryGetValue(assembly.Name, out var additionalNamespaceUsings)) + try { - foreach (var item in additionalNamespaceUsings) - { - additionalUsings.Add(item); - } + m.AddRange(strategy.Apply(context, actionItem)); } + catch (Exception e) + { + context.ReportDiagnostic( + Diagnostic.Create( + GeneratorDiagnostics.Exception, candidateClass.GetLocation(), + $"Strategy {strategy.GetType().FullName} failed!" + " - " + e.Message, e.StackTrace ?? string.Empty + ) + ); + Debug.WriteLine($"Strategy {strategy.GetType().FullName} failed!"); + Debug.WriteLine(e); + Debug.WriteLine(e.StackTrace); + } + + return m; } + ); - var existingUsings = candidateClass.SyntaxTree.GetCompilationUnitRoot() - .Usings - .Select(x => x.WithoutTrivia()) - .Union( - additionalUsings - .Except( - candidateClass.SyntaxTree.GetCompilationUnitRoot() - .Usings - .Where(z => z.Alias == null) - .Select(z => z.Name.ToFullString()) - ) - .Except(new [] { "" }) // I think there is a better way... but for now.. - .Distinct() - .Select(z => UsingDirective(IdentifierName(z))) - ) - .OrderBy(x => x.Name.ToFullString()) - .ToImmutableArray(); - - var cu = CompilationUnit( - List(), - List(existingUsings), - List(), - List(members) - ) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); - - addCacheSource( - $"{candidateClass.Identifier.Text}{( candidateClass.Arity > 0 ? candidateClass.Arity.ToString() : "" )}.cs", - candidateClass, - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); - - handlers.AddRange(actionItem.AssemblyJsonRpcHandlersAttributeArguments); - } + if (!members.Any()) return; + var namespacesMapping = new Dictionary() + { + ["OmniSharp.Extensions.DebugAdapter"] = new[] + { + "OmniSharp.Extensions.DebugAdapter.Protocol", "OmniSharp.Extensions.DebugAdapter.Protocol.Models", + "OmniSharp.Extensions.DebugAdapter.Protocol.Events", "OmniSharp.Extensions.DebugAdapter.Protocol.Requests" + }, + ["OmniSharp.Extensions.LanguageProtocol"] = new[] + { "OmniSharp.Extensions.LanguageServer.Protocol", "OmniSharp.Extensions.LanguageServer.Protocol.Models" }, + }; + + foreach (var assembly in actionItem.Compilation.References.Select(actionItem.Compilation.GetAssemblyOrModuleSymbol) + .OfType() + .Concat(new[] { actionItem.Compilation.Assembly })) { - var namespaces = new HashSet() { "OmniSharp.Extensions.JsonRpc" }; - if (handlers.Any()) + if (namespacesMapping.TryGetValue(assembly.Name, out var additionalNamespaceUsings)) { - var types = handlers.ToArray(); - var cu = CompilationUnit() - .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); - while (types.Length > 0) + foreach (var item in additionalNamespaceUsings) { - var innerTypes = types.Take(10).ToArray(); - types = types.Skip(10).ToArray(); - cu = cu.AddAttributeLists( - AttributeList( - target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), - SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))) - ) - ); + additionalUsings.Add(item); } + } + } - context.AddSource("GeneratedAssemblyJsonRpcHandlers.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); + var existingUsings = candidateClass.SyntaxTree.GetCompilationUnitRoot() + .Usings.Select(x => x.WithoutTrivia()) + .Union( + additionalUsings.Except( + candidateClass.SyntaxTree.GetCompilationUnitRoot() + .Usings.Where(z => z.Alias == null) + .Select(z => z.Name.ToFullString()) + ) + .Except(new[] { "" }) // I think there is a better way... but for now.. + .Distinct() + .Select(z => UsingDirective(IdentifierName(z))) + ) + .OrderBy(x => x.Name.ToFullString()) + .ToImmutableArray(); + + var cu = CompilationUnit(List(), List(existingUsings), List(), List(members)); + + context.AddSource( + $"{candidateClass.Identifier.Text}{( candidateClass.Arity > 0 ? candidateClass.Arity.ToString() : "" )}.cs", + cu.NormalizeWhitespace().GetText(Encoding.UTF8) + ); + } + + private void GenerateAssemblyJsonRpcHandlers(SourceProductionContext context, ImmutableArray handlers) + { + var namespaces = new HashSet() { "OmniSharp.Extensions.JsonRpc" }; + if (handlers.Any()) + { + var cu = CompilationUnit() + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))); + while (handlers.Length > 0) + { + var innerTypes = handlers.Take(10).ToArray(); + handlers = handlers.Skip(10).ToImmutableArray(); + cu = cu.AddAttributeLists( + AttributeList( + target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), + SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))) + ) + ); } + + context.AddSource("GeneratedAssemblyJsonRpcHandlers.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); } } @@ -196,46 +207,5 @@ private static ImmutableArray GetCompilationU ); return compilationUnitStrategies; } - - public GenerateHandlerMethodsGenerator() : base(() => new SyntaxReceiver(Cache)) - { - } - - public static CacheContainer Cache = new(); - - public class SyntaxReceiver : SyntaxReceiverCache - { - private string _attributes; - public List Candidates { get; } = new(); - - public SyntaxReceiver(CacheContainer cache) : base(cache) - { - _attributes = "GenerateHandler,GenerateRequestMethods,GenerateHandlerMethods"; - } - - public override string? GetKey(TypeDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(TypeDeclarationSyntax syntaxNode) - { - // any field with at least one attribute is a candidate for property generation - if (syntaxNode is ClassDeclarationSyntax or RecordDeclarationSyntax or InterfaceDeclarationSyntax && syntaxNode.AttributeLists.ContainsAttribute(_attributes)) - { - Candidates.Add(syntaxNode); - } - } - } } } diff --git a/src/JsonRpc.Generators/ICompilationUnitGeneratorStrategy.cs b/src/JsonRpc.Generators/ICompilationUnitGeneratorStrategy.cs index c3a147903..d7cc10336 100644 --- a/src/JsonRpc.Generators/ICompilationUnitGeneratorStrategy.cs +++ b/src/JsonRpc.Generators/ICompilationUnitGeneratorStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -6,6 +7,6 @@ namespace OmniSharp.Extensions.JsonRpc.Generators { internal interface ICompilationUnitGeneratorStrategy { - IEnumerable Apply(GeneratorData item); + IEnumerable Apply(SourceProductionContext context, GeneratorData item); } } diff --git a/src/JsonRpc.Generators/IExtensionMethodContextGeneratorStrategy.cs b/src/JsonRpc.Generators/IExtensionMethodContextGeneratorStrategy.cs index 7160e8285..8d3e5bff8 100644 --- a/src/JsonRpc.Generators/IExtensionMethodContextGeneratorStrategy.cs +++ b/src/JsonRpc.Generators/IExtensionMethodContextGeneratorStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -6,6 +7,6 @@ namespace OmniSharp.Extensions.JsonRpc.Generators { internal interface IExtensionMethodContextGeneratorStrategy { - IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item); + IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item); } } diff --git a/src/JsonRpc.Generators/IExtensionMethodGeneratorStrategy.cs b/src/JsonRpc.Generators/IExtensionMethodGeneratorStrategy.cs index c1bf09b8b..537177649 100644 --- a/src/JsonRpc.Generators/IExtensionMethodGeneratorStrategy.cs +++ b/src/JsonRpc.Generators/IExtensionMethodGeneratorStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -6,6 +7,6 @@ namespace OmniSharp.Extensions.JsonRpc.Generators { internal interface IExtensionMethodGeneratorStrategy { - IEnumerable Apply(GeneratorData item); + IEnumerable Apply(SourceProductionContext context, GeneratorData item); } } diff --git a/src/JsonRpc.Generators/JsonRpc.Generators.csproj b/src/JsonRpc.Generators/JsonRpc.Generators.csproj index 8f0a15cc0..7854d8f6f 100644 --- a/src/JsonRpc.Generators/JsonRpc.Generators.csproj +++ b/src/JsonRpc.Generators/JsonRpc.Generators.csproj @@ -11,15 +11,15 @@ - - + + <_Parameter1>Generation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - + diff --git a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs index 00884886a..edf1356f9 100644 --- a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs +++ b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs @@ -1,284 +1,358 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class RegistrationOptionsGenerator : CachedSourceGenerator + public class RegistrationOptionsGenerator : IIncrementalGenerator { - private static string[] RequiredUsings = { + private static string[] RequiredUsings = + { "OmniSharp.Extensions.LanguageServer.Protocol", "OmniSharp.Extensions.LanguageServer.Protocol.Serialization", "OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities", }; - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) + private record AttributeData( + INamedTypeSymbol RegistrationOptionsInterfaceSymbol, INamedTypeSymbol TextDocumentRegistrationOptionsInterfaceSymbol, + INamedTypeSymbol WorkDoneProgressOptionsInterfaceSymbol, INamedTypeSymbol StaticRegistrationOptionsInterfaceSymbol + ); + public void Initialize(IncrementalGeneratorInitializationContext context) { - var compilation = context.Compilation; - - var registrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions")!; - var textDocumentRegistrationOptionsInterfaceSymbol = - compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions")!; - var workDoneProgressOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions")!; - var staticRegistrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions")!; + var attributes = context.CompilationProvider + .Select( + (compilation, token) => + { + var registrationOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions")!; + var textDocumentRegistrationOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions" + )!; + var workDoneProgressOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions" + )!; + var staticRegistrationOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions" + )!; + return new AttributeData( + registrationOptionsInterfaceSymbol, textDocumentRegistrationOptionsInterfaceSymbol, + workDoneProgressOptionsInterfaceSymbol, staticRegistrationOptionsInterfaceSymbol + ); + } + ); + var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => + syntaxNode is TypeDeclarationSyntax tds and (ClassDeclarationSyntax or RecordDeclarationSyntax) + && tds.AttributeLists + .SelectMany(z => z.Attributes) + .Any(z => z.Name.ToFullString().Contains("GenerateRegistrationOptions")), + (syntaxContext, token) => syntaxContext + ) + .Combine(context.CompilationProvider) + .Select( + (tuple, token) => + { + var (syntaxContext, compilation) = tuple; + var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol((TypeDeclarationSyntax)syntaxContext.Node); + if (typeSymbol is not { }) return default!; + var data = RegistrationOptionAttributes.Parse( + compilation, + (TypeDeclarationSyntax)syntaxContext.Node, + typeSymbol + ); + return data is not { } + ? default! + : ( registrationOptions: (TypeDeclarationSyntax)syntaxContext.Node, + semanticModel: syntaxContext.SemanticModel, typeSymbol: typeSymbol, data: data! ); + } + ) + .Where(z => z is { data: { } }) + .Combine(attributes) + .Select( + (tuple, token) => ( + tuple.Left.registrationOptions, tuple.Left.data, tuple.Left.semanticModel, tuple.Left.typeSymbol, + attributes: tuple.Right ) + ) + ; + + context.RegisterSourceOutput(syntaxProvider, GenerateRegistrationOptions); + context.RegisterSourceOutput( + syntaxProvider + .Select( + (tuple, token) => ( namespaces: tuple.typeSymbol.ContainingNamespace.ToDisplayString(), + AttributeArgument(TypeOfExpression(IdentifierName(tuple.typeSymbol.Name))) ) + ) + .Collect(), GenerateAssemblyRegistrationOptions + ); + } - foreach (var registrationOptions in syntaxReceiver.RegistrationOptions) + private void GenerateRegistrationOptions( + SourceProductionContext context, + (TypeDeclarationSyntax registrationOptions, RegistrationOptionAttributes data, SemanticModel semanticModel, INamedTypeSymbol typeSymbol, + AttributeData attributes) valueTuple + ) + { + var (registrationOptions, data, semanticModel, typeSymbol, attributes) = valueTuple; + try { - try + if (!registrationOptions.Modifiers.Any(z => z.IsKind(SyntaxKind.PartialKeyword))) { - var semanticModel = context.Compilation.GetSemanticModel(registrationOptions.SyntaxTree); - var typeSymbol = semanticModel.GetDeclaredSymbol(registrationOptions); + context.ReportDiagnostic( + Diagnostic.Create(GeneratorDiagnostics.MustBePartial, registrationOptions.Identifier.GetLocation(), registrationOptions.Identifier.Text) + ); + return; + } - if (typeSymbol is not { }) continue; - var data = RegistrationOptionAttributes.Parse(context, registrationOptions, typeSymbol); - if (data is not { }) continue; + var extendedRegistrationOptions = registrationOptions.WithAttributeLists(List()) + .WithBaseList( + BaseList( + SingletonSeparatedList( + SimpleBaseType( + ParseName(attributes.RegistrationOptionsInterfaceSymbol.ToDisplayString()) + ) + ) + ) + ) + .WithMembers(List()); - if (!registrationOptions.Modifiers.Any(z => z.IsKind(SyntaxKind.PartialKeyword))) - { - cacheDiagnostic(registrationOptions, static r => Diagnostic.Create(GeneratorDiagnostics.MustBePartial, r.Identifier.GetLocation(), r.Identifier.Text)); - continue; - } - var extendedRegistrationOptions = registrationOptions - .WithAttributeLists(List()) - .WithBaseList( - BaseList( - SingletonSeparatedList( - SimpleBaseType(ParseName(registrationOptionsInterfaceSymbol.ToDisplayString())) - ) - ) - ) - .WithMembers(List()); - - - var staticRegistrationOptions = registrationOptions - .WithIdentifier(Identifier($"StaticOptions")) - .WithMembers(List(registrationOptions.Members.OfType())) - .WithAttributeLists(List()); - - var staticBaseList = - registrationOptions.BaseList?.Types.Where(z => z.Type.GetSyntaxName() != textDocumentRegistrationOptionsInterfaceSymbol.Name).ToArray() - ?? Array.Empty(); - if (staticBaseList.Length > 0) - { - staticRegistrationOptions = staticRegistrationOptions.WithBaseList(BaseList(SeparatedList(staticBaseList))); - } - else + var staticRegistrationOptions = registrationOptions.WithIdentifier(Identifier($"StaticOptions")) + .WithMembers( + List( + registrationOptions.Members.OfType() + ) + ) + .WithAttributeLists(List()); + + var staticBaseList = + registrationOptions.BaseList?.Types.Where(z => z.Type.GetSyntaxName() != attributes.TextDocumentRegistrationOptionsInterfaceSymbol.Name) + .ToArray() ?? Array.Empty(); + if (staticBaseList.Length > 0) + { + staticRegistrationOptions = staticRegistrationOptions.WithBaseList(BaseList(SeparatedList(staticBaseList))); + } + else + { + staticRegistrationOptions = staticRegistrationOptions.WithBaseList(null); + } + + if (data.KeyExpression is { }) + { + var attributeList = AttributeList( + SingletonSeparatedList( + Attribute( + IdentifierName("RegistrationOptionsKey"), AttributeArgumentList(SeparatedList(data.KeyExpression.Select(AttributeArgument))) + ) + ) + ); + extendedRegistrationOptions = extendedRegistrationOptions.AddAttributeLists(attributeList); + staticRegistrationOptions = staticRegistrationOptions.AddAttributeLists(attributeList); + } + + if (data.SupportsDocumentSelector && !data.ImplementsDocumentSelector) + { + if (registrationOptions.BaseList?.Types.Any( + z => z.Type.ToFullString().Contains(attributes.TextDocumentRegistrationOptionsInterfaceSymbol.Name) + ) != true) { - staticRegistrationOptions = staticRegistrationOptions.WithBaseList(null); + extendedRegistrationOptions = ExtendAndImplementInterface( + extendedRegistrationOptions, attributes.TextDocumentRegistrationOptionsInterfaceSymbol + ); } - if (data.KeyExpression is { }) - { - var attributeList = - AttributeList( - SingletonSeparatedList( - Attribute( - IdentifierName("RegistrationOptionsKey"), - AttributeArgumentList( - SeparatedList(data.KeyExpression.Select(AttributeArgument)) - ) + extendedRegistrationOptions = extendedRegistrationOptions.AddMembers( + PropertyDeclaration(NullableType(IdentifierName("DocumentSelector")), Identifier("DocumentSelector")) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) + .WithAccessorList( + AccessorList( + List( + new[] + { + AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), + AccessorDeclaration(SyntaxKind.SetAccessorDeclaration) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + } ) ) - ); - extendedRegistrationOptions = extendedRegistrationOptions.AddAttributeLists(attributeList); - staticRegistrationOptions = staticRegistrationOptions.AddAttributeLists(attributeList); - } + ) + ); + } - if (data.SupportsDocumentSelector && !data.ImplementsDocumentSelector) + if (data.SupportsWorkDoneProgress && !data.ImplementsWorkDoneProgress) + { + if (registrationOptions.BaseList?.Types.Any(z => z.Type.GetSyntaxName() == attributes.WorkDoneProgressOptionsInterfaceSymbol.Name) != true) { - if (registrationOptions.BaseList?.Types.Any(z => z.Type.ToFullString().Contains(textDocumentRegistrationOptionsInterfaceSymbol.Name)) != true) - { - extendedRegistrationOptions = ExtendAndImplementInterface(extendedRegistrationOptions, textDocumentRegistrationOptionsInterfaceSymbol); - } - - extendedRegistrationOptions = extendedRegistrationOptions - .AddMembers( - PropertyDeclaration(NullableType(IdentifierName("DocumentSelector")), Identifier("DocumentSelector")) - .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) - .WithAccessorList( - AccessorList( - List( - new[] { - AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), - AccessorDeclaration(SyntaxKind.SetAccessorDeclaration) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - } - ) - ) - ) - ); + extendedRegistrationOptions = ExtendAndImplementInterface( + extendedRegistrationOptions, attributes.WorkDoneProgressOptionsInterfaceSymbol + ); + staticRegistrationOptions = ExtendAndImplementInterface(staticRegistrationOptions, attributes.WorkDoneProgressOptionsInterfaceSymbol); } - if (data.SupportsWorkDoneProgress && !data.ImplementsWorkDoneProgress) - { - if (registrationOptions.BaseList?.Types.Any(z => z.Type.GetSyntaxName() == workDoneProgressOptionsInterfaceSymbol.Name) != true) - { - extendedRegistrationOptions = ExtendAndImplementInterface(extendedRegistrationOptions, workDoneProgressOptionsInterfaceSymbol); - staticRegistrationOptions = ExtendAndImplementInterface(staticRegistrationOptions, workDoneProgressOptionsInterfaceSymbol); - } - - staticRegistrationOptions = staticRegistrationOptions.AddMembers(GetWorkDoneProperty()); - extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(GetWorkDoneProperty()); - } + staticRegistrationOptions = staticRegistrationOptions.AddMembers(GetWorkDoneProperty()); + extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(GetWorkDoneProperty()); + } - if (data.SupportsStaticRegistrationOptions && !data.ImplementsStaticRegistrationOptions) + if (data.SupportsStaticRegistrationOptions && !data.ImplementsStaticRegistrationOptions) + { + if (registrationOptions.BaseList?.Types.Any(z => z.Type.GetSyntaxName() == attributes.StaticRegistrationOptionsInterfaceSymbol.Name) + != true) { - if (registrationOptions.BaseList?.Types.Any(z => z.Type.GetSyntaxName() == staticRegistrationOptionsInterfaceSymbol.Name) != true) - { - extendedRegistrationOptions = ExtendAndImplementInterface(extendedRegistrationOptions, staticRegistrationOptionsInterfaceSymbol); - staticRegistrationOptions = ExtendAndImplementInterface(staticRegistrationOptions, staticRegistrationOptionsInterfaceSymbol); - } - - staticRegistrationOptions = staticRegistrationOptions.AddMembers(GetIdProperty()); - extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(GetIdProperty()); + extendedRegistrationOptions = ExtendAndImplementInterface( + extendedRegistrationOptions, attributes.StaticRegistrationOptionsInterfaceSymbol + ); + staticRegistrationOptions = ExtendAndImplementInterface(staticRegistrationOptions, attributes.StaticRegistrationOptionsInterfaceSymbol); } - if (data.RegistrationOptionsConverter is null - && CreateConverter(registrationOptions, staticRegistrationOptions.Members.OfType()) is { } converter) - { - extendedRegistrationOptions = extendedRegistrationOptions - .AddAttributeLists( - AttributeList( - SingletonSeparatedList( - Attribute( - IdentifierName("RegistrationOptionsConverterAttribute"), - AttributeArgumentList( - SingletonSeparatedList( - AttributeArgument( - TypeOfExpression(IdentifierName(converter.Identifier.Text)) + staticRegistrationOptions = staticRegistrationOptions.AddMembers(GetIdProperty()); + extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(GetIdProperty()); + } + + if (data.RegistrationOptionsConverter is null && CreateConverter( + registrationOptions, staticRegistrationOptions.Members.OfType() + ) is { } converter) + { + extendedRegistrationOptions = extendedRegistrationOptions.AddAttributeLists( + AttributeList( + SingletonSeparatedList( + Attribute( + IdentifierName("RegistrationOptionsConverterAttribute"), + AttributeArgumentList( + SingletonSeparatedList( + AttributeArgument( + TypeOfExpression( + IdentifierName(converter.Identifier.Text) + ) + ) + ) + ) + ) + ) + ) ) - ) - ) - ) - ) - ) - ) - .AddMembers(converter); - } + .AddMembers(converter); + } - extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(staticRegistrationOptions); + extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(staticRegistrationOptions); - var members = new List() { extendedRegistrationOptions }; + var members = new List() { extendedRegistrationOptions }; - var cu = CompilationUnit() - .WithUsings(registrationOptions.SyntaxTree.GetCompilationUnitRoot().Usings) - .AddMembers( - NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) - .WithMembers(List(members)) - .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) - .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) - ) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); + var cu = CompilationUnit() + .WithUsings(registrationOptions.SyntaxTree.GetCompilationUnitRoot().Usings) + .AddMembers( + NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) + .WithMembers(List(members)) + .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) + .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) + ); - foreach (var ns in RequiredUsings) + foreach (var ns in RequiredUsings) + { + if (cu.Usings.All(z => z.Name.ToFullString() != ns)) { - if (cu.Usings.All(z => z.Name.ToFullString() != ns)) - { - cu = cu.AddUsings(UsingDirective(ParseName(ns))); - } + cu = cu.AddUsings(UsingDirective(ParseName(ns))); } - - addCacheSource( - $"{registrationOptions.Identifier.Text}.cs", - registrationOptions, - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); - } - catch (Exception e) - { - context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.Exception, registrationOptions.GetLocation(), e.Message, e.StackTrace ?? string.Empty)); - Debug.WriteLine(e); - Debug.WriteLine(e.StackTrace); } + + context.AddSource($"{registrationOptions.Identifier.Text}.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); + } + catch (Exception e) + { + context.ReportDiagnostic( + Diagnostic.Create(GeneratorDiagnostics.Exception, registrationOptions.GetLocation(), e.Message, e.StackTrace ?? string.Empty) + ); + Debug.WriteLine(e); + Debug.WriteLine(e.StackTrace); } + } + private void GenerateAssemblyRegistrationOptions( + SourceProductionContext context, ImmutableArray<(string @namespace, AttributeArgumentSyntax argumentSyntax)> types + ) + { + var namespaces = new HashSet() { "OmniSharp.Extensions.LanguageServer.Protocol" }; + if (types.Any()) { - var namespaces = new HashSet() { "OmniSharp.Extensions.LanguageServer.Protocol" }; - var types = syntaxReceiver.FoundNodes - .Concat(syntaxReceiver.RegistrationOptions) - .Select( - options => { - var semanticModel = context.Compilation.GetSemanticModel(options.SyntaxTree); - var typeSymbol = semanticModel.GetDeclaredSymbol(options)!; - namespaces.Add(typeSymbol.ContainingNamespace.ToDisplayString()); - return AttributeArgument(TypeOfExpression(IdentifierName(typeSymbol.Name))); - } - ) - .ToArray(); - if (types.Any()) + foreach (var item in types) { - var cu = CompilationUnit() - .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) - .AddAttributeLists( - AttributeList( - target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), - SingletonSeparatedList(Attribute(IdentifierName("AssemblyRegistrationOptions"), AttributeArgumentList(SeparatedList(types)))) + namespaces.Add(item.@namespace); + } + + var cu = CompilationUnit() + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) + .AddAttributeLists( + AttributeList( + target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), + SingletonSeparatedList( + Attribute( + IdentifierName("AssemblyRegistrationOptions"), + AttributeArgumentList(SeparatedList(types.Select(z => z.argumentSyntax))) + ) ) ) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); + ); - context.AddSource("AssemblyRegistrationOptions.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); - } + context.AddSource("AssemblyRegistrationOptions.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); } + } - static TypeDeclarationSyntax ExtendAndImplementInterface(TypeDeclarationSyntax syntax, ITypeSymbol symbolToExtendFrom) - { - return syntax switch { - ClassDeclarationSyntax cd => cd.AddBaseListTypes(SimpleBaseType(ParseName(symbolToExtendFrom.ToDisplayString()))), - RecordDeclarationSyntax rd => rd.AddBaseListTypes(SimpleBaseType(ParseName(symbolToExtendFrom.ToDisplayString()))), - _ => throw new NotSupportedException() - }; - } - static PropertyDeclarationSyntax GetWorkDoneProperty() + static TypeDeclarationSyntax ExtendAndImplementInterface(TypeDeclarationSyntax syntax, ITypeSymbol symbolToExtendFrom) + { + return syntax switch { - return PropertyDeclaration(PredefinedType(Token(SyntaxKind.BoolKeyword)), Identifier("WorkDoneProgress")) - .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) - .WithAttributeLists( - SingletonList( - AttributeList( - SingletonSeparatedList(Attribute(IdentifierName("Optional"))) - ) + ClassDeclarationSyntax cd => cd.AddBaseListTypes(SimpleBaseType(ParseName(symbolToExtendFrom.ToDisplayString()))), + RecordDeclarationSyntax rd => rd.AddBaseListTypes(SimpleBaseType(ParseName(symbolToExtendFrom.ToDisplayString()))), + _ => throw new NotSupportedException() + }; + } + + static PropertyDeclarationSyntax GetWorkDoneProperty() + { + return PropertyDeclaration(PredefinedType(Token(SyntaxKind.BoolKeyword)), Identifier("WorkDoneProgress")) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) + .WithAttributeLists( + SingletonList( + AttributeList( + SingletonSeparatedList(Attribute(IdentifierName("Optional"))) ) ) - .WithAccessorList(CommonElements.GetSetAccessor); - } + ) + .WithAccessorList(CommonElements.GetSetAccessor); + } - static PropertyDeclarationSyntax GetIdProperty() - { - return PropertyDeclaration(NullableType(PredefinedType(Token(SyntaxKind.StringKeyword))), Identifier("Id")) - .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) - .WithAttributeLists( - SingletonList( - AttributeList( - SingletonSeparatedList(Attribute(IdentifierName("Optional"))) - ) + static PropertyDeclarationSyntax GetIdProperty() + { + return PropertyDeclaration(NullableType(PredefinedType(Token(SyntaxKind.StringKeyword))), Identifier("Id")) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) + .WithAttributeLists( + SingletonList( + AttributeList( + SingletonSeparatedList(Attribute(IdentifierName("Optional"))) ) ) - .WithAccessorList(CommonElements.GetSetAccessor); - } + ) + .WithAccessorList(CommonElements.GetSetAccessor); } private static IEnumerable GetMapping(IEnumerable properties, IdentifierNameSyntax paramName) { return properties - .Where(z => z.AccessorList?.Accessors.Any(a => a.Keyword.Kind() == SyntaxKind.SetKeyword || a.Keyword.Kind() == SyntaxKind.InitKeyword) == true) + .Where( + z => z.AccessorList?.Accessors.Any(a => a.Keyword.Kind() == SyntaxKind.SetKeyword || a.Keyword.Kind() == SyntaxKind.InitKeyword) == true + ) .Select( property => AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, @@ -310,7 +384,8 @@ private static IEnumerable GetMapping(IEnumerable GetMapping(IEnumerable GetMapping(IEnumerable new SyntaxReceiver(Cache)) - { - } - - public static CacheContainer Cache = new(); - - public class SyntaxReceiver : SyntaxReceiverCache - { - public List RegistrationOptions { get; } = new(); - - public override string? GetKey(TypeDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - foreach (var item in syntax.Members.OfType().Select(z => z.Identifier.Text)) - { - hasher.Append(item); - } - - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(TypeDeclarationSyntax syntaxNode) - { - if (syntaxNode is ClassDeclarationSyntax or RecordDeclarationSyntax - && syntaxNode.AttributeLists - .SelectMany(z => z.Attributes) - .Any(z => z.Name.ToFullString().Contains("GenerateRegistrationOptions")) - ) - { - RegistrationOptions.Add(syntaxNode); - } - } - - public SyntaxReceiver(CacheContainer cache) : base(cache) - { - } - } } } diff --git a/src/JsonRpc.Generators/Strategies/EnsureNamespaceStrategy.cs b/src/JsonRpc.Generators/Strategies/EnsureNamespaceStrategy.cs index 7f4482cde..76e48e5b7 100644 --- a/src/JsonRpc.Generators/Strategies/EnsureNamespaceStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/EnsureNamespaceStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -6,7 +7,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class EnsureNamespaceStrategy : IExtensionMethodGeneratorStrategy { - public IEnumerable Apply(GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, GeneratorData item) { if (item.Capability != null) item.AdditionalUsings.Add(item.Capability.Symbol.ContainingNamespace.ToDisplayString()); if (item.RegistrationOptions != null) item.AdditionalUsings.Add(item.RegistrationOptions.Symbol.ContainingNamespace.ToDisplayString()); diff --git a/src/JsonRpc.Generators/Strategies/ExtensionMethodGeneratorStrategy.cs b/src/JsonRpc.Generators/Strategies/ExtensionMethodGeneratorStrategy.cs index 0b8116e80..182210655 100644 --- a/src/JsonRpc.Generators/Strategies/ExtensionMethodGeneratorStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/ExtensionMethodGeneratorStrategy.cs @@ -19,13 +19,13 @@ public ExtensionMethodGeneratorStrategy(ImmutableArray Apply(GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, GeneratorData item) { var methods = _extensionMethodGeneratorStrategies.Aggregate( new List(), (m, strategy) => { try { - m.AddRange(strategy.Apply(item)); + m.AddRange(strategy.Apply(context, item)); } catch (Exception e) { diff --git a/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs b/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs index 65881c524..08a0b1368 100644 --- a/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs @@ -11,7 +11,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class HandlerGeneratorStrategy : ICompilationUnitGeneratorStrategy { - public IEnumerable Apply(GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, GeneratorData item) { if (item.JsonRpcAttributes.GenerateHandler is not { }) yield break; var members = new List(); diff --git a/src/JsonRpc.Generators/Strategies/HandlerRegistryActionContextRunnerStrategy.cs b/src/JsonRpc.Generators/Strategies/HandlerRegistryActionContextRunnerStrategy.cs index ffda7747c..ab5ddf6df 100644 --- a/src/JsonRpc.Generators/Strategies/HandlerRegistryActionContextRunnerStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/HandlerRegistryActionContextRunnerStrategy.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -14,17 +15,20 @@ public HandlerRegistryActionContextRunnerStrategy(ImmutableArray Apply(GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, GeneratorData item) { + foreach (var diagnostic in item.JsonRpcAttributes.HandlerRegistryDiagnostics) + { + context.ReportDiagnostic(diagnostic); + } return item.JsonRpcAttributes.HandlerRegistries .Select( registry => new ExtensionMethodContext( - item.JsonRpcAttributes.GenerateHandlerMethods!.Data, item.TypeDeclaration, item.TypeSymbol, registry, item.JsonRpcAttributes.HandlerRegistries, - item.Context + item.JsonRpcAttributes.GenerateHandlerMethods!.Data, item.TypeDeclaration, item.TypeSymbol, registry, item.JsonRpcAttributes.HandlerRegistries ) { IsRegistry = true } ) .SelectMany(_ => _strategies, (actionContext, strategy) => new { actionContext, strategy }) - .SelectMany(@t => @t.strategy.Apply(@t.actionContext, item)); + .SelectMany(@t => @t.strategy.Apply(context, @t.actionContext, item)); } } } diff --git a/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs index 660226913..b4f0324bc 100644 --- a/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Collections.Generic; using System.Collections.Immutable; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -13,7 +14,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class OnNotificationMethodGeneratorWithRegistrationOptionsStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is not { RegistrationOptions: { } registrationOptions }) yield break; if (item is not NotificationItem notification) yield break; diff --git a/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithoutRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithoutRegistrationOptionsStrategy.cs index 984cf5f4b..d0e158e53 100644 --- a/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithoutRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithoutRegistrationOptionsStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -10,7 +11,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class OnNotificationMethodGeneratorWithoutRegistrationOptionsStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is { RegistrationOptions: { } }) yield break; if (item is not NotificationItem notification) yield break; diff --git a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs index 7db3b435e..7ad741a03 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs @@ -21,7 +21,7 @@ public OnRequestMethodGeneratorWithRegistrationOptionsStrategy(bool doResolve) _doResolve = doResolve; } - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is not { RegistrationOptions: { } registrationOptions }) yield break; if (item is not RequestItem request) yield break; diff --git a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs index 2eecbffe3..0bdcdccaa 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs @@ -19,7 +19,7 @@ public OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy(bool doResolve _doResolve = doResolve; } - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is { RegistrationOptions: { } }) yield break; if (item is not RequestItem request) yield break; diff --git a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs index b13c22046..303f9908d 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs @@ -14,7 +14,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is not { RegistrationOptions: { } registrationOptions }) yield break; if (item is not RequestItem request) yield break; diff --git a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs index 027144aa6..a7f88defc 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs @@ -13,7 +13,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies internal class OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is { RegistrationOptions: { } }) yield break; if (item is not RequestItem request) yield break; diff --git a/src/JsonRpc.Generators/Strategies/RequestProxyActionContextRunnerStrategy.cs b/src/JsonRpc.Generators/Strategies/RequestProxyActionContextRunnerStrategy.cs index 17ee67b1f..791c51ddc 100644 --- a/src/JsonRpc.Generators/Strategies/RequestProxyActionContextRunnerStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/RequestProxyActionContextRunnerStrategy.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -14,17 +15,20 @@ public RequestProxyActionContextRunnerStrategy(ImmutableArray Apply(GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, GeneratorData item) { + foreach (var diagnostic in item.JsonRpcAttributes.RequestProxyDiagnostics) + { + context.ReportDiagnostic(diagnostic); + } return item.JsonRpcAttributes.RequestProxies .Select( registry => new ExtensionMethodContext( - item.JsonRpcAttributes.GenerateRequestMethods!.Data, item.TypeDeclaration, item.TypeSymbol, registry, item.JsonRpcAttributes.RequestProxies, - item.Context + item.JsonRpcAttributes.GenerateRequestMethods!.Data, item.TypeDeclaration, item.TypeSymbol, registry, item.JsonRpcAttributes.RequestProxies ) { IsProxy = true } ) .SelectMany(_ => _strategies, (actionContext, strategy) => new { actionContext, strategy }) - .SelectMany(t => t.strategy.Apply(t.actionContext, item)); + .SelectMany(t => t.strategy.Apply(context, t.actionContext, item)); } } } diff --git a/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs index bad6be5c1..265473f86 100644 --- a/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; @@ -8,7 +9,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class SendMethodNotificationStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is not NotificationItem notification) yield break; if (extensionMethodContext is not { IsProxy: true }) yield break; diff --git a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs index fdcf99139..7bbc19ce3 100644 --- a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs @@ -9,7 +9,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class SendMethodRequestStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (item is not RequestItem request) yield break; if (extensionMethodContext is not { IsProxy: true }) yield break; diff --git a/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs b/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs index f1fbaef01..21d7b9905 100644 --- a/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; @@ -8,7 +9,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class TypedDelegatingHandlerStrategy : IExtensionMethodGeneratorStrategy { - public IEnumerable Apply(GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, GeneratorData item) { if (item is not RequestItem requestItem) yield break; if (requestItem is not { LspAttributes: { Resolver: { } } }) yield break; diff --git a/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs b/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs index 82c16622d..17eb45176 100644 --- a/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs @@ -7,7 +7,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies { internal class WarnIfResponseRouterIsNotProvidedStrategy : IExtensionMethodContextGeneratorStrategy { - public IEnumerable Apply(ExtensionMethodContext extensionMethodContext, GeneratorData item) + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) { if (extensionMethodContext is not { IsProxy: true }) yield break; @@ -20,7 +20,7 @@ public IEnumerable Apply(ExtensionMethodContext extensi && generateRequestMethods.Data.ConstructorArguments[0].Values.Length == 0 ) && !extensionMethodContext.TypeSymbol.ContainingNamespace.ToDisplayString().StartsWith("OmniSharp.Extensions.DebugAdapter.Protocol")) { - item.ReportDiagnostic(static type => Diagnostic.Create(GeneratorDiagnostics.NoResponseRouterProvided, type.Identifier.GetLocation(), type.Identifier.Text)); + context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.NoResponseRouterProvided, item.TypeDeclaration.Identifier.GetLocation(), item.TypeDeclaration.Identifier.Text)); } } } diff --git a/src/JsonRpc.Generators/StronglyTypedGenerator.cs b/src/JsonRpc.Generators/StronglyTypedGenerator.cs index dd83fafdc..42f64bcf5 100644 --- a/src/JsonRpc.Generators/StronglyTypedGenerator.cs +++ b/src/JsonRpc.Generators/StronglyTypedGenerator.cs @@ -5,252 +5,298 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using static OmniSharp.Extensions.JsonRpc.Generators.Helpers; namespace OmniSharp.Extensions.JsonRpc.Generators { [Generator] - public class StronglyTypedGenerator : CachedSourceGenerator + public class StronglyTypedGenerator : IIncrementalGenerator { - private static string[] RequiredUsings = new[] { + private static string[] RequiredUsings = new[] + { "System.Collections.Generic", "System.Collections.ObjectModel", "System.Collections.Immutable", "System.Linq", }; - protected override void Execute( - GeneratorExecutionContext context, SyntaxReceiver syntaxReceiver, AddCacheSource addCacheSource, - ReportCacheDiagnostic cacheDiagnostic - ) - { - var generateTypedDataAttributeSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute"); - var generateContainerAttributeSymbol = context.Compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateContainerAttribute"); + private record AttributeData(INamedTypeSymbol GenerateTypedDataAttributeSymbol, INamedTypeSymbol GenerateContainerAttributeSymbol); - foreach (var classToContain in syntaxReceiver.CreateContainers) - { - var semanticModel = context.Compilation.GetSemanticModel(classToContain.SyntaxTree); - var typeSymbol = semanticModel.GetDeclaredSymbol(classToContain); - var attribute = typeSymbol?.GetAttributes().FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateContainerAttributeSymbol)); - if (typeSymbol == null || attribute is null) continue; - - var containerName = attribute is { ConstructorArguments: { Length: > 0 } arguments } ? arguments[0].Value as string : null; - - var container = CreateContainerClass(classToContain, containerName) - .AddAttributeLists( - AttributeList( - SeparatedList( - new[] { - Attribute(ParseName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")), - Attribute(ParseName("System.Runtime.CompilerServices.CompilerGeneratedAttribute")) - } - ) - ) - ); + public void Initialize(IncrementalGeneratorInitializationContext context) + { + var attributes = context.CompilationProvider + .Select( + (compilation, token) => new AttributeData( + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute" + )!, + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateContainerAttribute" + )! + ) + ); - var cu = CompilationUnit() - .WithUsings(classToContain.SyntaxTree.GetCompilationUnitRoot().Usings) - .AddMembers( - NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) - .AddMembers(container) - .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) - .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) - ) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); - - foreach (var ns in RequiredUsings) + var createContainersSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => syntaxNode switch { - if (cu.Usings.All(z => z.Name.ToFullString() != ns)) - { - cu = cu.AddUsings(UsingDirective(ParseName(ns))); - } - } + StructDeclarationSyntax structDeclarationSyntax when structDeclarationSyntax.AttributeLists.ContainsAttribute("GenerateContainer") => true, + TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) when typeDeclarationSyntax + .AttributeLists.ContainsAttribute("GenerateContainer") => true, + _ => false + }, transform: (syntaxContext, token) => syntaxContext + ); - addCacheSource( - $"{containerName ?? classToContain.Identifier.Text + "Container"}.cs", - classToContain, - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); - } + var canBeResolvedSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => + syntaxNode is TypeDeclarationSyntax { BaseList: { } } typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) + && syntaxNode.SyntaxTree.HasCompilationUnitRoot + && typeDeclarationSyntax.Members.OfType().Any(z => z.Identifier.Text == "Data") + && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanBeResolved"), + transform: (syntaxContext, token) => syntaxContext + ); - foreach (var canBeResolved in syntaxReceiver.CanBeResolved) - { - var dataInterfaceName = IdentifierName("ICanBeResolved"); - CreateTypedClass( - context, canBeResolved, dataInterfaceName, generateTypedDataAttributeSymbol, generateContainerAttributeSymbol, true, addCacheSource, cacheDiagnostic - ); - } + var canHaveDataSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + predicate: (syntaxNode, token) => + syntaxNode is TypeDeclarationSyntax { BaseList: { } } typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) + && syntaxNode.SyntaxTree.HasCompilationUnitRoot + && typeDeclarationSyntax.Members.OfType().Any(z => z.Identifier.Text == "Data") + && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanHaveData"), transform: (syntaxContext, token) => syntaxContext + ); - foreach (var canBeResolved in syntaxReceiver.CanHaveData) - { - var dataInterfaceName = IdentifierName("ICanHaveData"); - CreateTypedClass( - context, canBeResolved, dataInterfaceName, generateTypedDataAttributeSymbol, generateContainerAttributeSymbol, false, addCacheSource, cacheDiagnostic + context.RegisterSourceOutput(createContainersSyntaxProvider.Combine(attributes), GenerateContainerClass); + context.RegisterSourceOutput(canBeResolvedSyntaxProvider.Combine(attributes), GenerateCanBeResolvedClass); + context.RegisterSourceOutput(canHaveDataSyntaxProvider.Combine(attributes), GenerateCanHaveDataClass); + } + + private void GenerateContainerClass(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, AttributeData attributeData) valueTuple) + { + var (syntaxContext, attributeData) = valueTuple; + var classToContain = (TypeDeclarationSyntax)syntaxContext.Node; + var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(classToContain); + var attribute = typeSymbol?.GetAttributes() + .FirstOrDefault( + z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, attributeData.GenerateContainerAttributeSymbol) + ); + if (typeSymbol == null || attribute is null) return; + + var containerName = attribute is { ConstructorArguments: { Length: > 0 } arguments } ? arguments[0].Value as string : null; + + var container = CreateContainerClass(classToContain, containerName) + .AddAttributeLists( + AttributeList( + SeparatedList( + new[] + { + Attribute(ParseName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")), + Attribute(ParseName("System.Runtime.CompilerServices.CompilerGeneratedAttribute")) + } + ) + ) ); - } - static void CreateTypedClass( - GeneratorExecutionContext context, - TypeDeclarationSyntax candidate, - IdentifierNameSyntax dataInterfaceName, - INamedTypeSymbol? generateTypedDataAttributeSymbol, - INamedTypeSymbol? generateContainerAttributeSymbol, - bool includeHandlerIdentity, - AddCacheSource cacheItem, - ReportCacheDiagnostic cacheDiagnostic - ) - { - var semanticModel = context.Compilation.GetSemanticModel(candidate.SyntaxTree); - var typeSymbol = semanticModel.GetDeclaredSymbol(candidate); - var attribute = typeSymbol?.GetAttributes().FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateTypedDataAttributeSymbol)); - if (typeSymbol == null || attribute is null) return; - var container = typeSymbol.GetAttributes().FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateContainerAttributeSymbol)); + var cu = CompilationUnit() + .WithUsings(classToContain.SyntaxTree.GetCompilationUnitRoot().Usings) + .AddMembers( + NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) + .AddMembers(container) + .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) + .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) + ); - if (!candidate.Modifiers.Any(SyntaxKind.PartialKeyword)) + foreach (var ns in RequiredUsings) + { + if (cu.Usings.All(z => z.Name.ToFullString() != ns)) { - cacheDiagnostic(candidate, static c => Diagnostic.Create(GeneratorDiagnostics.MustBePartial, c.Identifier.GetLocation(), c.Identifier.Text)); - return; + cu = cu.AddUsings(UsingDirective(ParseName(ns))); } + } - var property = candidate.Members.OfType().Single(z => z.Identifier.Text == "Data"); - var partialClass = candidate - .WithAttributeLists(List()) - .WithBaseList(null) - .WithMembers(List()) - .AddMembers( - GetWithDataMethod(candidate, HandlerIdentityConstraintClause(includeHandlerIdentity, IdentifierName("TData"))), - GetFromMethod(candidate, includeHandlerIdentity) - ); - - var compilationMembers = new List(); - - - var convertFromOperator = GetConvertFromOperator(candidate); - var convertToOperator = GetConvertToOperator(candidate); - // remove the data property - var typedClass = candidate - .WithHandlerIdentityConstraint(includeHandlerIdentity) - .WithMembers(candidate.Members.Replace(property, GetPropertyImpl(property).WithType(IdentifierName("T")))) - .AddMembers( - GetWithDataMethod(candidate, HandlerIdentityConstraintClause(includeHandlerIdentity, IdentifierName("TData"))), - GetExplicitProperty(property, dataInterfaceName), - GetJDataProperty(), - convertFromOperator, - convertToOperator, - GetGenericFromMethod(candidate) - ) - .WithAttributeLists( - List( - candidate.AttributeLists - .Where(z => !z.ContainsAttribute("Method") && !z.ContainsAttribute("GenerateTypedData")) - ) + context.AddSource( + $"{containerName ?? classToContain.Identifier.Text + "Container"}.cs", + cu.NormalizeWhitespace().GetText(Encoding.UTF8) + ); + } + + private void GenerateCanBeResolvedClass(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, AttributeData attributeData) valueTuple) + { + var (syntaxContext, attributeData) = valueTuple; + var canBeResolved = (TypeDeclarationSyntax)syntaxContext.Node; + var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(canBeResolved)!; + + var dataInterfaceName = IdentifierName("ICanBeResolved"); + CreateTypedClass( + context, canBeResolved, typeSymbol, dataInterfaceName, attributeData.GenerateTypedDataAttributeSymbol, attributeData.GenerateContainerAttributeSymbol, true + ); + } + + private void GenerateCanHaveDataClass(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, AttributeData attributeData) valueTuple) + { + var (syntaxContext, attributeData) = valueTuple; + var canBeResolved = (TypeDeclarationSyntax)syntaxContext.Node; + var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(canBeResolved)!; + + var dataInterfaceName = IdentifierName("ICanHaveData"); + CreateTypedClass( + context, canBeResolved, typeSymbol, dataInterfaceName, attributeData.GenerateTypedDataAttributeSymbol, attributeData.GenerateContainerAttributeSymbol, true + ); + } + + private static void CreateTypedClass( + SourceProductionContext context, + TypeDeclarationSyntax candidate, + INamedTypeSymbol typeSymbol, + IdentifierNameSyntax dataInterfaceName, + INamedTypeSymbol? generateTypedDataAttributeSymbol, + INamedTypeSymbol? generateContainerAttributeSymbol, + bool includeHandlerIdentity + ) + { + var attribute = typeSymbol?.GetAttributes() + .FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateTypedDataAttributeSymbol)); + if (typeSymbol == null || attribute is null) return; + var container = typeSymbol.GetAttributes() + .FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateContainerAttributeSymbol)); + + if (!candidate.Modifiers.Any(SyntaxKind.PartialKeyword)) + { + context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.MustBePartial, candidate.Identifier.GetLocation(), candidate.Identifier.Text)); + return; + } + + var property = candidate.Members.OfType().Single(z => z.Identifier.Text == "Data"); + var partialClass = candidate + .WithAttributeLists(List()) + .WithBaseList(null) + .WithMembers(List()) + .AddMembers( + GetWithDataMethod(candidate, HandlerIdentityConstraintClause(includeHandlerIdentity, IdentifierName("TData"))), + GetFromMethod(candidate, includeHandlerIdentity) + ); + + var compilationMembers = new List(); + + + var convertFromOperator = GetConvertFromOperator(candidate); + var convertToOperator = GetConvertToOperator(candidate); + // remove the data property + var typedClass = candidate + .WithHandlerIdentityConstraint(includeHandlerIdentity) + .WithMembers(candidate.Members.Replace(property, GetPropertyImpl(property).WithType(IdentifierName("T")))) + .AddMembers( + GetWithDataMethod(candidate, HandlerIdentityConstraintClause(includeHandlerIdentity, IdentifierName("TData"))), + GetExplicitProperty(property, dataInterfaceName), + GetJDataProperty(), + convertFromOperator, + convertToOperator, + GetGenericFromMethod(candidate) + ) + .WithAttributeLists( + List( + candidate.AttributeLists + .Where(z => !z.ContainsAttribute("Method") && !z.ContainsAttribute("GenerateTypedData")) ) - .WithBaseList(BaseList(SingletonSeparatedList(SimpleBaseType(dataInterfaceName)))) - .AddAttributeLists( - AttributeList( - SeparatedList( - new[] { - Attribute(ParseName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")), - Attribute(ParseName("System.Runtime.CompilerServices.CompilerGeneratedAttribute")) - } - ) + ) + .WithBaseList(BaseList(SingletonSeparatedList(SimpleBaseType(dataInterfaceName)))) + .AddAttributeLists( + AttributeList( + SeparatedList( + new[] + { + Attribute(ParseName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")), + Attribute(ParseName("System.Runtime.CompilerServices.CompilerGeneratedAttribute")) + } ) ) + ) // .WithLeadingTrivia(candidate.GetLeadingTrivia().Where(z => !z.ToString().Contains("#nullable"))) // .WithTrailingTrivia(candidate.GetTrailingTrivia().Where(z => !z.ToString().Contains("#nullable"))) - ; + ; - if (container is { }) - { - var containerName = container is { ConstructorArguments: { Length: > 0 } arguments } ? arguments[0].Value as string : null; - var typedContainer = CreateContainerClass(typedClass, containerName) - .WithHandlerIdentityConstraint(includeHandlerIdentity); - - var typedArgumentList = TypeArgumentList(SingletonSeparatedList(IdentifierName("T"))); - typedContainer = typedContainer - .AddMembers( - ConversionOperatorDeclaration(Token(SyntaxKind.ImplicitKeyword), IdentifierName(typedContainer.Identifier)) - .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) - .WithParameterList( - ParameterList( - SingletonSeparatedList( - Parameter(Identifier("container")) - .WithType(GenericName(typedContainer.Identifier).WithTypeArgumentList(typedArgumentList)) - ) + if (container is { }) + { + var containerName = container is { ConstructorArguments: { Length: > 0 } arguments } ? arguments[0].Value as string : null; + var typedContainer = CreateContainerClass(typedClass, containerName) + .WithHandlerIdentityConstraint(includeHandlerIdentity); + + var typedArgumentList = TypeArgumentList(SingletonSeparatedList(IdentifierName("T"))); + typedContainer = typedContainer + .AddMembers( + ConversionOperatorDeclaration(Token(SyntaxKind.ImplicitKeyword), IdentifierName(typedContainer.Identifier)) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) + .WithParameterList( + ParameterList( + SingletonSeparatedList( + Parameter(Identifier("container")) + .WithType(GenericName(typedContainer.Identifier).WithTypeArgumentList(typedArgumentList)) ) ) - .WithExpressionBody( - ArrowExpressionClause( - ObjectCreationExpression(IdentifierName(typedContainer.Identifier)) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("container"), - IdentifierName("Select") - ) + ) + .WithExpressionBody( + ArrowExpressionClause( + ObjectCreationExpression(IdentifierName(typedContainer.Identifier)) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("container"), + IdentifierName("Select") ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - SimpleLambdaExpression(Parameter(Identifier("value"))) - .WithExpressionBody( - CastExpression( - IdentifierName(candidate.Identifier), - IdentifierName("value") - ) + ) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + SimpleLambdaExpression(Parameter(Identifier("value"))) + .WithExpressionBody( + CastExpression( + IdentifierName(candidate.Identifier), + IdentifierName("value") ) - ) + ) ) ) ) - ) + ) ) ) ) - ) - ) - .MakeMethodNullable(IdentifierName("container")) - .WithSemicolonToken( - Token(SyntaxKind.SemicolonToken) + ) ) - ); + ) + .MakeMethodNullable(IdentifierName("container")) + .WithSemicolonToken( + Token(SyntaxKind.SemicolonToken) + ) + ); - compilationMembers.Add(typedContainer); - } + compilationMembers.Add(typedContainer); + } - var cu = CompilationUnit() - .WithUsings(candidate.SyntaxTree.GetCompilationUnitRoot().Usings) - .AddMembers( - NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) - .AddMembers(partialClass, typedClass) - .AddMembers(compilationMembers.ToArray()) - .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) - .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) - ) - .WithLeadingTrivia(Comment(Preamble.GeneratedByATool)) - .WithTrailingTrivia(CarriageReturnLineFeed); - foreach (var ns in RequiredUsings) + var cu = CompilationUnit() + .WithUsings(candidate.SyntaxTree.GetCompilationUnitRoot().Usings) + .AddMembers( + NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) + .AddMembers(partialClass, typedClass) + .AddMembers(compilationMembers.ToArray()) + .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) + .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) + ); + foreach (var ns in RequiredUsings) + { + if (cu.Usings.All(z => z.Name.ToFullString() != ns)) { - if (cu.Usings.All(z => z.Name.ToFullString() != ns)) - { - cu = cu.AddUsings(UsingDirective(ParseName(ns))); - } + cu = cu.AddUsings(UsingDirective(ParseName(ns))); } - - cacheItem( - $"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}Typed.cs", - candidate, - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); } + + context.AddSource( + $"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}Typed.cs", + cu.NormalizeWhitespace().GetText(Encoding.UTF8) + ); } private static MethodDeclarationSyntax GetWithDataMethod(TypeDeclarationSyntax syntax, SyntaxList constraintSyntax) @@ -277,7 +323,8 @@ private static MethodDeclarationSyntax GetWithDataMethod(TypeDeclarationSyntax s SyntaxKind.ObjectInitializerExpression, SeparatedList( GetMapping(syntax, null).Concat( - new ExpressionSyntax[] { + new ExpressionSyntax[] + { AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, IdentifierName("Data"), @@ -337,7 +384,10 @@ private static MethodDeclarationSyntax GetFromMethod(TypeDeclarationSyntax synta private static IEnumerable GetMapping(TypeDeclarationSyntax syntax, IdentifierNameSyntax? paramName) { return syntax.Members.OfType() - .Where(z => z.AccessorList?.Accessors.Any(a => a.Keyword.Kind() == SyntaxKind.SetKeyword || a.Keyword.Kind() == SyntaxKind.InitKeyword) == true) + .Where( + z => z.AccessorList?.Accessors.Any(a => a.Keyword.Kind() == SyntaxKind.SetKeyword || a.Keyword.Kind() == SyntaxKind.InitKeyword) + == true + ) .Where(z => z.Identifier.Text != "Data") .Select( property => AssignmentExpression( @@ -383,7 +433,8 @@ private static ConversionOperatorDeclarationSyntax GetConvertToOperator(TypeDecl SeparatedList( GetMapping(syntax, paramName) .Concat( - new[] { + new[] + { AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, IdentifierName("Data"), @@ -438,7 +489,8 @@ private static ConversionOperatorDeclarationSyntax GetConvertFromOperator(TypeDe SeparatedList( GetMapping(syntax, paramName) .Concat( - new[] { + new[] + { AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, IdentifierName("JData"), @@ -474,18 +526,27 @@ private static PropertyDeclarationSyntax GetJDataProperty() .WithAccessorList( AccessorList( List( - new[] { + new[] + { AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) .WithExpressionBody( ArrowExpressionClause( - InvocationExpression(MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), IdentifierName("GetRawData"))) + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), IdentifierName("GetRawData") + ) + ) ) ) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), AccessorDeclaration(SyntaxKind.InitAccessorDeclaration) .WithExpressionBody( ArrowExpressionClause( - InvocationExpression(MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), IdentifierName("SetRawData"))) + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), IdentifierName("SetRawData") + ) + ) .WithArgumentList(ArgumentList(SingletonSeparatedList(Argument(IdentifierName("value"))))) ) ) @@ -501,7 +562,8 @@ static PropertyDeclarationSyntax GetPropertyImpl(PropertyDeclarationSyntax synta return syntax.WithAccessorList( AccessorList( List( - new[] { + new[] + { AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) .WithExpressionBody( ArrowExpressionClause( @@ -573,7 +635,8 @@ private static TypeDeclarationSyntax CreateContainerClass(TypeDeclarationSyntax ) .WithMembers( List( - new MemberDeclarationSyntax[] { + new MemberDeclarationSyntax[] + { ConstructorDeclaration(classIdentifier) .WithModifiers( TokenList( @@ -611,19 +674,27 @@ private static TypeDeclarationSyntax CreateContainerClass(TypeDeclarationSyntax .WithParameterList( ParameterList( SingletonSeparatedList( - Parameter(Identifier("items")).WithType(GenericName(Identifier("IEnumerable")).WithTypeArgumentList(typeArgumentList)) + Parameter(Identifier("items")).WithType( + GenericName(Identifier("IEnumerable")).WithTypeArgumentList(typeArgumentList) + ) ) ) ) .WithInitializer( - ConstructorInitializer(SyntaxKind.BaseConstructorInitializer, ArgumentList(SingletonSeparatedList(Argument(IdentifierName("items"))))) + ConstructorInitializer( + SyntaxKind.BaseConstructorInitializer, ArgumentList(SingletonSeparatedList(Argument(IdentifierName("items")))) + ) ) .WithBody(Block()), ConstructorDeclaration(classIdentifier) .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) - .WithParameterList(ParameterList(SingletonSeparatedList(ArrayParameter(typeName).WithModifiers(TokenList(Token(SyntaxKind.ParamsKeyword)))))) + .WithParameterList( + ParameterList(SingletonSeparatedList(ArrayParameter(typeName).WithModifiers(TokenList(Token(SyntaxKind.ParamsKeyword))))) + ) .WithInitializer( - ConstructorInitializer(SyntaxKind.BaseConstructorInitializer, ArgumentList(SingletonSeparatedList(Argument(IdentifierName("items"))))) + ConstructorInitializer( + SyntaxKind.BaseConstructorInitializer, ArgumentList(SingletonSeparatedList(Argument(IdentifierName("items")))) + ) ) .WithBody(Block()), AddConversionBody( @@ -649,7 +720,9 @@ private static TypeDeclarationSyntax CreateContainerClass(TypeDeclarationSyntax Identifier("List"), MethodDeclaration(className, Identifier("From")) ) - .WithParameterList(ParameterList(SingletonSeparatedList(ArrayParameter(typeName).WithModifiers(TokenList(Token(SyntaxKind.ParamsKeyword)))))), + .WithParameterList( + ParameterList(SingletonSeparatedList(ArrayParameter(typeName).WithModifiers(TokenList(Token(SyntaxKind.ParamsKeyword))))) + ), AddConversionBody( typeName, Identifier("Collection"), @@ -817,74 +890,5 @@ static BaseMethodDeclarationSyntax AddConversionBody(TypeSyntax typeName, Syntax ); } } - - public StronglyTypedGenerator() : base(() => new SyntaxReceiver(Cache)) - { - } - - public static CacheContainer Cache = new(); - - public class SyntaxReceiver : SyntaxReceiverCache - { - public List CanBeResolved { get; } = new(); - public List CanHaveData { get; } = new(); - public List CreateContainers { get; } = new(); - - public override string? GetKey(TypeDeclarationSyntax syntax) - { - var hasher = new CacheKeyHasher(); - hasher.Append(syntax.SyntaxTree.FilePath); - hasher.Append(syntax.Keyword.Text); - hasher.Append(syntax.Identifier.Text); - hasher.Append(syntax.TypeParameterList); - hasher.Append(syntax.AttributeLists); - hasher.Append(syntax.BaseList); - return hasher; - } - - /// - /// Called for every syntax node in the compilation, we can inspect the nodes and save any information useful for generation - /// - public override void OnVisitNode(TypeDeclarationSyntax syntaxNode) - { - // any field with at least one attribute is a candidate for property generation - - if (syntaxNode is StructDeclarationSyntax structDeclarationSyntax) - { - if (structDeclarationSyntax.AttributeLists.ContainsAttribute("GenerateContainer")) - { - CreateContainers.Add(structDeclarationSyntax); - } - } - - if (syntaxNode is ClassDeclarationSyntax or RecordDeclarationSyntax) - { - if (syntaxNode.AttributeLists.ContainsAttribute("GenerateContainer")) - { - CreateContainers.Add(syntaxNode); - } - - if ( - syntaxNode.BaseList != null && - syntaxNode.SyntaxTree.HasCompilationUnitRoot && - syntaxNode.Members.OfType().Any(z => z.Identifier.Text == "Data") - ) - { - if (syntaxNode.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanBeResolved")) - { - CanBeResolved.Add(syntaxNode); - } - else if (syntaxNode.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanHaveData")) - { - CanHaveData.Add(syntaxNode); - } - } - } - } - - public SyntaxReceiver(CacheContainer cache) : base(cache) - { - } - } } } diff --git a/src/Protocol/Generation/GenerateContainerAttribute.cs b/src/Protocol/Generation/GenerateContainerAttribute.cs index 793f9bafa..582e7a175 100644 --- a/src/Protocol/Generation/GenerateContainerAttribute.cs +++ b/src/Protocol/Generation/GenerateContainerAttribute.cs @@ -1,11 +1,10 @@ using System; using System.Diagnostics; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; namespace OmniSharp.Extensions.LanguageServer.Protocol.Generation { /// - /// Allows generating a typed container counterpart to any model that implements + /// Allows generating a typed container counterpart to any model that implements /// /// /// Efforts will be made to make this available for consumers once source generators land diff --git a/src/Protocol/Generation/GenerateTypedDataAttribute.cs b/src/Protocol/Generation/GenerateTypedDataAttribute.cs index c016fe25f..4b7d222f1 100644 --- a/src/Protocol/Generation/GenerateTypedDataAttribute.cs +++ b/src/Protocol/Generation/GenerateTypedDataAttribute.cs @@ -1,11 +1,10 @@ using System; using System.Diagnostics; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; namespace OmniSharp.Extensions.LanguageServer.Protocol.Generation { /// - /// Allows generating a typed counterpart to any model that implements + /// Allows generating a typed counterpart to any model that implements /// /// /// Efforts will be made to make this available for consumers once source generators land diff --git a/test/Client.Tests/Client.Tests.csproj b/test/Client.Tests/Client.Tests.csproj index c5d883459..07ae8a6c0 100644 --- a/test/Client.Tests/Client.Tests.csproj +++ b/test/Client.Tests/Client.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;net5.0;netcoreapp2.1 + netcoreapp3.1;net6.0 OmniSharp.Extensions.LanguageClient.Tests OmniSharp.Extensions.LanguageServer.Client.Tests diff --git a/test/Dap.Tests/Dap.Tests.csproj b/test/Dap.Tests/Dap.Tests.csproj index 91db07c80..e61abe1ff 100644 --- a/test/Dap.Tests/Dap.Tests.csproj +++ b/test/Dap.Tests/Dap.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - netcoreapp3.1;net5.0;netcoreapp2.1 + netcoreapp3.1;net6.0 true AnyCPU diff --git a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs index 67abc23a2..7d5298c70 100644 --- a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs +++ b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs @@ -1,7 +1,5 @@ using System.Threading.Tasks; using OmniSharp.Extensions.JsonRpc.Generators; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; -using TestingUtils; using Xunit; namespace Generation.Tests @@ -39,22 +37,13 @@ namespace Test public partial class DeclarationParams { [Optional] - public ProgressToken? WorkDoneToken - { - get; - init; - } + public ProgressToken? WorkDoneToken { get; init; } [Optional] - public ProgressToken? PartialResultToken - { - get; - init; - } + public ProgressToken? PartialResultToken { get; init; } } } #nullable restore"; - CacheKeyHasher.Cache = true; await GenerationHelpers.AssertGeneratedAsExpected(source, expected); await GenerationHelpers.AssertGeneratedAsExpected(source, expected); } diff --git a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs index e151a270b..ea2e0b94a 100644 --- a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs +++ b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs @@ -1,7 +1,5 @@ using System.Threading.Tasks; using OmniSharp.Extensions.JsonRpc.Generators; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; -using TestingUtils; using Xunit; namespace Generation.Tests @@ -58,7 +56,6 @@ namespace Test } } #nullable restore"; - CacheKeyHasher.Cache = true; await GenerationHelpers.AssertGeneratedAsExpected(source, expected); } } diff --git a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs index 1ff3de714..02ecefce5 100644 --- a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs +++ b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs @@ -35,11 +35,7 @@ namespace Test public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions { [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase { @@ -57,11 +53,7 @@ public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions { [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } } } } @@ -99,11 +91,7 @@ namespace Test public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions { [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase { @@ -121,11 +109,7 @@ public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) public partial class StaticOptions : IWorkDoneProgressOptions { [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } } } } @@ -208,18 +192,10 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Test [RegistrationOptionsConverterAttribute(typeof(CodeActionRegistrationOptionsConverter))] public partial class CodeActionRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions { - public DocumentSelector? DocumentSelector - { - get; - set; - } + public DocumentSelector? DocumentSelector { get; set; } [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase { @@ -243,13 +219,7 @@ public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protoco /// may list out every specific kind they provide. /// [Optional] - public Container? CodeActionKinds - { - get; - set; - } - - = new Container(); + public Container? CodeActionKinds { get; set; } = new Container(); /// /// The server provides support to resolve additional /// information for a code action. @@ -257,18 +227,10 @@ public Container? CodeActionKinds /// @since 3.16.0 /// [Optional] - public bool ResolveProvider - { - get; - set; - } + public bool ResolveProvider { get; set; } [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } } } } @@ -369,18 +331,10 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Test [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] public partial class CodeActionRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions { - public DocumentSelector? DocumentSelector - { - get; - set; - } + public DocumentSelector? DocumentSelector { get; set; } [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] public partial class StaticOptions : IWorkDoneProgressOptions @@ -392,13 +346,7 @@ public partial class StaticOptions : IWorkDoneProgressOptions /// may list out every specific kind they provide. /// [Optional] - public Container? CodeActionKinds - { - get; - set; - } - - = new Container(); + public Container? CodeActionKinds { get; set; } = new Container(); /// /// The server provides support to resolve additional /// information for a code action. @@ -406,18 +354,10 @@ public Container? CodeActionKinds /// @since 3.16.0 /// [Optional] - public bool ResolveProvider - { - get; - set; - } + public bool ResolveProvider { get; set; } [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } } } } diff --git a/test/Generation.Tests/Generation.Tests.csproj b/test/Generation.Tests/Generation.Tests.csproj index 9da152b04..8f8f18ef0 100644 --- a/test/Generation.Tests/Generation.Tests.csproj +++ b/test/Generation.Tests/Generation.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net5.0;netcoreapp2.1 + netcoreapp3.1;net6.0 true AnyCPU @@ -12,6 +12,5 @@ - diff --git a/test/Generation.Tests/GenerationHelpers.cs b/test/Generation.Tests/GenerationHelpers.cs index b1aa84fdc..7f5f38918 100644 --- a/test/Generation.Tests/GenerationHelpers.cs +++ b/test/Generation.Tests/GenerationHelpers.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Collections.Immutable; using System.IO; using System.Linq; @@ -10,9 +11,11 @@ using Microsoft.CodeAnalysis.Text; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +//using OmniSharp.Extensions.DebugAdapter.Protocol.Client; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.JsonRpc.Generators; using OmniSharp.Extensions.LanguageServer.Protocol.Server; +//using OmniSharp.Extensions.LanguageServer.Protocol.Server; using Xunit; namespace Generation.Tests @@ -23,7 +26,8 @@ static GenerationHelpers() { // this "core assemblies hack" is from https://stackoverflow.com/a/47196516/4418060 var coreAssemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location)!; - var coreAssemblyNames = new[] { + var coreAssemblyNames = new[] + { "mscorlib.dll", "netstandard.dll", "System.dll", @@ -35,9 +39,11 @@ static GenerationHelpers() }; var coreMetaReferences = coreAssemblyNames.Select(x => MetadataReference.CreateFromFile(Path.Combine(coreAssemblyPath, x))); - var otherAssemblies = new[] { + var otherAssemblies = new[] + { typeof(CSharpCompilation).Assembly, typeof(GenerateHandlerMethodsAttribute).Assembly, + typeof(GenerationHelpers).Assembly, typeof(IDebugAdapterClientRegistry).Assembly, typeof(Unit).Assembly, typeof(JToken).Assembly, @@ -54,33 +60,31 @@ static GenerationHelpers() internal const string CSharpDefaultFileExt = "cs"; internal const string TestProjectName = "TestProject"; - internal static readonly string NormalizedPreamble = NormalizeToLf(Preamble.GeneratedByATool + Lf); - internal static readonly ImmutableArray MetadataReferences; - public static async Task AssertGeneratedAsExpected(string source, string expected) where T : ISourceGenerator, new() + public static async Task AssertGeneratedAsExpected(string source, string expected) where T : IIncrementalGenerator, new() { var generatedTree = await GenerateAsync(source); // normalize line endings to just LF - var generatedText = NormalizeToLf(generatedTree.GetText().ToString()).Trim(); + var generatedText = NormalizeToLf(generatedTree.Last().GetText().ToString()).Trim(); // and append preamble to the expected - var expectedText = NormalizedPreamble + NormalizeToLf(expected).Trim(); + var expectedText = NormalizeToLf(expected).Trim(); // Assert.Equal(expectedText, generatedText); generatedText.Should().Be(expectedText); } - public static async Task Generate(string source) where T : ISourceGenerator, new() + public static async Task Generate(string source) where T : IIncrementalGenerator, new() { var generatedTree = await GenerateAsync(source); // normalize line endings to just LF - var generatedText = NormalizeToLf(generatedTree.GetText().ToString()); + var generatedText = NormalizeToLf(generatedTree.Last().GetText().ToString()); // and append preamble to the expected return generatedText; } public static string NormalizeToLf(string input) => input.Replace(CrLf, Lf); - public static async Task GenerateAsync(string source) where T : ISourceGenerator, new() + public static async Task> GenerateAsync(string source) where T : IIncrementalGenerator, new() { var document = CreateProject(source).Documents.Single(); var tree = await document.GetSyntaxTreeAsync(); @@ -89,7 +93,7 @@ static GenerationHelpers() throw new InvalidOperationException("Could not get the syntax tree of the sources"); } - var compilation = (CSharpCompilation) (await document.Project.GetCompilationAsync())!; + var compilation = (CSharpCompilation)( await document.Project.GetCompilationAsync() )!; if (compilation is null) { throw new InvalidOperationException("Could not compile the sources"); @@ -98,10 +102,10 @@ static GenerationHelpers() var diagnostics = compilation.GetDiagnostics(); // Assert.Empty(diagnostics.Where(x => x.Severity >= DiagnosticSeverity.Warning)); - ISourceGenerator generator = new T(); + IIncrementalGenerator generator = new T(); var driver = CSharpGeneratorDriver.Create( - ImmutableArray.Create(generator), + ImmutableArray.Create(generator.AsSourceGenerator()), ImmutableArray.Empty, compilation.SyntaxTrees[0].Options as CSharpParseOptions ); @@ -110,7 +114,9 @@ compilation.SyntaxTrees[0].Options as CSharpParseOptions Assert.Empty(diagnostics.Where(x => x.Severity >= DiagnosticSeverity.Warning)); // the syntax tree added by the generator will be the last one in the compilation - return outputCompilation.SyntaxTrees.Last(z => !z.FilePath.Contains("AssemblyRegistrationOptions") && !z.FilePath.Contains("GeneratedAssemblyJsonRpcHandlers")); + return outputCompilation.SyntaxTrees.Where( + z => !z.FilePath.Contains("AssemblyRegistrationOptions") && !z.FilePath.Contains("GeneratedAssemblyJsonRpcHandlers") + ); } public static Project CreateProject(params string[] sources) diff --git a/test/Generation.Tests/JsonRpcGenerationTests.cs b/test/Generation.Tests/JsonRpcGenerationTests.cs index 87b7e43de..e105db5ad 100644 --- a/test/Generation.Tests/JsonRpcGenerationTests.cs +++ b/test/Generation.Tests/JsonRpcGenerationTests.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using FluentAssertions; using OmniSharp.Extensions.JsonRpc.Generators; -using OmniSharp.Extensions.JsonRpc.Generators.Cache; using TestingUtils; using Xunit; using Xunit.Sdk; @@ -206,7 +205,6 @@ public interface IExitHandler : IJsonRpcNotificationHandler } }"; - CacheKeyHasher.Cache = true; Func a = () => AssertGeneratedAsExpected(source, ""); a.Should().Throw().WithMessage("*Could not infer the request router(s)*"); a.Should().Throw("cache").WithMessage("*Could not infer the request router(s)*"); diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index ed42f75f3..04b2377ef 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -54,7 +54,7 @@ abstract public partial class WorkspaceSymbolsHandlerBase : AbstractHandlers.Req [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] abstract public partial class WorkspaceSymbolsPartialHandlerBase : AbstractHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler { - protected WorkspaceSymbolsPartialHandlerBase(System.Guid id, IProgressManager progressManager): base(progressManager, Container.From) + protected WorkspaceSymbolsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) { } } @@ -109,12 +109,6 @@ public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServ public async Task Supports_Generating_Custom_Language_Extensions() { var source = @" -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - using MediatR; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -189,11 +183,7 @@ namespace Lsp.Tests.Integration.Fixtures public partial class UnitTestRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions { [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } class UnitTestRegistrationOptionsConverter : RegistrationOptionsConverterBase { @@ -211,18 +201,10 @@ public override StaticOptions Convert(UnitTestRegistrationOptions source) public partial class StaticOptions : IWorkDoneProgressOptions { [Optional] - public bool SupportsDebugging - { - get; - set; - } + public bool SupportsDebugging { get; set; } [Optional] - public bool WorkDoneProgress - { - get; - set; - } + public bool WorkDoneProgress { get; set; } } } } @@ -321,7 +303,7 @@ abstract public partial class DiscoverUnitTestsHandlerBase : AbstractHandlers.Re [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] abstract public partial class DiscoverUnitTestsPartialHandlerBase : AbstractHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler { - protected DiscoverUnitTestsPartialHandlerBase(System.Guid id, IProgressManager progressManager): base(progressManager, Container.From) + protected DiscoverUnitTestsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) { } } diff --git a/test/Generation.Tests/TypedCanBeResolvedTests.cs b/test/Generation.Tests/TypedCanBeResolvedTests.cs index 2d7b0b28e..e34a0b47c 100644 --- a/test/Generation.Tests/TypedCanBeResolvedTests.cs +++ b/test/Generation.Tests/TypedCanBeResolvedTests.cs @@ -98,10 +98,9 @@ public CodeLens WithData(TData data) public static CodeLens? From(CodeLens? item) where T : class?, IHandlerIdentity? => item switch { - not null => item, _ => null - } - - ; + not null => item, + _ => null + }; } /// @@ -118,29 +117,17 @@ public partial record CodeLens : ICanBeResolved where T : class?, IHandlerIde /// /// The range in which this code lens is valid. Should only span a single line. /// - public Range Range - { - get; - init; - } + public Range Range { get; init; } [Optional] - public Command? Command - { - get; - init; - } + public Command? Command { get; init; } /// /// A data entry field that is preserved on a code lens item between /// a code lens and a code lens resolve request. /// [Optional] - public T Data - { - get => this.GetRawData()!; - init => this.SetRawData(value); - } + public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } private string DebuggerDisplay => $""{Range}{(Command != null ? $"" {Command}"" : """")}""; public override string ToString() => DebuggerDisplay; @@ -150,133 +137,111 @@ public CodeLens WithData(TData data) return new CodeLens{Range = Range, Command = Command, Data = data}; } - JToken? ICanBeResolved.Data - { - get; - init; - } + JToken? ICanBeResolved.Data { get; init; } - private JToken? JData - { - get => this.GetRawData(); - init => this.SetRawData(value); - } + private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } public static implicit operator CodeLens(CodeLens value) => new CodeLens{Range = value.Range, Command = value.Command, JData = value.Data}; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""value"")] public static implicit operator CodeLens? (CodeLens? value) => value switch { - not null => new CodeLens{Range = value.Range, Command = value.Command, Data = value.JData}, _ => null - } - - ; + not null => new CodeLens{Range = value.Range, Command = value.Command, Data = value.JData}, + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""item"")] public static CodeLens? From(CodeLens? item) => item switch { - not null => item, _ => null - } - - ; + not null => item, + _ => null + }; } public partial class CodeLensContainer : ContainerBase> where T : class?, IHandlerIdentity? { - public CodeLensContainer(): this(Enumerable.Empty>()) + public CodeLensContainer() : this(Enumerable.Empty>()) { } - public CodeLensContainer(IEnumerable> items): base(items) + public CodeLensContainer(IEnumerable> items) : base(items) { } - public CodeLensContainer(params CodeLens[] items): base(items) + public CodeLensContainer(params CodeLens[] items) : base(items) { } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(IEnumerable>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(params CodeLens[] items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (Collection>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(Collection>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (List>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(List>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (in ImmutableArray>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(in ImmutableArray>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (ImmutableList>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(ImmutableList>? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""container"")] public static implicit operator CodeLensContainer? (CodeLensContainer? container) => container switch { - not null => new CodeLensContainer(container.Select(value => (CodeLens)value)), _ => null - } - - ; + not null => new CodeLensContainer(container.Select(value => (CodeLens)value)), + _ => null + }; } } #nullable restore"; @@ -364,95 +329,84 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Test [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] public partial class CodeLensContainer : ContainerBase { - public CodeLensContainer(): this(Enumerable.Empty()) + public CodeLensContainer() : this(Enumerable.Empty()) { } - public CodeLensContainer(IEnumerable items): base(items) + public CodeLensContainer(IEnumerable items) : base(items) { } - public CodeLensContainer(params CodeLens[] items): base(items) + public CodeLensContainer(params CodeLens[] items) : base(items) { } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(IEnumerable? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(params CodeLens[] items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (Collection? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(Collection? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (List? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(List? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (in ImmutableArray? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(in ImmutableArray? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static implicit operator CodeLensContainer? (ImmutableList? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] public static CodeLensContainer? From(ImmutableList? items) => items switch { - not null => new CodeLensContainer(items), _ => null - } - - ; + not null => new CodeLensContainer(items), + _ => null + }; } } #nullable restore"; diff --git a/test/JsonRpc.Tests/JsonRpc.Tests.csproj b/test/JsonRpc.Tests/JsonRpc.Tests.csproj index 2c42ce7ea..163f47307 100644 --- a/test/JsonRpc.Tests/JsonRpc.Tests.csproj +++ b/test/JsonRpc.Tests/JsonRpc.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net5.0;netcoreapp2.1 + netcoreapp3.1;net6.0 true AnyCPU diff --git a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj index 46970d637..4962ff8ef 100644 --- a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj +++ b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net5.0;netcoreapp3.1;netcoreapp2.1 + net6.0;netcoreapp3.1 true AnyCPU diff --git a/test/Lsp.Tests/Lsp.Tests.csproj b/test/Lsp.Tests/Lsp.Tests.csproj index 46970d637..4962ff8ef 100644 --- a/test/Lsp.Tests/Lsp.Tests.csproj +++ b/test/Lsp.Tests/Lsp.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net5.0;netcoreapp3.1;netcoreapp2.1 + net6.0;netcoreapp3.1 true AnyCPU From bb43454386122f8d64099dfd4c8339c685ffc2de Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 20 Feb 2022 16:33:29 -0500 Subject: [PATCH 021/647] Updated private test dependencies (#758) * Updated private test dependencies * removed mergify --- .build/Solution.cs | 50 +- .husky/pre-commit | 4 +- .mergify.yml | 101 --- Directory.Build.targets | 8 +- package-lock.json | 641 ++++++++---------- .../Integration/RequestCancellationTests.cs | 6 +- .../JsonRpcGenerationTests.cs | 4 +- test/JsonRpc.Tests/HandlerResolverTests.cs | 10 +- test/JsonRpc.Tests/IntegrationTests.cs | 8 +- .../JsonRpc.Tests/RecursiveResolutionTests.cs | 16 +- .../ErroringHandlingTests.cs | 2 +- .../LanguageServerConfigurationTests.cs | 2 +- .../RequestCancellationTests.cs | 10 +- .../WorkspaceFolderTests.cs | 2 +- .../Server/TextDocumentSyncKindTests.cs | 2 +- .../Matchers/ResolveCommandMatcherTests.cs | 4 +- .../Models/CompletionItemKindTests.cs | 2 +- .../Models/DiagnosticSeverityTests.cs | 2 +- .../Models/DocumentHighlightKindTests.cs | 2 +- test/Lsp.Tests/Models/FileChangeTypeTests.cs | 2 +- .../Lsp.Tests/Models/InsertTextFormatTests.cs | 2 +- test/Lsp.Tests/Models/MessageTypeTests.cs | 2 +- test/Lsp.Tests/Models/SymbolKindTests.cs | 2 +- .../Models/TextDocumentSaveReasonTests.cs | 2 +- .../AutoNSubstitute/TraceWriter.cs | 3 +- ...RecordStructuralEqualityEquivalencyStep.cs | 8 +- 26 files changed, 361 insertions(+), 536 deletions(-) delete mode 100644 .mergify.yml diff --git a/.build/Solution.cs b/.build/Solution.cs index 5b98afc89..83230b184 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -1,30 +1,10 @@ using System.Collections.Generic; using System.Linq; using Nuke.Common.CI.GitHubActions; -using Rocket.Surgery.Nuke; using Rocket.Surgery.Nuke.ContinuousIntegration; using Rocket.Surgery.Nuke.DotNetCore; using Rocket.Surgery.Nuke.GithubActions; -[AzurePipelinesSteps( - AutoGenerate = false, - InvokeTargets = new[] { nameof(Default) }, - NonEntryTargets = new[] { - nameof(ICIEnvironment.CIEnvironment), - nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports), - nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura), - nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges), - nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport), - nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary), - nameof(Default) - }, - ExcludedTargets = new[] - { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.Restore), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) }, - Parameters = new[] { - nameof(IHaveCodeCoverage.CoverageDirectory), nameof(IHaveOutputArtifacts.ArtifactsDirectory), nameof(Verbosity), - nameof(IHaveConfiguration.Configuration) - } -)] [GitHubActionsSteps( "ci", GitHubActionsImage.MacOsLatest, @@ -64,8 +44,10 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi checkoutStep.FetchDepth = 0; buildJob.Environment["NUGET_PACKAGES"] = "${{ github.workspace }}/.nuget/packages"; buildJob.Steps.InsertRange( - buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] { - new RunStep("Fetch all history for all tags and branches") { + buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] + { + new RunStep("Fetch all history for all tags and branches") + { Run = "git fetch --prune" }, new UsingStep("NuGet Cache") @@ -81,19 +63,23 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi ${{ runner.os }}-nuget-" } }, - new SetupDotNetStep("Use .NET Core 3.1 SDK") { + new SetupDotNetStep("Use .NET Core 3.1 SDK") + { DotNetVersion = "3.1.x" }, - new SetupDotNetStep("Use .NET Core 6.0 SDK") { + new SetupDotNetStep("Use .NET Core 6.0 SDK") + { DotNetVersion = "6.0.x" }, } ); buildJob.Steps.Add( - new UsingStep("Publish Coverage") { + new UsingStep("Publish Coverage") + { Uses = "codecov/codecov-action@v1", - With = new Dictionary { + With = new Dictionary + { ["name"] = "actions-${{ matrix.os }}", ["fail_ci_if_error"] = "true", } @@ -101,7 +87,8 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi ); buildJob.Steps.Add( - new UploadArtifactStep("Publish logs") { + new UploadArtifactStep("Publish logs") + { Name = "logs", Path = "artifacts/logs/", If = "always()" @@ -109,7 +96,8 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi ); buildJob.Steps.Add( - new UploadArtifactStep("Publish coverage data") { + new UploadArtifactStep("Publish coverage data") + { Name = "coverage", Path = "coverage/", If = "always()" @@ -117,7 +105,8 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi ); buildJob.Steps.Add( - new UploadArtifactStep("Publish test data") { + new UploadArtifactStep("Publish test data") + { Name = "test data", Path = "artifacts/test/", If = "always()" @@ -125,7 +114,8 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi ); buildJob.Steps.Add( - new UploadArtifactStep("Publish NuGet Packages") { + new UploadArtifactStep("Publish NuGet Packages") + { Name = "nuget", Path = "artifacts/nuget/", If = "always()" diff --git a/.husky/pre-commit b/.husky/pre-commit index c6d920851..d0879ca8c 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -4,6 +4,4 @@ npx lint-staged -d -r dotnet nuke --generate-configuration GitHubActions_ci --host GitHubActions git add .github/workflows/ci.yml -dotnet nuke --generate-configuration GitHubActions_ci-ignore --host GitHubActions -git add .github/workflows/ci-ignore.yml -git add .nuke/build.schema.json \ No newline at end of file +git add .nuke/build.schema.json diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index f8cd7f329..000000000 --- a/.mergify.yml +++ /dev/null @@ -1,101 +0,0 @@ -pull_request_rules: - - name: automatic merge when GitHub branch protection passes (others) - conditions: - - base=master - - -author~=^dependabot(|-preview)\[bot\]$ - - 'label=merge' - actions: - merge: - method: squash - strict: smart+fasttrack - - name: automatic merge when GitHub branch protection passes - conditions: - - merged - - 'label=merge' - actions: - label: - remove: - - 'merge' - - name: delete head branch after merge - conditions: - - merged - actions: - label: - remove: - - 'merge' - - 'github-actions' - - 'javascript' - - '.NET' - delete_head_branch: {} - - name: automatic merge for JetBrains.ReSharper.CommandLineTools pull requests - conditions: - - title~=^Bump JetBrains\.ReSharper\.CommandLineTools.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for ReportGenerator pull requests - conditions: - - title~=^Bump ReportGenerator.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for GitVersion.Tool pull requests - conditions: - - title~=^Bump GitVersion\.Tool.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for Bogus pull requests - conditions: - - title~=^Bump Bogus.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for coverlet pull requests - conditions: - - title~=^Bump coverlet.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for FakeItEasy pull requests - conditions: - - title~=^Bump FakeItEasy.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for FluentAssertions pull requests - conditions: - - title~=^Bump FluentAssertions.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for xunit pull requests - conditions: - - title~=^Bump xunit.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' - - name: automatic merge for Microsoft.NET.Test.Sdk pull requests - conditions: - - title~=^Bump Microsoft\.NET\.Test\.Sdk.*$ - - author~=^dependabot(|-preview)\[bot\]$ - actions: - label: - add: - - 'merge' diff --git a/Directory.Build.targets b/Directory.Build.targets index c40b47dd6..328101a9b 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -24,10 +24,10 @@ - + - + @@ -46,7 +46,7 @@ - + - + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0108fd203..e560ad123 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2,90 +2,25 @@ "requires": true, "lockfileVersion": 1, "dependencies": { - "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "@prettier/plugin-xml": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-1.2.0.tgz", + "integrity": "sha512-bFvVAZKs59XNmntYjyefn3K4TBykS6E+d6ZW8IcylAs88ZO+TzLhp0dPpi0VKfPzq1Nb+kpDnPRTiwb4zY6NgA==", "dev": true, "requires": { - "@babel/highlight": "^7.14.5" + "@xml-tools/parser": "^1.0.11", + "prettier": ">=2.3" } }, - "@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", - "dev": true - }, - "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "@xml-tools/parser": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.11.tgz", + "integrity": "sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "chevrotain": "7.1.1" } }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -96,12 +31,6 @@ "indent-string": "^4.0.0" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -112,19 +41,16 @@ } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", + "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "dev": true }, "astral-regex": { "version": "2.0.0", @@ -141,20 +67,13 @@ "fill-range": "^7.0.1" } }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "chevrotain": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-7.1.1.tgz", + "integrity": "sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "regexp-to-ast": "0.5.0" } }, "clean-stack": { @@ -173,13 +92,13 @@ } }, "cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, "requires": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" } }, "color-convert": { @@ -198,30 +117,17 @@ "dev": true }, "colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", + "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", "dev": true }, "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true }, - "cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -234,42 +140,24 @@ } }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" } }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "execa": { @@ -298,24 +186,12 @@ "to-regex-range": "^5.0.1" } }, - "get-own-enumerable-property-symbols": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", - "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", - "dev": true - }, "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -323,37 +199,21 @@ "dev": true }, "husky": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", - "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", "dev": true }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true }, "is-number": { @@ -362,99 +222,129 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", - "dev": true - }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "lilconfig": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", + "integrity": "sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==", "dev": true }, "lint-staged": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-11.1.2.tgz", - "integrity": "sha512-6lYpNoA9wGqkL6Hew/4n1H6lRqF3qCsujVT0Oq5Z4hiSAM7S6NksPJ3gnr7A7R52xCtiZMcEUNNQ6d6X5Bvh9w==", - "dev": true, - "requires": { - "chalk": "^4.1.1", - "cli-truncate": "^2.1.0", - "commander": "^7.2.0", - "cosmiconfig": "^7.0.0", - "debug": "^4.3.1", - "enquirer": "^2.3.6", - "execa": "^5.0.0", - "listr2": "^3.8.2", - "log-symbols": "^4.1.0", + "version": "12.3.4", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.3.4.tgz", + "integrity": "sha512-yv/iK4WwZ7/v0GtVkNb3R82pdL9M+ScpIbJLJNyCXkJ1FGaXvRCOg/SeL59SZtPpqZhE7BD6kPKFLIDUhDx2/w==", + "dev": true, + "requires": { + "cli-truncate": "^3.1.0", + "colorette": "^2.0.16", + "commander": "^8.3.0", + "debug": "^4.3.3", + "execa": "^5.1.1", + "lilconfig": "2.0.4", + "listr2": "^4.0.1", "micromatch": "^4.0.4", "normalize-path": "^3.0.0", - "please-upgrade-node": "^3.2.0", - "string-argv": "0.3.1", - "stringify-object": "^3.3.0" + "object-inspect": "^1.12.0", + "string-argv": "^0.3.1", + "supports-color": "^9.2.1", + "yaml": "^1.10.2" } }, "listr2": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.11.0.tgz", - "integrity": "sha512-XLJVe2JgXCyQTa3FbSv11lkKExYmEyA4jltVo8z4FX10Vt1Yj8IMekBfwim0BSOM9uj1QMTJvDQQpHyuPbB/dQ==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-4.0.4.tgz", + "integrity": "sha512-vJOm5KD6uZXjSsrwajr+mNacIjf87gWvlBEltPWLbTkslUscWAzquyK4xfe9Zd4RDgO5nnwFyV06FC+uVR+5mg==", "dev": true, "requires": { "cli-truncate": "^2.1.0", - "colorette": "^1.2.2", + "colorette": "^2.0.16", "log-update": "^4.0.0", "p-map": "^4.0.0", - "rxjs": "^6.6.7", + "rfdc": "^1.3.0", + "rxjs": "^7.5.4", "through": "^2.3.8", "wrap-ansi": "^7.0.0" - } - }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, "log-update": { @@ -469,6 +359,33 @@ "wrap-ansi": "^6.2.0" }, "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -480,6 +397,26 @@ "is-fullwidth-code-point": "^3.0.0" } }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -536,6 +473,12 @@ "path-key": "^3.0.0" } }, + "object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true + }, "onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -554,64 +497,28 @@ "aggregate-error": "^3.0.0" } }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, - "please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "requires": { - "semver-compare": "^1.0.0" - } - }, "prettier": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "regexp-to-ast": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", + "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", "dev": true }, "restore-cursor": { @@ -624,21 +531,21 @@ "signal-exit": "^3.0.2" } }, + "rfdc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "dev": true + }, "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.4.tgz", + "integrity": "sha512-h5M3Hk78r6wAheJF0a5YahB1yRQKCsZ4MsGdZ5O9ETbVtjPcScGfrMmoOq7EBsCRzd4BDkvDJ7ogP8Sz5tTFiQ==", "dev": true, "requires": { - "tslib": "^1.9.0" + "tslib": "^2.1.0" } }, - "semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", - "dev": true - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -655,20 +562,19 @@ "dev": true }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" } }, "string-argv": { @@ -678,34 +584,23 @@ "dev": true }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz", + "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==", "dev": true, "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "stringify-object": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", - "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", - "dev": true, - "requires": { - "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", - "is-regexp": "^1.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^6.0.1" } }, "strip-final-newline": { @@ -715,13 +610,10 @@ "dev": true }, "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.1.tgz", + "integrity": "sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==", + "dev": true }, "through": { "version": "2.3.8", @@ -739,9 +631,9 @@ } }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, "type-fest": { @@ -768,6 +660,55 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, "yaml": { diff --git a/test/Dap.Tests/Integration/RequestCancellationTests.cs b/test/Dap.Tests/Integration/RequestCancellationTests.cs index 715f763b7..b39fa8c77 100644 --- a/test/Dap.Tests/Integration/RequestCancellationTests.cs +++ b/test/Dap.Tests/Integration/RequestCancellationTests.cs @@ -31,11 +31,11 @@ public async Task Should_Cancel_Pending_Requests() CancellationToken.Register(cts.Cancel); return client.RequestCompletions(new CompletionsArguments(), cts.Token); }; - action.Should().Throw(); + await action.Should().ThrowAsync(); } [Fact(Skip = "Needs Work")] - public void Should_Cancel_Requests_After_Timeout() + public async Task Should_Cancel_Requests_After_Timeout() { Func> action = async () => { var (client, _) = await Initialize( @@ -47,7 +47,7 @@ public void Should_Cancel_Requests_After_Timeout() return await client.RequestCompletions(new CompletionsArguments()); }; - action.Should().Throw(); + await action.Should().ThrowAsync(); } private void ConfigureClient(DebugAdapterClientOptions options) diff --git a/test/Generation.Tests/JsonRpcGenerationTests.cs b/test/Generation.Tests/JsonRpcGenerationTests.cs index e105db5ad..4c2ffe04f 100644 --- a/test/Generation.Tests/JsonRpcGenerationTests.cs +++ b/test/Generation.Tests/JsonRpcGenerationTests.cs @@ -206,8 +206,8 @@ public interface IExitHandler : IJsonRpcNotificationHandler }"; Func a = () => AssertGeneratedAsExpected(source, ""); - a.Should().Throw().WithMessage("*Could not infer the request router(s)*"); - a.Should().Throw("cache").WithMessage("*Could not infer the request router(s)*"); + await a.Should().ThrowAsync().WithMessage("*Could not infer the request router(s)*"); + await a.Should().ThrowAsync("cache").WithMessage("*Could not infer the request router(s)*"); } [Fact] diff --git a/test/JsonRpc.Tests/HandlerResolverTests.cs b/test/JsonRpc.Tests/HandlerResolverTests.cs index fcdf543f9..db0b069b5 100644 --- a/test/JsonRpc.Tests/HandlerResolverTests.cs +++ b/test/JsonRpc.Tests/HandlerResolverTests.cs @@ -39,28 +39,28 @@ public interface IJsonRpcNotificationDataHandler : IJsonRpcNotificationHandler(), new AssemblyScanningHandlerTypeDescriptorProvider(new [] { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(HandlerResolverTests).Assembly })) { - (IJsonRpcHandler) Substitute.For(new[] { requestHandler }, new object[0]) + (IJsonRpcHandler) Substitute.For(new[] { requestHandler }, Array.Empty()) }; handler.Should().Contain(x => x.Method == key); } - [Theory] + [Theory(Skip = "Inaccurate")] [InlineData(typeof(IJsonRpcRequestHandler), "request", null)] [InlineData(typeof(IJsonRpcRequestResponseHandler), "requestresponse", typeof(Request))] [InlineData(typeof(IJsonRpcNotificationDataHandler), "notificationdata", null)] public void Should_Have_CorrectParams(Type requestHandler, string key, Type expected) { var handler = new HandlerCollection(Substitute.For(), new AssemblyScanningHandlerTypeDescriptorProvider(new [] { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(HandlerResolverTests).Assembly })) { - (IJsonRpcHandler) Substitute.For(new[] { requestHandler }, new object[0]) + (IJsonRpcHandler) Substitute.For(new[] { requestHandler }, Array.Empty()) }; - handler.First(x => x.Method == key).Params.Should().IsSameOrEqualTo(expected); + handler.First(x => x.Method == key).Params.Should().Be(expected); } } } diff --git a/test/JsonRpc.Tests/IntegrationTests.cs b/test/JsonRpc.Tests/IntegrationTests.cs index 755efba60..5d912722b 100644 --- a/test/JsonRpc.Tests/IntegrationTests.cs +++ b/test/JsonRpc.Tests/IntegrationTests.cs @@ -54,10 +54,10 @@ public async Task Should_throw_when_sending_requests() ); Func clientRequest = () => client.SendRequest("myrequest", (Request) null!).Returning(CancellationToken); - clientRequest.Should().Throw(); + await clientRequest.Should().ThrowAsync(); Func serverRequest = () => server.SendRequest("myrequest", (Request) null!).Returning(CancellationToken); - serverRequest.Should().Throw(); + await serverRequest.Should().ThrowAsync(); } [Fact] @@ -69,10 +69,10 @@ public async Task Should_throw_when_receiving_requests() ); Func clientRequest = () => client.SendRequest("myrequest", new Request()).Returning(CancellationToken); - clientRequest.Should().Throw(); + await clientRequest.Should().ThrowAsync(); Func serverRequest = () => server.SendRequest("myrequest", new Request()).Returning(CancellationToken); - serverRequest.Should().Throw(); + await serverRequest.Should().ThrowAsync(); } [Fact] diff --git a/test/JsonRpc.Tests/RecursiveResolutionTests.cs b/test/JsonRpc.Tests/RecursiveResolutionTests.cs index 16fa140f1..4132326d4 100644 --- a/test/JsonRpc.Tests/RecursiveResolutionTests.cs +++ b/test/JsonRpc.Tests/RecursiveResolutionTests.cs @@ -21,7 +21,7 @@ public RecursiveResolutionTests(ITestOutputHelper testOutputHelper) : base(new J } [Fact(Skip = "appears to cause a deadlock")] - public void Server_Can_Be_Injected_Into_Handler_After_Creation_Using_Registration() + public async Task Server_Can_Be_Injected_Into_Handler_After_Creation_Using_Registration() { Func a = async () => { var (_, server) = await Initialize( @@ -34,11 +34,11 @@ public void Server_Can_Be_Injected_Into_Handler_After_Creation_Using_Registratio .AddHandler>() ); }; - a.Should().NotThrow(); + await a.Should().NotThrowAsync(); } [Fact(Skip = "appears to cause a deadlock")] - public void Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Registration() + public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Registration() { Func a = () => Initialize( options => { }, @@ -46,12 +46,12 @@ public void Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Registr .AddHandler>() .AddHandler>() ); - var result = a.Should().Throw(); + var result = await a.Should().ThrowAsync(); result.And.ErrorName.Should().Be("UnableToResolveFromRegisteredServices"); } [Fact(Skip = "appears to cause a deadlock")] - public void Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Description() + public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Description() { Func a = () => Initialize( options => { }, @@ -59,12 +59,12 @@ public void Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Descrip .AddSingleton(JsonRpcHandlerDescription.Infer(typeof(InterfaceHandler))) .AddSingleton(JsonRpcHandlerDescription.Infer(typeof(ClassHandler))) ); - var result = a.Should().Throw(); + var result = await a.Should().ThrowAsync(); result.And.ErrorName.Should().Be("UnableToResolveFromRegisteredServices"); } [Fact(Skip = "appears to cause a deadlock")] - public void Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Injection() + public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Injection() { Func a = () => Initialize( options => { }, @@ -72,7 +72,7 @@ public void Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Injecti .AddSingleton>() .AddSingleton>() ); - var result = a.Should().Throw(); + var result = await a.Should().ThrowAsync(); result.And.ErrorName.Should().Be("UnableToResolveFromRegisteredServices"); } diff --git a/test/Lsp.Integration.Tests/ErroringHandlingTests.cs b/test/Lsp.Integration.Tests/ErroringHandlingTests.cs index 581d12a5b..cc8edf89a 100644 --- a/test/Lsp.Integration.Tests/ErroringHandlingTests.cs +++ b/test/Lsp.Integration.Tests/ErroringHandlingTests.cs @@ -43,7 +43,7 @@ public async Task Should_Handle_Malformed_Request() var req = client.SendRequest(TextDocumentNames.CodeAction, codeActionParams); Func a = () => req.Returning(CancellationToken); - a.Should().Throw(); + await a.Should().ThrowAsync(); } [Fact] diff --git a/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs b/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs index 684b95d3d..b40359ede 100644 --- a/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs +++ b/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs @@ -57,7 +57,7 @@ public async Task Should_Allow_Null_Response() }, ConfigureServer); Func a = () => server.Configuration.GetConfiguration(new ConfigurationItem() { Section = "mysection" }); - a.Should().NotThrow(); + await a.Should().NotThrowAsync(); } [Fact] diff --git a/test/Lsp.Integration.Tests/RequestCancellationTests.cs b/test/Lsp.Integration.Tests/RequestCancellationTests.cs index 4e964bbcc..d028392cc 100644 --- a/test/Lsp.Integration.Tests/RequestCancellationTests.cs +++ b/test/Lsp.Integration.Tests/RequestCancellationTests.cs @@ -40,7 +40,7 @@ public async Task Should_Cancel_Pending_Requests() }, cts.Token ).AsTask(); }; - action.Should().Throw(); + await action.Should().ThrowAsync(); } [Fact] @@ -65,7 +65,7 @@ public async Task Should_Abandon_Pending_Requests_For_Text_Changes() ); Func action = () => request1; - action.Should().Throw(); + await action.Should().ThrowAsync(); } [Fact] @@ -85,11 +85,11 @@ await client.TextDocument.RequestCompletion( }, CancellationToken ).AsTask(); }; - action.Should().Throw(); + await action.Should().ThrowAsync(); } [Fact] - public void Should_Cancel_Requests_After_Timeout_without_Content_Modified() + public async Task Should_Cancel_Requests_After_Timeout_without_Content_Modified() { Func action = async () => { var (client, _) = await Initialize( @@ -105,7 +105,7 @@ await client.TextDocument.RequestCompletion( }, CancellationToken ).AsTask(); }; - action.Should().Throw(); + await action.Should().ThrowAsync(); } [Fact] diff --git a/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs b/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs index 2c716f85c..240394788 100644 --- a/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs +++ b/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs @@ -81,7 +81,7 @@ public async Task Should_Allow_Null_Response() }, ConfigureServer); Func a = () => server.WorkspaceFolderManager.Refresh().LastOrDefaultAsync().ToTask(); - a.Should().NotThrow(); + await a.Should().NotThrowAsync(); } [Fact] diff --git a/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs b/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs index 972026a55..b6b3a4eea 100644 --- a/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs +++ b/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs b/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs index b7313da9c..3633d7007 100644 --- a/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs +++ b/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs @@ -58,7 +58,7 @@ public void Should_Return_Empty_Descriptor() } [Fact] - public void Should_Not_Throw_Given_Another_Descriptor() + public async Task Should_Not_Throw_Given_Another_Descriptor() { // Given var resolveHandler = Substitute.For(); @@ -84,7 +84,7 @@ public void Should_Not_Throw_Given_Another_Descriptor() // When Func a = async () => await handlerMatcher.Handle(new CodeLensParams(), CancellationToken.None, () => Task.FromResult(new CodeLensContainer())); - a.Should().NotThrow(); + await a.Should().NotThrowAsync(); } [Fact] diff --git a/test/Lsp.Tests/Models/CompletionItemKindTests.cs b/test/Lsp.Tests/Models/CompletionItemKindTests.cs index e2bd817e4..96eeda557 100644 --- a/test/Lsp.Tests/Models/CompletionItemKindTests.cs +++ b/test/Lsp.Tests/Models/CompletionItemKindTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs b/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs index d22423e33..e39cbbfa0 100644 --- a/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs +++ b/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs b/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs index 6d1ed3a48..93222c6dd 100644 --- a/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs +++ b/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/FileChangeTypeTests.cs b/test/Lsp.Tests/Models/FileChangeTypeTests.cs index ea73243cf..ebbb01dc0 100644 --- a/test/Lsp.Tests/Models/FileChangeTypeTests.cs +++ b/test/Lsp.Tests/Models/FileChangeTypeTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/InsertTextFormatTests.cs b/test/Lsp.Tests/Models/InsertTextFormatTests.cs index 82f3f81fb..296c57361 100644 --- a/test/Lsp.Tests/Models/InsertTextFormatTests.cs +++ b/test/Lsp.Tests/Models/InsertTextFormatTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/MessageTypeTests.cs b/test/Lsp.Tests/Models/MessageTypeTests.cs index 48f71fe72..1bc6410a6 100644 --- a/test/Lsp.Tests/Models/MessageTypeTests.cs +++ b/test/Lsp.Tests/Models/MessageTypeTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/SymbolKindTests.cs b/test/Lsp.Tests/Models/SymbolKindTests.cs index 03324b193..9db4cef02 100644 --- a/test/Lsp.Tests/Models/SymbolKindTests.cs +++ b/test/Lsp.Tests/Models/SymbolKindTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs b/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs index 1bf797457..28111a0ac 100644 --- a/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs +++ b/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs @@ -19,7 +19,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); - deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); + deresult.Should().Be(model); } } } diff --git a/test/TestingUtils/AutoNSubstitute/TraceWriter.cs b/test/TestingUtils/AutoNSubstitute/TraceWriter.cs index fda504366..8eb873e54 100644 --- a/test/TestingUtils/AutoNSubstitute/TraceWriter.cs +++ b/test/TestingUtils/AutoNSubstitute/TraceWriter.cs @@ -1,11 +1,10 @@ using System; -using FluentAssertions.Equivalency; using Microsoft.Extensions.Logging; // ReSharper disable once CheckNamespace namespace NSubstitute { - public class TraceWriter : ITraceWriter + public class TraceWriter : FluentAssertions.Equivalency.Tracing.ITraceWriter { private readonly ILogger _logger; diff --git a/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs b/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs index 58df13de0..c874e8499 100644 --- a/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs +++ b/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs @@ -1,15 +1,13 @@ using FluentAssertions.Equivalency; +using FluentAssertions.Equivalency.Steps; namespace TestingUtils { public class RecordStructuralEqualityEquivalencyStep : StructuralEqualityEquivalencyStep, IEquivalencyStep { - bool IEquivalencyStep.CanHandle( - IEquivalencyValidationContext context, - IEquivalencyAssertionOptions config - ) + EquivalencyResult IEquivalencyStep.Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator) { - return context?.Subject?.GetType()?.GetMethod("$") != null; + return comparands.Subject?.GetType()?.GetMethod("$") != null ? EquivalencyResult.AssertionCompleted : EquivalencyResult.ContinueWithNext; } } } From 1c584d72bfbd0897e1b9a5a34afcedd68eb1a1de Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 20 Feb 2022 17:32:14 -0500 Subject: [PATCH 022/647] Removed explicit reference to System.IO.Pipelines see #595 (#759) --- Directory.Build.targets | 103 ++++++++++++------------ sample/SampleServer/SampleServer.csproj | 1 - src/JsonRpc/JsonRpc.csproj | 48 +++++++---- 3 files changed, 84 insertions(+), 68 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 328101a9b..765e8a870 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,52 +1,51 @@ -ο»Ώ - - - $(BaseIntermediateOutputPath)\GeneratedFiles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file +ο»Ώ + + + $(BaseIntermediateOutputPath)\GeneratedFiles + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index 2f6296f5d..482852f5b 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -20,7 +20,6 @@ - diff --git a/src/JsonRpc/JsonRpc.csproj b/src/JsonRpc/JsonRpc.csproj index f62bc92b6..b347e0f6d 100644 --- a/src/JsonRpc/JsonRpc.csproj +++ b/src/JsonRpc/JsonRpc.csproj @@ -14,52 +14,70 @@ - - + - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.JsonRpc.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.JsonRpc.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageProtocol, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f From aacb0baddb7c3f0709c6272c76bd176f4f4d698c Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Mon, 21 Feb 2022 16:20:15 -0500 Subject: [PATCH 023/647] one more pipelines reference --- benchmarks/Pipeline/Pipeline.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 0027f64e2..17f69cce5 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,6 @@ - From 7e0eefd220435ace5b8f6f3d0534a644394072f9 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Wed, 27 Apr 2022 21:54:42 -0400 Subject: [PATCH 024/647] Cleanup warnings and bump minor versions (#760) * Updated to system.reactive, collections.immutable and nerdbank.streams * Cleanup existing warnings * disabled more warnings --- .build/Build.cs | 6 +- .lintstagedrc.js | 8 +- Directory.Build.targets | 6 +- sample/SampleServer/Program.cs | 58 ++- sample/SampleServer/SemanticTokensHandler.cs | 43 +- src/Client/LanguageClient.cs | 97 +++-- ...nguageClientServiceCollectionExtensions.cs | 45 +- src/Dap.Client/DebugAdapterClient.cs | 82 +++- src/Dap.Client/DebugAdapterClientOptions.cs | 171 ++++++-- ...dapterClientServiceCollectionExtensions.cs | 42 +- .../DapRpcErrorConverter.cs | 9 +- .../Feature/Events/BreakpointFeature.cs | 10 +- .../Feature/Events/CapabilitiesFeature.cs | 16 +- .../Feature/Events/InitializedFeature.cs | 12 +- .../Feature/Events/LoadedSourceFeature.cs | 10 +- .../Feature/Events/ModuleFeature.cs | 12 +- .../Feature/Events/OutputFeature.cs | 12 +- .../Feature/Events/ProcessFeature.cs | 10 +- .../Feature/Events/ProgressFeature.cs | 32 +- .../Feature/Requests/AttachFeature.cs | 12 +- .../Requests/BreakpointLocationsFeature.cs | 15 +- .../Feature/Requests/CompletionsFeature.cs | 17 +- .../Requests/ConfigurationDoneFeature.cs | 16 +- .../Requests/DataBreakpointInfoFeature.cs | 14 +- .../Feature/Requests/DisassembleFeature.cs | 22 +- .../Feature/Requests/DisconnectFeature.cs | 12 +- .../Feature/Requests/EvaluateFeature.cs | 15 +- .../Feature/Requests/ExceptionInfoFeature.cs | 10 +- .../Feature/Requests/GotoFeature.cs | 12 +- .../Feature/Requests/GotoTargetsFeature.cs | 14 +- .../Requests/InitializeRequestFeature.cs | 15 +- .../Feature/Requests/LaunchFeature.cs | 12 +- .../Feature/Requests/LoadedSourcesFeature.cs | 14 +- .../Feature/Requests/ModulesFeature.cs | 10 +- .../Feature/Requests/NextFeature.cs | 12 +- .../Feature/Requests/PauseFeature.cs | 12 +- .../Feature/Requests/ReadMemoryFeature.cs | 15 +- .../Feature/Requests/RestartFeature.cs | 16 +- .../Feature/Requests/RestartFrameFeature.cs | 12 +- .../Requests/ReverseContinueFeature.cs | 12 +- .../Feature/Requests/RunInTerminalFeature.cs | 12 +- .../Feature/Requests/ScopesFeature.cs | 12 +- .../Feature/Requests/SetBreakpointsFeature.cs | 15 +- .../Requests/SetDataBreakpointsFeature.cs | 12 +- .../SetExceptionBreakpointsFeature.cs | 35 +- .../Feature/Requests/SetExpressionFeature.cs | 14 +- .../Requests/SetFunctionBreakpointsFeature.cs | 14 +- .../SetInstructionBreakpointsFeature.cs | 12 +- .../Feature/Requests/SetVariableFeature.cs | 14 +- .../Feature/Requests/SourceFeature.cs | 13 +- .../Feature/Requests/StepBackFeature.cs | 12 +- .../Feature/Requests/StepInFeature.cs | 12 +- .../Feature/Requests/StepInTargetsFeature.cs | 10 +- .../Feature/Requests/StepOutFeature.cs | 12 +- .../Feature/Requests/TerminateFeature.cs | 12 +- .../Requests/TerminateThreadsFeature.cs | 12 +- .../Feature/Requests/ThreadsFeature.cs | 12 +- .../IDebugAdapterProtocolProxy.cs | 47 ++- src/Dap.Protocol/Models/Checksum.cs | 2 +- src/Dap.Protocol/Models/ColumnDescriptor.cs | 4 +- src/Dap.Protocol/Models/DataBreakpoint.cs | 2 +- .../Models/ExceptionBreakpointsFilter.cs | 4 +- .../Models/ExceptionFilterOptions.cs | 2 +- .../Models/InstructionBreakpoint.cs | 2 +- src/Dap.Protocol/Models/Message.cs | 2 +- src/Dap.Protocol/Models/Module.cs | 5 +- .../Models/ModulesViewDescriptor.cs | 2 +- src/Dap.Protocol/Models/StackFrame.cs | 6 +- src/Dap.Protocol/Models/Thread.cs | 2 +- src/Dap.Protocol/Models/Variable.cs | 4 +- src/Dap.Shared/DapResponseRouter.cs | 50 ++- .../JsonRpc.Generation.csproj | 15 - ...AssemblyCapabilityKeyAttributeGenerator.cs | 32 +- ...semblyJsonRpcHandlersAttributeGenerator.cs | 17 +- .../AutoImplementParamsGenerator.cs | 26 +- .../Contexts/GeneratorData.cs | 8 +- .../Contexts/RegistrationOptionAttributes.cs | 55 +-- .../EnumLikeStringGenerator.cs | 284 ++++--------- .../GenerateHandlerMethodsGenerator.cs | 23 +- .../RegistrationOptionsGenerator.cs | 33 +- ...rnIfResponseRouterIsNotProvidedStrategy.cs | 18 +- .../StronglyTypedGenerator.cs | 42 +- src/JsonRpc.Testing/JsonRpcTestBase.cs | 14 +- ...lyScanningHandlerTypeDescriptorProvider.cs | 159 ++++--- src/JsonRpc/DefaultJsonRpcServerFacade.cs | 41 +- src/JsonRpc/ErrorResponse.cs | 12 +- src/JsonRpc/IActivityTracingStrategy.cs | 119 +++--- src/JsonRpc/IJsonRpcRequestHandler.cs | 4 +- src/JsonRpc/IResponseHandler.cs | 2 +- src/JsonRpc/IResponseRouter.cs | 2 +- src/JsonRpc/InputHandler.cs | 53 ++- src/JsonRpc/JsonRpcCommonMethodsBase.cs | 168 +++++--- src/JsonRpc/JsonRpcServerBase.cs | 36 +- src/JsonRpc/NoopResponseRouter.cs | 27 +- src/JsonRpc/OutputHandler.cs | 25 +- src/JsonRpc/Receiver.cs | 33 +- src/JsonRpc/ResponseRouter.cs | 61 ++- .../Converters/EnumLikeStringConverter.cs | 24 +- .../Converters/RpcErrorConverter.cs | 9 +- src/JsonRpc/Server/RequestException.cs | 2 +- .../ProposedClientCapabilities.cs | 7 +- src/Protocol.Proposals/ProposedExtensions.cs | 3 +- .../ProposedCapabilitiesConverter.cs | 13 +- .../Serialization/ProposedLspSerializer.cs | 2 + .../ProposedServerCapabilities.cs | 4 - .../ProposedWorkspaceServerCapabilities.cs | 2 - .../TextDocumentClientCapabilities.cs | 3 - .../Capabilities/WindowClientCapabilities.cs | 3 - src/Protocol/DocumentUri.Internal.cs | 55 ++- src/Protocol/DocumentUri.cs | 93 +++-- .../Features/Client/LogTraceFeature.cs | 7 +- .../Features/Client/RegistrationFeature.cs | 207 +++++---- .../Features/Document/CallHierarchyFeature.cs | 331 ++++++++++----- .../Features/Document/CodeActionFeature.cs | 151 ++++--- .../Features/Document/CodeLensFeature.cs | 45 +- .../Features/Document/ColorFeature.cs | 31 +- .../Features/Document/DeclarationFeature.cs | 14 +- .../Features/Document/DefinitionFeature.cs | 16 +- .../Document/DocumentFormattingFeature.cs | 19 +- .../Document/DocumentHighlightFeature.cs | 18 +- .../Features/Document/DocumentLinkFeature.cs | 53 ++- .../DocumentOnTypeFormattingFeature.cs | 19 +- .../DocumentRangeFormattingFeature.cs | 17 +- .../Document/DocumentSymbolFeature.cs | 56 ++- .../Features/Document/FoldingRangeFeature.cs | 31 +- .../Features/Document/HoverFeature.cs | 26 +- .../Document/ImplementationFeature.cs | 19 +- .../Document/LinkedEditingRangeFeature.cs | 28 +- .../Features/Document/MonikerFeature.cs | 36 +- .../Features/Document/RenameFeature.cs | 64 +-- .../Document/SelectionRangeFeature.cs | 31 +- .../Document/SemanticTokensFeature.cs | 283 ++++++++----- .../Features/Document/SignatureHelpFeature.cs | 52 ++- .../Document/TextDocumentSyncFeature.cs | 146 ++++--- .../Document/TypeDefinitionFeature.cs | 20 +- .../Features/FileOperationsFeature.cs | 175 ++++---- .../Features/General/InitializeFeature.cs | 12 +- .../Features/General/InitializedFeature.cs | 4 +- src/Protocol/Features/ProgressFeature.cs | 55 ++- .../Features/Window/LogMessageFeature.cs | 49 ++- .../Window/ShowDocumentRequestFeature.cs | 9 +- .../Features/Window/ShowMessageFeature.cs | 54 ++- .../Window/ShowMessageRequestFeature.cs | 22 +- .../Window/WorkDoneProgressFeature.cs | 2 +- .../Workspace/WorkspaceFoldersFeature.cs | 6 +- src/Protocol/LanguageProtocolProxy.cs | 45 +- .../LanguageProtocolRpcOptionsBase.cs | 1 - src/Protocol/Models/ClientInfo.cs | 7 +- src/Protocol/Models/Command.cs | 20 +- src/Protocol/Models/CreateFile.cs | 2 +- src/Protocol/Models/DeleteFile.cs | 2 +- src/Protocol/Models/Diagnostic.cs | 34 +- src/Protocol/Models/FileEvent.cs | 7 +- src/Protocol/Models/FileSystemWatcher.cs | 7 +- src/Protocol/Models/Location.cs | 9 +- src/Protocol/Models/LocationLink.cs | 6 +- src/Protocol/Models/MarkupContent.cs | 7 +- src/Protocol/Models/Range.cs | 14 +- src/Protocol/Models/RenameFile.cs | 4 +- src/Protocol/Models/ServerInfo.cs | 7 +- src/Protocol/Models/TextDocumentIdentifier.cs | 26 +- src/Protocol/Models/TextDocumentItem.cs | 9 +- .../Models/TextDocumentPositionParams.cs | 4 +- src/Protocol/Models/TextEdit.cs | 80 +++- .../PartialItemRequestProgressObservable.cs | 36 +- .../PartialItemsRequestProgressObservable.cs | 41 +- .../ChangeAnnotationIdentifierConverter.cs | 2 +- .../Capabilities/IServerCapabilities.cs | 1 - .../IWorkspaceServerCapabilities.cs | 4 +- src/Protocol/Shared/LspHandlerDescriptor.cs | 58 ++- .../LspHandlerTypeDescriptorProvider.cs | 37 +- src/Server/ClientCapabilityProvider.cs | 23 +- src/Server/LanguageServer.cs | 105 +++-- .../Pipelines/SemanticTokensDeltaPipeline.cs | 7 +- ...uageProtocolServiceCollectionExtensions.cs | 18 +- test/.editorconfig | 12 + test/Client.Tests/ClientTests.cs | 208 +++++---- test/Dap.Tests/DapOutputHandlerTests.cs | 12 +- .../DebugAdapterSpecifictionRecieverTests.cs | 28 +- test/Dap.Tests/EnumLikeConverterTests.cs | 8 +- .../ConnectionAndDisconnectionTests.cs | 16 +- .../Integration/CustomRequestsTests.cs | 57 ++- .../Integration/GenericDapServerTests.cs | 1 - .../HandlersManagerIntegrationTests.cs | 18 +- .../Integration/RequestCancellationTests.cs | 17 +- .../AutoImplementParamsGeneratorTests.cs | 2 + .../EnumLikeStringGeneratorTests.cs | 2 +- .../GeneratedRegistrationOptionsTests.cs | 2 +- test/Generation.Tests/GenerationHelpers.cs | 13 +- .../JsonRpcGenerationTests.cs | 4 +- test/Generation.Tests/LspFeatureTests.cs | 1 - .../TypedCanBeResolvedTests.cs | 1 - test/JsonRpc.Tests/HandlerResolverTests.cs | 21 +- test/JsonRpc.Tests/InputHandlerTests.cs | 33 +- test/JsonRpc.Tests/IntegrationTests.cs | 68 +-- .../JsonRpc.Tests/RecursiveResolutionTests.cs | 20 +- .../ActivityTracingTests.cs | 7 +- .../ConnectionAndDisconnectionTests.cs | 18 +- .../CustomRequestsTests.cs | 26 +- .../DisableDefaultsTests.cs | 24 +- .../DynamicRegistrationTests.cs | 99 +++-- .../ErroringHandlingTests.cs | 39 +- test/Lsp.Integration.Tests/EventingTests.cs | 66 +-- .../ExecuteCommandTests.cs | 347 +++++++++------ .../ExecuteTypedCommandTests.cs | 395 +++++++++++------- test/Lsp.Integration.Tests/ExtensionTests.cs | 83 ++-- .../FileOperationTests.cs | 58 ++- .../Fixtures/DefaultClient.cs | 4 +- .../Fixtures/DefaultOptions.cs | 9 +- .../Fixtures/DefaultServer.cs | 2 +- .../Fixtures/ExampleExtensions.cs | 35 +- .../IConfigureLanguageClientOptions.cs | 2 +- .../IConfigureLanguageProtocolFixture.cs | 4 +- .../IConfigureLanguageServerOptions.cs | 4 +- .../Fixtures/LanguageProtocolFixture.cs | 7 +- .../Fixtures/LanguageProtocolFixtureTest.cs | 20 +- .../FluentAssertionsExtensions.cs | 74 ++-- .../HandlersManagerIntegrationTests.cs | 30 +- .../InitializationTests.cs | 50 ++- .../IntegrationTestingExtensions.cs | 2 +- .../LanguageServerConfigurationTests.cs | 46 +- .../LanguageServerLoggingTests.cs | 23 +- test/Lsp.Integration.Tests/LogMessageTests.cs | 19 +- test/Lsp.Integration.Tests/MonikerTests.cs | 29 +- .../OverrideHandlerTests.cs | 30 +- .../Lsp.Integration.Tests/PartialItemTests.cs | 41 +- .../PartialItemsTests.cs | 137 ++++-- test/Lsp.Integration.Tests/ProgressTests.cs | 119 ++++-- test/Lsp.Integration.Tests/Properties.cs | 4 +- test/Lsp.Integration.Tests/ProposalTests.cs | 26 +- .../RecursiveResolutionTests.cs | 87 ++-- test/Lsp.Integration.Tests/RenameTests.cs | 59 ++- .../RequestCancellationTests.cs | 59 ++- .../Lsp.Integration.Tests/ShowMessageTests.cs | 23 +- .../TypedCallHierarchyTests.cs | 94 +++-- .../TypedCodeActionTests.cs | 323 ++++++++------ .../TypedCodeLensTests.cs | 304 +++++++++----- .../TypedCompletionTests.cs | 295 ++++++++----- .../TypedDocumentLinkTests.cs | 277 +++++++----- .../WorkspaceFolderTests.cs | 66 ++- .../Server/TextDocumentSyncKindTests.cs | 1 - .../ClientCapabilityProviderTests.cs | 173 +++++--- test/Lsp.Tests/DiagnosticKindTests.cs | 5 +- test/Lsp.Tests/FluentAssertionsExtensions.cs | 72 ++-- test/Lsp.Tests/FoundationTests.cs | 182 +++++--- test/Lsp.Tests/Models/CodeLensTests.cs | 11 +- .../Models/CompletionItemKindTests.cs | 1 - .../Models/DiagnosticSeverityTests.cs | 1 - .../Models/DocumentHighlightKindTests.cs | 1 - test/Lsp.Tests/Models/FileChangeTypeTests.cs | 1 - .../Lsp.Tests/Models/InsertTextFormatTests.cs | 1 - test/Lsp.Tests/Models/MessageTypeTests.cs | 1 - test/Lsp.Tests/Models/SymbolKindTests.cs | 1 - .../Models/TextDocumentSaveReasonTests.cs | 1 - test/Lsp.Tests/SemanticTokensDocumentTests.cs | 221 ++++++---- test/Lsp.Tests/SemanticTokensLegendTests.cs | 38 +- .../Lsp.Tests/SupportedCapabilitiesFixture.cs | 24 +- .../AutoNSubstitute/TestLogger.cs | 3 +- .../AutoNSubstitute/TestLoggerFactory.cs | 18 +- test/TestingUtils/FactWithSkipOnAttribute.cs | 3 +- test/TestingUtils/RetryTheoryAttribute.cs | 10 +- 261 files changed, 6284 insertions(+), 4094 deletions(-) delete mode 100644 src/JsonRpc.Generation/JsonRpc.Generation.csproj diff --git a/.build/Build.cs b/.build/Build.cs index f98da474f..51e58f460 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -6,7 +6,6 @@ using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.MSBuild; -using Rocket.Surgery.Nuke; using Rocket.Surgery.Nuke.DotNetCore; [PublicAPI] @@ -37,7 +36,10 @@ public partial class Solution : NukeBuild, /// - Microsoft VisualStudio https://nuke.build/visualstudio /// - Microsoft VSCode https://nuke.build/vscode /// - public static int Main() => Execute(x => x.Default); + public static int Main() + { + return Execute(x => x.Default); + } [OptionalGitRepository] public GitRepository? GitRepository { get; } diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 8403c0104..0e6af2f49 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -19,10 +19,8 @@ function cleanupcode(filenames) { module.exports = { '*.cs': filenames => { - return [`echo "'${filenames.join(`' '`)}'" | dotnet format --include -`].concat(cleanupcode(filenames)); + return [`echo "'${filenames.join(`' '`)}'" | dotnet format --include -`]; //.concat(cleanupcode(filenames)); }, - '*.{csproj,targets,props,xml}': filenames => - forEachChunk(filenames, chunk => [`prettier --write '${chunk.join(`' '`)}'`]), - '*.{js,ts,jsx,tsx,json,yml,yaml}': filenames => - forEachChunk(filenames, chunk => [`prettier --write '${chunk.join(`' '`)}'`]), + '*.{csproj,targets,props,xml}': filenames => forEachChunk(filenames, chunk => [`prettier --write '${chunk.join(`' '`)}'`]), + '*.{js,ts,jsx,tsx,json,yml,yaml}': filenames => forEachChunk(filenames, chunk => [`prettier --write '${chunk.join(`' '`)}'`]), }; diff --git a/Directory.Build.targets b/Directory.Build.targets index 765e8a870..6078ba62b 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -35,15 +35,15 @@ - - + + - + diff --git a/sample/SampleServer/Program.cs b/sample/SampleServer/Program.cs index d86b96a49..999932d2a 100644 --- a/sample/SampleServer/Program.cs +++ b/sample/SampleServer/Program.cs @@ -8,11 +8,16 @@ using OmniSharp.Extensions.LanguageServer.Server; using Serilog; +// ReSharper disable UnusedParameter.Local + namespace SampleServer { internal class Program { - private static void Main(string[] args) => MainAsync(args).Wait(); + private static void Main(string[] args) + { + MainAsync(args).Wait(); + } private static async Task MainAsync(string[] args) { @@ -51,9 +56,11 @@ private static async Task MainAsync(string[] args) .WithHandler() .WithServices(x => x.AddLogging(b => b.SetMinimumLevel(LogLevel.Trace))) .WithServices( - services => { + services => + { services.AddSingleton( - provider => { + provider => + { var loggerFactory = provider.GetService(); var logger = loggerFactory.CreateLogger(); @@ -63,20 +70,24 @@ private static async Task MainAsync(string[] args) } ); services.AddSingleton( - new ConfigurationItem { + new ConfigurationItem + { Section = "typescript", } ).AddSingleton( - new ConfigurationItem { + new ConfigurationItem + { Section = "terminal", } ); } ) .OnInitialize( - async (server, request, token) => { + async (server, request, token) => + { var manager = server.WorkDoneManager.For( - request, new WorkDoneProgressBegin { + request, new WorkDoneProgressBegin + { Title = "Server is starting...", Percentage = 10, } @@ -86,7 +97,8 @@ private static async Task MainAsync(string[] args) await Task.Delay(2000).ConfigureAwait(false); manager.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 20, Message = "loading in progress" } @@ -94,9 +106,11 @@ private static async Task MainAsync(string[] args) } ) .OnInitialized( - async (server, request, response, token) => { + async (server, request, response, token) => + { workDone.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 40, Message = "loading almost done", } @@ -105,7 +119,8 @@ private static async Task MainAsync(string[] args) await Task.Delay(2000).ConfigureAwait(false); workDone.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Message = "loading done", Percentage = 100, } @@ -114,8 +129,10 @@ private static async Task MainAsync(string[] args) } ) .OnStarted( - async (languageServer, token) => { - using var manager = await languageServer.WorkDoneManager.Create(new WorkDoneProgressBegin { Title = "Doing some work..." }).ConfigureAwait(false); + async (languageServer, token) => + { + using var manager = await languageServer.WorkDoneManager.Create(new WorkDoneProgressBegin { Title = "Doing some work..." }) + .ConfigureAwait(false); manager.OnNext(new WorkDoneProgressReport { Message = "doing things..." }); await Task.Delay(10000).ConfigureAwait(false); @@ -125,9 +142,11 @@ private static async Task MainAsync(string[] args) var logger = languageServer.Services.GetService>(); var configuration = await languageServer.Configuration.GetConfiguration( - new ConfigurationItem { + new ConfigurationItem + { Section = "typescript", - }, new ConfigurationItem { + }, new ConfigurationItem + { Section = "terminal", } ).ConfigureAwait(false); @@ -138,7 +157,7 @@ private static async Task MainAsync(string[] args) baseConfig.Add(config.Key, config.Value); } - logger.LogInformation("Base Config: {Config}", baseConfig); + logger.LogInformation("Base Config: {@Config}", baseConfig); var scopedConfig = new JObject(); foreach (var config in configuration.AsEnumerable()) @@ -146,7 +165,7 @@ private static async Task MainAsync(string[] args) scopedConfig.Add(config.Key, config.Value); } - logger.LogInformation("Scoped Config: {Config}", scopedConfig); + logger.LogInformation("Scoped Config: {@Config}", scopedConfig); } ) ).ConfigureAwait(false); @@ -165,6 +184,9 @@ public Foo(ILogger logger) _logger = logger; } - public void SayFoo() => _logger.LogInformation("Fooooo!"); + public void SayFoo() + { + _logger.LogInformation("Fooooo!"); + } } } diff --git a/sample/SampleServer/SemanticTokensHandler.cs b/sample/SampleServer/SemanticTokensHandler.cs index 6f1a5db36..a95635c3d 100644 --- a/sample/SampleServer/SemanticTokensHandler.cs +++ b/sample/SampleServer/SemanticTokensHandler.cs @@ -9,7 +9,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; namespace SampleServer { @@ -18,8 +17,10 @@ public class SemanticTokensHandler : SemanticTokensHandlerBase { private readonly ILogger _logger; - public SemanticTokensHandler(ILogger logger) => + public SemanticTokensHandler(ILogger logger) + { _logger = logger; + } public override async Task Handle( SemanticTokensParams request, CancellationToken cancellationToken @@ -57,7 +58,7 @@ CancellationToken cancellationToken var content = await File.ReadAllTextAsync(DocumentUri.GetFileSystemPath(identifier), cancellationToken).ConfigureAwait(false); await Task.Yield(); - foreach (var (line, text) in content.Split('\n').Select((text, line) => (line, text))) + foreach (var (line, text) in content.Split('\n').Select((text, line) => ( line, text ))) { var parts = text.TrimEnd().Split(';', ' ', '.', '"', '(', ')'); var index = 0; @@ -73,8 +74,10 @@ CancellationToken cancellationToken } protected override Task - GetSemanticTokensDocument(ITextDocumentIdentifierParams @params, CancellationToken cancellationToken) => - Task.FromResult(new SemanticTokensDocument(RegistrationOptions.Legend)); + GetSemanticTokensDocument(ITextDocumentIdentifierParams @params, CancellationToken cancellationToken) + { + return Task.FromResult(new SemanticTokensDocument(RegistrationOptions.Legend)); + } private IEnumerable RotateEnum(IEnumerable values) @@ -86,17 +89,25 @@ private IEnumerable RotateEnum(IEnumerable values) } } - protected override SemanticTokensRegistrationOptions CreateRegistrationOptions(SemanticTokensCapability capability, ClientCapabilities clientCapabilities) => new SemanticTokensRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp"), - Legend = new SemanticTokensLegend() { - TokenModifiers = capability.TokenModifiers, - TokenTypes = capability.TokenTypes - }, - Full = new SemanticTokensCapabilityRequestFull { - Delta = true - }, - Range = true - }; + protected override SemanticTokensRegistrationOptions CreateRegistrationOptions( + SemanticTokensCapability capability, ClientCapabilities clientCapabilities + ) + { + return new SemanticTokensRegistrationOptions + { + DocumentSelector = DocumentSelector.ForLanguage("csharp"), + Legend = new SemanticTokensLegend + { + TokenModifiers = capability.TokenModifiers, + TokenTypes = capability.TokenTypes + }, + Full = new SemanticTokensCapabilityRequestFull + { + Delta = true + }, + Range = true + }; + } } #pragma warning restore 618 } diff --git a/src/Client/LanguageClient.cs b/src/Client/LanguageClient.cs index 0d5ba8b19..633634784 100644 --- a/src/Client/LanguageClient.cs +++ b/src/Client/LanguageClient.cs @@ -25,6 +25,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using OmniSharp.Extensions.LanguageServer.Shared; + // ReSharper disable SuspiciousTypeConversion.Global namespace OmniSharp.Extensions.LanguageServer.Client @@ -64,12 +65,21 @@ public class LanguageClient : JsonRpcServerBase, ILanguageClient private readonly int? _concurrency; private readonly IResolverContext _resolverContext; - internal static IContainer CreateContainer(LanguageClientOptions options, IServiceProvider? outerServiceProvider) => - JsonRpcServerContainer.Create(outerServiceProvider) - .AddLanguageClientInternals(options, outerServiceProvider); + internal static IContainer CreateContainer(LanguageClientOptions options, IServiceProvider? outerServiceProvider) + { + return JsonRpcServerContainer.Create(outerServiceProvider) + .AddLanguageClientInternals(options, outerServiceProvider); + } - public static LanguageClient Create(LanguageClientOptions options) => Create(options, null); - public static LanguageClient Create(Action optionsAction) => Create(optionsAction, null); + public static LanguageClient Create(LanguageClientOptions options) + { + return Create(options, null); + } + + public static LanguageClient Create(Action optionsAction) + { + return Create(optionsAction, null); + } public static LanguageClient Create(Action optionsAction, IServiceProvider? outerServiceProvider) { @@ -78,28 +88,53 @@ public static LanguageClient Create(Action optionsAction, return Create(options, outerServiceProvider); } - public static LanguageClient Create(LanguageClientOptions options, IServiceProvider? outerServiceProvider) => - CreateContainer(options, outerServiceProvider).Resolve(); + public static LanguageClient Create(LanguageClientOptions options, IServiceProvider? outerServiceProvider) + { + return CreateContainer(options, outerServiceProvider).Resolve(); + } - public static Task From(LanguageClientOptions options) => From(options, null, CancellationToken.None); - public static Task From(Action optionsAction) => From(optionsAction, null, CancellationToken.None); - public static Task From(LanguageClientOptions options, CancellationToken cancellationToken) => From(options, null, cancellationToken); - public static Task From(Action optionsAction, CancellationToken cancellationToken) => From(optionsAction, null, cancellationToken); + public static Task From(LanguageClientOptions options) + { + return From(options, null, CancellationToken.None); + } - public static Task From(LanguageClientOptions options, IServiceProvider? outerServiceProvider) => - From(options, outerServiceProvider, CancellationToken.None); + public static Task From(Action optionsAction) + { + return From(optionsAction, null, CancellationToken.None); + } - public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider) => - From(optionsAction, outerServiceProvider, CancellationToken.None); + public static Task From(LanguageClientOptions options, CancellationToken cancellationToken) + { + return From(options, null, cancellationToken); + } - public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken) + public static Task From(Action optionsAction, CancellationToken cancellationToken) + { + return From(optionsAction, null, cancellationToken); + } + + public static Task From(LanguageClientOptions options, IServiceProvider? outerServiceProvider) + { + return From(options, outerServiceProvider, CancellationToken.None); + } + + public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider) + { + return From(optionsAction, outerServiceProvider, CancellationToken.None); + } + + public static Task From( + Action optionsAction, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken + ) { var options = new LanguageClientOptions(); optionsAction(options); return From(options, outerServiceProvider, cancellationToken); } - public static async Task From(LanguageClientOptions options, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken) + public static async Task From( + LanguageClientOptions options, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken + ) { var server = Create(options, outerServiceProvider); await server.Initialize(cancellationToken).ConfigureAwait(false); @@ -113,7 +148,10 @@ public static async Task From(LanguageClientOptions options, ISe /// /// /// - public static LanguageClient PreInit(Action optionsAction) => Create(optionsAction); + public static LanguageClient PreInit(Action optionsAction) + { + return Create(optionsAction); + } /// /// Create the server without connecting to the client @@ -122,7 +160,10 @@ public static async Task From(LanguageClientOptions options, ISe /// /// /// - public static LanguageClient PreInit(LanguageClientOptions options) => Create(options); + public static LanguageClient PreInit(LanguageClientOptions options) + { + return Create(options); + } internal LanguageClient( Connection connection, @@ -219,7 +260,8 @@ public InitializeResult ServerSettings public async Task Initialize(CancellationToken token) { - var @params = new InitializeParams { + var @params = new InitializeParams + { Trace = _trace, ClientInfo = _clientInfo, Capabilities = _clientCapabilities, @@ -232,7 +274,8 @@ public async Task Initialize(CancellationToken token) var capabilitiesObject = new JObject(); foreach (var capability in _capabilities) { - var keys = capability.GetType().GetCustomAttribute()?.Keys.Select(key => char.ToLower(key[0]) + key.Substring(1)).ToArray(); + var keys = capability.GetType().GetCustomAttribute()?.Keys.Select(key => char.ToLower(key[0]) + key.Substring(1)) + .ToArray(); if (keys != null) { var value = capabilitiesObject; @@ -247,6 +290,7 @@ public async Task Initialize(CancellationToken token) value[key] = value = new JObject(); } } + var lastKey = keys[keys.Length - 1]; value[lastKey] = JToken.FromObject(capability, _serializer.JsonSerializer); } @@ -399,8 +443,10 @@ private Supports UseOrTryAndFindCapability(Supports supports) where T : public IObservable Start => _initializeComplete.AsObservable(); - bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) => - _responseRouter.TryGetRequest(id, out method, out pendingTask); + bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) + { + return _responseRouter.TryGetRequest(id, out method, out pendingTask); + } public Task WasStarted => _initializeComplete.ToTask(_scheduler); @@ -423,6 +469,9 @@ public IDisposable Register(Action registryAction) return result; } - object IServiceProvider.GetService(Type serviceType) => Services.GetService(serviceType); + object IServiceProvider.GetService(Type serviceType) + { + return Services.GetService(serviceType); + } } } diff --git a/src/Client/LanguageClientServiceCollectionExtensions.cs b/src/Client/LanguageClientServiceCollectionExtensions.cs index ff5a021c5..a0e3c8b3c 100644 --- a/src/Client/LanguageClientServiceCollectionExtensions.cs +++ b/src/Client/LanguageClientServiceCollectionExtensions.cs @@ -25,7 +25,7 @@ internal static IContainer AddLanguageClientInternals(this IContainer container, container.RegisterInstance(options.ClientCapabilities); container.RegisterMany( - reuse: Reuse.Singleton, + Reuse.Singleton, nonPublicServiceTypes: true, ifAlreadyRegistered: IfAlreadyRegistered.Keep ); @@ -41,14 +41,24 @@ internal static IContainer AddLanguageClientInternals(this IContainer container, #pragma warning restore 4014 } - container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(TextDocumentLanguageClient)), reuse: Reuse.Singleton); - container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(ClientLanguageClient)), reuse: Reuse.Singleton); - container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(GeneralLanguageClient)), reuse: Reuse.Singleton); - container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(WindowLanguageClient)), reuse: Reuse.Singleton); - container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(WorkspaceLanguageClient)), reuse: Reuse.Singleton); + container.RegisterMany( + serviceTypeCondition: type => type.Name.Contains(nameof(TextDocumentLanguageClient)), reuse: Reuse.Singleton + ); + container.RegisterMany( + serviceTypeCondition: type => type.Name.Contains(nameof(ClientLanguageClient)), reuse: Reuse.Singleton + ); + container.RegisterMany( + serviceTypeCondition: type => type.Name.Contains(nameof(GeneralLanguageClient)), reuse: Reuse.Singleton + ); + container.RegisterMany( + serviceTypeCondition: type => type.Name.Contains(nameof(WindowLanguageClient)), reuse: Reuse.Singleton + ); + container.RegisterMany( + serviceTypeCondition: type => type.Name.Contains(nameof(WorkspaceLanguageClient)), reuse: Reuse.Singleton + ); container.RegisterMany( - serviceTypeCondition: type => type.IsClass || !type.Name.Contains("Proxy") && typeof(DefaultLanguageClientFacade).GetInterfaces() - .Except(typeof(DefaultLanguageClientFacade).BaseType!.GetInterfaces()).Any(z => type == z), + serviceTypeCondition: type => type.IsClass || ( !type.Name.Contains("Proxy") && typeof(DefaultLanguageClientFacade).GetInterfaces() + .Except(typeof(DefaultLanguageClientFacade).BaseType!.GetInterfaces()).Any(z => type == z) ), reuse: Reuse.Singleton ); container.RegisterInstance>(new ValueOptionsFactory(options)); @@ -60,7 +70,8 @@ internal static IContainer AddLanguageClientInternals(this IContainer container, ); container.RegisterInstance( - options.ClientInfo ?? new ClientInfo { + options.ClientInfo ?? new ClientInfo + { Name = Assembly.GetEntryAssembly()?.GetName().ToString() ?? string.Empty, Version = Assembly.GetEntryAssembly()?.GetCustomAttribute() ?.InformationalVersion ?? @@ -69,9 +80,11 @@ internal static IContainer AddLanguageClientInternals(this IContainer container, } ); - var providedConfiguration = options.Services.FirstOrDefault(z => z.ServiceType == typeof(IConfiguration) && z.ImplementationInstance is IConfiguration); + var providedConfiguration = + options.Services.FirstOrDefault(z => z.ServiceType == typeof(IConfiguration) && z.ImplementationInstance is IConfiguration); container.RegisterDelegate( - _ => { + _ => + { var builder = options.ConfigurationBuilder; var outerConfiguration = outerServiceProvider?.GetService(); if (outerConfiguration != null) @@ -103,10 +116,14 @@ internal static IContainer AddLanguageClientInternals(this IContainer container, return container; } - public static IServiceCollection AddLanguageClient(this IServiceCollection services, Action? configureOptions = null) => - AddLanguageClient(services, Options.DefaultName, configureOptions); + public static IServiceCollection AddLanguageClient(this IServiceCollection services, Action? configureOptions = null) + { + return AddLanguageClient(services, Options.DefaultName, configureOptions); + } - public static IServiceCollection AddLanguageClient(this IServiceCollection services, string name, Action? configureOptions = null) + public static IServiceCollection AddLanguageClient( + this IServiceCollection services, string name, Action? configureOptions = null + ) { // If we get called multiple times we're going to remove the default server // and force consumers to use the resolver. diff --git a/src/Dap.Client/DebugAdapterClient.cs b/src/Dap.Client/DebugAdapterClient.cs index 3141c0605..209c110c0 100644 --- a/src/Dap.Client/DebugAdapterClient.cs +++ b/src/Dap.Client/DebugAdapterClient.cs @@ -16,6 +16,7 @@ using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; using OmniSharp.Extensions.DebugAdapter.Shared; using OmniSharp.Extensions.JsonRpc; + // ReSharper disable SuspiciousTypeConversion.Global namespace OmniSharp.Extensions.DebugAdapter.Client @@ -39,12 +40,21 @@ public class DebugAdapterClient : JsonRpcServerBase, IDebugAdapterClient, IDebug private readonly ISubject _initializedComplete = new AsyncSubject(); private readonly int? _concurrency; - internal static IContainer CreateContainer(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) => - JsonRpcServerContainer.Create(outerServiceProvider) - .AddDebugAdapterClientInternals(options, outerServiceProvider); + internal static IContainer CreateContainer(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) + { + return JsonRpcServerContainer.Create(outerServiceProvider) + .AddDebugAdapterClientInternals(options, outerServiceProvider); + } - public static DebugAdapterClient Create(DebugAdapterClientOptions options) => Create(options, null); - public static DebugAdapterClient Create(Action optionsAction) => Create(optionsAction, null); + public static DebugAdapterClient Create(DebugAdapterClientOptions options) + { + return Create(options, null); + } + + public static DebugAdapterClient Create(Action optionsAction) + { + return Create(optionsAction, null); + } public static DebugAdapterClient Create(Action optionsAction, IServiceProvider? outerServiceProvider) { @@ -53,30 +63,53 @@ public static DebugAdapterClient Create(Action option return Create(options, outerServiceProvider); } - public static DebugAdapterClient Create(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) => - CreateContainer(options, outerServiceProvider).Resolve(); + public static DebugAdapterClient Create(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) + { + return CreateContainer(options, outerServiceProvider).Resolve(); + } + + public static Task From(DebugAdapterClientOptions options) + { + return From(options, null, CancellationToken.None); + } + + public static Task From(Action optionsAction) + { + return From(optionsAction, null, CancellationToken.None); + } - public static Task From(DebugAdapterClientOptions options) => From(options, null, CancellationToken.None); - public static Task From(Action optionsAction) => From(optionsAction, null, CancellationToken.None); - public static Task From(DebugAdapterClientOptions options, CancellationToken cancellationToken) => From(options, null, cancellationToken); + public static Task From(DebugAdapterClientOptions options, CancellationToken cancellationToken) + { + return From(options, null, cancellationToken); + } - public static Task From(Action optionsAction, CancellationToken cancellationToken) => - From(optionsAction, null, cancellationToken); + public static Task From(Action optionsAction, CancellationToken cancellationToken) + { + return From(optionsAction, null, cancellationToken); + } - public static Task From(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) => - From(options, outerServiceProvider, CancellationToken.None); + public static Task From(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) + { + return From(options, outerServiceProvider, CancellationToken.None); + } - public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider) => - From(optionsAction, outerServiceProvider, CancellationToken.None); + public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider) + { + return From(optionsAction, outerServiceProvider, CancellationToken.None); + } - public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken) + public static Task From( + Action optionsAction, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken + ) { var options = new DebugAdapterClientOptions(); optionsAction(options); return From(options, outerServiceProvider, cancellationToken); } - public static async Task From(DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken) + public static async Task From( + DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken + ) { var server = Create(options, outerServiceProvider); await server.Initialize(cancellationToken).ConfigureAwait(false); @@ -179,9 +212,11 @@ Task IRequestHandler.Handle(InitializedEvent reque private void RegisterCapabilities(InitializeRequestArguments capabilities) { capabilities.SupportsRunInTerminalRequest = capabilities.SupportsRunInTerminalRequest || _collection.ContainsHandler(typeof(IRunInTerminalHandler)); - capabilities.SupportsProgressReporting = capabilities.SupportsProgressReporting || _collection.ContainsHandler(typeof(IProgressStartHandler)) && - _collection.ContainsHandler(typeof(IProgressUpdateHandler)) && - _collection.ContainsHandler(typeof(IProgressEndHandler)); + capabilities.SupportsProgressReporting = capabilities.SupportsProgressReporting || ( + _collection.ContainsHandler(typeof(IProgressStartHandler)) && + _collection.ContainsHandler(typeof(IProgressUpdateHandler)) && + _collection.ContainsHandler(typeof(IProgressEndHandler)) + ); } public InitializeRequestArguments ClientSettings @@ -204,6 +239,9 @@ public void Dispose() _connection.Dispose(); } - object IServiceProvider.GetService(Type serviceType) => _serviceProvider.GetService(serviceType); + object IServiceProvider.GetService(Type serviceType) + { + return _serviceProvider.GetService(serviceType); + } } } diff --git a/src/Dap.Client/DebugAdapterClientOptions.cs b/src/Dap.Client/DebugAdapterClientOptions.cs index 0f11dceee..56ce0c978 100644 --- a/src/Dap.Client/DebugAdapterClientOptions.cs +++ b/src/Dap.Client/DebugAdapterClientOptions.cs @@ -1,13 +1,11 @@ ο»Ώusing System; using System.Threading; using System.Threading.Tasks; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Client; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.DebugAdapter.Shared; using OmniSharp.Extensions.JsonRpc; @@ -35,108 +33,199 @@ public DebugAdapterClientOptions() public bool SupportsProgressReporting { get; set; } public bool SupportsInvalidatedEvent { get; set; } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(string method, IJsonRpcHandler handler, JsonRpcHandlerOptions? options) => - AddHandler(method, handler, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler( + string method, IJsonRpcHandler handler, JsonRpcHandlerOptions? options + ) + { + return AddHandler(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry. - AddHandler(string method, JsonRpcHandlerFactory handlerFunc, JsonRpcHandlerOptions? options) => AddHandler(method, handlerFunc, options); + AddHandler(string method, JsonRpcHandlerFactory handlerFunc, JsonRpcHandlerOptions? options) + { + return AddHandler(method, handlerFunc, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandlers(params IJsonRpcHandler[] handlers) => AddHandlers(handlers); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandlers(params IJsonRpcHandler[] handlers) + { + return AddHandlers(handlers); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(JsonRpcHandlerFactory handlerFunc, JsonRpcHandlerOptions? options) => - AddHandler(handlerFunc, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler( + JsonRpcHandlerFactory handlerFunc, JsonRpcHandlerOptions? options + ) + { + return AddHandler(handlerFunc, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(IJsonRpcHandler handler, JsonRpcHandlerOptions? options) => - AddHandler(handler, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(IJsonRpcHandler handler, JsonRpcHandlerOptions? options) + { + return AddHandler(handler, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(JsonRpcHandlerOptions? options) => AddHandler(options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(JsonRpcHandlerOptions? options) + { + return AddHandler(options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(string method, JsonRpcHandlerOptions? options) => - AddHandler(method, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(string method, JsonRpcHandlerOptions? options) + { + return AddHandler(method, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(Type type, JsonRpcHandlerOptions? options) => AddHandler(type, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(Type type, JsonRpcHandlerOptions? options) + { + return AddHandler(type, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(string method, Type type, JsonRpcHandlerOptions? options) => - AddHandler(method, type, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandler(string method, Type type, JsonRpcHandlerOptions? options) + { + return AddHandler(method, type, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandlerLink(string fromMethod, string toMethod) => - AddHandlerLink(fromMethod, toMethod); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.AddHandlerLink(string fromMethod, string toMethod) + { + return AddHandlerLink(fromMethod, toMethod); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonRequest( string method, Func> handler, JsonRpcHandlerOptions? options - ) => OnJsonRequest(method, handler, options); + ) + { + return OnJsonRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonRequest( string method, Func> handler, JsonRpcHandlerOptions? options - ) => OnJsonRequest(method, handler, options); + ) + { + return OnJsonRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func> handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func> handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func> handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func> handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnRequest( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnRequest(method, handler, options); + ) + { + return OnRequest(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( string method, Action handler, JsonRpcHandlerOptions? options - ) => OnNotification(method, handler, options); + ) + { + return OnNotification(method, handler, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonNotification(string method, Action handler, JsonRpcHandlerOptions? options) => - OnJsonNotification(method, handler, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonNotification( + string method, Action handler, JsonRpcHandlerOptions? options + ) + { + return OnJsonNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonNotification( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnJsonNotification(method, handler, options); + ) + { + return OnJsonNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonNotification( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnJsonNotification(method, handler, options); + ) + { + return OnJsonNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnJsonNotification( string method, Action handler, JsonRpcHandlerOptions? options - ) => OnJsonNotification(method, handler, options); + ) + { + return OnJsonNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( string method, Action handler, JsonRpcHandlerOptions? options - ) => OnNotification(method, handler, options); + ) + { + return OnNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnNotification(method, handler, options); + ) + { + return OnNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnNotification(method, handler, options); + ) + { + return OnNotification(method, handler, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification(string method, Action handler, JsonRpcHandlerOptions? options) => - OnNotification(method, handler, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( + string method, Action handler, JsonRpcHandlerOptions? options + ) + { + return OnNotification(method, handler, options); + } IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( string method, Func handler, JsonRpcHandlerOptions? options - ) => OnNotification(method, handler, options); + ) + { + return OnNotification(method, handler, options); + } - IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification(string method, Func handler, JsonRpcHandlerOptions? options) => - OnNotification(method, handler, options); + IDebugAdapterClientRegistry IJsonRpcHandlerRegistry.OnNotification( + string method, Func handler, JsonRpcHandlerOptions? options + ) + { + return OnNotification(method, handler, options); + } } } diff --git a/src/Dap.Client/DebugAdapterClientServiceCollectionExtensions.cs b/src/Dap.Client/DebugAdapterClientServiceCollectionExtensions.cs index a823d45d9..d4bffec16 100644 --- a/src/Dap.Client/DebugAdapterClientServiceCollectionExtensions.cs +++ b/src/Dap.Client/DebugAdapterClientServiceCollectionExtensions.cs @@ -15,7 +15,9 @@ namespace OmniSharp.Extensions.DebugAdapter.Client { public static class DebugAdapterClientServiceCollectionExtensions { - internal static IContainer AddDebugAdapterClientInternals(this IContainer container, DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider) + internal static IContainer AddDebugAdapterClientInternals( + this IContainer container, DebugAdapterClientOptions options, IServiceProvider? outerServiceProvider + ) { container = container.AddDebugAdapterProtocolInternals(options); @@ -31,9 +33,10 @@ internal static IContainer AddDebugAdapterClientInternals(this IContainer contai container.RegisterInstance>(new ValueOptionsFactory(options)); container.RegisterInstance( - new InitializeRequestArguments { + new InitializeRequestArguments + { Locale = options.Locale, - AdapterId = options.AdapterId!, + AdapterId = options.AdapterId, ClientId = options.ClientId, ClientName = options.ClientName, PathFormat = options.PathFormat, @@ -55,14 +58,17 @@ internal static IContainer AddDebugAdapterClientInternals(this IContainer contai setup: Setup.With(condition: req => req.IsResolutionRoot || req.Container.Resolve().Started) ); container.RegisterMany( - serviceTypeCondition: type => type.IsClass || !type.Name.Contains("Proxy") && typeof(DefaultDebugAdapterClientFacade).GetInterfaces().Except(typeof(DefaultDebugAdapterClientFacade).BaseType!.GetInterfaces()).Any(z => type == z), + serviceTypeCondition: type => type.IsClass || ( !type.Name.Contains("Proxy") && typeof(DefaultDebugAdapterClientFacade).GetInterfaces() + .Except(typeof(DefaultDebugAdapterClientFacade).BaseType!.GetInterfaces()).Any(z => type == z) ), reuse: Reuse.Singleton ); // container. - var providedConfiguration = options.Services.FirstOrDefault(z => z.ServiceType == typeof(IConfiguration) && z.ImplementationInstance is IConfiguration); + var providedConfiguration = + options.Services.FirstOrDefault(z => z.ServiceType == typeof(IConfiguration) && z.ImplementationInstance is IConfiguration); container.RegisterDelegate( - _ => { + _ => + { var builder = new ConfigurationBuilder(); if (outerServiceProvider != null) { @@ -75,7 +81,7 @@ internal static IContainer AddDebugAdapterClientInternals(this IContainer contai if (providedConfiguration != null) { - builder.CustomAddConfiguration((providedConfiguration.ImplementationInstance as IConfiguration)!); + builder.CustomAddConfiguration(( providedConfiguration.ImplementationInstance as IConfiguration )!); } return builder.Build(); @@ -86,10 +92,14 @@ internal static IContainer AddDebugAdapterClientInternals(this IContainer contai return container; } - public static IServiceCollection AddDebugAdapterClient(this IServiceCollection services, Action? configureOptions = null) => - AddDebugAdapterClient(services, Options.DefaultName, configureOptions); + public static IServiceCollection AddDebugAdapterClient(this IServiceCollection services, Action? configureOptions = null) + { + return AddDebugAdapterClient(services, Options.DefaultName, configureOptions); + } - public static IServiceCollection AddDebugAdapterClient(this IServiceCollection services, string name, Action? configureOptions = null) + public static IServiceCollection AddDebugAdapterClient( + this IServiceCollection services, string name, Action? configureOptions = null + ) { // If we get called multiple times we're going to remove the default server // and force consumers to use the resolver. @@ -100,15 +110,21 @@ public static IServiceCollection AddDebugAdapterClient(this IServiceCollection s services.RemoveAll(); services.AddSingleton( _ => - throw new NotSupportedException("DebugAdapterClient has been registered multiple times, you must use DebugAdapterClientResolver instead") + throw new NotSupportedException( + "DebugAdapterClient has been registered multiple times, you must use DebugAdapterClientResolver instead" + ) ); services.AddSingleton( _ => - throw new NotSupportedException("DebugAdapterClient has been registered multiple times, you must use DebugAdapterClientResolver instead") + throw new NotSupportedException( + "DebugAdapterClient has been registered multiple times, you must use DebugAdapterClientResolver instead" + ) ); services.AddSingleton( _ => - throw new NotSupportedException("DebugAdapterClient has been registered multiple times, you must use DebugAdapterClientResolver instead") + throw new NotSupportedException( + "DebugAdapterClient has been registered multiple times, you must use DebugAdapterClientResolver instead" + ) ); } diff --git a/src/Dap.Protocol/DebugAdapterConverters/DapRpcErrorConverter.cs b/src/Dap.Protocol/DebugAdapterConverters/DapRpcErrorConverter.cs index d26bf9fd6..da99d76b2 100644 --- a/src/Dap.Protocol/DebugAdapterConverters/DapRpcErrorConverter.cs +++ b/src/Dap.Protocol/DebugAdapterConverters/DapRpcErrorConverter.cs @@ -48,9 +48,12 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist object? requestId = null; if (obj.TryGetValue("id", out var id)) { - var idString = id.Type == JTokenType.String ? (string) id : null; - var idLong = id.Type == JTokenType.Integer ? (long?) id : null; - requestId = idString ?? ( idLong.HasValue ? (object?) idLong.Value : null ); + requestId = id switch + { + { Type: JTokenType.String } => id.Value(), + { Type: JTokenType.Integer } => id.Value(), + _ => null + }; } ErrorMessage? data = null; diff --git a/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs b/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs index 19f04b79c..de76a5862 100644 --- a/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs +++ b/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs @@ -80,11 +80,9 @@ namespace Events { [Parallel] [Method(EventNames.Breakpoint, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record BreakpointEvent : IRequest { /// @@ -96,7 +94,7 @@ public record BreakpointEvent : IRequest /// /// The 'id' attribute is used to find the target breakpoint and the other attributes are used as the new values. /// - public Breakpoint Breakpoint { get; init; } + public Breakpoint Breakpoint { get; init; } = null!; } diff --git a/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs b/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs index 28d81b0da..7d34b09b3 100644 --- a/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs +++ b/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs @@ -105,7 +105,8 @@ public record Capabilities public Container? SupportedChecksumAlgorithms { get; set; } /// - /// The debug adapter supports the 'restart' request. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by calling the + /// The debug adapter supports the 'restart' request. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by + /// calling the /// RestartRequest. /// [Optional] @@ -136,7 +137,8 @@ public record Capabilities public bool SupportTerminateDebuggee { get; set; } /// - /// The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' result of the + /// The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' + /// result of the /// 'StackTrace' request are supported. /// [Optional] @@ -233,17 +235,15 @@ namespace Events { [Parallel] [Method(EventNames.Capabilities, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record CapabilitiesEvent : IRequest { /// /// The set of updated capabilities. /// - public Capabilities Capabilities { get; init; } + public Capabilities Capabilities { get; init; } = null!; } } } diff --git a/src/Dap.Protocol/Feature/Events/InitializedFeature.cs b/src/Dap.Protocol/Feature/Events/InitializedFeature.cs index e301e0d79..35fa55a40 100644 --- a/src/Dap.Protocol/Feature/Events/InitializedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/InitializedFeature.cs @@ -9,13 +9,9 @@ namespace Events { [Parallel] [Method(EventNames.Initialized, Direction.ServerToClient)] - [ - GenerateHandler(Name = "DebugAdapterInitialized"), - GenerateHandlerMethods, - GenerateRequestMethods - ] - public record InitializedEvent : IRequest - { - } + [GenerateHandler(Name = "DebugAdapterInitialized")] + [GenerateHandlerMethods] + [GenerateRequestMethods] + public record InitializedEvent : IRequest; } } diff --git a/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs b/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs index 9b86f9598..f916d033d 100644 --- a/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs +++ b/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs @@ -10,11 +10,9 @@ namespace Events { [Parallel] [Method(EventNames.LoadedSource, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record LoadedSourceEvent : IRequest { /// @@ -25,7 +23,7 @@ public record LoadedSourceEvent : IRequest /// /// The new, changed, or removed source. /// - public Source Source { get; init; } + public Source Source { get; init; } = null!; } [StringEnum] diff --git a/src/Dap.Protocol/Feature/Events/ModuleFeature.cs b/src/Dap.Protocol/Feature/Events/ModuleFeature.cs index ce15fe09b..828af7c13 100644 --- a/src/Dap.Protocol/Feature/Events/ModuleFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ModuleFeature.cs @@ -1,7 +1,7 @@ ο»Ώusing MediatR; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.DebugAdapter.Protocol @@ -10,11 +10,9 @@ namespace Events { [Parallel] [Method(EventNames.Module, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ModuleEvent : IRequest { /// @@ -25,7 +23,7 @@ public record ModuleEvent : IRequest /// /// The new, changed, or removed module. In case of 'removed' only the module id is used. /// - public Module Module { get; init; } + public Module Module { get; init; } = null!; } [StringEnum] diff --git a/src/Dap.Protocol/Feature/Events/OutputFeature.cs b/src/Dap.Protocol/Feature/Events/OutputFeature.cs index f56e4e70c..0a5635579 100644 --- a/src/Dap.Protocol/Feature/Events/OutputFeature.cs +++ b/src/Dap.Protocol/Feature/Events/OutputFeature.cs @@ -12,11 +12,9 @@ namespace Events { [Parallel] [Method(EventNames.Output, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record OutputEvent : IRequest { /// @@ -29,13 +27,13 @@ public record OutputEvent : IRequest /// /// The output to report. /// - public string Output { get; init; } + public string Output { get; init; } = null!; /// /// Support for keeping an output log organized by grouping related messages. /// Values: /// 'start': Start a new group in expanded mode. Subsequent output events are - /// members of the group and should be shown indented. + /// members of the group and should be shown indented. /// The 'output' attribute becomes the name of the group and is not indented. /// 'startCollapsed': Start a new group in collapsed mode. Subsequent output /// events are members of the group and should be shown indented (as soon as diff --git a/src/Dap.Protocol/Feature/Events/ProcessFeature.cs b/src/Dap.Protocol/Feature/Events/ProcessFeature.cs index 11fa7fc16..fb5128ac6 100644 --- a/src/Dap.Protocol/Feature/Events/ProcessFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ProcessFeature.cs @@ -10,17 +10,15 @@ namespace Events { [Parallel] [Method(EventNames.Process, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ProcessEvent : IRequest { /// /// The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// The system process id of the debugged process. This property will be missing for non-system processes. diff --git a/src/Dap.Protocol/Feature/Events/ProgressFeature.cs b/src/Dap.Protocol/Feature/Events/ProgressFeature.cs index 16ebd60a5..aca27ceaf 100644 --- a/src/Dap.Protocol/Feature/Events/ProgressFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ProgressFeature.cs @@ -14,7 +14,7 @@ public abstract record ProgressEvent /// /// The ID that was introduced in the initial 'progressStart' event. /// - public ProgressToken ProgressId { get; init; } + public ProgressToken ProgressId { get; init; } = null!; /// /// Optional, more detailed progress message. If omitted, the previous message (if any) is used. @@ -25,17 +25,15 @@ public abstract record ProgressEvent [Serial] [Method(EventNames.ProgressStart, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ProgressStartEvent : ProgressEvent, IRequest { /// /// Mandatory (short) title of the progress reporting. Shown in the UI to describe the long running operation. /// - public string Title { get; init; } + public string Title { get; init; } = null!; /// /// The request ID that this progress report is related to. If specified a debug adapter is expected to emit @@ -62,11 +60,9 @@ public record ProgressStartEvent : ProgressEvent, IRequest [Serial] [Method(EventNames.ProgressUpdate, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ProgressUpdateEvent : ProgressEvent, IRequest { /// @@ -78,13 +74,9 @@ public record ProgressUpdateEvent : ProgressEvent, IRequest [Serial] [Method(EventNames.ProgressEnd, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] - public record ProgressEndEvent : ProgressEvent, IRequest - { - } + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] + public record ProgressEndEvent : ProgressEvent, IRequest; } } diff --git a/src/Dap.Protocol/Feature/Requests/AttachFeature.cs b/src/Dap.Protocol/Feature/Requests/AttachFeature.cs index 2dd02d4d9..a91dc0445 100644 --- a/src/Dap.Protocol/Feature/Requests/AttachFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/AttachFeature.cs @@ -13,11 +13,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Attach, Direction.ClientToServer)] - [ - GenerateHandler(Name = "Attach", AllowDerivedRequests = true), - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler(Name = "Attach", AllowDerivedRequests = true)] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record AttachRequestArguments : IRequest { /// @@ -32,8 +30,6 @@ public record AttachRequestArguments : IRequest [JsonExtensionData] public IDictionary ExtensionData { get; init; } = new Dictionary(); } - public record AttachResponse - { - } + public record AttachResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/BreakpointLocationsFeature.cs b/src/Dap.Protocol/Feature/Requests/BreakpointLocationsFeature.cs index 491f0d8dc..f89850a07 100644 --- a/src/Dap.Protocol/Feature/Requests/BreakpointLocationsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/BreakpointLocationsFeature.cs @@ -11,17 +11,15 @@ namespace Requests { [Parallel] [Method(RequestNames.BreakpointLocations, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record BreakpointLocationsArguments : IRequest { /// /// The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. /// - public Source Source { get; init; } + public Source Source { get; init; } = null!; /// /// Start line of range to search possible breakpoint locations in. If only the line is specified, the request returns all possible locations in that line. @@ -41,7 +39,8 @@ public record BreakpointLocationsArguments : IRequest - /// Optional end column of range to search possible breakpoint locations in. If no end column is given, then it is assumed to be in the last column of the end line. + /// Optional end column of range to search possible breakpoint locations in. If no end column is given, then it is assumed to be in the last column of the end + /// line. /// [Optional] public int? EndColumn { get; init; } @@ -52,7 +51,7 @@ public record BreakpointLocationsResponse /// /// Sorted set of possible breakpoint locations. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } } diff --git a/src/Dap.Protocol/Feature/Requests/CompletionsFeature.cs b/src/Dap.Protocol/Feature/Requests/CompletionsFeature.cs index 6eb1ec66a..3298033c5 100644 --- a/src/Dap.Protocol/Feature/Requests/CompletionsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/CompletionsFeature.cs @@ -13,11 +13,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Completions, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record CompletionsArguments : IRequest { /// @@ -29,7 +27,7 @@ public record CompletionsArguments : IRequest /// /// One or more source lines.Typically this is the text a user has typed into the debug console before he asked for completion. /// - public string Text { get; init; } + public string Text { get; init; } = null!; /// /// The character position for which to determine the completion proposals. @@ -48,7 +46,7 @@ public record CompletionsResponse /// /// The possible completions for . /// - public Container Targets { get; init; } + public Container Targets { get; init; } = null!; } } @@ -62,7 +60,7 @@ public record CompletionItem /// /// The label of this completion item. By default this is also the text that is inserted when selecting this completion. /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// If text is not falsy then it is inserted instead of the label. @@ -113,7 +111,8 @@ public record CompletionItem [JsonConverter(typeof(StringEnumConverter))] public enum CompletionItemType { - Method, Function, Constructor, Field, Variable, Class, Interface, Module, Property, Unit, Value, Enum, Keyword, Snippet, Text, Color, File, Reference, CustomColor + Method, Function, Constructor, Field, Variable, Class, Interface, Module, Property, Unit, Value, Enum, Keyword, Snippet, Text, Color, File, + Reference, CustomColor } } } diff --git a/src/Dap.Protocol/Feature/Requests/ConfigurationDoneFeature.cs b/src/Dap.Protocol/Feature/Requests/ConfigurationDoneFeature.cs index 3ccd14f6c..f67e050e6 100644 --- a/src/Dap.Protocol/Feature/Requests/ConfigurationDoneFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ConfigurationDoneFeature.cs @@ -9,17 +9,11 @@ namespace Requests { [Parallel] [Method(RequestNames.ConfigurationDone, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] - public record ConfigurationDoneArguments : IRequest - { - } + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] + public record ConfigurationDoneArguments : IRequest; - public record ConfigurationDoneResponse - { - } + public record ConfigurationDoneResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/DataBreakpointInfoFeature.cs b/src/Dap.Protocol/Feature/Requests/DataBreakpointInfoFeature.cs index d1b02bbf1..30972e614 100644 --- a/src/Dap.Protocol/Feature/Requests/DataBreakpointInfoFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/DataBreakpointInfoFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.DataBreakpointInfo, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record DataBreakpointInfoArguments : IRequest { /// @@ -27,7 +25,7 @@ public record DataBreakpointInfoArguments : IRequest /// /// The name of the Variable's child to obtain data breakpoint information for. If variableReference isn’t provided, this can be an expression. /// - public string Name { get; init; } + public string Name { get; init; } = null!; } public record DataBreakpointInfoResponse @@ -35,12 +33,12 @@ public record DataBreakpointInfoResponse /// /// An identifier for the data on which a data breakpoint can be registered with the setDataBreakpoints request or null if no data breakpoint is available. /// - public string DataId { get; init; } + public string DataId { get; init; } = null!; /// /// UI string that describes on what data the breakpoint is set on or why a data breakpoint is not available. /// - public string Description { get; init; } + public string Description { get; init; } = null!; /// /// Optional attribute listing the available access types for a potential data breakpoint.A UI frontend could surface this information. diff --git a/src/Dap.Protocol/Feature/Requests/DisassembleFeature.cs b/src/Dap.Protocol/Feature/Requests/DisassembleFeature.cs index 32ff4087b..e28e68d2f 100644 --- a/src/Dap.Protocol/Feature/Requests/DisassembleFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/DisassembleFeature.cs @@ -11,17 +11,15 @@ namespace Requests { [Parallel] [Method(RequestNames.Disassemble, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record DisassembleArguments : IRequest { /// /// Memory reference to the base location containing the instructions to disassemble. /// - public string MemoryReference { get; init; } + public string MemoryReference { get; init; } = null!; /// /// Optional offset(in bytes) to be applied to the reference location before disassembling.Can be negative. @@ -37,7 +35,8 @@ public record DisassembleArguments : IRequest public long? InstructionOffset { get; init; } /// - /// Number of instructions to disassemble starting at the specified location and offset.An adapter must return exactly this number of instructions - any unavailable instructions + /// Number of instructions to disassemble starting at the specified location and offset.An adapter must return exactly this number of instructions - any + /// unavailable instructions /// should be replaced with an implementation-defined 'invalid instruction' value. /// public long InstructionCount { get; init; } @@ -54,7 +53,7 @@ public record DisassembleResponse /// /// The list of disassembled instructions. /// - public Container Instructions { get; init; } + public Container Instructions { get; init; } = null!; } } @@ -69,7 +68,7 @@ public record DisassembledInstruction /// /// The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. /// - public string Address { get; init; } + public string Address { get; init; } = null!; /// /// Optional raw bytes representing the instruction and its operands, in an implementation-defined format. @@ -80,7 +79,7 @@ public record DisassembledInstruction /// /// Text representing the instruction and its operands, in an implementation-defined format. /// - public string Instruction { get; init; } + public string Instruction { get; init; } = null!; /// /// Name of the symbol that corresponds with the location of this instruction, if any. @@ -89,7 +88,8 @@ public record DisassembledInstruction public string? Symbol { get; init; } /// - /// Source location that corresponds to this instruction, if any. Should always be set (if available) on the first instruction returned, but can be omitted afterwards if this + /// Source location that corresponds to this instruction, if any. Should always be set (if available) on the first instruction returned, but can be omitted + /// afterwards if this /// instruction maps to the same source file as the previous instruction. /// [Optional] diff --git a/src/Dap.Protocol/Feature/Requests/DisconnectFeature.cs b/src/Dap.Protocol/Feature/Requests/DisconnectFeature.cs index 0da05095b..3da9dc03c 100644 --- a/src/Dap.Protocol/Feature/Requests/DisconnectFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/DisconnectFeature.cs @@ -10,11 +10,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Disconnect, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record DisconnectArguments : IRequest { /// @@ -32,8 +30,6 @@ public record DisconnectArguments : IRequest public bool TerminateDebuggee { get; init; } } - public record DisconnectResponse - { - } + public record DisconnectResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/EvaluateFeature.cs b/src/Dap.Protocol/Feature/Requests/EvaluateFeature.cs index e6b6848af..9d4820f90 100644 --- a/src/Dap.Protocol/Feature/Requests/EvaluateFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/EvaluateFeature.cs @@ -11,17 +11,15 @@ namespace Requests { [Parallel] [Method(RequestNames.Evaluate, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record EvaluateArguments : IRequest { /// /// The expression to evaluate. /// - public string Expression { get; init; } + public string Expression { get; init; } = null!; /// /// Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. @@ -61,7 +59,7 @@ public record EvaluateResponse /// /// The result of the evaluate request. /// - public string Result { get; init; } + public string Result { get; init; } = null!; /// /// The optional type of the evaluate result. @@ -95,7 +93,8 @@ public record EvaluateResponse public long? IndexedVariables { get; init; } /// - /// Memory reference to a location appropriate for this result.For pointer type eval results, this is generally a reference to the memory address contained in the pointer. + /// Memory reference to a location appropriate for this result.For pointer type eval results, this is generally a reference to the memory address contained in the + /// pointer. /// [Optional] public string? MemoryReference { get; init; } diff --git a/src/Dap.Protocol/Feature/Requests/ExceptionInfoFeature.cs b/src/Dap.Protocol/Feature/Requests/ExceptionInfoFeature.cs index c734e3c03..8a664d585 100644 --- a/src/Dap.Protocol/Feature/Requests/ExceptionInfoFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ExceptionInfoFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.ExceptionInfo, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ExceptionInfoArguments : IRequest { /// @@ -29,7 +27,7 @@ public record ExceptionInfoResponse /// /// ID of the exception that was thrown. /// - public string ExceptionId { get; init; } + public string ExceptionId { get; init; } = null!; /// /// Descriptive text for the exception provided by the debug adapter. diff --git a/src/Dap.Protocol/Feature/Requests/GotoFeature.cs b/src/Dap.Protocol/Feature/Requests/GotoFeature.cs index 1c9c48a0b..24898294e 100644 --- a/src/Dap.Protocol/Feature/Requests/GotoFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/GotoFeature.cs @@ -9,11 +9,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Goto, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record GotoArguments : IRequest { /// @@ -27,8 +25,6 @@ public record GotoArguments : IRequest public long TargetId { get; init; } } - public record GotoResponse - { - } + public record GotoResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/GotoTargetsFeature.cs b/src/Dap.Protocol/Feature/Requests/GotoTargetsFeature.cs index 472d7bc76..2fbf84ef2 100644 --- a/src/Dap.Protocol/Feature/Requests/GotoTargetsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/GotoTargetsFeature.cs @@ -11,17 +11,15 @@ namespace Requests { [Parallel] [Method(RequestNames.GotoTargets, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record GotoTargetsArguments : IRequest { /// /// The source location for which the goto targets are determined. /// - public Source Source { get; init; } + public Source Source { get; init; } = null!; /// /// The line location for which the goto targets are determined. @@ -40,7 +38,7 @@ public record GotoTargetsResponse /// /// The possible goto targets of the specified location. /// - public Container Targets { get; init; } + public Container Targets { get; init; } = null!; } } @@ -60,7 +58,7 @@ public record GotoTarget /// /// The name of the goto target (shown in the UI). /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// The line of the goto target. diff --git a/src/Dap.Protocol/Feature/Requests/InitializeRequestFeature.cs b/src/Dap.Protocol/Feature/Requests/InitializeRequestFeature.cs index 07df4b3e6..a8c4e645c 100644 --- a/src/Dap.Protocol/Feature/Requests/InitializeRequestFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/InitializeRequestFeature.cs @@ -12,18 +12,17 @@ namespace Requests { [Parallel] [Method(RequestNames.Initialize, Direction.ClientToServer)] - [ - GenerateHandler(Name = "DebugAdapterInitialize"), - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler(Name = "DebugAdapterInitialize")] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record InitializeRequestArguments : IRequest, IInitializeRequestArguments { /// /// The ID of the(frontend) client using this adapter. /// - [Optional, JsonProperty("clientID")] + [Optional] + [JsonProperty("clientID")] public string? ClientId { get; set; } /// @@ -102,8 +101,6 @@ public record InitializeRequestArguments : IRequest, IInitia public bool SupportsInvalidatedEvent { get; set; } } - public record InitializeResponse : Capabilities - { - } + public record InitializeResponse : Capabilities; } } diff --git a/src/Dap.Protocol/Feature/Requests/LaunchFeature.cs b/src/Dap.Protocol/Feature/Requests/LaunchFeature.cs index d57aa0a5d..a8e793ed7 100644 --- a/src/Dap.Protocol/Feature/Requests/LaunchFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/LaunchFeature.cs @@ -13,11 +13,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Launch, Direction.ClientToServer)] - [ - GenerateHandler(Name = "Launch", AllowDerivedRequests = true), - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler(Name = "Launch", AllowDerivedRequests = true)] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record LaunchRequestArguments : IRequest { /// @@ -38,8 +36,6 @@ public record LaunchRequestArguments : IRequest [JsonExtensionData] public IDictionary ExtensionData { get; init; } = new Dictionary(); } - public record LaunchResponse - { - } + public record LaunchResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/LoadedSourcesFeature.cs b/src/Dap.Protocol/Feature/Requests/LoadedSourcesFeature.cs index cd6eaac6d..74d5fd822 100644 --- a/src/Dap.Protocol/Feature/Requests/LoadedSourcesFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/LoadedSourcesFeature.cs @@ -10,21 +10,17 @@ namespace Requests { [Parallel] [Method(RequestNames.LoadedSources, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] - public record LoadedSourcesArguments : IRequest - { - } + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] + public record LoadedSourcesArguments : IRequest; public record LoadedSourcesResponse { /// /// Set of loaded sources. /// - public Container Sources { get; init; } + public Container Sources { get; init; } = null!; } } diff --git a/src/Dap.Protocol/Feature/Requests/ModulesFeature.cs b/src/Dap.Protocol/Feature/Requests/ModulesFeature.cs index 42d0f5ed6..b6bb7251d 100644 --- a/src/Dap.Protocol/Feature/Requests/ModulesFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ModulesFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Modules, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ModulesArguments : IRequest { /// @@ -36,7 +34,7 @@ public record ModulesResponse /// /// All modules or range of modules. /// - public Container Modules { get; init; } + public Container Modules { get; init; } = null!; /// /// The total number of modules available. diff --git a/src/Dap.Protocol/Feature/Requests/NextFeature.cs b/src/Dap.Protocol/Feature/Requests/NextFeature.cs index b053b23a4..32f8e94bd 100644 --- a/src/Dap.Protocol/Feature/Requests/NextFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/NextFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Next, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record NextArguments : IRequest { /// @@ -30,8 +28,6 @@ public record NextArguments : IRequest public SteppingGranularity Granularity { get; init; } } - public record NextResponse - { - } + public record NextResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/PauseFeature.cs b/src/Dap.Protocol/Feature/Requests/PauseFeature.cs index e1a34b884..68e3a0ca3 100644 --- a/src/Dap.Protocol/Feature/Requests/PauseFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/PauseFeature.cs @@ -9,11 +9,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Pause, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record PauseArguments : IRequest { /// @@ -22,8 +20,6 @@ public record PauseArguments : IRequest public long ThreadId { get; init; } } - public record PauseResponse - { - } + public record PauseResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/ReadMemoryFeature.cs b/src/Dap.Protocol/Feature/Requests/ReadMemoryFeature.cs index 6abfd2947..b5aaa375f 100644 --- a/src/Dap.Protocol/Feature/Requests/ReadMemoryFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ReadMemoryFeature.cs @@ -10,17 +10,15 @@ namespace Requests { [Parallel] [Method(RequestNames.ReadMemory, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ReadMemoryArguments : IRequest { /// /// Memory reference to the base location from which data should be read. /// - public string MemoryReference { get; init; } + public string MemoryReference { get; init; } = null!; /// /// Optional offset(in bytes) to be applied to the reference location before reading data.Can be negative. @@ -40,10 +38,11 @@ public record ReadMemoryResponse /// /// The address of the first byte of data returned.Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. /// - public string Address { get; init; } + public string Address { get; init; } = null!; /// - /// The number of unreadable bytes encountered after the last successfully read byte. This can be used to determine the number of bytes that must be skipped before a subsequent + /// The number of unreadable bytes encountered after the last successfully read byte. This can be used to determine the number of bytes that must be skipped before + /// a subsequent /// 'readMemory' request will succeed. /// [Optional] diff --git a/src/Dap.Protocol/Feature/Requests/RestartFeature.cs b/src/Dap.Protocol/Feature/Requests/RestartFeature.cs index 4c2ba7803..e8eacee83 100644 --- a/src/Dap.Protocol/Feature/Requests/RestartFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/RestartFeature.cs @@ -9,17 +9,11 @@ namespace Requests { [Parallel] [Method(RequestNames.Restart, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] - public record RestartArguments : IRequest - { - } + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] + public record RestartArguments : IRequest; - public record RestartResponse - { - } + public record RestartResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/RestartFrameFeature.cs b/src/Dap.Protocol/Feature/Requests/RestartFrameFeature.cs index b39262630..ba8641736 100644 --- a/src/Dap.Protocol/Feature/Requests/RestartFrameFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/RestartFrameFeature.cs @@ -9,11 +9,9 @@ namespace Requests { [Parallel] [Method(RequestNames.RestartFrame, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record RestartFrameArguments : IRequest { /// @@ -22,8 +20,6 @@ public record RestartFrameArguments : IRequest public long FrameId { get; init; } } - public record RestartFrameResponse - { - } + public record RestartFrameResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/ReverseContinueFeature.cs b/src/Dap.Protocol/Feature/Requests/ReverseContinueFeature.cs index cfb892f5b..4e1d0980a 100644 --- a/src/Dap.Protocol/Feature/Requests/ReverseContinueFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ReverseContinueFeature.cs @@ -9,11 +9,9 @@ namespace Requests { [Parallel] [Method(RequestNames.ReverseContinue, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ReverseContinueArguments : IRequest { /// @@ -22,8 +20,6 @@ public record ReverseContinueArguments : IRequest public long ThreadId { get; init; } } - public record ReverseContinueResponse - { - } + public record ReverseContinueResponse; } } diff --git a/src/Dap.Protocol/Feature/Requests/RunInTerminalFeature.cs b/src/Dap.Protocol/Feature/Requests/RunInTerminalFeature.cs index 139173497..15a9b7aa3 100644 --- a/src/Dap.Protocol/Feature/Requests/RunInTerminalFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/RunInTerminalFeature.cs @@ -14,11 +14,9 @@ namespace Requests { [Parallel] [Method(RequestNames.RunInTerminal, Direction.ServerToClient)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record RunInTerminalArguments : IRequest { /// @@ -36,12 +34,12 @@ public record RunInTerminalArguments : IRequest /// /// Working directory of the command. /// - public string Cwd { get; init; } + public string Cwd { get; init; } = null!; /// /// List of arguments.The first argument is the command to run. /// - public Container Args { get; init; } + public Container Args { get; init; } = null!; /// /// Environment key-value pairs that are added to or removed from the default environment. diff --git a/src/Dap.Protocol/Feature/Requests/ScopesFeature.cs b/src/Dap.Protocol/Feature/Requests/ScopesFeature.cs index 21930d92b..73315a52b 100644 --- a/src/Dap.Protocol/Feature/Requests/ScopesFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ScopesFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Scopes, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record ScopesArguments : IRequest { /// @@ -29,7 +27,7 @@ public record ScopesResponse /// /// The scopes of the stackframe.If the array has length zero, there are no scopes available. /// - public Container Scopes { get; init; } + public Container Scopes { get; init; } = null!; } } @@ -43,7 +41,7 @@ public record Scope /// /// Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. diff --git a/src/Dap.Protocol/Feature/Requests/SetBreakpointsFeature.cs b/src/Dap.Protocol/Feature/Requests/SetBreakpointsFeature.cs index eb8002949..cf498fe37 100644 --- a/src/Dap.Protocol/Feature/Requests/SetBreakpointsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetBreakpointsFeature.cs @@ -12,17 +12,15 @@ namespace Requests { [Parallel] [Method(RequestNames.SetBreakpoints, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetBreakpointsArguments : IRequest { /// /// The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. /// - public Source Source { get; init; } + public Source Source { get; init; } = null!; /// /// The code locations of the breakpoints. @@ -47,9 +45,10 @@ public record SetBreakpointsArguments : IRequest public record SetBreakpointsResponse { /// - /// Information about the breakpoints.The array elements are in the same order as the elements of the 'breakpoints' (or the deprecated 'lines') array in the arguments. + /// Information about the breakpoints.The array elements are in the same order as the elements of the 'breakpoints' (or the deprecated 'lines') array in the + /// arguments. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } } } diff --git a/src/Dap.Protocol/Feature/Requests/SetDataBreakpointsFeature.cs b/src/Dap.Protocol/Feature/Requests/SetDataBreakpointsFeature.cs index c0c62005b..a6f9408da 100644 --- a/src/Dap.Protocol/Feature/Requests/SetDataBreakpointsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetDataBreakpointsFeature.cs @@ -10,17 +10,15 @@ namespace Requests { [Parallel] [Method(RequestNames.SetDataBreakpoints, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetDataBreakpointsArguments : IRequest { /// /// The contents of this array replaces all existing data breakpoints. An empty array clears all data breakpoints. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } public record SetDataBreakpointsResponse @@ -28,7 +26,7 @@ public record SetDataBreakpointsResponse /// /// Information about the data breakpoints.The array elements correspond to the elements of the input argument 'breakpoints' array. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } } } diff --git a/src/Dap.Protocol/Feature/Requests/SetExceptionBreakpointsFeature.cs b/src/Dap.Protocol/Feature/Requests/SetExceptionBreakpointsFeature.cs index 0e4c62d33..429073517 100644 --- a/src/Dap.Protocol/Feature/Requests/SetExceptionBreakpointsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetExceptionBreakpointsFeature.cs @@ -13,24 +13,23 @@ namespace Requests { [Parallel] [Method(RequestNames.SetExceptionBreakpoints, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetExceptionBreakpointsArguments : IRequest { /// /// IDs of checked exception options.The set of IDs is returned via the 'exceptionBreakpointFilters' capability. /// - public Container Filters { get; init; } + public Container Filters { get; init; } = null!; + /// - /// Set of exception filters and their options. The set of all possible - /// exception filters is defined by the 'exceptionBreakpointFilters' - /// capability. This attribute is only honored by a debug adapter if the - /// capability 'supportsExceptionFilterOptions' is true. The 'filter' and - /// 'filterOptions' sets are additive. - /// + /// Set of exception filters and their options. The set of all possible + /// exception filters is defined by the 'exceptionBreakpointFilters' + /// capability. This attribute is only honored by a debug adapter if the + /// capability 'supportsExceptionFilterOptions' is true. The 'filter' and + /// 'filterOptions' sets are additive. + /// [Optional] public Container? FilterOptions { get; init; } @@ -41,9 +40,7 @@ public record SetExceptionBreakpointsArguments : IRequest? ExceptionOptions { get; init; } } - public record SetExceptionBreakpointsResponse - { - } + public record SetExceptionBreakpointsResponse; } namespace Models @@ -55,7 +52,8 @@ namespace Models public record ExceptionOptions { /// - /// A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected. By convention the first segment of the path is a category that is + /// A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected. By convention the first segment of the path is + /// a category that is /// used to group exceptions in the UI. /// [Optional] @@ -68,7 +66,8 @@ public record ExceptionOptions } /// - /// An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.If a segment consists of more than one name, it matches the + /// An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.If a segment consists of more than one + /// name, it matches the /// names provided if β€˜negate’ is false or missing or it matches anything except the names provided if β€˜negate’ is true. /// public record ExceptionPathSegment @@ -82,7 +81,7 @@ public record ExceptionPathSegment /// /// Depending on the value of 'negate' the names that should match or not match. /// - public Container Names { get; init; } + public Container Names { get; init; } = null!; } /// diff --git a/src/Dap.Protocol/Feature/Requests/SetExpressionFeature.cs b/src/Dap.Protocol/Feature/Requests/SetExpressionFeature.cs index 4bbcd7eae..036565e16 100644 --- a/src/Dap.Protocol/Feature/Requests/SetExpressionFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetExpressionFeature.cs @@ -11,22 +11,20 @@ namespace Requests { [Parallel] [Method(RequestNames.SetExpression, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetExpressionArguments : IRequest { /// /// The l-value expression to assign to. /// - public string Expression { get; init; } + public string Expression { get; init; } = null!; /// /// The value expression to assign to the l-value expression. /// - public string Value { get; init; } + public string Value { get; init; } = null!; /// /// Evaluate the expressions in the scope of this stack frame. If not specified, the expressions are evaluated in the global scope. @@ -46,7 +44,7 @@ public record SetExpressionResponse /// /// The new value of the expression. /// - public string Value { get; init; } + public string Value { get; init; } = null!; /// /// The optional type of the value. diff --git a/src/Dap.Protocol/Feature/Requests/SetFunctionBreakpointsFeature.cs b/src/Dap.Protocol/Feature/Requests/SetFunctionBreakpointsFeature.cs index 89ffd7b5d..7e8a52843 100644 --- a/src/Dap.Protocol/Feature/Requests/SetFunctionBreakpointsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetFunctionBreakpointsFeature.cs @@ -11,17 +11,15 @@ namespace Requests { [Parallel] [Method(RequestNames.SetFunctionBreakpoints, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetFunctionBreakpointsArguments : IRequest { /// /// The function names of the breakpoints. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } public record SetFunctionBreakpointsResponse @@ -29,7 +27,7 @@ public record SetFunctionBreakpointsResponse /// /// Information about the breakpoints.The array elements correspond to the elements of the 'breakpoints' array. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } } @@ -44,7 +42,7 @@ public record FunctionBreakpoint /// /// The name of the function. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// An optional expression for conditional breakpoints. diff --git a/src/Dap.Protocol/Feature/Requests/SetInstructionBreakpointsFeature.cs b/src/Dap.Protocol/Feature/Requests/SetInstructionBreakpointsFeature.cs index 059ec1780..e43d569cc 100644 --- a/src/Dap.Protocol/Feature/Requests/SetInstructionBreakpointsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetInstructionBreakpointsFeature.cs @@ -10,17 +10,15 @@ namespace Requests { [Parallel] [Method(RequestNames.SetInstructionBreakpoints, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetInstructionBreakpointsArguments : IRequest { /// /// The contents of this array replaces all existing data breakpoints. An empty array clears all data breakpoints. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } public record SetInstructionBreakpointsResponse @@ -28,7 +26,7 @@ public record SetInstructionBreakpointsResponse /// /// Information about the data breakpoints.The array elements correspond to the elements of the input argument 'breakpoints' array. /// - public Container Breakpoints { get; init; } + public Container Breakpoints { get; init; } = null!; } } diff --git a/src/Dap.Protocol/Feature/Requests/SetVariableFeature.cs b/src/Dap.Protocol/Feature/Requests/SetVariableFeature.cs index 86c0ff019..3a60c46e1 100644 --- a/src/Dap.Protocol/Feature/Requests/SetVariableFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SetVariableFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.SetVariable, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SetVariableArguments : IRequest { /// @@ -26,12 +24,12 @@ public record SetVariableArguments : IRequest /// /// The name of the variable in the container. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// The value of the variable. /// - public string Value { get; init; } + public string Value { get; init; } = null!; /// /// Specifies details on how to format the response value. @@ -45,7 +43,7 @@ public record SetVariableResponse /// /// The new value of the variable. /// - public string Value { get; init; } + public string Value { get; init; } = null!; /// /// The type of the new value.Typically shown in the UI when hovering over the value. diff --git a/src/Dap.Protocol/Feature/Requests/SourceFeature.cs b/src/Dap.Protocol/Feature/Requests/SourceFeature.cs index 5f536cb4b..c93f266c1 100644 --- a/src/Dap.Protocol/Feature/Requests/SourceFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/SourceFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Source, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record SourceArguments : IRequest { /// @@ -25,7 +23,8 @@ public record SourceArguments : IRequest public Source? Source { get; init; } /// - /// The reference to the source.This is the same as source.sourceReference.This is provided for backward compatibility since old backends do not understand the 'source' attribute. + /// The reference to the source.This is the same as source.sourceReference.This is provided for backward compatibility since old backends do not understand the + /// 'source' attribute. /// public long SourceReference { get; init; } } @@ -35,7 +34,7 @@ public record SourceResponse /// /// Content of the source reference. /// - public string Content { get; init; } + public string Content { get; init; } = null!; /// /// Optional content type(mime type) of the source. diff --git a/src/Dap.Protocol/Feature/Requests/StepBackFeature.cs b/src/Dap.Protocol/Feature/Requests/StepBackFeature.cs index e10fc90fa..a18e8b912 100644 --- a/src/Dap.Protocol/Feature/Requests/StepBackFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/StepBackFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.StepBack, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record StepBackArguments : IRequest { /// @@ -30,9 +28,7 @@ public record StepBackArguments : IRequest public SteppingGranularity? Granularity { get; init; } } - public record StepBackResponse - { - } + public record StepBackResponse; } namespace Models diff --git a/src/Dap.Protocol/Feature/Requests/StepInFeature.cs b/src/Dap.Protocol/Feature/Requests/StepInFeature.cs index de48539ab..11ba85a4b 100644 --- a/src/Dap.Protocol/Feature/Requests/StepInFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/StepInFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.StepIn, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record StepInArguments : IRequest { /// @@ -36,9 +34,7 @@ public record StepInArguments : IRequest public SteppingGranularity? Granularity { get; init; } } - public record StepInResponse - { - } + public record StepInResponse; } namespace Models diff --git a/src/Dap.Protocol/Feature/Requests/StepInTargetsFeature.cs b/src/Dap.Protocol/Feature/Requests/StepInTargetsFeature.cs index 340f9fa3d..828ed4b04 100644 --- a/src/Dap.Protocol/Feature/Requests/StepInTargetsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/StepInTargetsFeature.cs @@ -10,11 +10,9 @@ namespace Requests { [Parallel] [Method(RequestNames.StepInTargets, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record StepInTargetsArguments : IRequest { /// @@ -47,7 +45,7 @@ public record StepInTarget /// /// The name of the stepIn target (shown in the UI). /// - public string Label { get; init; } + public string Label { get; init; } = null!; } } } diff --git a/src/Dap.Protocol/Feature/Requests/StepOutFeature.cs b/src/Dap.Protocol/Feature/Requests/StepOutFeature.cs index eb55141d5..9bc8567eb 100644 --- a/src/Dap.Protocol/Feature/Requests/StepOutFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/StepOutFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.StepOut, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record StepOutArguments : IRequest { /// @@ -30,9 +28,7 @@ public record StepOutArguments : IRequest public SteppingGranularity? Granularity { get; init; } } - public record StepOutResponse - { - } + public record StepOutResponse; } namespace Models diff --git a/src/Dap.Protocol/Feature/Requests/TerminateFeature.cs b/src/Dap.Protocol/Feature/Requests/TerminateFeature.cs index 8edb397ed..f15f4d256 100644 --- a/src/Dap.Protocol/Feature/Requests/TerminateFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/TerminateFeature.cs @@ -10,11 +10,9 @@ namespace Requests { [Parallel] [Method(RequestNames.Terminate, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record TerminateArguments : IRequest { /// @@ -24,9 +22,7 @@ public record TerminateArguments : IRequest public bool Restart { get; init; } } - public record TerminateResponse - { - } + public record TerminateResponse; } namespace Models diff --git a/src/Dap.Protocol/Feature/Requests/TerminateThreadsFeature.cs b/src/Dap.Protocol/Feature/Requests/TerminateThreadsFeature.cs index 5677d8e1e..592e19cff 100644 --- a/src/Dap.Protocol/Feature/Requests/TerminateThreadsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/TerminateThreadsFeature.cs @@ -11,11 +11,9 @@ namespace Requests { [Parallel] [Method(RequestNames.TerminateThreads, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] public record TerminateThreadsArguments : IRequest { /// @@ -25,9 +23,7 @@ public record TerminateThreadsArguments : IRequest public Container? ThreadIds { get; init; } } - public record TerminateThreadsResponse - { - } + public record TerminateThreadsResponse; } namespace Models diff --git a/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs b/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs index 1975a2b2e..498ccf17b 100644 --- a/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs @@ -10,14 +10,10 @@ namespace Requests { [Parallel] [Method(RequestNames.Threads, Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods, - GenerateRequestMethods - ] - public record ThreadsArguments : IRequest - { - } + [GenerateHandler] + [GenerateHandlerMethods] + [GenerateRequestMethods] + public record ThreadsArguments : IRequest; public record ThreadsResponse { diff --git a/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs b/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs index 7bab6b7fc..5d8f4921e 100644 --- a/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs +++ b/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs @@ -14,33 +14,60 @@ public interface IDebugAdapterProtocolProxy : IResponseRouter, IDebugAdapterProt { } - abstract class DebugAdapterProtocolProxy : IDebugAdapterProtocolProxy + internal abstract class DebugAdapterProtocolProxy : IDebugAdapterProtocolProxy { private readonly IResponseRouter _responseRouter; protected readonly IResolverContext ResolverContext; private readonly IDebugAdapterProtocolSettings _debugAdapterProtocolSettings; - public DebugAdapterProtocolProxy(IResponseRouter requestRouter, IResolverContext resolverContext, IDebugAdapterProtocolSettings debugAdapterProtocolSettings) + public DebugAdapterProtocolProxy( + IResponseRouter requestRouter, IResolverContext resolverContext, IDebugAdapterProtocolSettings debugAdapterProtocolSettings + ) { _responseRouter = requestRouter; ResolverContext = resolverContext; _debugAdapterProtocolSettings = debugAdapterProtocolSettings; } - public void SendNotification(string method) => _responseRouter.SendNotification(method); + public void SendNotification(string method) + { + _responseRouter.SendNotification(method); + } - public void SendNotification(string method, T @params) => _responseRouter.SendNotification(method, @params); + public void SendNotification(string method, T @params) + { + _responseRouter.SendNotification(method, @params); + } - public void SendNotification(IRequest request) => _responseRouter.SendNotification(request); + public void SendNotification(IRequest request) + { + _responseRouter.SendNotification(request); + } - public IResponseRouterReturns SendRequest(string method, T @params) => _responseRouter.SendRequest(method, @params); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return _responseRouter.SendRequest(method, @params); + } - public IResponseRouterReturns SendRequest(string method) => _responseRouter.SendRequest(method); + public IResponseRouterReturns SendRequest(string method) + { + return _responseRouter.SendRequest(method); + } + + public Task SendRequest(IRequest request, CancellationToken cancellationToken) + { + return _responseRouter.SendRequest(request, cancellationToken); + } - public Task SendRequest(IRequest request, CancellationToken cancellationToken) => _responseRouter.SendRequest(request, cancellationToken); + bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) + { + return _responseRouter.TryGetRequest(id, out method, out pendingTask); + } - bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) => _responseRouter.TryGetRequest(id, out method, out pendingTask); - object IServiceProvider.GetService(Type serviceType) => ResolverContext.GetService(serviceType); + object IServiceProvider.GetService(Type serviceType) + { + return ResolverContext.GetService(serviceType); + } public InitializeRequestArguments ClientSettings => _debugAdapterProtocolSettings.ClientSettings; public InitializeResponse ServerSettings => _debugAdapterProtocolSettings.ServerSettings; diff --git a/src/Dap.Protocol/Models/Checksum.cs b/src/Dap.Protocol/Models/Checksum.cs index 00f35e175..26d3a5cdc 100644 --- a/src/Dap.Protocol/Models/Checksum.cs +++ b/src/Dap.Protocol/Models/Checksum.cs @@ -16,6 +16,6 @@ public record Checksum /// Value of the checksum. /// [JsonProperty("checksum")] - public string Value { get; init; } + public string Value { get; init; } = null!; } } diff --git a/src/Dap.Protocol/Models/ColumnDescriptor.cs b/src/Dap.Protocol/Models/ColumnDescriptor.cs index 83456b904..d3c705e2e 100644 --- a/src/Dap.Protocol/Models/ColumnDescriptor.cs +++ b/src/Dap.Protocol/Models/ColumnDescriptor.cs @@ -11,12 +11,12 @@ public record ColumnDescriptor /// /// Name of the attribute rendered in this column. /// - public string AttributeName { get; init; } + public string AttributeName { get; init; } = null!; /// /// Header UI label of column. /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// Format to use for the rendered values in this column. TBD how the format strings looks like. diff --git a/src/Dap.Protocol/Models/DataBreakpoint.cs b/src/Dap.Protocol/Models/DataBreakpoint.cs index 34cb4fd51..42e58a63f 100644 --- a/src/Dap.Protocol/Models/DataBreakpoint.cs +++ b/src/Dap.Protocol/Models/DataBreakpoint.cs @@ -10,7 +10,7 @@ public record DataBreakpoint /// /// An id representing the data. This id is returned from the dataBreakpointInfo request. /// - public string DataId { get; init; } + public string DataId { get; init; } = null!; /// /// The access type of the data. diff --git a/src/Dap.Protocol/Models/ExceptionBreakpointsFilter.cs b/src/Dap.Protocol/Models/ExceptionBreakpointsFilter.cs index 5100a89f7..86431b9ba 100644 --- a/src/Dap.Protocol/Models/ExceptionBreakpointsFilter.cs +++ b/src/Dap.Protocol/Models/ExceptionBreakpointsFilter.cs @@ -11,12 +11,12 @@ public record ExceptionBreakpointsFilter /// /// The internal ID of the filter. This value is passed to the setExceptionBreakpoints request. /// - public string Filter { get; init; } + public string Filter { get; init; } = null!; /// /// The name of the filter. This will be shown in the UI. /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// Initial value of the filter. If not specified a value 'false' is assumed. diff --git a/src/Dap.Protocol/Models/ExceptionFilterOptions.cs b/src/Dap.Protocol/Models/ExceptionFilterOptions.cs index a7046d04a..3230ec432 100644 --- a/src/Dap.Protocol/Models/ExceptionFilterOptions.cs +++ b/src/Dap.Protocol/Models/ExceptionFilterOptions.cs @@ -8,7 +8,7 @@ public record ExceptionFilterOptions /// ID of an exception filter returned by the 'exceptionBreakpointFilters' /// capability. /// - public string FilterId { get; init; } + public string FilterId { get; init; } = null!; /// /// An optional expression for conditional exceptions. diff --git a/src/Dap.Protocol/Models/InstructionBreakpoint.cs b/src/Dap.Protocol/Models/InstructionBreakpoint.cs index f33622484..054aa71ec 100644 --- a/src/Dap.Protocol/Models/InstructionBreakpoint.cs +++ b/src/Dap.Protocol/Models/InstructionBreakpoint.cs @@ -8,7 +8,7 @@ public record InstructionBreakpoint /// The instruction reference of the breakpoint. /// This should be a memory or instruction pointer reference from an EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint. /// - public string InstructionReference { get; init; } + public string InstructionReference { get; init; } = null!; /// /// An optional offset from the instruction reference. diff --git a/src/Dap.Protocol/Models/Message.cs b/src/Dap.Protocol/Models/Message.cs index cf25c1c35..171fcac43 100644 --- a/src/Dap.Protocol/Models/Message.cs +++ b/src/Dap.Protocol/Models/Message.cs @@ -17,7 +17,7 @@ public record Message /// A format string for the message. Embedded variables have the form '{name}'. /// If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes. /// - public string Format { get; init; } + public string Format { get; init; } = null!; /// /// An object used as a dictionary for looking up the variables in the format string. diff --git a/src/Dap.Protocol/Models/Module.cs b/src/Dap.Protocol/Models/Module.cs index bdb12efa7..dfd02c144 100644 --- a/src/Dap.Protocol/Models/Module.cs +++ b/src/Dap.Protocol/Models/Module.cs @@ -6,7 +6,8 @@ namespace OmniSharp.Extensions.DebugAdapter.Protocol.Models { /// /// A Module object represents a row in the modules view. - /// Two attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or deleting. + /// Two attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or + /// deleting. /// The name is used to minimally render the module in the UI. /// Additional attributes can be added to the module.They will show up in the module View if they have a corresponding ColumnDescriptor. /// To avoid an unnecessary proliferation of additional attributes with similar semantics but different names @@ -22,7 +23,7 @@ public record Module /// /// A name of the module. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// optional but recommended attributes. diff --git a/src/Dap.Protocol/Models/ModulesViewDescriptor.cs b/src/Dap.Protocol/Models/ModulesViewDescriptor.cs index 56fb696b4..404bde7b5 100644 --- a/src/Dap.Protocol/Models/ModulesViewDescriptor.cs +++ b/src/Dap.Protocol/Models/ModulesViewDescriptor.cs @@ -6,6 +6,6 @@ /// public record ModulesViewDescriptor { - public Container Columns { get; init; } + public Container Columns { get; init; } = null!; } } diff --git a/src/Dap.Protocol/Models/StackFrame.cs b/src/Dap.Protocol/Models/StackFrame.cs index 29b09753c..f05571723 100644 --- a/src/Dap.Protocol/Models/StackFrame.cs +++ b/src/Dap.Protocol/Models/StackFrame.cs @@ -70,8 +70,8 @@ public record StackFrame [StringEnum] public readonly partial struct StackFramePresentationHint { - public static SourcePresentationHint Normal { get; } = new SourcePresentationHint("normal"); - public static SourcePresentationHint Label { get; } = new SourcePresentationHint("label"); - public static SourcePresentationHint Subtle { get; } = new SourcePresentationHint("subtle"); + public static StackFramePresentationHint Normal { get; } = new StackFramePresentationHint("normal"); + public static StackFramePresentationHint Label { get; } = new StackFramePresentationHint("label"); + public static StackFramePresentationHint Subtle { get; } = new StackFramePresentationHint("subtle"); } } diff --git a/src/Dap.Protocol/Models/Thread.cs b/src/Dap.Protocol/Models/Thread.cs index f0ac0c653..b55d738c8 100644 --- a/src/Dap.Protocol/Models/Thread.cs +++ b/src/Dap.Protocol/Models/Thread.cs @@ -13,6 +13,6 @@ public record Thread /// /// A name of the thread. /// - public string Name { get; init; } + public string Name { get; init; } = null!; } } diff --git a/src/Dap.Protocol/Models/Variable.cs b/src/Dap.Protocol/Models/Variable.cs index e78b36246..e7aba6042 100644 --- a/src/Dap.Protocol/Models/Variable.cs +++ b/src/Dap.Protocol/Models/Variable.cs @@ -15,12 +15,12 @@ public record Variable /// /// The variable's name. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// The variable's value. This can be a multi-line text, e.g. for a function the body of a function. /// - public string Value { get; init; } + public string Value { get; init; } = null!; /// /// The type of the variable's value. Typically shown in the UI when hovering over the value. diff --git a/src/Dap.Shared/DapResponseRouter.cs b/src/Dap.Shared/DapResponseRouter.cs index 0133caaeb..a41b86032 100644 --- a/src/Dap.Shared/DapResponseRouter.cs +++ b/src/Dap.Shared/DapResponseRouter.cs @@ -28,31 +28,48 @@ public DapResponseRouter(IOutputHandler outputHandler, ISerializer serializer) Serializer = serializer; } - public void SendNotification(string method) => + public void SendNotification(string method) + { OutputHandler.Send( - new OutgoingNotification { + new OutgoingNotification + { Method = method } ); + } - public void SendNotification(string method, T @params) => + public void SendNotification(string method, T @params) + { OutputHandler.Send( - new OutgoingNotification { + new OutgoingNotification + { Method = method, Params = @params } ); + } - public void SendNotification(IRequest @params) => SendNotification(GetMethodName(@params.GetType()), @params); + public void SendNotification(IRequest @params) + { + SendNotification(GetMethodName(@params.GetType()), @params); + } - public Task SendRequest(IRequest @params, CancellationToken cancellationToken) => - SendRequest(GetMethodName(@params.GetType()), @params).Returning(cancellationToken); + public Task SendRequest(IRequest @params, CancellationToken cancellationToken) + { + return SendRequest(GetMethodName(@params.GetType()), @params).Returning(cancellationToken); + } - public IResponseRouterReturns SendRequest(string method) => new ResponseRouterReturnsImpl(this, method, new object()); + public IResponseRouterReturns SendRequest(string method) + { + return new ResponseRouterReturnsImpl(this, method, new object()); + } - public IResponseRouterReturns SendRequest(string method, T @params) => new ResponseRouterReturnsImpl(this, method, @params); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return new ResponseRouterReturnsImpl(this, method, @params); + } - public bool TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) + public bool TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) { var result = Requests.TryGetValue(id, out var source); method = source.method; @@ -99,7 +116,8 @@ public async Task Returning(CancellationToken cancellation cancellationToken.ThrowIfCancellationRequested(); _router.OutputHandler.Send( - new OutgoingRequest { + new OutgoingRequest + { Method = _method, Params = _params, Id = nextId @@ -108,7 +126,8 @@ public async Task Returning(CancellationToken cancellation if (_method != RequestNames.Cancel) { cancellationToken.Register( - () => { + () => + { if (tcs.Task.IsCompleted) return; #pragma warning disable VSTHRD110 _router.SendRequest(RequestNames.Cancel, new { requestId = nextId }).Returning(CancellationToken.None); @@ -122,7 +141,7 @@ public async Task Returning(CancellationToken cancellation var result = await tcs.Task.ConfigureAwait(false); if (typeof(TResponse) == typeof(Unit)) { - return (TResponse) (object) Unit.Value; + return (TResponse)(object)Unit.Value; } return result.ToObject(_router.Serializer.JsonSerializer); @@ -133,7 +152,10 @@ public async Task Returning(CancellationToken cancellation } } - public async Task ReturningVoid(CancellationToken cancellationToken) => await Returning(cancellationToken).ConfigureAwait(false); + public async Task ReturningVoid(CancellationToken cancellationToken) + { + await Returning(cancellationToken).ConfigureAwait(false); + } } } } diff --git a/src/JsonRpc.Generation/JsonRpc.Generation.csproj b/src/JsonRpc.Generation/JsonRpc.Generation.csproj deleted file mode 100644 index c053a21df..000000000 --- a/src/JsonRpc.Generation/JsonRpc.Generation.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - netstandard1.0 - OmniSharp.Extensions.JsonRpc.Generation - OmniSharp.Extensions.JsonRpc.Generation - - - - - - - - diff --git a/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs b/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs index 538a04a54..63f581d5a 100644 --- a/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs +++ b/src/JsonRpc.Generators/AssemblyCapabilityKeyAttributeGenerator.cs @@ -15,7 +15,7 @@ public class AssemblyCapabilityKeyAttributeGenerator : IIncrementalGenerator public void Initialize(IncrementalGeneratorInitializationContext context) { var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => { if (syntaxNode.Parent is TypeDeclarationSyntax) return false; if (syntaxNode is TypeDeclarationSyntax { Arity: 0, BaseList: { } bl } typeDeclarationSyntax @@ -38,11 +38,11 @@ public void Initialize(IncrementalGeneratorInitializationContext context) return false; }, - transform: (syntaxContext, token) => + (syntaxContext, _) => { - var namespaces = new HashSet() { "OmniSharp.Extensions.LanguageServer.Protocol" }; + var namespaces = new HashSet { "OmniSharp.Extensions.LanguageServer.Protocol" }; var tds = (TypeDeclarationSyntax)syntaxContext.Node; - + foreach (var item in syntaxContext.Node.SyntaxTree.GetCompilationUnitRoot() .Usings.Where(z => z.Alias == null) .Select(z => z.Name.ToFullString())) @@ -52,14 +52,26 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node)!; - return (namespaces, Attribute(IdentifierName("AssemblyCapabilityKey"), AttributeArgumentList(SeparatedList(new[] { AttributeArgument(TypeOfExpression(ParseName(typeSymbol.ToDisplayString()))), }.Concat(tds.AttributeLists.GetAttribute("CapabilityKey")!.ArgumentList!.Arguments))))); + return ( namespaces, + Attribute( + IdentifierName("AssemblyCapabilityKey"), + AttributeArgumentList( + SeparatedList( + new[] { AttributeArgument(TypeOfExpression(ParseName(typeSymbol.ToDisplayString()))), }.Concat( + tds.AttributeLists.GetAttribute("CapabilityKey")!.ArgumentList!.Arguments + ) + ) + ) + ) ); } ).Collect(); - + context.RegisterSourceOutput(syntaxProvider, GenerateAssemblyCapabilityKeys); } - private void GenerateAssemblyCapabilityKeys(SourceProductionContext context, ImmutableArray<(HashSet namespaces, AttributeSyntax attribute)> types) + private void GenerateAssemblyCapabilityKeys( + SourceProductionContext context, ImmutableArray<(HashSet namespaces, AttributeSyntax attribute)> types + ) { var namespaces = types.Aggregate( new HashSet(), (set, tuple) => @@ -75,8 +87,10 @@ private void GenerateAssemblyCapabilityKeys(SourceProductionContext context, Imm if (types.Any()) { var cu = CompilationUnit() - .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) - .AddAttributeLists(AttributeList(target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SeparatedList(types.Select(z => z.attribute)))); + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) + .AddAttributeLists( + AttributeList(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SeparatedList(types.Select(z => z.attribute))) + ); context.AddSource("AssemblyCapabilityKeys.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); } diff --git a/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs b/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs index 9871cd1bb..89f043221 100644 --- a/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs +++ b/src/JsonRpc.Generators/AssemblyJsonRpcHandlersAttributeGenerator.cs @@ -1,7 +1,5 @@ -using System; using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics; using System.Linq; using System.Text; using Microsoft.CodeAnalysis; @@ -19,7 +17,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var syntaxProvider = context .SyntaxProvider .CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => { if (syntaxNode.Parent is TypeDeclarationSyntax) return false; if (syntaxNode is TypeDeclarationSyntax { Arity: 0, BaseList: { } bl } typeDeclarationSyntax @@ -58,7 +56,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) return false; }, - transform: (syntaxContext, token) => AttributeArgument( + (syntaxContext, _) => AttributeArgument( TypeOfExpression( ParseName(syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node)!.ToDisplayString()) ) @@ -71,16 +69,21 @@ public void Initialize(IncrementalGeneratorInitializationContext context) private void GenerateAssemblyJsonRpcHandlers(SourceProductionContext context, ImmutableArray types) { - var namespaces = new HashSet() { "OmniSharp.Extensions.JsonRpc" }; + var namespaces = new HashSet { "OmniSharp.Extensions.JsonRpc" }; if (types.Any()) { var cu = CompilationUnit() - .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))); + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))); while (types.Length > 0) { var innerTypes = types.Take(10).ToArray(); types = types.Skip(10).ToImmutableArray(); - cu = cu.AddAttributeLists(AttributeList(target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))))); + cu = cu.AddAttributeLists( + AttributeList( + AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), + SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))) + ) + ); } context.AddSource("AssemblyJsonRpcHandlers.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); diff --git a/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs b/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs index 74287848d..c9eac05da 100644 --- a/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs +++ b/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -20,7 +19,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var _interfaces = "IPartialItemsRequest,IPartialItemRequest,IWorkDoneProgressParams,IHandlerIdentity"; var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => { if (syntaxNode is TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) && ( typeDeclarationSyntax.AttributeLists.ContainsAttribute(_attributes) @@ -32,7 +31,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) } return false; - }, transform: (syntaxContext, token) => { return syntaxContext; } + }, (syntaxContext, _) => { return syntaxContext; } ); @@ -50,10 +49,14 @@ private static void GenerateAutoImplementedInterfaces(SourceProductionContext co var autoImplementProperties = AutoImplementInterfaces(candidate, symbol).ToArray(); if (autoImplementProperties is { Length: > 0 }) { - var extendedParams = candidate.WithAttributeLists(List()) - .WithMembers(List(autoImplementProperties)) - .WithConstraintClauses(List()) - .WithBaseList(null); + var extendedParams = candidate + .WithAttributeLists(List()) + .WithMembers(List(autoImplementProperties)) + .WithConstraintClauses(List()) + .WithBaseList(null) + .WithOpenBraceToken(Token(SyntaxKind.OpenBraceToken)) + .WithCloseBraceToken(Token(SyntaxKind.CloseBraceToken)) + .WithSemicolonToken(Token(SyntaxKind.None)); members.Add(extendedParams); } @@ -65,7 +68,12 @@ private static void GenerateAutoImplementedInterfaces(SourceProductionContext co } var cu = CompilationUnit( - List(), List(candidate.SyntaxTree.GetCompilationUnitRoot().Usings), List(), + List(), + List( + candidate.SyntaxTree.GetCompilationUnitRoot().Usings.Concat( + new[] { UsingDirective(ParseName("Newtonsoft.Json")), UsingDirective(ParseName("System.ComponentModel")) } + ) + ), List(), SingletonList( NamespaceDeclaration(ParseName(symbol.ContainingNamespace.ToDisplayString())) .WithMembers(List(members)) @@ -144,7 +152,7 @@ private static IEnumerable AutoImplementInterfaces(Base SingletonSeparatedList( AttributeArgument( MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, IdentifierName("EditorBrowsableState"), + SyntaxKind.SimpleMemberAccessExpression, ParseName("EditorBrowsableState"), IdentifierName("Never") ) ) diff --git a/src/JsonRpc.Generators/Contexts/GeneratorData.cs b/src/JsonRpc.Generators/Contexts/GeneratorData.cs index 8af0444e6..33cffce86 100644 --- a/src/JsonRpc.Generators/Contexts/GeneratorData.cs +++ b/src/JsonRpc.Generators/Contexts/GeneratorData.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; @@ -8,7 +7,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Contexts { - abstract record GeneratorData( + internal abstract record GeneratorData( TypeDeclarationSyntax TypeDeclaration, INamedTypeSymbol TypeSymbol, JsonRpcAttributes JsonRpcAttributes, @@ -91,7 +90,10 @@ HashSet additionalUsings && tds.AttributeLists.ContainsAttribute("GenerateHandler") )?.GetSyntax() is TypeDeclarationSyntax declarationSyntax) { - return Create(parent.Compilation, declarationSyntax, parent.Compilation.GetSemanticModel(declarationSyntax.SyntaxTree), parent.AdditionalUsings) as RequestItem; } + return Create( + parent.Compilation, declarationSyntax, parent.Compilation.GetSemanticModel(declarationSyntax.SyntaxTree), parent.AdditionalUsings + ) as RequestItem; + } return null; } diff --git a/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs b/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs index dd19d8100..28b59670c 100644 --- a/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs +++ b/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs @@ -1,4 +1,3 @@ -using System.Collections; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; @@ -7,7 +6,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators.Contexts { - record RegistrationOptionAttributes( + internal record RegistrationOptionAttributes( SyntaxAttributeData? GenerateRegistrationOptions, string? Key, ExpressionSyntax[]? KeyExpression, @@ -23,13 +22,14 @@ bool ImplementsStaticRegistrationOptions public static RegistrationOptionAttributes? Parse(Compilation compilation, TypeDeclarationSyntax syntax, INamedTypeSymbol symbol) { var registrationOptionsAttributeSymbol = - compilation.GetTypeByMetadataName($"OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateRegistrationOptionsAttribute"); + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateRegistrationOptionsAttribute"); var registrationOptionsConverterAttributeSymbol = - compilation.GetTypeByMetadataName($"OmniSharp.Extensions.LanguageServer.Protocol.RegistrationOptionsConverterAttribute"); + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.RegistrationOptionsConverterAttribute"); // var registrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions"); var textDocumentRegistrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions"); - var workDoneProgressOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions"); + var workDoneProgressOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions"); var staticRegistrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions"); @@ -40,33 +40,35 @@ bool ImplementsStaticRegistrationOptions ITypeSymbol? converter = null; var supportsDocumentSelector = data.NamedArguments.Any(z => z is { Key: nameof(SupportsDocumentSelector), Value: { Value: true } }) - || symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( + || ( symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( z => SymbolEqualityComparer.Default.Equals(z, textDocumentRegistrationOptionsInterfaceSymbol) - ) - || textDocumentRegistrationOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( + ) ) + || ( textDocumentRegistrationOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( type => type.Type.GetSyntaxName()?.Contains(textDocumentRegistrationOptionsInterfaceSymbol.Name) == true - ) == true; + ) == true ); var supportsWorkDoneProgress = data.NamedArguments.Any(z => z is { Key: nameof(SupportsWorkDoneProgress), Value: { Value: true } }) - || symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( + || ( symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( z => SymbolEqualityComparer.Default.Equals(z, workDoneProgressOptionsInterfaceSymbol) - ) - || workDoneProgressOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( + ) ) + || ( workDoneProgressOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( type => type.Type.GetSyntaxName()?.Contains(workDoneProgressOptionsInterfaceSymbol.Name) == true - ) == true; - var supportsStaticRegistrationOptions = data.NamedArguments.Any(z => z is { Key: nameof(SupportsStaticRegistrationOptions), Value: { Value: true } }) - || symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( - z => SymbolEqualityComparer.Default.Equals(z, staticRegistrationOptionsInterfaceSymbol) - ) - || staticRegistrationOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( - type => type.Type.GetSyntaxName()?.Contains(staticRegistrationOptionsInterfaceSymbol.Name) == true - ) == true; + ) == true ); + var supportsStaticRegistrationOptions = + data.NamedArguments.Any(z => z is { Key: nameof(SupportsStaticRegistrationOptions), Value: { Value: true } }) + || ( symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( + z => SymbolEqualityComparer.Default.Equals(z, staticRegistrationOptionsInterfaceSymbol) + ) ) + || ( staticRegistrationOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( + type => type.Type.GetSyntaxName()?.Contains(staticRegistrationOptionsInterfaceSymbol.Name) == true + ) == true ); - if (attributeSyntax is { ArgumentList: { Arguments: { Count: >=1 } syntaxArguments } }) + if (attributeSyntax is { ArgumentList: { Arguments: { Count: >= 1 } syntaxArguments } }) { converter = data.NamedArguments.FirstOrDefault(z => z is { Key: "Converter" }).Value.Type; converterSyntax = syntaxArguments .Select( - z => z is { + z => z is + { Expression: TypeOfExpressionSyntax expressionSyntax, NameEquals: { Name: { Identifier: { Text: "Converter" } } } } ? expressionSyntax.Type @@ -75,7 +77,8 @@ bool ImplementsStaticRegistrationOptions .FirstOrDefault(); if (converter is null) { - if (symbol.GetAttribute(registrationOptionsConverterAttributeSymbol) is { ConstructorArguments: { Length: >=1 } converterArguments } converterData + if (symbol.GetAttribute(registrationOptionsConverterAttributeSymbol) is + { ConstructorArguments: { Length: >= 1 } converterArguments } converterData && converterArguments[0].Kind is TypedConstantKind.Type && converterData.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax converterAttributeSyntax && converterAttributeSyntax is { ArgumentList: { Arguments: { Count: 1 } converterArgumentSyntax } } @@ -115,7 +118,9 @@ static IEnumerable getStringExpressionSyntaxes(AttributeArgume yield return literalExpressionSyntax; break; case InvocationExpressionSyntax - { Expression: IdentifierNameSyntax { Identifier: { Text: "nameof" } } }: + { + Expression: IdentifierNameSyntax { Identifier: { Text: "nameof" } } + }: yield return syntax.Expression; break; } @@ -132,7 +137,7 @@ static IEnumerable getStringExpressionSyntaxes(AttributeArgume supportsWorkDoneProgress, supportsDocumentSelector, supportsStaticRegistrationOptions, - converterSyntax is null ? null : new SyntaxSymbol(converterSyntax, (INamedTypeSymbol) converter!), + converterSyntax is null ? null : new SyntaxSymbol(converterSyntax, (INamedTypeSymbol)converter!), symbol .GetMembers() .AsEnumerable() diff --git a/src/JsonRpc.Generators/EnumLikeStringGenerator.cs b/src/JsonRpc.Generators/EnumLikeStringGenerator.cs index 25d2b6e42..7d395976e 100644 --- a/src/JsonRpc.Generators/EnumLikeStringGenerator.cs +++ b/src/JsonRpc.Generators/EnumLikeStringGenerator.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -15,10 +14,10 @@ public class EnumLikeStringGenerator : IIncrementalGenerator public void Initialize(IncrementalGeneratorInitializationContext context) { var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (node, token) => node is StructDeclarationSyntax tds && tds.AttributeLists.ContainsAttribute("StringEnum"), - transform: (syntaxContext, token) => syntaxContext + (node, _) => node is StructDeclarationSyntax tds && tds.AttributeLists.ContainsAttribute("StringEnum"), + (syntaxContext, _) => syntaxContext ); - + context.RegisterSourceOutput(syntaxProvider, GenerateEnum); } @@ -47,25 +46,48 @@ private void GenerateEnum(SourceProductionContext context, GeneratorSyntaxContex .WithMembers(SingletonList(GetImplementation(candidate))) ) ) - .AddUsings(UsingDirective(ParseName("System")), UsingDirective(ParseName("System.Collections.Generic")), UsingDirective(ParseName("System.Diagnostics")), UsingDirective(ParseName("System.Linq")), UsingDirective(ParseName("System.Reflection")), UsingDirective(ParseName("Newtonsoft.Json")), UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc")), UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc.Serialization.Converters"))) + .AddUsings( + UsingDirective(ParseName("System")), UsingDirective(ParseName("System.Collections.Generic")), + UsingDirective(ParseName("System.Diagnostics")), UsingDirective(ParseName("System.Linq")), + UsingDirective(ParseName("System.Reflection")), UsingDirective(ParseName("Newtonsoft.Json")), + UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc")), + UsingDirective(ParseName("OmniSharp.Extensions.JsonRpc.Serialization.Converters")) + ) .WithLeadingTrivia() .WithTrailingTrivia() .WithLeadingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true))) .WithTrailingTrivia(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true))); - context.AddSource($"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}{( candidate.Arity > 0 ? candidate.Arity.ToString() : "" )}.cs", cu.NormalizeWhitespace().GetText(Encoding.UTF8)); + context.AddSource( + $"{Path.GetFileNameWithoutExtension(candidate.SyntaxTree.FilePath)}_{candidate.Identifier.Text}{( candidate.Arity > 0 ? candidate.Arity.ToString() : "" )}.cs", + cu.NormalizeWhitespace().GetText(Encoding.UTF8) + ); } private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax syntax) { + var items = syntax.Members + .OfType() + .Where(z => z.Modifiers.Any(SyntaxKind.StaticKeyword)) + .Select(z => IdentifierName(z.Identifier.Text)) + .Concat( + syntax.Members + .OfType() + .Where(z => z.Modifiers.Any(SyntaxKind.StaticKeyword)) + .Where(z => z.Declaration.Variables.Count == 1) + .Select(z => IdentifierName(z.Declaration.Variables[0].Identifier.Text)) + ); return syntax .WithBaseList( BaseList( SeparatedList( - new BaseTypeSyntax[] { + new BaseTypeSyntax[] + { SimpleBaseType( GenericName(Identifier("IEquatable")) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(PredefinedType(Token(SyntaxKind.StringKeyword))))) + .WithTypeArgumentList( + TypeArgumentList(SingletonSeparatedList(PredefinedType(Token(SyntaxKind.StringKeyword)))) + ) ), SimpleBaseType( GenericName(Identifier("IEquatable")) @@ -78,7 +100,8 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithAttributeLists( List( - new[] { + new[] + { AttributeList( SingletonSeparatedList( Attribute(IdentifierName("JsonConverter")) @@ -112,7 +135,8 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithMembers( List( - new MemberDeclarationSyntax[] { + new MemberDeclarationSyntax[] + { FieldDeclaration( VariableDeclaration( GenericName(Identifier("Lazy")) @@ -121,7 +145,9 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax SingletonSeparatedList( GenericName(Identifier("IReadOnlyList")) .WithTypeArgumentList( - TypeArgumentList(SingletonSeparatedList(IdentifierName(syntax.Identifier.Text))) + TypeArgumentList( + SingletonSeparatedList(IdentifierName(syntax.Identifier.Text)) + ) ) ) ) @@ -140,7 +166,9 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax GenericName(Identifier("IReadOnlyList")) .WithTypeArgumentList( TypeArgumentList( - SingletonSeparatedList(IdentifierName(syntax.Identifier.Text)) + SingletonSeparatedList( + IdentifierName(syntax.Identifier.Text) + ) ) ) ) @@ -156,169 +184,25 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax Block( SingletonList( ReturnStatement( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - InvocationExpression( - MemberAccessExpression( - SyntaxKind - .SimpleMemberAccessExpression, - InvocationExpression( - MemberAccessExpression( - SyntaxKind - .SimpleMemberAccessExpression, - TypeOfExpression( - IdentifierName( - syntax.Identifier - .Text - ) - ), - IdentifierName( - "GetProperties" - ) - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - BinaryExpression( - SyntaxKind - .BitwiseOrExpression, - MemberAccessExpression( - SyntaxKind - .SimpleMemberAccessExpression, - IdentifierName( - "BindingFlags" - ), - IdentifierName( - "Static" - ) - ), - MemberAccessExpression( - SyntaxKind - .SimpleMemberAccessExpression, - IdentifierName( - "BindingFlags" - ), - IdentifierName( - "Public" - ) - ) - ) - ) - ) - ) - ), - IdentifierName("Where") - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - SimpleLambdaExpression( - Parameter( - Identifier("z") - ) - ) - .WithExpressionBody( - BinaryExpression( - SyntaxKind - .NotEqualsExpression, - MemberAccessExpression( - SyntaxKind - .SimpleMemberAccessExpression, - IdentifierName( - "z" - ), - IdentifierName( - "Name" - ) - ), - InvocationExpression( - IdentifierName( - "nameof" - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - IdentifierName( - "Defaults" - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ), - IdentifierName("Select") - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - SimpleLambdaExpression( - Parameter( - Identifier("z") - ) - ) - .WithExpressionBody( - InvocationExpression( - MemberAccessExpression( - SyntaxKind - .SimpleMemberAccessExpression, - IdentifierName("z"), - IdentifierName( - "GetValue" - ) - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - LiteralExpression( - SyntaxKind - .NullLiteralExpression - ) - ) - ) - ) - ) - ) - ) - ) - ) - ), - GenericName( - Identifier("Cast") - ) - .WithTypeArgumentList( - TypeArgumentList( - SingletonSeparatedList( - IdentifierName(syntax.Identifier.Text) - ) + ArrayCreationExpression( + ArrayType(IdentifierName(syntax.Identifier.Text)) + .WithRankSpecifiers( + SingletonList( + ArrayRankSpecifier( + SingletonSeparatedList< + ExpressionSyntax>( + OmittedArraySizeExpression() ) ) + ) ) - ), - IdentifierName("ToArray") ) - ) + .WithInitializer( + InitializerExpression( + SyntaxKind.ArrayInitializerExpression, + SeparatedList(items) + ) + ) ) ) ) @@ -334,11 +218,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PrivateKeyword), - Token(SyntaxKind.StaticKeyword), - Token(SyntaxKind.ReadOnlyKeyword) - } + Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.StaticKeyword), Token(SyntaxKind.ReadOnlyKeyword) ) ), PropertyDeclaration( @@ -356,10 +236,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.StaticKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword) ) ) .WithExpressionBody( @@ -390,10 +267,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PrivateKeyword), - Token(SyntaxKind.ReadOnlyKeyword) - } + Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword) ) ), ConstructorDeclaration( @@ -436,10 +310,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.StaticKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword) ) ) .WithParameterList( @@ -483,10 +354,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.StaticKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword) ) ) .WithParameterList( @@ -521,10 +389,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.OverrideKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.OverrideKeyword) ) ) .WithExpressionBody( @@ -619,10 +484,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.OverrideKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.OverrideKeyword) ) ) .WithParameterList( @@ -706,10 +568,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.OverrideKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.OverrideKeyword) ) ) .WithExpressionBody( @@ -734,16 +593,14 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.StaticKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword) ) ) .WithParameterList( ParameterList( SeparatedList( - new SyntaxNodeOrToken[] { + new SyntaxNodeOrToken[] + { Parameter( Identifier("left") ) @@ -792,16 +649,14 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax ) .WithModifiers( TokenList( - new[] { - Token(SyntaxKind.PublicKeyword), - Token(SyntaxKind.StaticKeyword) - } + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword) ) ) .WithParameterList( ParameterList( SeparatedList( - new SyntaxNodeOrToken[] { + new SyntaxNodeOrToken[] + { Parameter( Identifier("left") ) @@ -848,6 +703,7 @@ private static StructDeclarationSyntax GetImplementation(StructDeclarationSyntax } ) ) + .NormalizeWhitespace() ; } } diff --git a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs index 9f954c748..51e875466 100644 --- a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs +++ b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs @@ -20,14 +20,14 @@ public void Initialize(IncrementalGeneratorInitializationContext context) { var _attributes = "GenerateHandler,GenerateRequestMethods,GenerateHandlerMethods"; var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => syntaxNode is TypeDeclarationSyntax tds and (ClassDeclarationSyntax or RecordDeclarationSyntax or InterfaceDeclarationSyntax) - && tds.AttributeLists.ContainsAttribute(_attributes), transform: (syntaxContext, token) => syntaxContext + && tds.AttributeLists.ContainsAttribute(_attributes), (syntaxContext, _) => syntaxContext ) .Combine(context.CompilationProvider) .Select( - (tuple, token) => + (tuple, _) => { var (syntaxContext, compilaiton) = tuple; var additionalUsings = new HashSet @@ -64,10 +64,15 @@ syntaxNode is TypeDeclarationSyntax tds ); context.RegisterSourceOutput(syntaxProvider, GenerateHandlerMethods); - context.RegisterSourceOutput(syntaxProvider.Where(z => z.actionItem is {}).SelectMany((z, _) => z.actionItem!.AssemblyJsonRpcHandlersAttributeArguments).Collect(), GenerateAssemblyJsonRpcHandlers); + context.RegisterSourceOutput( + syntaxProvider.Where(z => z.actionItem is { }).SelectMany((z, _) => z.actionItem!.AssemblyJsonRpcHandlersAttributeArguments).Collect(), + GenerateAssemblyJsonRpcHandlers + ); } - private void GenerateHandlerMethods(SourceProductionContext context, (GeneratorData? actionItem, Diagnostic? diagnostic, HashSet additionalUsings) valueTuple) + private void GenerateHandlerMethods( + SourceProductionContext context, (GeneratorData? actionItem, Diagnostic? diagnostic, HashSet additionalUsings) valueTuple + ) { var (actionItem, diagnostic, additionalUsings) = valueTuple; // context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.Message, null, $"candidate: {candidateClass.Identifier.ToFullString()}")); @@ -108,7 +113,7 @@ private void GenerateHandlerMethods(SourceProductionContext context, (GeneratorD if (!members.Any()) return; - var namespacesMapping = new Dictionary() + var namespacesMapping = new Dictionary { ["OmniSharp.Extensions.DebugAdapter"] = new[] { @@ -157,18 +162,18 @@ private void GenerateHandlerMethods(SourceProductionContext context, (GeneratorD private void GenerateAssemblyJsonRpcHandlers(SourceProductionContext context, ImmutableArray handlers) { - var namespaces = new HashSet() { "OmniSharp.Extensions.JsonRpc" }; + var namespaces = new HashSet { "OmniSharp.Extensions.JsonRpc" }; if (handlers.Any()) { var cu = CompilationUnit() - .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))); + .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))); while (handlers.Length > 0) { var innerTypes = handlers.Take(10).ToArray(); handlers = handlers.Skip(10).ToImmutableArray(); cu = cu.AddAttributeLists( AttributeList( - target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), + AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SingletonSeparatedList(Attribute(IdentifierName("AssemblyJsonRpcHandlers"), AttributeArgumentList(SeparatedList(innerTypes)))) ) ); diff --git a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs index edf1356f9..2c36fcf4f 100644 --- a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs +++ b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs @@ -15,7 +15,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators [Generator] public class RegistrationOptionsGenerator : IIncrementalGenerator { - private static string[] RequiredUsings = + private static readonly string[] RequiredUsings = { "OmniSharp.Extensions.LanguageServer.Protocol", "OmniSharp.Extensions.LanguageServer.Protocol.Serialization", @@ -26,11 +26,12 @@ private record AttributeData( INamedTypeSymbol RegistrationOptionsInterfaceSymbol, INamedTypeSymbol TextDocumentRegistrationOptionsInterfaceSymbol, INamedTypeSymbol WorkDoneProgressOptionsInterfaceSymbol, INamedTypeSymbol StaticRegistrationOptionsInterfaceSymbol ); + public void Initialize(IncrementalGeneratorInitializationContext context) { var attributes = context.CompilationProvider .Select( - (compilation, token) => + (compilation, _) => { var registrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions")!; @@ -53,16 +54,16 @@ public void Initialize(IncrementalGeneratorInitializationContext context) } ); var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => syntaxNode is TypeDeclarationSyntax tds and (ClassDeclarationSyntax or RecordDeclarationSyntax) && tds.AttributeLists .SelectMany(z => z.Attributes) .Any(z => z.Name.ToFullString().Contains("GenerateRegistrationOptions")), - (syntaxContext, token) => syntaxContext + (syntaxContext, _) => syntaxContext ) .Combine(context.CompilationProvider) .Select( - (tuple, token) => + (tuple, _) => { var (syntaxContext, compilation) = tuple; var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol((TypeDeclarationSyntax)syntaxContext.Node); @@ -75,13 +76,13 @@ syntaxNode is TypeDeclarationSyntax tds and (ClassDeclarationSyntax or RecordDec return data is not { } ? default! : ( registrationOptions: (TypeDeclarationSyntax)syntaxContext.Node, - semanticModel: syntaxContext.SemanticModel, typeSymbol: typeSymbol, data: data! ); + semanticModel: syntaxContext.SemanticModel, typeSymbol, data: data! ); } ) .Where(z => z is { data: { } }) .Combine(attributes) .Select( - (tuple, token) => ( + (tuple, _) => ( tuple.Left.registrationOptions, tuple.Left.data, tuple.Left.semanticModel, tuple.Left.typeSymbol, attributes: tuple.Right ) ) @@ -91,8 +92,8 @@ syntaxNode is TypeDeclarationSyntax tds and (ClassDeclarationSyntax or RecordDec context.RegisterSourceOutput( syntaxProvider .Select( - (tuple, token) => ( namespaces: tuple.typeSymbol.ContainingNamespace.ToDisplayString(), - AttributeArgument(TypeOfExpression(IdentifierName(tuple.typeSymbol.Name))) ) + (tuple, _) => ( namespaces: tuple.typeSymbol.ContainingNamespace.ToDisplayString(), + AttributeArgument(TypeOfExpression(IdentifierName(tuple.typeSymbol.Name))) ) ) .Collect(), GenerateAssemblyRegistrationOptions ); @@ -128,7 +129,7 @@ private void GenerateRegistrationOptions( .WithMembers(List()); - var staticRegistrationOptions = registrationOptions.WithIdentifier(Identifier($"StaticOptions")) + var staticRegistrationOptions = registrationOptions.WithIdentifier(Identifier("StaticOptions")) .WithMembers( List( registrationOptions.Members.OfType() @@ -247,7 +248,7 @@ private void GenerateRegistrationOptions( extendedRegistrationOptions = extendedRegistrationOptions.AddMembers(staticRegistrationOptions); - var members = new List() { extendedRegistrationOptions }; + var members = new List { extendedRegistrationOptions }; var cu = CompilationUnit() .WithUsings(registrationOptions.SyntaxTree.GetCompilationUnitRoot().Usings) @@ -282,7 +283,7 @@ private void GenerateAssemblyRegistrationOptions( SourceProductionContext context, ImmutableArray<(string @namespace, AttributeArgumentSyntax argumentSyntax)> types ) { - var namespaces = new HashSet() { "OmniSharp.Extensions.LanguageServer.Protocol" }; + var namespaces = new HashSet { "OmniSharp.Extensions.LanguageServer.Protocol" }; if (types.Any()) { foreach (var item in types) @@ -294,7 +295,7 @@ private void GenerateAssemblyRegistrationOptions( .WithUsings(List(namespaces.OrderBy(z => z).Select(z => UsingDirective(ParseName(z))))) .AddAttributeLists( AttributeList( - target: AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), + AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)), SingletonSeparatedList( Attribute( IdentifierName("AssemblyRegistrationOptions"), @@ -309,7 +310,7 @@ private void GenerateAssemblyRegistrationOptions( } - static TypeDeclarationSyntax ExtendAndImplementInterface(TypeDeclarationSyntax syntax, ITypeSymbol symbolToExtendFrom) + private static TypeDeclarationSyntax ExtendAndImplementInterface(TypeDeclarationSyntax syntax, ITypeSymbol symbolToExtendFrom) { return syntax switch { @@ -319,7 +320,7 @@ static TypeDeclarationSyntax ExtendAndImplementInterface(TypeDeclarationSyntax s }; } - static PropertyDeclarationSyntax GetWorkDoneProperty() + private static PropertyDeclarationSyntax GetWorkDoneProperty() { return PropertyDeclaration(PredefinedType(Token(SyntaxKind.BoolKeyword)), Identifier("WorkDoneProgress")) .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) @@ -333,7 +334,7 @@ static PropertyDeclarationSyntax GetWorkDoneProperty() .WithAccessorList(CommonElements.GetSetAccessor); } - static PropertyDeclarationSyntax GetIdProperty() + private static PropertyDeclarationSyntax GetIdProperty() { return PropertyDeclaration(NullableType(PredefinedType(Token(SyntaxKind.StringKeyword))), Identifier("Id")) .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) diff --git a/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs b/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs index 17eb45176..6432f37d7 100644 --- a/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/WarnIfResponseRouterIsNotProvidedStrategy.cs @@ -13,14 +13,18 @@ public IEnumerable Apply(SourceProductionContext contex var generateRequestMethods = item.JsonRpcAttributes.GenerateRequestMethods; if (generateRequestMethods != null && ( - generateRequestMethods.Data.ConstructorArguments.Length == 0 || - generateRequestMethods.Data.ConstructorArguments[0].Kind != TypedConstantKind.Array - && generateRequestMethods.Data.ConstructorArguments[0].Value == null - || generateRequestMethods.Data.ConstructorArguments[0].Kind == TypedConstantKind.Array - && generateRequestMethods.Data.ConstructorArguments[0].Values.Length == 0 ) - && !extensionMethodContext.TypeSymbol.ContainingNamespace.ToDisplayString().StartsWith("OmniSharp.Extensions.DebugAdapter.Protocol")) + generateRequestMethods.Data.ConstructorArguments.Length == 0 || + ( generateRequestMethods.Data.ConstructorArguments[0].Kind != TypedConstantKind.Array + && generateRequestMethods.Data.ConstructorArguments[0].Value == null ) + || ( generateRequestMethods.Data.ConstructorArguments[0].Kind == TypedConstantKind.Array + && generateRequestMethods.Data.ConstructorArguments[0].Values.Length == 0 ) ) && !extensionMethodContext.TypeSymbol.ContainingNamespace + .ToDisplayString().StartsWith("OmniSharp.Extensions.DebugAdapter.Protocol")) { - context.ReportDiagnostic(Diagnostic.Create(GeneratorDiagnostics.NoResponseRouterProvided, item.TypeDeclaration.Identifier.GetLocation(), item.TypeDeclaration.Identifier.Text)); + context.ReportDiagnostic( + Diagnostic.Create( + GeneratorDiagnostics.NoResponseRouterProvided, item.TypeDeclaration.Identifier.GetLocation(), item.TypeDeclaration.Identifier.Text + ) + ); } } } diff --git a/src/JsonRpc.Generators/StronglyTypedGenerator.cs b/src/JsonRpc.Generators/StronglyTypedGenerator.cs index 42f64bcf5..299cd4f25 100644 --- a/src/JsonRpc.Generators/StronglyTypedGenerator.cs +++ b/src/JsonRpc.Generators/StronglyTypedGenerator.cs @@ -13,7 +13,7 @@ namespace OmniSharp.Extensions.JsonRpc.Generators [Generator] public class StronglyTypedGenerator : IIncrementalGenerator { - private static string[] RequiredUsings = new[] + private static readonly string[] RequiredUsings = { "System.Collections.Generic", "System.Collections.ObjectModel", @@ -27,7 +27,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) { var attributes = context.CompilationProvider .Select( - (compilation, token) => new AttributeData( + (compilation, _) => new AttributeData( compilation.GetTypeByMetadataName( "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute" )!, @@ -38,30 +38,30 @@ public void Initialize(IncrementalGeneratorInitializationContext context) ); var createContainersSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => syntaxNode switch + (syntaxNode, _) => syntaxNode switch { StructDeclarationSyntax structDeclarationSyntax when structDeclarationSyntax.AttributeLists.ContainsAttribute("GenerateContainer") => true, TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) when typeDeclarationSyntax .AttributeLists.ContainsAttribute("GenerateContainer") => true, _ => false - }, transform: (syntaxContext, token) => syntaxContext + }, (syntaxContext, _) => syntaxContext ); var canBeResolvedSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => syntaxNode is TypeDeclarationSyntax { BaseList: { } } typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) && syntaxNode.SyntaxTree.HasCompilationUnitRoot && typeDeclarationSyntax.Members.OfType().Any(z => z.Identifier.Text == "Data") && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanBeResolved"), - transform: (syntaxContext, token) => syntaxContext + (syntaxContext, _) => syntaxContext ); var canHaveDataSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( - predicate: (syntaxNode, token) => + (syntaxNode, _) => syntaxNode is TypeDeclarationSyntax { BaseList: { } } typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) && syntaxNode.SyntaxTree.HasCompilationUnitRoot && typeDeclarationSyntax.Members.OfType().Any(z => z.Identifier.Text == "Data") - && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanHaveData"), transform: (syntaxContext, token) => syntaxContext + && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanHaveData"), (syntaxContext, _) => syntaxContext ); context.RegisterSourceOutput(createContainersSyntaxProvider.Combine(attributes), GenerateContainerClass); @@ -123,10 +123,11 @@ private void GenerateCanBeResolvedClass(SourceProductionContext context, (Genera var (syntaxContext, attributeData) = valueTuple; var canBeResolved = (TypeDeclarationSyntax)syntaxContext.Node; var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(canBeResolved)!; - + var dataInterfaceName = IdentifierName("ICanBeResolved"); CreateTypedClass( - context, canBeResolved, typeSymbol, dataInterfaceName, attributeData.GenerateTypedDataAttributeSymbol, attributeData.GenerateContainerAttributeSymbol, true + context, canBeResolved, typeSymbol, dataInterfaceName, attributeData.GenerateTypedDataAttributeSymbol, + attributeData.GenerateContainerAttributeSymbol, true ); } @@ -135,10 +136,11 @@ private void GenerateCanHaveDataClass(SourceProductionContext context, (Generato var (syntaxContext, attributeData) = valueTuple; var canBeResolved = (TypeDeclarationSyntax)syntaxContext.Node; var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(canBeResolved)!; - + var dataInterfaceName = IdentifierName("ICanHaveData"); CreateTypedClass( - context, canBeResolved, typeSymbol, dataInterfaceName, attributeData.GenerateTypedDataAttributeSymbol, attributeData.GenerateContainerAttributeSymbol, true + context, canBeResolved, typeSymbol, dataInterfaceName, attributeData.GenerateTypedDataAttributeSymbol, + attributeData.GenerateContainerAttributeSymbol, true ); } @@ -169,6 +171,9 @@ bool includeHandlerIdentity .WithAttributeLists(List()) .WithBaseList(null) .WithMembers(List()) + .WithOpenBraceToken(Token(SyntaxKind.OpenBraceToken)) + .WithCloseBraceToken(Token(SyntaxKind.CloseBraceToken)) + .WithSemicolonToken(Token(SyntaxKind.None)) .AddMembers( GetWithDataMethod(candidate, HandlerIdentityConstraintClause(includeHandlerIdentity, IdentifierName("TData"))), GetFromMethod(candidate, includeHandlerIdentity) @@ -385,8 +390,11 @@ private static IEnumerable GetMapping(TypeDeclarationSyntax sy { return syntax.Members.OfType() .Where( - z => z.AccessorList?.Accessors.Any(a => a.Keyword.Kind() == SyntaxKind.SetKeyword || a.Keyword.Kind() == SyntaxKind.InitKeyword) - == true + z => z.AccessorList?.Accessors.Any( + a => + a.Keyword.IsKind(SyntaxKind.SetKeyword) + || a.Keyword.IsKind(SyntaxKind.InitKeyword) + ) == true ) .Where(z => z.Identifier.Text != "Data") .Select( @@ -465,7 +473,7 @@ private static ConversionOperatorDeclarationSyntax GetConvertFromOperator(TypeDe Token(SyntaxKind.ImplicitKeyword), GenericName(identifier).WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))) ) - .WithModifiers(TokenList(new[] { Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword) })) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) .WithParameterList( ParameterList( SingletonSeparatedList(Parameter(paramIdentifier).WithType(name)) @@ -557,7 +565,7 @@ private static PropertyDeclarationSyntax GetJDataProperty() ); } - static PropertyDeclarationSyntax GetPropertyImpl(PropertyDeclarationSyntax syntax) + private static PropertyDeclarationSyntax GetPropertyImpl(PropertyDeclarationSyntax syntax) { return syntax.WithAccessorList( AccessorList( @@ -847,7 +855,7 @@ static ParameterSyntax ArrayParameter(TypeSyntax typeName) static BaseMethodDeclarationSyntax AddConversionBody(TypeSyntax typeName, SyntaxToken collectionName, BaseMethodDeclarationSyntax syntax) { - TypeSyntax objectName = syntax is ConversionOperatorDeclarationSyntax d ? d.Type : syntax is MethodDeclarationSyntax m ? m.ReturnType : null!; + var objectName = syntax is ConversionOperatorDeclarationSyntax d ? d.Type : syntax is MethodDeclarationSyntax m ? m.ReturnType : null!; objectName = objectName.EnsureNotNullable(); return syntax .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) diff --git a/src/JsonRpc.Testing/JsonRpcTestBase.cs b/src/JsonRpc.Testing/JsonRpcTestBase.cs index 991ca6165..ddfc4b88f 100644 --- a/src/JsonRpc.Testing/JsonRpcTestBase.cs +++ b/src/JsonRpc.Testing/JsonRpcTestBase.cs @@ -1,9 +1,7 @@ ο»Ώusing System; using System.Diagnostics; using System.Reactive; -using System.Reactive.Concurrency; using System.Reactive.Disposables; -using System.Reactive.Threading.Tasks; using System.Threading; using System.Threading.Tasks; @@ -35,8 +33,16 @@ public JsonRpcTestBase(JsonRpcTestOptions testOptions) public ISettler Events { get; } public JsonRpcTestOptions TestOptions { get; } public CancellationToken CancellationToken => _cancellationTokenSource.Token; - public Task SettleNext() => Events.SettleNext(); - public IObservable Settle() => Events.Settle(); + + public Task SettleNext() + { + return Events.SettleNext(); + } + + public IObservable Settle() + { + return Events.Settle(); + } public void Dispose() { diff --git a/src/JsonRpc/AssemblyScanningHandlerTypeDescriptorProvider.cs b/src/JsonRpc/AssemblyScanningHandlerTypeDescriptorProvider.cs index d880f1f57..6666c5361 100644 --- a/src/JsonRpc/AssemblyScanningHandlerTypeDescriptorProvider.cs +++ b/src/JsonRpc/AssemblyScanningHandlerTypeDescriptorProvider.cs @@ -31,7 +31,8 @@ public class HandlerTypeDescriptorHelper .FirstOrDefault(t => MethodAttribute.AllFrom(t).Any()); } - private static readonly Type[] HandlerTypes = { + private static readonly Type[] HandlerTypes = + { typeof(IJsonRpcNotificationHandler<>), typeof(IJsonRpcRequestHandler<>), typeof(IJsonRpcRequestHandler<,>), @@ -55,8 +56,8 @@ public static Type GetHandlerInterface(Type type) { if (IsValidInterface(type)) return type; return type.GetTypeInfo() - .ImplementedInterfaces - .First(IsValidInterface); + .ImplementedInterfaces + .First(IsValidInterface); } catch (Exception e) { @@ -64,15 +65,17 @@ public static Type GetHandlerInterface(Type type) } } - internal static Type? UnwrapGenericType(Type genericType, Type type, int arity = 0) => - type.GetTypeInfo() - .ImplementedInterfaces - .FirstOrDefault(x => x.GetTypeInfo().IsGenericType && x.GetTypeInfo().GetGenericTypeDefinition() == genericType) - ?.GetTypeInfo() - ?.GetGenericArguments()[arity]; + internal static Type? UnwrapGenericType(Type genericType, Type type, int arity = 0) + { + return type.GetTypeInfo() + .ImplementedInterfaces + .FirstOrDefault(x => x.GetTypeInfo().IsGenericType && x.GetTypeInfo().GetGenericTypeDefinition() == genericType) + ?.GetTypeInfo() + ?.GetGenericArguments()[arity]; + } } - class AssemblyScanningHandlerTypeDescriptorProvider : IHandlerTypeDescriptorProvider + internal class AssemblyScanningHandlerTypeDescriptorProvider : IHandlerTypeDescriptorProvider { private readonly ConcurrentDictionary _methodNames = new(); @@ -91,44 +94,52 @@ internal AssemblyScanningHandlerTypeDescriptorProvider(IEnumerable ass } } - internal static IEnumerable GetDescriptors(IEnumerable assemblies) => assemblies.SelectMany( - x => { - try - { - return x.GetTypes(); - } - catch - { - return Enumerable.Empty(); - } - } - ) - .Where(z => z.IsInterface || z.IsClass && !z.IsAbstract) - // running on mono this call can cause issues when scanning of the entire assembly. - .Where( - z => { - try - { - return typeof(IJsonRpcHandler).IsAssignableFrom(z); - } - catch - { - return false; - } - } - ) - .Where(z => MethodAttribute.From(z) != null) - .Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers - .Select(HandlerTypeDescriptorHelper.GetMethodType) - .Distinct() - .ToLookup(x => MethodAttribute.From(x)!.Method) - .SelectMany( - x => x - .Distinct() - .Select(z => new HandlerTypeDescriptor(z!) as IHandlerTypeDescriptor) - ); - - public IHandlerTypeDescriptor? GetHandlerTypeDescriptor() => GetHandlerTypeDescriptor(typeof(TA)); + internal static IEnumerable GetDescriptors(IEnumerable assemblies) + { + return assemblies.SelectMany( + x => + { + try + { + return x.GetTypes(); + } + catch + { + return Enumerable.Empty(); + } + } + ) + .Where(z => z.IsInterface || ( z.IsClass && !z.IsAbstract )) + // running on mono this call can cause issues when scanning of the entire assembly. + .Where( + z => + { + try + { + return typeof(IJsonRpcHandler).IsAssignableFrom(z); + } + catch + { + return false; + } + } + ) + .Where(z => MethodAttribute.From(z) != null) + .Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers + .Select(HandlerTypeDescriptorHelper.GetMethodType) + .Distinct() + .ToLookup(x => MethodAttribute.From(x)!.Method) + .SelectMany( + x => x + .Distinct() + .Select(z => new HandlerTypeDescriptor(z!) as IHandlerTypeDescriptor) + ); + } + + public IHandlerTypeDescriptor? GetHandlerTypeDescriptor() + { + return GetHandlerTypeDescriptor(typeof(TA)); + } public IHandlerTypeDescriptor? GetHandlerTypeDescriptor(Type type) { @@ -144,9 +155,15 @@ internal static IEnumerable GetDescriptors(IEnumerable() where T : IJsonRpcHandler => GetMethodName(typeof(T)); + public string? GetMethodName() where T : IJsonRpcHandler + { + return GetMethodName(typeof(T)); + } - public bool IsMethodName(string name, params Type[] types) => types.Any(z => GetMethodName(z)?.Equals(name) == true); + public bool IsMethodName(string name, params Type[] types) + { + return types.Any(z => GetMethodName(z)?.Equals(name) == true); + } public string? GetMethodName(Type type) { @@ -172,7 +189,7 @@ internal static IEnumerable GetDescriptors(IEnumerable + internal class AssemblyAttributeHandlerTypeDescriptorProvider : IHandlerTypeDescriptorProvider { private readonly ConcurrentDictionary _methodNames = new(); @@ -191,19 +208,25 @@ internal AssemblyAttributeHandlerTypeDescriptorProvider(IEnumerable as } } - internal static IEnumerable GetDescriptors(IEnumerable assemblies) => assemblies.SelectMany(x => x.GetCustomAttributes()) - .SelectMany(z => z.Types) - .Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers - .Select(HandlerTypeDescriptorHelper.GetMethodType) - .Distinct() - .ToLookup(x => MethodAttribute.From(x)!.Method) - .SelectMany( - x => x - .Distinct() - .Select(z => new HandlerTypeDescriptor(z!) as IHandlerTypeDescriptor) - ); + internal static IEnumerable GetDescriptors(IEnumerable assemblies) + { + return assemblies.SelectMany(x => x.GetCustomAttributes()) + .SelectMany(z => z.Types) + .Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers + .Select(HandlerTypeDescriptorHelper.GetMethodType) + .Distinct() + .ToLookup(x => MethodAttribute.From(x)!.Method) + .SelectMany( + x => x + .Distinct() + .Select(z => new HandlerTypeDescriptor(z!) as IHandlerTypeDescriptor) + ); + } - public IHandlerTypeDescriptor? GetHandlerTypeDescriptor() => GetHandlerTypeDescriptor(typeof(TA)); + public IHandlerTypeDescriptor? GetHandlerTypeDescriptor() + { + return GetHandlerTypeDescriptor(typeof(TA)); + } public IHandlerTypeDescriptor? GetHandlerTypeDescriptor(Type type) { @@ -219,9 +242,15 @@ internal static IEnumerable GetDescriptors(IEnumerable() where T : IJsonRpcHandler => GetMethodName(typeof(T)); + public string? GetMethodName() where T : IJsonRpcHandler + { + return GetMethodName(typeof(T)); + } - public bool IsMethodName(string name, params Type[] types) => types.Any(z => GetMethodName(z)?.Equals(name) == true); + public bool IsMethodName(string name, params Type[] types) + { + return types.Any(z => GetMethodName(z)?.Equals(name) == true); + } public string? GetMethodName(Type type) { diff --git a/src/JsonRpc/DefaultJsonRpcServerFacade.cs b/src/JsonRpc/DefaultJsonRpcServerFacade.cs index e9ef8a4d9..832446d68 100644 --- a/src/JsonRpc/DefaultJsonRpcServerFacade.cs +++ b/src/JsonRpc/DefaultJsonRpcServerFacade.cs @@ -20,20 +20,45 @@ public DefaultJsonRpcServerFacade(IResponseRouter requestRouter, IServiceProvide _handlersManager = handlersManager; } - public void SendNotification(string method) => _responseRouter.SendNotification(method); + public void SendNotification(string method) + { + _responseRouter.SendNotification(method); + } - public void SendNotification(string method, T @params) => _responseRouter.SendNotification(method, @params); + public void SendNotification(string method, T @params) + { + _responseRouter.SendNotification(method, @params); + } - public void SendNotification(IRequest request) => _responseRouter.SendNotification(request); + public void SendNotification(IRequest request) + { + _responseRouter.SendNotification(request); + } - public IResponseRouterReturns SendRequest(string method, T @params) => _responseRouter.SendRequest(method, @params); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return _responseRouter.SendRequest(method, @params); + } - public IResponseRouterReturns SendRequest(string method) => _responseRouter.SendRequest(method); + public IResponseRouterReturns SendRequest(string method) + { + return _responseRouter.SendRequest(method); + } + + public Task SendRequest(IRequest request, CancellationToken cancellationToken) + { + return _responseRouter.SendRequest(request, cancellationToken); + } - public Task SendRequest(IRequest request, CancellationToken cancellationToken) => _responseRouter.SendRequest(request, cancellationToken); + bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) + { + return _responseRouter.TryGetRequest(id, out method, out pendingTask); + } - bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) => _responseRouter.TryGetRequest(id, out method, out pendingTask); - object IServiceProvider.GetService(Type serviceType) => _serviceProvider.GetService(serviceType); + object IServiceProvider.GetService(Type serviceType) + { + return _serviceProvider.GetService(serviceType); + } public IDisposable Register(Action registryAction) { diff --git a/src/JsonRpc/ErrorResponse.cs b/src/JsonRpc/ErrorResponse.cs index 5a499d6a9..1c119ddb3 100644 --- a/src/JsonRpc/ErrorResponse.cs +++ b/src/JsonRpc/ErrorResponse.cs @@ -21,10 +21,16 @@ public ErrorResponse(OutgoingResponse outgoingResponse) public bool IsError => Error != null; public RpcError? Error { get; } - public object? Value => IsResponse ? (object?) Response : IsError ? Error : null; + public object? Value => IsResponse ? Response : IsError ? Error : null; - public static implicit operator ErrorResponse(OutgoingResponse outgoingResponse) => new ErrorResponse(outgoingResponse); + public static implicit operator ErrorResponse(OutgoingResponse outgoingResponse) + { + return new ErrorResponse(outgoingResponse); + } - public static implicit operator ErrorResponse(RpcError error) => new ErrorResponse(error); + public static implicit operator ErrorResponse(RpcError error) + { + return new ErrorResponse(error); + } } } diff --git a/src/JsonRpc/IActivityTracingStrategy.cs b/src/JsonRpc/IActivityTracingStrategy.cs index 6a8837a81..40aaaa699 100644 --- a/src/JsonRpc/IActivityTracingStrategy.cs +++ b/src/JsonRpc/IActivityTracingStrategy.cs @@ -18,27 +18,33 @@ public interface IActivityTracingStrategy void ApplyOutgoing(ITraceData data); IDisposable? ApplyInbound(ITraceData data); } + internal static class Hex { - private static readonly byte[] HexBytes = new byte[] { (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f' }; + private static readonly byte[] HexBytes = + { + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'a', (byte)'b', (byte)'c', + (byte)'d', (byte)'e', (byte)'f' + }; + private static readonly byte[] ReverseHexDigits = BuildReverseHexDigits(); internal static void Encode(ReadOnlySpan src, ref Span dest) { - Span bytes = MemoryMarshal.Cast(dest); + var bytes = MemoryMarshal.Cast(dest); // Inspired by http://stackoverflow.com/questions/623104/c-byte-to-hex-string/3974535#3974535 - int lengthInNibbles = src.Length * 2; + var lengthInNibbles = src.Length * 2; - for (int i = 0; i < (lengthInNibbles & -2); i++) + for (var i = 0; i < ( lengthInNibbles & -2 ); i++) { - int index0 = +i >> 1; - var b = (byte)(src[index0] >> 4); - bytes[(2 * i) + 1] = 0; + var index0 = +i >> 1; + var b = (byte)( src[index0] >> 4 ); + bytes[( 2 * i ) + 1] = 0; bytes[2 * i++] = HexBytes[b]; - b = (byte)(src[index0] & 0x0F); - bytes[(2 * i) + 1] = 0; + b = (byte)( src[index0] & 0x0F ); + bytes[( 2 * i ) + 1] = 0; bytes[2 * i] = HexBytes[b]; } @@ -47,12 +53,12 @@ internal static void Encode(ReadOnlySpan src, ref Span dest) internal static void Decode(ReadOnlySpan value, Span bytes) { - for (int i = 0; i < value.Length; i++) + for (var i = 0; i < value.Length; i++) { - int c1 = ReverseHexDigits[value[i++] - '0'] << 4; + var c1 = ReverseHexDigits[value[i++] - '0'] << 4; int c2 = ReverseHexDigits[value[i] - '0']; - bytes[i >> 1] = (byte)(c1 + c2); + bytes[i >> 1] = (byte)( c1 + c2 ); } } @@ -60,12 +66,12 @@ private static byte[] BuildReverseHexDigits() { var bytes = new byte['f' - '0' + 1]; - for (int i = 0; i < 10; i++) + for (var i = 0; i < 10; i++) { bytes[i] = (byte)i; } - for (int i = 10; i < 16; i++) + for (var i = 10; i < 16; i++) { bytes[i + 'a' - '0' - 0x0a] = (byte)i; bytes[i + 'A' - '0' - 0x0a] = (byte)i; @@ -94,16 +100,16 @@ internal TraceParent(string? traceparent) { if (traceparent is null) { - this.Version = 0; - this.Flags = TraceFlags.None; + Version = 0; + Flags = TraceFlags.None; return; } - ReadOnlySpan traceparentChars = traceparent.AsSpan(); + var traceparentChars = traceparent.AsSpan(); // Decode version - ReadOnlySpan slice = Consume(ref traceparentChars, VersionByteCount * 2); - fixed (byte* pVersion = &this.Version) + var slice = Consume(ref traceparentChars, VersionByteCount * 2); + fixed (byte* pVersion = &Version) { Hex.Decode(slice, new Span(pVersion, 1)); } @@ -112,7 +118,7 @@ internal TraceParent(string? traceparent) // Decode traceid slice = Consume(ref traceparentChars, TraceIdByteCount * 2); - fixed (byte* pTraceId = this.TraceId) + fixed (byte* pTraceId = TraceId) { Hex.Decode(slice, new Span(pTraceId, TraceIdByteCount)); } @@ -121,7 +127,7 @@ internal TraceParent(string? traceparent) // Decode parentid slice = Consume(ref traceparentChars, ParentIdByteCount * 2); - fixed (byte* pParentId = this.ParentId) + fixed (byte* pParentId = ParentId) { Hex.Decode(slice, new Span(pParentId, ParentIdByteCount)); } @@ -130,7 +136,7 @@ internal TraceParent(string? traceparent) // Decode flags slice = Consume(ref traceparentChars, FlagsByteCount * 2); - fixed (TraceFlags* pFlags = &this.Flags) + fixed (TraceFlags* pFlags = &Flags) { Hex.Decode(slice, new Span(pFlags, 1)); } @@ -147,7 +153,7 @@ static void ConsumeHyphen(ref ReadOnlySpan value) ReadOnlySpan Consume(ref ReadOnlySpan buffer, int length) { - ReadOnlySpan result = buffer.Slice(0, length); + var result = buffer.Slice(0, length); buffer = buffer.Slice(length); return result; } @@ -171,7 +177,7 @@ internal Guid TraceIdGuid { get { - fixed (byte* pTraceId = this.TraceId) + fixed (byte* pTraceId = TraceId) { return CopyBufferToGuid(new ReadOnlySpan(pTraceId, TraceIdByteCount)); } @@ -181,31 +187,32 @@ internal Guid TraceIdGuid public override string ToString() { // When calculating the number of characters required, double each 'byte' we have to encode since we're using hex. - Span traceparent = stackalloc char[(VersionByteCount * 2) + 1 + (TraceIdByteCount * 2) + 1 + (ParentIdByteCount * 2) + 1 + (FlagsByteCount * 2)]; - Span traceParentRemaining = traceparent; + Span traceparent = + stackalloc char[( VersionByteCount * 2 ) + 1 + ( TraceIdByteCount * 2 ) + 1 + ( ParentIdByteCount * 2 ) + 1 + ( FlagsByteCount * 2 )]; + var traceParentRemaining = traceparent; - fixed (byte* pVersion = &this.Version) + fixed (byte* pVersion = &Version) { Hex.Encode(new ReadOnlySpan(pVersion, 1), ref traceParentRemaining); } AddHyphen(ref traceParentRemaining); - fixed (byte* pTraceId = this.TraceId) + fixed (byte* pTraceId = TraceId) { Hex.Encode(new ReadOnlySpan(pTraceId, TraceIdByteCount), ref traceParentRemaining); } AddHyphen(ref traceParentRemaining); - fixed (byte* pParentId = this.ParentId) + fixed (byte* pParentId = ParentId) { Hex.Encode(new ReadOnlySpan(pParentId, ParentIdByteCount), ref traceParentRemaining); } AddHyphen(ref traceParentRemaining); - fixed (TraceFlags* pFlags = &this.Flags) + fixed (TraceFlags* pFlags = &Flags) { Hex.Encode(new ReadOnlySpan(pFlags, 1), ref traceParentRemaining); } @@ -224,7 +231,7 @@ static void AddHyphen(ref Span value) } } - private static unsafe Guid CopyBufferToGuid(ReadOnlySpan buffer) + private static Guid CopyBufferToGuid(ReadOnlySpan buffer) { Debug.Assert(buffer.Length == 16, "Guid buffer length mismatch."); fixed (byte* pBuffer = buffer) @@ -248,7 +255,7 @@ public static string? TraceState } /// - /// Gets or sets the that will receive the activity transfer, start and stop events . + /// Gets or sets the that will receive the activity transfer, start and stop events . /// public TraceSource? TraceSource { get; set; } @@ -261,7 +268,8 @@ public unsafe void ApplyOutgoing(ITraceData data) FillRandomBytes(new Span(traceparent.ParentId, TraceParent.ParentIdByteCount)); CopyGuidToBuffer(Trace.CorrelationManager.ActivityId, new Span(traceparent.TraceId, TraceParent.TraceIdByteCount)); - if (this.TraceSource is object && (this.TraceSource.Switch.Level & SourceLevels.ActivityTracing) == SourceLevels.ActivityTracing && this.TraceSource.Listeners.Count > 0) + if (TraceSource is { } && ( TraceSource.Switch.Level & SourceLevels.ActivityTracing ) == SourceLevels.ActivityTracing + && TraceSource.Listeners.Count > 0) { traceparent.Flags |= TraceParent.TraceFlags.Sampled; } @@ -271,21 +279,24 @@ public unsafe void ApplyOutgoing(ITraceData data) } } - /// - public unsafe IDisposable? ApplyInbound(ITraceData request) + /// + public IDisposable? ApplyInbound(ITraceData request) { var traceparent = new TraceParent(request.TraceParent); - Guid childActivityId = Guid.NewGuid(); - string? activityName = request is IMethodWithParams p ? p.Method : null; + var childActivityId = Guid.NewGuid(); + var activityName = request is IMethodWithParams p ? p.Method : null; - return new ActivityState(request, this.TraceSource, activityName, traceparent.TraceIdGuid, childActivityId); + return new ActivityState(request, TraceSource, activityName, traceparent.TraceIdGuid, childActivityId); } - private static void FillRandomBytes(Span buffer) => CopyGuidToBuffer(Guid.NewGuid(), buffer); + private static void FillRandomBytes(Span buffer) + { + CopyGuidToBuffer(Guid.NewGuid(), buffer); + } - private unsafe static void CopyGuidToBuffer(Guid guid, Span buffer) + private static unsafe void CopyGuidToBuffer(Guid guid, Span buffer) { - ReadOnlySpan guidBytes = new ReadOnlySpan(&guid, sizeof(Guid)); + var guidBytes = new ReadOnlySpan(&guid, sizeof(Guid)); guidBytes.Slice(0, buffer.Length).CopyTo(buffer); } @@ -294,17 +305,17 @@ private class ActivityState : IDisposable private readonly TraceSource? traceSource; private readonly Guid originalActivityId; private readonly string? originalTraceState; - private readonly string? activityName; + private readonly string activityName; private readonly Guid parentTraceId; internal ActivityState(ITraceData request, TraceSource? traceSource, string? activityName, Guid parentTraceId, Guid childTraceId) { - this.originalActivityId = Trace.CorrelationManager.ActivityId; - this.originalTraceState = TraceState; - this.activityName = activityName; + originalActivityId = Trace.CorrelationManager.ActivityId; + originalTraceState = TraceState; + this.activityName = activityName ?? ""; this.parentTraceId = parentTraceId; - if (traceSource is object && parentTraceId != Guid.Empty) + if (traceSource is { } && parentTraceId != Guid.Empty) { // We set ActivityId to a short-lived value here for the sake of the TraceTransfer call that comes next. // TraceTransfer goes from the current activity to the one passed as an argument. @@ -323,31 +334,29 @@ internal ActivityState(ITraceData request, TraceSource? traceSource, string? act public void Dispose() { - this.traceSource?.TraceEvent(TraceEventType.Stop, 0, this.activityName); + traceSource?.TraceEvent(TraceEventType.Stop, 0, activityName); - if (this.parentTraceId != Guid.Empty) + if (parentTraceId != Guid.Empty) { - this.traceSource?.TraceTransfer(0, nameof(TraceEventType.Transfer), this.parentTraceId); + traceSource?.TraceTransfer(0, nameof(TraceEventType.Transfer), parentTraceId); } - Trace.CorrelationManager.ActivityId = this.originalActivityId; - TraceState = this.originalTraceState; + Trace.CorrelationManager.ActivityId = originalActivityId; + TraceState = originalTraceState; } } } public interface ITraceData { - - /// /// Gets or sets the data for the W3C Trace Context traceparent value. /// - string? TraceParent { get; set; } + string? TraceParent { get; set; } /// /// Gets or sets the data for the W3C Trace Context tracestate value. /// - string? TraceState { get; set; } + string? TraceState { get; set; } } } diff --git a/src/JsonRpc/IJsonRpcRequestHandler.cs b/src/JsonRpc/IJsonRpcRequestHandler.cs index 3a885c86b..59f4f3a46 100644 --- a/src/JsonRpc/IJsonRpcRequestHandler.cs +++ b/src/JsonRpc/IJsonRpcRequestHandler.cs @@ -6,7 +6,7 @@ namespace OmniSharp.Extensions.JsonRpc /// /// Client --> --> /// | - /// Server <-- <-- + /// Server (-- (-- /// /// /// @@ -20,7 +20,7 @@ public interface IJsonRpcRequestHandler : IRequestHandle /// /// Client --> --> /// | - /// Server <-- <-- + /// Server (-- (-- /// /// /// diff --git a/src/JsonRpc/IResponseHandler.cs b/src/JsonRpc/IResponseHandler.cs index cd02f2875..2090791e0 100644 --- a/src/JsonRpc/IResponseHandler.cs +++ b/src/JsonRpc/IResponseHandler.cs @@ -6,7 +6,7 @@ namespace OmniSharp.Extensions.JsonRpc /// /// Server --> --> /// | - /// Client <-- <-- + /// Client (-- (-- /// /// /// diff --git a/src/JsonRpc/IResponseRouter.cs b/src/JsonRpc/IResponseRouter.cs index 6d3337ee2..6fa2ba15a 100644 --- a/src/JsonRpc/IResponseRouter.cs +++ b/src/JsonRpc/IResponseRouter.cs @@ -14,6 +14,6 @@ public interface IResponseRouter IResponseRouterReturns SendRequest(string method, T @params); IResponseRouterReturns SendRequest(string method); Task SendRequest(IRequest request, CancellationToken cancellationToken); - bool TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask); + bool TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask); } } diff --git a/src/JsonRpc/InputHandler.cs b/src/JsonRpc/InputHandler.cs index d2f9cdfdb..38f4d25c3 100644 --- a/src/JsonRpc/InputHandler.cs +++ b/src/JsonRpc/InputHandler.cs @@ -83,15 +83,18 @@ IScheduler scheduler new RequestInvokerOptions( requestTimeout, supportContentModified, - concurrency ?? 0), + concurrency ?? 0 + ), loggerFactory, - scheduler), + scheduler + ), loggerFactory, unhandledInputProcessException, - getException) + getException + ) { } - + public InputHandler( PipeReader pipeReader, IOutputHandler outputHandler, @@ -120,7 +123,8 @@ public InputHandler( new Memory(_contentLengthValueBuffer); // Max string length of the long value _stopProcessing = new CancellationTokenSource(); - _disposable = new CompositeDisposable { + _disposable = new CompositeDisposable + { Disposable.Create(() => _stopProcessing.Cancel()), _stopProcessing, _requestInvoker, @@ -133,16 +137,19 @@ public InputHandler( public void Start() { _disposable.Add( - Observable.FromAsync(async () => { - try + Observable.FromAsync( + async () => { - await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false); - } - catch (Exception e) - { - _logger.LogCritical(e, "unhandled exception"); + try + { + await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false); + } + catch (Exception e) + { + _logger.LogCritical(e, "unhandled exception"); + } } - }).Subscribe(_inputActive) + ).Subscribe(_inputActive) ); _disposable.Add( _inputQueue @@ -250,7 +257,7 @@ private bool TryParseContentLength(ref ReadOnlySequence buffer, out long l return false; } - var slice = buffer.Slice(0, colon!.Value); + var slice = buffer.Slice(0, colon.Value); slice.CopyTo(_contentLengthBuffer.Span); if (IsEqual(_contentLengthBuffer.Span, ContentLength)) @@ -280,7 +287,7 @@ private bool TryParseContentLength(ref ReadOnlySequence buffer, out long l var whitespacePosition = lengthSlice.PositionOf((byte)' '); if (whitespacePosition.HasValue) { - lengthSlice = lengthSlice.Slice(0, whitespacePosition!.Value); + lengthSlice = lengthSlice.Slice(0, whitespacePosition.Value); } lengthSlice.CopyTo(_contentLengthValueMemory.Span); @@ -415,7 +422,8 @@ private void HandleRequest(in ReadOnlySequence request) _inputQueue.OnNext( Observable.Create( - observer => { + observer => + { if (response is ServerResponse serverResponse) { // _logger.LogDebug("Setting successful Response for {ResponseId}", response.Id); @@ -455,7 +463,7 @@ private void HandleRequest(in ReadOnlySequence request) var requestHandle = _requestInvoker.InvokeRequest(descriptor, item.Request); _requests.TryAdd(requestHandle.Request.Id, requestHandle); - requestHandle.OnComplete += (request) => _requests.TryRemove(request.Id, out _); + requestHandle.OnComplete += r => _requests.TryRemove(r.Id, out _); } catch (JsonReaderException e) { @@ -480,11 +488,11 @@ private void HandleRequest(in ReadOnlySequence request) var cancelParams = item.Notification.Params?.ToObject(); if (cancelParams == null) { - _logger.LogDebug("Got incorrect cancellation params", item.Notification.Method); + _logger.LogDebug("Got incorrect cancellation params for {Method}", item.Notification.Method); continue; } - _logger.LogDebug("Cancelling pending request", item.Notification.Method); + _logger.LogDebug("Cancelling pending request for {Method}", item.Notification.Method); if (_requests.TryGetValue(cancelParams.Id, out var requestHandle)) { requestHandle.CancellationTokenSource.Cancel(); @@ -522,8 +530,10 @@ private void HandleRequest(in ReadOnlySequence request) } } - private static Exception DefaultErrorParser(string? method, ServerError error, CreateResponseExceptionHandler? customHandler) => - error.Error.Code switch { + private static Exception DefaultErrorParser(string? method, ServerError error, CreateResponseExceptionHandler? customHandler) + { + return error.Error.Code switch + { ErrorCodes.ServerNotInitialized => new ServerNotInitializedException(error.Id), ErrorCodes.MethodNotSupported => new MethodNotSupportedException(error.Id, method ?? "UNKNOWN"), ErrorCodes.InvalidRequest => new InvalidRequestException(error.Id), @@ -540,5 +550,6 @@ private static Exception DefaultErrorParser(string? method, ServerError error, C error.Error.Data?.ToString() ?? string.Empty ) }; + } } } diff --git a/src/JsonRpc/JsonRpcCommonMethodsBase.cs b/src/JsonRpc/JsonRpcCommonMethodsBase.cs index 81898519e..da1536d7c 100644 --- a/src/JsonRpc/JsonRpcCommonMethodsBase.cs +++ b/src/JsonRpc/JsonRpcCommonMethodsBase.cs @@ -11,73 +11,119 @@ public abstract class JsonRpcCommonMethodsBase : IJsonRpcHandlerRegistry w { #region OnRequest / OnNotification - public T OnJsonRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) => - AddHandler(method, _ => new DelegatingJsonRequestHandler(handler), options); - - public T OnJsonRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) => - OnJsonRequest(method, HandlerAdapter.Adapt(handler), options); - - public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) => - OnRequest(method, HandlerAdapter.Adapt(handler), options); - - public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) => - OnRequest(method, (_, _) => handler(), options); - - public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) => AddHandler( - method, _ => new DelegatingRequestHandler(_.GetRequiredService(), handler), options - ); - - public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) => - OnRequest(method, (_, cancellationToken) => handler(cancellationToken), options); - - public T OnRequest(string method, Func handler, JsonRpcHandlerOptions? options = null) => - OnRequest(method, HandlerAdapter.Adapt(handler), options); - - public T OnRequest(string method, Func handler, JsonRpcHandlerOptions? options = null) => AddHandler( - method, _ => new DelegatingRequestHandler(_.GetRequiredService(), handler), options - ); - - public T OnRequest(string method, Func handler, JsonRpcHandlerOptions? options = null) => - OnRequest(method, (_, cancellationToken) => handler(cancellationToken), options); - - public T OnJsonNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) => - OnJsonNotification(method, HandlerAdapter.Adapt(handler), options); - - public T OnJsonNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) => - OnJsonNotification(method, HandlerAdapter.Adapt(handler), options); - - public T OnJsonNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) => - AddHandler(method, _ => new DelegatingJsonNotificationHandler(handler), options); - - public T OnJsonNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) => - OnJsonNotification(method, HandlerAdapter.Adapt(handler), options); - - public T OnNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) => - OnNotification(method, HandlerAdapter.Adapt(handler), options); - - public T OnNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) => - OnNotification(method, HandlerAdapter.Adapt(handler), options); - - public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) => AddHandler( - method, _ => new DelegatingNotificationHandler(_.GetRequiredService(), handler), options - ); - - public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) => - OnNotification(method, HandlerAdapter.Adapt(handler), options); - - public T OnNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) => - OnNotification( - method, (_, _) => { + public T OnJsonRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) + { + return AddHandler(method, _ => new DelegatingJsonRequestHandler(handler), options); + } + + public T OnJsonRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) + { + return OnJsonRequest(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) + { + return OnRequest(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) + { + return OnRequest(method, (_, _) => handler(), options); + } + + public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) + { + return AddHandler( + method, _ => new DelegatingRequestHandler(_.GetRequiredService(), handler), options + ); + } + + public T OnRequest(string method, Func> handler, JsonRpcHandlerOptions? options = null) + { + return OnRequest(method, (_, cancellationToken) => handler(cancellationToken), options); + } + + public T OnRequest(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return OnRequest(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnRequest(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return AddHandler( + method, _ => new DelegatingRequestHandler(_.GetRequiredService(), handler), options + ); + } + + public T OnRequest(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return OnRequest(method, (_, cancellationToken) => handler(cancellationToken), options); + } + + public T OnJsonNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) + { + return OnJsonNotification(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnJsonNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) + { + return OnJsonNotification(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnJsonNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return AddHandler(method, _ => new DelegatingJsonNotificationHandler(handler), options); + } + + public T OnJsonNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return OnJsonNotification(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) + { + return OnNotification(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) + { + return OnNotification(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return AddHandler( + method, _ => new DelegatingNotificationHandler(_.GetRequiredService(), handler), options + ); + } + + public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return OnNotification(method, HandlerAdapter.Adapt(handler), options); + } + + public T OnNotification(string method, Action handler, JsonRpcHandlerOptions? options = null) + { + return OnNotification( + method, (_, _) => + { handler(); return Task.CompletedTask; }, options ); + } - public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) => AddHandler( - method, _ => new DelegatingNotificationHandler(_.GetRequiredService(), (_, token) => handler(token)), options - ); + public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return AddHandler( + method, _ => new DelegatingNotificationHandler(_.GetRequiredService(), (_, token) => handler(token)), options + ); + } - public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) => OnNotification(method, _ => handler(), options); + public T OnNotification(string method, Func handler, JsonRpcHandlerOptions? options = null) + { + return OnNotification(method, _ => handler(), options); + } #endregion diff --git a/src/JsonRpc/JsonRpcServerBase.cs b/src/JsonRpc/JsonRpcServerBase.cs index 123627289..2a5aeed03 100644 --- a/src/JsonRpc/JsonRpcServerBase.cs +++ b/src/JsonRpc/JsonRpcServerBase.cs @@ -17,19 +17,39 @@ protected JsonRpcServerBase(IHandlersManager handlersManager, IResponseRouter re public IResponseRouter ResponseRouter { get; } public IHandlersManager HandlersManager { get; } - public void SendNotification(string method) => ResponseRouter.SendNotification(method); + public void SendNotification(string method) + { + ResponseRouter.SendNotification(method); + } - public void SendNotification(string method, T @params) => ResponseRouter.SendNotification(method, @params); + public void SendNotification(string method, T @params) + { + ResponseRouter.SendNotification(method, @params); + } - public void SendNotification(IRequest @params) => ResponseRouter.SendNotification(@params); + public void SendNotification(IRequest @params) + { + ResponseRouter.SendNotification(@params); + } - public Task SendRequest(IRequest @params, CancellationToken cancellationToken) => ResponseRouter.SendRequest(@params, cancellationToken); + public Task SendRequest(IRequest @params, CancellationToken cancellationToken) + { + return ResponseRouter.SendRequest(@params, cancellationToken); + } - public IResponseRouterReturns SendRequest(string method, T @params) => ResponseRouter.SendRequest(method, @params); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return ResponseRouter.SendRequest(method, @params); + } - public IResponseRouterReturns SendRequest(string method) => ResponseRouter.SendRequest(method); + public IResponseRouterReturns SendRequest(string method) + { + return ResponseRouter.SendRequest(method); + } - bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) => - ResponseRouter.TryGetRequest(id, out method, out pendingTask); + bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) + { + return ResponseRouter.TryGetRequest(id, out method, out pendingTask); + } } } diff --git a/src/JsonRpc/NoopResponseRouter.cs b/src/JsonRpc/NoopResponseRouter.cs index 52a78648f..7816d40d1 100644 --- a/src/JsonRpc/NoopResponseRouter.cs +++ b/src/JsonRpc/NoopResponseRouter.cs @@ -29,13 +29,22 @@ public void SendNotification(IRequest request) { } - public IResponseRouterReturns SendRequest(string method, T @params) => new Impl(); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return new Impl(); + } - public IResponseRouterReturns SendRequest(string method) => new Impl(); + public IResponseRouterReturns SendRequest(string method) + { + return new Impl(); + } - public Task SendRequest(IRequest request, CancellationToken cancellationToken) => Task.FromResult(default!); + public Task SendRequest(IRequest request, CancellationToken cancellationToken) + { + return Task.FromResult(default!); + } - bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) + bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) { method = default!; pendingTask = default!; @@ -44,9 +53,15 @@ bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string metho private class Impl : IResponseRouterReturns { - public Task Returning(CancellationToken cancellationToken) => Task.FromResult(default!); + public Task Returning(CancellationToken cancellationToken) + { + return Task.FromResult(default!); + } - public Task ReturningVoid(CancellationToken cancellationToken) => Task.CompletedTask; + public Task ReturningVoid(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } } } } diff --git a/src/JsonRpc/OutputHandler.cs b/src/JsonRpc/OutputHandler.cs index 4402c7c28..5edc7c469 100644 --- a/src/JsonRpc/OutputHandler.cs +++ b/src/JsonRpc/OutputHandler.cs @@ -3,11 +3,9 @@ using System.ComponentModel; using System.IO.Pipelines; using System.Linq; -using System.Reactive; using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Text; using System.Threading; using System.Threading.Channels; @@ -30,7 +28,6 @@ public class OutputHandler : IOutputHandler private readonly TaskCompletionSource _outputIsFinished; private readonly CompositeDisposable _disposable; private bool _delayComplete; - private readonly CancellationTokenSource _stopProcessing; private readonly Channel _channel; private readonly ChannelWriter _writer; @@ -52,7 +49,8 @@ public OutputHandler( _outputIsFinished = new TaskCompletionSource(); _channel = Channel.CreateUnbounded( - new UnboundedChannelOptions() { + new UnboundedChannelOptions + { AllowSynchronousContinuations = true, SingleReader = true, SingleWriter = false @@ -61,11 +59,12 @@ public OutputHandler( _queue = _channel.Reader; _writer = _channel.Writer; - _stopProcessing = new CancellationTokenSource(); - _disposable = new CompositeDisposable { - Disposable.Create(() => _stopProcessing.Cancel()), - _stopProcessing, - Observable.FromAsync(() => ProcessOutputStream(_stopProcessing.Token)) + var stopProcessing = new CancellationTokenSource(); + _disposable = new CompositeDisposable + { + Disposable.Create(() => stopProcessing.Cancel()), + stopProcessing, + Observable.FromAsync(() => ProcessOutputStream(stopProcessing.Token)) .Do(_ => { }, e => _logger.LogCritical(e, "unhandled exception")) .Subscribe() }; @@ -141,7 +140,8 @@ private async Task ProcessOutputStream(CancellationToken cancellationToken) // TODO: this will be part of the serialization refactor to make streaming first class var content = _serializer.SerializeObject(value); var contentBytes = Encoding.UTF8.GetBytes(content).AsMemory(); - await _pipeWriter.WriteAsync(Encoding.UTF8.GetBytes($"Content-Length: {contentBytes.Length}\r\n\r\n"), cancellationToken).ConfigureAwait(false); + await _pipeWriter.WriteAsync(Encoding.UTF8.GetBytes($"Content-Length: {contentBytes.Length}\r\n\r\n"), cancellationToken) + .ConfigureAwait(false); await _pipeWriter.WriteAsync(contentBytes, cancellationToken).ConfigureAwait(false); await _pipeWriter.FlushAsync(cancellationToken).ConfigureAwait(false); } while (true); @@ -163,7 +163,10 @@ private async Task ProcessOutputStream(CancellationToken cancellationToken) } } - public Task WaitForShutdown() => _outputIsFinished.Task; + public Task WaitForShutdown() + { + return _outputIsFinished.Task; + } private void Error(Exception ex) { diff --git a/src/JsonRpc/Receiver.cs b/src/JsonRpc/Receiver.cs index 201d7f233..017c879d7 100644 --- a/src/JsonRpc/Receiver.cs +++ b/src/JsonRpc/Receiver.cs @@ -27,7 +27,10 @@ public bool IsValid(JToken container) return false; } - public void Initialized() => _initialized = true; + public void Initialized() + { + _initialized = true; + } public virtual (IEnumerable results, bool hasResponse) GetRequests(JToken container) { @@ -63,9 +66,12 @@ protected virtual Renor GetRenor(JToken @object) // ReSharper disable once AssignmentInConditionalExpression if (hasRequestId = request.TryGetValue("id", out var id)) { - var idString = id.Type == JTokenType.String ? (string) id : null; - var idLong = id.Type == JTokenType.Integer ? (long?) id : null; - requestId = idString ?? ( idLong.HasValue ? (object) idLong.Value : null ); + requestId = id switch + { + { Type: JTokenType.String } => id.Value(), + { Type: JTokenType.Integer } => id.Value(), + _ => null + }; } if (hasRequestId && request.TryGetValue("result", out var response)) @@ -109,20 +115,23 @@ protected virtual Renor GetRenor(JToken @object) // !id == notification if (!hasRequestId) { - return new Notification(method!, @params) { + return new Notification(method!, @params) + { TraceState = traceState, TraceParent = traceParent, }; } - else + + return new Request(requestId!, method!, @params) { - return new Request(requestId!, method!, @params) { - TraceState = traceState, - TraceParent = traceParent, - }; - } + TraceState = traceState, + TraceParent = traceParent, + }; } - public bool ShouldOutput(object value) => _initialized; + public bool ShouldOutput(object value) + { + return _initialized; + } } } diff --git a/src/JsonRpc/ResponseRouter.cs b/src/JsonRpc/ResponseRouter.cs index 4ef205245..d66afc528 100644 --- a/src/JsonRpc/ResponseRouter.cs +++ b/src/JsonRpc/ResponseRouter.cs @@ -18,38 +18,57 @@ internal class ResponseRouter : IResponseRouter internal readonly ConcurrentDictionary pendingTask)> Requests = new ConcurrentDictionary pendingTask)>(); - public ResponseRouter(Lazy outputHandler, ISerializer serializer, IHandlerTypeDescriptorProvider handlerTypeDescriptorProvider) + public ResponseRouter( + Lazy outputHandler, ISerializer serializer, IHandlerTypeDescriptorProvider handlerTypeDescriptorProvider + ) { OutputHandler = outputHandler; Serializer = serializer; _handlerTypeDescriptorProvider = handlerTypeDescriptorProvider; } - public void SendNotification(string method) => + public void SendNotification(string method) + { OutputHandler.Value.Send( - new OutgoingNotification { + new OutgoingNotification + { Method = method } ); + } - public void SendNotification(string method, T @params) => + public void SendNotification(string method, T @params) + { OutputHandler.Value.Send( - new OutgoingNotification { + new OutgoingNotification + { Method = method, Params = @params } ); + } - public void SendNotification(IRequest @params) => SendNotification(GetMethodName(@params.GetType()), @params); + public void SendNotification(IRequest @params) + { + SendNotification(GetMethodName(@params.GetType()), @params); + } - public Task SendRequest(IRequest @params, CancellationToken cancellationToken) => - SendRequest(GetMethodName(@params.GetType()), @params).Returning(cancellationToken); + public Task SendRequest(IRequest @params, CancellationToken cancellationToken) + { + return SendRequest(GetMethodName(@params.GetType()), @params).Returning(cancellationToken); + } - public IResponseRouterReturns SendRequest(string method) => new ResponseRouterReturnsImpl(this, method, new object()); + public IResponseRouterReturns SendRequest(string method) + { + return new ResponseRouterReturnsImpl(this, method, new object()); + } - public IResponseRouterReturns SendRequest(string method, T @params) => new ResponseRouterReturnsImpl(this, method, @params); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return new ResponseRouterReturnsImpl(this, method, @params); + } - public bool TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)] out TaskCompletionSource pendingTask) + public bool TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) { var result = Requests.TryGetValue(id, out var source); method = source.method; @@ -57,8 +76,11 @@ public bool TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNu return result; } - private string GetMethodName(Type type) => - _handlerTypeDescriptorProvider.GetMethodName(type) ?? throw new NotSupportedException($"Unable to infer method name for type {type.FullName}"); + private string GetMethodName(Type type) + { + return _handlerTypeDescriptorProvider.GetMethodName(type) + ?? throw new NotSupportedException($"Unable to infer method name for type {type.FullName}"); + } private class ResponseRouterReturnsImpl : IResponseRouterReturns { @@ -84,14 +106,16 @@ public async Task Returning(CancellationToken cancellation try { _router.OutputHandler.Value.Send( - new OutgoingRequest { + new OutgoingRequest + { Method = _method, Params = _params, Id = nextId } ); cancellationToken.Register( - () => { + () => + { if (tcs.Task.IsCompleted) return; _router.CancelRequest(new CancelParams { Id = nextId }); } @@ -100,7 +124,7 @@ public async Task Returning(CancellationToken cancellation var result = await tcs.Task.ConfigureAwait(false); if (typeof(TResponse) == typeof(Unit)) { - return (TResponse) (object) Unit.Value; + return (TResponse)(object)Unit.Value; } return result.ToObject(_router.Serializer.JsonSerializer); @@ -111,7 +135,10 @@ public async Task Returning(CancellationToken cancellation } } - public async Task ReturningVoid(CancellationToken cancellationToken) => await Returning(cancellationToken).ConfigureAwait(false); + public async Task ReturningVoid(CancellationToken cancellationToken) + { + await Returning(cancellationToken).ConfigureAwait(false); + } } } } diff --git a/src/JsonRpc/Serialization/Converters/EnumLikeStringConverter.cs b/src/JsonRpc/Serialization/Converters/EnumLikeStringConverter.cs index 6ff70ff86..ae1c7298d 100644 --- a/src/JsonRpc/Serialization/Converters/EnumLikeStringConverter.cs +++ b/src/JsonRpc/Serialization/Converters/EnumLikeStringConverter.cs @@ -4,21 +4,27 @@ namespace OmniSharp.Extensions.JsonRpc.Serialization.Converters { - internal class EnumLikeStringConverter : JsonConverter + internal class EnumLikeStringConverter : JsonConverter { - public override void WriteJson(JsonWriter writer, IEnumLikeString value, JsonSerializer serializer) => new JValue(value.ToString()).WriteTo(writer); + public override void WriteJson(JsonWriter writer, IEnumLikeString? value, JsonSerializer serializer) + { + new JValue(value?.ToString()).WriteTo(writer); + } - public override IEnumLikeString ReadJson( - JsonReader reader, Type objectType, IEnumLikeString existingValue, + public override IEnumLikeString? ReadJson( + JsonReader reader, Type objectType, IEnumLikeString? existingValue, bool hasExistingValue, JsonSerializer serializer - ) => - ( reader.TokenType, Nullable.GetUnderlyingType(objectType) ) switch { - (JsonToken.String, null) => (IEnumLikeString) Activator.CreateInstance(objectType, (string) reader.Value), - (JsonToken.String, { } realType) => (IEnumLikeString) Activator.CreateInstance(realType, (string) reader.Value), - (_, { }) => (IEnumLikeString) Activator.CreateInstance(objectType, null), + ) + { + return ( reader.TokenType, Nullable.GetUnderlyingType(objectType) ) switch + { + (JsonToken.String, null) => (IEnumLikeString)Activator.CreateInstance(objectType, (string)reader.Value), + (JsonToken.String, { } realType) => (IEnumLikeString)Activator.CreateInstance(realType, (string)reader.Value), + (_, { }) => (IEnumLikeString)Activator.CreateInstance(objectType, null), _ => null }; + } public override bool CanRead => true; } diff --git a/src/JsonRpc/Serialization/Converters/RpcErrorConverter.cs b/src/JsonRpc/Serialization/Converters/RpcErrorConverter.cs index 1ae5cb787..8e39b77a6 100644 --- a/src/JsonRpc/Serialization/Converters/RpcErrorConverter.cs +++ b/src/JsonRpc/Serialization/Converters/RpcErrorConverter.cs @@ -33,9 +33,12 @@ public override RpcError ReadJson( object? requestId = null; if (obj.TryGetValue("id", out var id)) { - var idString = id.Type == JTokenType.String ? (string) id : null; - var idLong = id.Type == JTokenType.Integer ? (long?) id : null; - requestId = idString ?? ( idLong.HasValue ? (object) idLong.Value : null ); + requestId = id switch + { + { Type: JTokenType.String } => id.Value(), + { Type: JTokenType.Integer } => id.Value(), + _ => null + }; } ErrorMessage? data = null; diff --git a/src/JsonRpc/Server/RequestException.cs b/src/JsonRpc/Server/RequestException.cs index d41260fc8..ad8defb3b 100644 --- a/src/JsonRpc/Server/RequestException.cs +++ b/src/JsonRpc/Server/RequestException.cs @@ -49,7 +49,7 @@ public RequestException(int errorCode, object? requestId, string? message) : bas /// public RequestException(int errorCode, string? message, string? requestId, Exception inner) : base(message, inner) { - RequestId = !string.IsNullOrWhiteSpace(requestId) ? requestId! : UnknownRequestId; + RequestId = !string.IsNullOrWhiteSpace(requestId) ? requestId : UnknownRequestId; ErrorCode = errorCode; } diff --git a/src/Protocol.Proposals/Client/Capabilities/ProposedClientCapabilities.cs b/src/Protocol.Proposals/Client/Capabilities/ProposedClientCapabilities.cs index 45d4ac5e9..beaea73a2 100644 --- a/src/Protocol.Proposals/Client/Capabilities/ProposedClientCapabilities.cs +++ b/src/Protocol.Proposals/Client/Capabilities/ProposedClientCapabilities.cs @@ -1,10 +1,9 @@ using System; -using System.Collections.Generic; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { [Obsolete(Constants.Proposal)] - public class ProposedClientCapabilities : ClientCapabilities { } + public class ProposedClientCapabilities : ClientCapabilities + { + } } diff --git a/src/Protocol.Proposals/ProposedExtensions.cs b/src/Protocol.Proposals/ProposedExtensions.cs index e7f86a3c8..f63be24b3 100644 --- a/src/Protocol.Proposals/ProposedExtensions.cs +++ b/src/Protocol.Proposals/ProposedExtensions.cs @@ -1,5 +1,4 @@ -ο»Ώusing OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.LanguageServer.Client; +ο»Ώusing OmniSharp.Extensions.LanguageServer.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Server; diff --git a/src/Protocol.Proposals/Serialization/ProposedCapabilitiesConverter.cs b/src/Protocol.Proposals/Serialization/ProposedCapabilitiesConverter.cs index 0ea286577..3ff7a2807 100644 --- a/src/Protocol.Proposals/Serialization/ProposedCapabilitiesConverter.cs +++ b/src/Protocol.Proposals/Serialization/ProposedCapabilitiesConverter.cs @@ -1,6 +1,5 @@ ο»Ώusing System; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization { @@ -13,8 +12,16 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist return serializer.Deserialize(reader); } - public override bool CanConvert(Type objectType) => objectType == typeof(TFrom); - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => throw new NotImplementedException(); + public override bool CanConvert(Type objectType) + { + return objectType == typeof(TFrom); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + public override bool CanWrite => false; } } diff --git a/src/Protocol.Proposals/Serialization/ProposedLspSerializer.cs b/src/Protocol.Proposals/Serialization/ProposedLspSerializer.cs index aa7c6c8f1..faf237e1d 100644 --- a/src/Protocol.Proposals/Serialization/ProposedLspSerializer.cs +++ b/src/Protocol.Proposals/Serialization/ProposedLspSerializer.cs @@ -11,6 +11,7 @@ internal class ProposedLspSerializer : LspSerializer protected override void AddOrReplaceConverters(ICollection converters) { +#pragma warning disable CS0618 AddProposedCapabilitiesConverter(converters); AddProposedCapabilitiesConverter(converters); AddProposedCapabilitiesConverter(converters); @@ -18,6 +19,7 @@ protected override void AddOrReplaceConverters(ICollection conver AddProposedCapabilitiesConverter(converters); AddProposedCapabilitiesConverter(converters); AddProposedCapabilitiesConverter(converters); +#pragma warning restore CS0618 base.AddOrReplaceConverters(converters); } diff --git a/src/Protocol.Proposals/Server/Capabilities/ProposedServerCapabilities.cs b/src/Protocol.Proposals/Server/Capabilities/ProposedServerCapabilities.cs index c7644c56a..750ca32e4 100644 --- a/src/Protocol.Proposals/Server/Capabilities/ProposedServerCapabilities.cs +++ b/src/Protocol.Proposals/Server/Capabilities/ProposedServerCapabilities.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; namespace OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities { diff --git a/src/Protocol.Proposals/Server/Capabilities/ProposedWorkspaceServerCapabilities.cs b/src/Protocol.Proposals/Server/Capabilities/ProposedWorkspaceServerCapabilities.cs index b3d70aef4..75ee55e8e 100644 --- a/src/Protocol.Proposals/Server/Capabilities/ProposedWorkspaceServerCapabilities.cs +++ b/src/Protocol.Proposals/Server/Capabilities/ProposedWorkspaceServerCapabilities.cs @@ -1,6 +1,4 @@ using System; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; namespace OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities { diff --git a/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs b/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs index 303362a50..f74b73634 100644 --- a/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using Newtonsoft.Json.Linq; - namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { public class TextDocumentClientCapabilities : CapabilitiesBase, ITextDocumentClientCapabilities diff --git a/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs b/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs index c088e2e18..24ba5cebc 100644 --- a/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using Newtonsoft.Json.Linq; - namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { /// diff --git a/src/Protocol/DocumentUri.Internal.cs b/src/Protocol/DocumentUri.Internal.cs index a841a3649..3a34bc3a1 100644 --- a/src/Protocol/DocumentUri.Internal.cs +++ b/src/Protocol/DocumentUri.Internal.cs @@ -15,17 +15,35 @@ public partial class DocumentUri private static readonly Regex SingleSlashStart = new Regex(@"^\/"); private static readonly Regex DoubleSlashStart = new Regex(@"^\/\/"); - private static bool IsHighSurrogate(int charCode) => 0xD800 <= charCode && charCode <= 0xDBFF; + private static bool IsHighSurrogate(int charCode) + { + return 0xD800 <= charCode && charCode <= 0xDBFF; + } - private static bool IsLowSurrogate(int charCode) => 0xDC00 <= charCode && charCode <= 0xDFFF; + private static bool IsLowSurrogate(int charCode) + { + return 0xDC00 <= charCode && charCode <= 0xDFFF; + } - private static bool IsLowerAsciiHex(int code) => code >= CharCode.a && code <= CharCode.f; + private static bool IsLowerAsciiHex(int code) + { + return code >= CharCode.a && code <= CharCode.f; + } - private static bool IsLowerAsciiLetter(int code) => code >= CharCode.a && code <= CharCode.z; + private static bool IsLowerAsciiLetter(int code) + { + return code >= CharCode.a && code <= CharCode.z; + } - private static bool IsUpperAsciiLetter(int code) => code >= CharCode.A && code <= CharCode.Z; + private static bool IsUpperAsciiLetter(int code) + { + return code >= CharCode.A && code <= CharCode.Z; + } - private static bool IsAsciiLetter(int code) => IsLowerAsciiLetter(code) || IsUpperAsciiLetter(code); + private static bool IsAsciiLetter(int code) + { + return IsLowerAsciiLetter(code) || IsUpperAsciiLetter(code); + } private static void _validateUri(DocumentUri ret, bool? strict) { @@ -111,7 +129,8 @@ private static string ReferenceResolution(string? scheme, string path) return path; } - private static readonly IDictionary EncodeTable = new Dictionary { + private static readonly IDictionary EncodeTable = new Dictionary + { [CharCode.Colon] = "%3A", // gen-delims [CharCode.Slash] = "%2F", [CharCode.QuestionMark] = "%3F", @@ -146,19 +165,19 @@ private static string EncodeUriComponentFast(string uriComponent, bool allowSlas // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 if ( - code >= CharCode.a && code <= CharCode.z - || code >= CharCode.A && code <= CharCode.Z - || code >= CharCode.Digit0 && code <= CharCode.Digit9 + ( code >= CharCode.a && code <= CharCode.z ) + || ( code >= CharCode.A && code <= CharCode.Z ) + || ( code >= CharCode.Digit0 && code <= CharCode.Digit9 ) || code == CharCode.Dash || code == CharCode.Period || code == CharCode.Underline || code == CharCode.Tilde - || allowSlash && code == CharCode.Slash - || allowSlash && ( pos == 1 || pos == 2 ) && ( - uriComponent.Length >= 3 && uriComponent[0] == CharCode.Slash && - uriComponent[2] == CharCode.Colon - || uriComponent.Length >= 2 && uriComponent[1] == CharCode.Colon - ) + || ( allowSlash && code == CharCode.Slash ) + || ( allowSlash && ( pos == 1 || pos == 2 ) && ( + ( uriComponent.Length >= 3 && uriComponent[0] == CharCode.Slash && + uriComponent[2] == CharCode.Colon ) + || ( uriComponent.Length >= 2 && uriComponent[1] == CharCode.Colon ) + ) ) ) { // check if we are delaying native encode @@ -249,8 +268,8 @@ private static string UriToFsPath(DocumentUri uri, bool keepDriveLetterCasing) else if ( uri.Path.Length >= 3 && uri.Path[0] == CharCode.Slash - && ( uri.Path[1] >= CharCode.A && uri.Path[1] <= CharCode.Z || - uri.Path[1] >= CharCode.a && uri.Path[1] <= CharCode.z ) + && ( ( uri.Path[1] >= CharCode.A && uri.Path[1] <= CharCode.Z ) || + ( uri.Path[1] >= CharCode.a && uri.Path[1] <= CharCode.z ) ) && uri.Path[2] == CharCode.Colon ) { diff --git a/src/Protocol/DocumentUri.cs b/src/Protocol/DocumentUri.cs index 4f1870c46..299a91eec 100644 --- a/src/Protocol/DocumentUri.cs +++ b/src/Protocol/DocumentUri.cs @@ -69,7 +69,8 @@ public Uri ToUri() var parts = Authority.Split(':'); var host = parts[0]; var port = int.Parse(parts[1]); - return new UriBuilder { + return new UriBuilder + { Scheme = Scheme, Host = host, Port = port, @@ -79,7 +80,8 @@ public Uri ToUri() }.Uri; } - return new UriBuilder { + return new UriBuilder + { Scheme = Scheme, Host = Authority, Path = Path, @@ -101,16 +103,25 @@ public Uri ToUri() /// /// @param skipEncoding Do not encode the result, default is `false` /// - public override string ToString() => _asFormatted(this, false); + public override string ToString() + { + return _asFormatted(this, false); + } - public string ToUnencodedString() => _asFormatted(this, true); + public string ToUnencodedString() + { + return _asFormatted(this, true); + } /// /// Gets the file system path prefixed with / for unix platforms /// /// /// This will not a uri encode asian and cyrillic characters - public string GetFileSystemPath() => UriToFsPath(this, false); + public string GetFileSystemPath() + { + return UriToFsPath(this, false); + } /// public bool Equals(DocumentUri? other) @@ -133,7 +144,7 @@ public override bool Equals(object? obj) { if (obj is null) return false; if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((DocumentUri) obj); + return obj.GetType() == GetType() && Equals((DocumentUri)obj); } /// @@ -146,7 +157,7 @@ public override int GetHashCode() unchecked { var hashCode = comparer.GetHashCode(Path); - hashCode = ( hashCode * 397 ) ^ comparer.GetHashCode(Scheme); + hashCode = ( hashCode * 397 ) ^ comparer.GetHashCode(Scheme ?? ""); hashCode = ( hashCode * 397 ) ^ comparer.GetHashCode(Authority); hashCode = ( hashCode * 397 ) ^ comparer.GetHashCode(Query); hashCode = ( hashCode * 397 ) ^ comparer.GetHashCode(Fragment); @@ -181,7 +192,10 @@ out string fragment /// /// /// - public static bool operator ==(DocumentUri left, DocumentUri right) => Equals(left, right); + public static bool operator ==(DocumentUri left, DocumentUri right) + { + return Equals(left, right); + } /// /// Check if two uris are not equal @@ -189,15 +203,23 @@ out string fragment /// /// /// - public static bool operator !=(DocumentUri left, DocumentUri right) => !Equals(left, right); + public static bool operator !=(DocumentUri left, DocumentUri right) + { + return !Equals(left, right); + } /// /// Convert this uri into a . /// /// - /// This is explicit because to string gives the schema string with file:// but if you want the file system you use + /// + /// This is explicit because to string gives the schema string with file:// but if you want the file system you use + /// /// - public static explicit operator string(DocumentUri uri) => uri.ToString(); + public static explicit operator string(DocumentUri uri) + { + return uri.ToString(); + } /// /// Convert this into a . @@ -205,21 +227,30 @@ out string fragment /// /// The uri class has issues with higher level utf8 characters such as asian and cyrillic characters /// - public static explicit operator Uri(DocumentUri uri) => uri.ToUri(); + public static explicit operator Uri(DocumentUri uri) + { + return uri.ToUri(); + } /// /// Automatically convert a string to a uri for both filesystem paths or uris in a string /// /// /// - public static implicit operator DocumentUri(string url) => From(url); + public static implicit operator DocumentUri(string url) + { + return From(url); + } /// /// Automatically convert a uri to a document uri /// /// /// - public static implicit operator DocumentUri(Uri uri) => From(uri); + public static implicit operator DocumentUri(Uri uri) + { + return From(uri); + } /// /// Create a new document uri from the given @@ -267,8 +298,10 @@ public static DocumentUri From(string url) /// /// The file-system path, or null if the URI does not represent a file-system path. /// - public static string? GetFileSystemPath(ITextDocumentIdentifierParams textDocumentIdentifierParams) => - GetFileSystemPath(textDocumentIdentifierParams.TextDocument.Uri); + public static string? GetFileSystemPath(ITextDocumentIdentifierParams textDocumentIdentifierParams) + { + return GetFileSystemPath(textDocumentIdentifierParams.TextDocument.Uri); + } /// /// Get the local file-system path for the specified document URI. @@ -279,8 +312,10 @@ public static DocumentUri From(string url) /// /// The file-system path, or null if the URI does not represent a file-system path. /// - public static string? GetFileSystemPath(TextDocumentIdentifier textDocumentIdentifier) => - GetFileSystemPath(textDocumentIdentifier.Uri); + public static string? GetFileSystemPath(TextDocumentIdentifier textDocumentIdentifier) + { + return GetFileSystemPath(textDocumentIdentifier.Uri); + } /// /// Get the local file-system path for the specified document URI. @@ -310,7 +345,10 @@ public static DocumentUri From(string url) /// /// The LSP document URI. /// - public static DocumentUri FromFileSystemPath(string fileSystemPath) => File(fileSystemPath); + public static DocumentUri FromFileSystemPath(string fileSystemPath) + { + return File(fileSystemPath); + } private sealed class DocumentUriEqualityComparer : IEqualityComparer { @@ -322,7 +360,10 @@ public bool Equals(DocumentUri? x, DocumentUri? y) return x.GetType() == y.GetType() && x.Equals(y); } - public int GetHashCode(DocumentUri obj) => obj.GetHashCode(); + public int GetHashCode(DocumentUri obj) + { + return obj.GetHashCode(); + } } /// @@ -441,22 +482,26 @@ public static DocumentUri File(string path) return new DocumentUri("file", authority, path, Empty, Empty); } - public DocumentUri With(DocumentUriComponents components) => - new DocumentUri( + public DocumentUri With(DocumentUriComponents components) + { + return new DocumentUri( components.Scheme ?? Scheme, components.Authority ?? Authority, components.Path ?? Path, components.Query ?? Query, components.Fragment ?? Fragment ); + } - public static DocumentUri From(DocumentUriComponents components) => - new DocumentUri( + public static DocumentUri From(DocumentUriComponents components) + { + return new DocumentUri( components.Scheme ?? string.Empty, components.Authority ?? string.Empty, components.Path ?? string.Empty, components.Query ?? string.Empty, components.Fragment ?? string.Empty ); + } } } diff --git a/src/Protocol/Features/Client/LogTraceFeature.cs b/src/Protocol/Features/Client/LogTraceFeature.cs index 6712ce7e4..7c033130a 100644 --- a/src/Protocol/Features/Client/LogTraceFeature.cs +++ b/src/Protocol/Features/Client/LogTraceFeature.cs @@ -11,14 +11,15 @@ namespace Models { [Parallel] [Method(GeneralNames.LogTrace, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer))] public record LogTraceParams : IRequest { /// /// The message to be logged. /// - public string Message { get; init; } + public string Message { get; init; } = null!; /// /// Additional information that can be computed if the `trace` configuration is set to `'verbose'` diff --git a/src/Protocol/Features/Client/RegistrationFeature.cs b/src/Protocol/Features/Client/RegistrationFeature.cs index 557d6b578..b48e81a7c 100644 --- a/src/Protocol/Features/Client/RegistrationFeature.cs +++ b/src/Protocol/Features/Client/RegistrationFeature.cs @@ -2,6 +2,7 @@ using System.Collections.Immutable; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Newtonsoft.Json; using OmniSharp.Extensions.JsonRpc; @@ -17,23 +18,19 @@ namespace Models { [Parallel] [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer))] public partial record RegistrationParams : IJsonRpcRequest { - public RegistrationContainer Registrations { get; init; } + public RegistrationContainer Registrations { get; init; } = null!; } [Parallel] [Method(ClientNames.UnregisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "UnregisterCapability"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "UnregisterCapability")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer))] public partial record UnregistrationParams : IJsonRpcRequest { public UnregistrationContainer? Unregisterations { get; init; } @@ -58,12 +55,12 @@ public partial record Registration /// The id used to register the request. The id can be used to deregister /// the request again. /// - public string Id { get; init; } + public string Id { get; init; } = null!; /// /// The method / capability to register for. /// - public string Method { get; init; } + public string Method { get; init; } = null!; /// /// Options necessary for the registration. @@ -71,15 +68,23 @@ public partial record Registration [Optional] public object? RegisterOptions { get; init; } - private string DebuggerDisplay => $"[{Id}] {( RegisterOptions is ITextDocumentRegistrationOptions td ? $"{td.DocumentSelector}" : string.Empty )} {Method}"; + private string DebuggerDisplay => + $"[{Id}] {( RegisterOptions is ITextDocumentRegistrationOptions td ? $"{td.DocumentSelector}" : string.Empty )} {Method}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } - public static Unregistration ToUnregistration(Registration registration) => new Unregistration() { - Id = registration.Id, - Method = registration.Method, - }; + public static Unregistration ToUnregistration(Registration registration) + { + return new Unregistration + { + Id = registration.Id, + Method = registration.Method, + }; + } public class TextDocumentComparer : IEqualityComparer { @@ -93,7 +98,7 @@ public bool Equals(Registration? x, Registration? y) { // Id doesn't matter if they target the same text document // this is arbitrary but should be good in most cases. - return ( x.Id == y.Id || xTdro.DocumentSelector == yTdro.DocumentSelector ) && x.Method == y.Method; + return ( x.Id == y.Id || xTdro.DocumentSelector! == yTdro.DocumentSelector! ) && x.Method == y.Method; } return x.Id == y.Id && x.Method == y.Method; @@ -106,13 +111,13 @@ public int GetHashCode(Registration? obj) if (obj!.RegisterOptions is ITextDocumentRegistrationOptions tdro) { var hashCode = obj.Method.GetHashCode(); - return ( hashCode * 397 ) ^ ( tdro.DocumentSelector != null ? tdro.DocumentSelector.GetHashCode() : 0 ); + return ( hashCode * 397 ) ^ ( tdro.DocumentSelector?.GetHashCode() ?? 0 ); } else { var hashCode = obj!.Id.GetHashCode(); hashCode = ( hashCode * 397 ) ^ obj.Method.GetHashCode(); - return ( hashCode * 397 ) ^ ( obj.RegisterOptions != null ? obj.RegisterOptions.GetHashCode() : 0 ); + return ( hashCode * 397 ) ^ ( obj.RegisterOptions?.GetHashCode() ?? 0 ); } } } @@ -130,80 +135,122 @@ public partial record Unregistration /// The id used to unregister the request or notification. Usually an id /// provided during the register request. /// - public string Id { get; init; } + public string Id { get; init; } = null!; /// /// The method to unregister for. /// - public string Method { get; init; } + public string Method { get; init; } = null!; - public static implicit operator Unregistration(Registration registration) => - new Unregistration { + public static implicit operator Unregistration(Registration registration) + { + return new Unregistration + { Id = registration.Id, Method = registration.Method }; + } private string DebuggerDisplay => $"[{Id}] {Method}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } public partial class UnregistrationContainer { - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static UnregistrationContainer? From(IEnumerable? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator UnregistrationContainer?(Registration[] items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static UnregistrationContainer? From(params Registration[] items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator UnregistrationContainer?(Collection? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static UnregistrationContainer? From(Collection? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator UnregistrationContainer?(List? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static UnregistrationContainer? From(List? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator UnregistrationContainer?(ImmutableList? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static UnregistrationContainer? From(ImmutableList? items) => items switch { - not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), - _ => null - }; + [return: NotNullIfNotNull("items")] + public static UnregistrationContainer? From(IEnumerable? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static implicit operator UnregistrationContainer?(Registration[] items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static UnregistrationContainer? From(params Registration[] items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static implicit operator UnregistrationContainer?(Collection? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static UnregistrationContainer? From(Collection? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static implicit operator UnregistrationContainer?(List? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static UnregistrationContainer? From(List? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static implicit operator UnregistrationContainer?(ImmutableList? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } + + [return: NotNullIfNotNull("items")] + public static UnregistrationContainer? From(ImmutableList? items) + { + return items switch + { + not null => new UnregistrationContainer(items.Select(Registration.ToUnregistration)), + _ => null + }; + } } } diff --git a/src/Protocol/Features/Document/CallHierarchyFeature.cs b/src/Protocol/Features/Document/CallHierarchyFeature.cs index cdfa8096c..73f0949dd 100644 --- a/src/Protocol/Features/Document/CallHierarchyFeature.cs +++ b/src/Protocol/Features/Document/CallHierarchyFeature.cs @@ -30,16 +30,13 @@ namespace Models /// [Parallel] [Method(TextDocumentNames.PrepareCallHierarchy, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(CallHierarchyRegistrationOptions)), Capability(typeof(CallHierarchyCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(CallHierarchyRegistrationOptions))] + [Capability(typeof(CallHierarchyCapability))] public partial record CallHierarchyPrepareParams : TextDocumentPositionParams, IWorkDoneProgressParams, - IPartialItemsRequest?, CallHierarchyItem> - { - } + IPartialItemsRequest?, CallHierarchyItem>; /// /// Represents programming constructs like functions or constructors in the context @@ -54,7 +51,7 @@ public partial record CallHierarchyItem : ICanBeResolved /// /// The name of this item. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// The kind of this item. @@ -76,18 +73,18 @@ public partial record CallHierarchyItem : ICanBeResolved /// /// The resource identifier of this item. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. /// Must be contained by the [`range`](#CallHierarchyItem.range). /// - public Range SelectionRange { get; init; } + public Range SelectionRange { get; init; } = null!; /// /// A data entry field that is preserved between a call hierarchy prepare and @@ -103,11 +100,15 @@ public partial record CallHierarchyItem : ICanBeResolved $"{Range}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } + public abstract record CallHierarchyBaseCallParams : ICanBeResolved { - public CallHierarchyItem Item { get; init; } + public CallHierarchyItem Item { get; init; } = null!; JToken? ICanBeResolved.Data { @@ -115,10 +116,11 @@ public abstract record CallHierarchyBaseCallParams : ICanBeResolved init => Item.SetRawData(value); } } + public abstract record CallHierarchyBaseCallParams : ICanBeResolved where T : class?, IHandlerIdentity? { - public CallHierarchyItem Item { get; init; } + public CallHierarchyItem Item { get; init; } = null!; JToken? ICanBeResolved.Data { @@ -134,16 +136,13 @@ public abstract record CallHierarchyBaseCallParams : ICanBeResolved /// [Parallel] [Method(TextDocumentNames.CallHierarchyIncoming, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CallHierarchyIncoming"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CallHierarchyIncoming")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [Capability(typeof(CallHierarchyCapability))] public partial record CallHierarchyIncomingCallsParams : CallHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, CallHierarchyIncomingCall>, IDoesNotParticipateInRegistration - { - } + IPartialItemsRequest?, CallHierarchyIncomingCall>, + IDoesNotParticipateInRegistration; /// /// The parameter of a `callHierarchy/incomingCalls` request. @@ -151,29 +150,28 @@ public partial record CallHierarchyIncomingCallsParams : CallHierarchyBaseCallPa /// @since 3.16.0 /// [Method(TextDocumentNames.CallHierarchyIncoming, Direction.ClientToServer)] - public partial record CallHierarchyIncomingCallsParams : CallHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, CallHierarchyIncomingCall>, IDoesNotParticipateInRegistration - where T : class?, IHandlerIdentity? - { - } + public partial record CallHierarchyIncomingCallsParams : CallHierarchyBaseCallParams, IWorkDoneProgressParams, + IPartialItemsRequest?, CallHierarchyIncomingCall>, + IDoesNotParticipateInRegistration + where T : class?, IHandlerIdentity?; /// /// Represents an incoming call, e.g. a caller of a method or constructor. /// /// @since 3.16.0 /// - public partial record CallHierarchyIncomingCall + public partial record CallHierarchyIncomingCall { /// /// The item that makes the call. /// - public CallHierarchyItem From { get; init; } + public CallHierarchyItem From { get; init; } = null!; /// /// The range at which at which the calls appears. This is relative to the caller /// denoted by [`this.from`](#CallHierarchyIncomingCall.from). /// - public Container FromRanges { get; init; } + public Container FromRanges { get; init; } = null!; } /// @@ -183,20 +181,20 @@ public partial record CallHierarchyIncomingCall /// [Parallel] [Method(TextDocumentNames.CallHierarchyOutgoing, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CallHierarchyOutgoing"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CallHierarchyOutgoing")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [Capability(typeof(CallHierarchyCapability))] public partial record CallHierarchyOutgoingCallsParams : CallHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, CallHierarchyOutgoingCall>, IDoesNotParticipateInRegistration + IPartialItemsRequest?, CallHierarchyOutgoingCall>, + IDoesNotParticipateInRegistration { public static CallHierarchyOutgoingCallsParams Create(CallHierarchyOutgoingCallsParams item) where T : class?, IHandlerIdentity? { - return new CallHierarchyOutgoingCallsParams() { + return new CallHierarchyOutgoingCallsParams + { Item = item.Item, PartialResultToken = item.PartialResultToken, WorkDoneToken = item.PartialResultToken @@ -211,20 +209,29 @@ public static CallHierarchyOutgoingCallsParams Create(CallHierarchyOutgoin /// [Method(TextDocumentNames.CallHierarchyOutgoing, Direction.ClientToServer)] public partial record CallHierarchyOutgoingCallsParams : CallHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, CallHierarchyOutgoingCall>, IDoesNotParticipateInRegistration + IPartialItemsRequest?, CallHierarchyOutgoingCall>, + IDoesNotParticipateInRegistration where T : class?, IHandlerIdentity? { public static CallHierarchyOutgoingCallsParams Create(CallHierarchyOutgoingCallsParams item) { - return new CallHierarchyOutgoingCallsParams() { + return new CallHierarchyOutgoingCallsParams + { Item = item.Item, PartialResultToken = item.PartialResultToken, WorkDoneToken = item.PartialResultToken }; } - public static implicit operator CallHierarchyOutgoingCallsParams(CallHierarchyOutgoingCallsParams item) => Create(item); - public static implicit operator CallHierarchyOutgoingCallsParams(CallHierarchyOutgoingCallsParams item) => CallHierarchyOutgoingCallsParams.Create(item); + public static implicit operator CallHierarchyOutgoingCallsParams(CallHierarchyOutgoingCallsParams item) + { + return Create(item); + } + + public static implicit operator CallHierarchyOutgoingCallsParams(CallHierarchyOutgoingCallsParams item) + { + return CallHierarchyOutgoingCallsParams.Create(item); + } } /// @@ -237,14 +244,14 @@ public partial record CallHierarchyOutgoingCall /// /// The item that is called. /// - public CallHierarchyItem To { get; init; } + public CallHierarchyItem To { get; init; } = null!; /// /// The range at which this item is called. This is the range relative to the caller, e.g the item /// passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) /// and not [`this.to`](#CallHierarchyOutgoingCall.to). /// - public Container FromRanges { get; init; } + public Container FromRanges { get; init; } = null!; } /// @@ -274,7 +281,8 @@ public partial class CallHierarchyCapability : DynamicCapability namespace Document { - public abstract class CallHierarchyHandlerBase : AbstractHandlers.Base, ICallHierarchyPrepareHandler, + public abstract class CallHierarchyHandlerBase : AbstractHandlers.Base, + ICallHierarchyPrepareHandler, ICallHierarchyIncomingHandler, ICallHierarchyOutgoingHandler { @@ -294,7 +302,9 @@ protected CallHierarchyHandlerBase() : this(Guid.NewGuid()) public abstract Task?> Handle(CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken); public abstract Task?> Handle(CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken); } - public abstract class PartialCallHierarchyHandlerBase : AbstractHandlers.PartialResults?, CallHierarchyItem, + + public abstract class PartialCallHierarchyHandlerBase : AbstractHandlers.PartialResults?, + CallHierarchyItem, CallHierarchyRegistrationOptions, CallHierarchyCapability>, ICallHierarchyPrepareHandler, ICallHierarchyIncomingHandler, ICallHierarchyOutgoingHandler { @@ -314,11 +324,15 @@ protected PartialCallHierarchyHandlerBase(IProgressManager progressManager) : th { } - public Task?> Handle(CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken) => - _incoming.Handle(request, cancellationToken); + public Task?> Handle(CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken) + { + return _incoming.Handle(request, cancellationToken); + } - public Task?> Handle(CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken) => - _outgoing.Handle(request, cancellationToken); + public Task?> Handle(CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken) + { + return _outgoing.Handle(request, cancellationToken); + } protected abstract void Handle( CallHierarchyIncomingCallsParams request, IObserver> results, CancellationToken cancellationToken @@ -351,15 +365,24 @@ protected override void Handle( CallHierarchyIncomingCallsParams request, IObserver> results, CancellationToken cancellationToken - ) => _self.Handle(request, results, cancellationToken); + ) + { + _self.Handle(request, results, cancellationToken); + } - protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions(CallHierarchyCapability capability, ClientCapabilities clientCapabilities) => - ( (IRegistration) _self ).GetRegistrationOptions(capability, clientCapabilities); + protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions( + CallHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return ( (IRegistration)_self ).GetRegistrationOptions( + capability, clientCapabilities + ); + } } - class PartialOutgoing : - AbstractHandlers.PartialResults?, CallHierarchyOutgoingCall, CallHierarchyRegistrationOptions - , CallHierarchyCapability>, ICallHierarchyOutgoingHandler + private class PartialOutgoing : AbstractHandlers.PartialResults?, + CallHierarchyOutgoingCall, CallHierarchyRegistrationOptions + , CallHierarchyCapability>, ICallHierarchyOutgoingHandler { private readonly PartialCallHierarchyHandlerBase _self; private readonly Guid _id; @@ -375,12 +398,22 @@ public PartialOutgoing(Guid id, IProgressManager progressManager, PartialCallHie protected override void Handle( CallHierarchyOutgoingCallsParams request, IObserver> results, CancellationToken cancellationToken - ) => _self.Handle(request, results, cancellationToken); + ) + { + _self.Handle(request, results, cancellationToken); + } - protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions(CallHierarchyCapability capability, ClientCapabilities clientCapabilities) => - ( (IRegistration) _self ).GetRegistrationOptions(capability, clientCapabilities); + protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions( + CallHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return ( (IRegistration)_self ).GetRegistrationOptions( + capability, clientCapabilities + ); + } } } + public abstract class CallHierarchyHandlerBase : CallHierarchyHandlerBase where T : class?, IHandlerIdentity? { protected CallHierarchyHandlerBase(Guid id) : base(id) @@ -397,10 +430,13 @@ protected CallHierarchyHandlerBase() : this(Guid.NewGuid()) return Container.From(response?.Select(CallHierarchyItem.From)!); } - public sealed override Task?> Handle(CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken) + public sealed override Task?> Handle( + CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken + ) { return HandleIncomingCalls( - new CallHierarchyIncomingCallsParams() { + new CallHierarchyIncomingCallsParams + { Item = request.Item, PartialResultToken = request.PartialResultToken, WorkDoneToken = request.WorkDoneToken @@ -409,10 +445,13 @@ protected CallHierarchyHandlerBase() : this(Guid.NewGuid()) ); } - public sealed override Task?> Handle(CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken) + public sealed override Task?> Handle( + CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken + ) { return HandleOutgoingCalls( - new CallHierarchyOutgoingCallsParams() { + new CallHierarchyOutgoingCallsParams + { Item = request.Item, PartialResultToken = request.PartialResultToken, WorkDoneToken = request.WorkDoneToken @@ -422,38 +461,55 @@ protected CallHierarchyHandlerBase() : this(Guid.NewGuid()) } protected abstract Task>?> HandlePrepare(CallHierarchyPrepareParams request, CancellationToken cancellationToken); - protected abstract Task?> HandleIncomingCalls(CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken); - protected abstract Task?> HandleOutgoingCalls(CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken); + + protected abstract Task?> HandleIncomingCalls( + CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken + ); + + protected abstract Task?> HandleOutgoingCalls( + CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken + ); } + public abstract class PartialCallHierarchyHandlerBase : PartialCallHierarchyHandlerBase where T : class?, IHandlerIdentity? { protected PartialCallHierarchyHandlerBase(IProgressManager progressManager) : base(progressManager) { } - protected sealed override void Handle(CallHierarchyPrepareParams request, IObserver> results, CancellationToken cancellationToken) => + protected sealed override void Handle( + CallHierarchyPrepareParams request, IObserver> results, CancellationToken cancellationToken + ) + { Handle( request, Observer.Create>>( - x => results.OnNext(x.Select(z => (CallHierarchyItem) z)), + x => results.OnNext(x.Select(z => (CallHierarchyItem)z)), results.OnError, results.OnCompleted ), cancellationToken ); + } - protected abstract void Handle(CallHierarchyPrepareParams request, IObserver>> results, CancellationToken cancellationToken); + protected abstract void Handle( + CallHierarchyPrepareParams request, IObserver>> results, CancellationToken cancellationToken + ); protected sealed override void Handle( CallHierarchyIncomingCallsParams request, IObserver> results, CancellationToken cancellationToken - ) => Handle( - new CallHierarchyIncomingCallsParams() { - Item = request.Item, - PartialResultToken = request.PartialResultToken, - WorkDoneToken = request.WorkDoneToken - }, - results, - cancellationToken - ); + ) + { + Handle( + new CallHierarchyIncomingCallsParams + { + Item = request.Item, + PartialResultToken = request.PartialResultToken, + WorkDoneToken = request.WorkDoneToken + }, + results, + cancellationToken + ); + } protected abstract void Handle( CallHierarchyIncomingCallsParams request, IObserver> results, CancellationToken cancellationToken @@ -461,20 +517,25 @@ protected abstract void Handle( protected sealed override void Handle( CallHierarchyOutgoingCallsParams request, IObserver> results, CancellationToken cancellationToken - ) => Handle( - new CallHierarchyOutgoingCallsParams { - Item = request.Item, - PartialResultToken = request.PartialResultToken, - WorkDoneToken = request.WorkDoneToken - }, - results, - cancellationToken - ); + ) + { + Handle( + new CallHierarchyOutgoingCallsParams + { + Item = request.Item, + PartialResultToken = request.PartialResultToken, + WorkDoneToken = request.WorkDoneToken + }, + results, + cancellationToken + ); + } protected abstract void Handle( CallHierarchyOutgoingCallsParams request, IObserver> results, CancellationToken cancellationToken ); } + public static partial class CallHierarchyExtensions { public static ILanguageServerRegistry OnCallHierarchy( @@ -532,8 +593,10 @@ public static ILanguageServerRegistry OnCallHierarchy( public static ILanguageServerRegistry OnCallHierarchy( this ILanguageServerRegistry registry, Func>?>> handler, - Func, CallHierarchyCapability, CancellationToken, Task?>> incomingHandler, - Func, CallHierarchyCapability, CancellationToken, Task?>> outgoingHandler, + Func, CallHierarchyCapability, CancellationToken, Task?>> + incomingHandler, + Func, CallHierarchyCapability, CancellationToken, Task?>> + outgoingHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -655,8 +718,10 @@ public static ILanguageServerRegistry OnCallHierarchy( public static ILanguageServerRegistry OnCallHierarchy( this ILanguageServerRegistry registry, Action>, CallHierarchyCapability, CancellationToken> handler, - Action>, CallHierarchyCapability, CancellationToken> incomingHandler, - Action>, CallHierarchyCapability, CancellationToken> outgoingHandler, + Action>, CallHierarchyCapability, CancellationToken> + incomingHandler, + Action>, CallHierarchyCapability, CancellationToken> + outgoingHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) { @@ -712,8 +777,10 @@ public static ILanguageServerRegistry OnCallHierarchy( public static ILanguageServerRegistry OnCallHierarchy( this ILanguageServerRegistry registry, Action>>, CallHierarchyCapability, CancellationToken> handler, - Action, IObserver>, CallHierarchyCapability, CancellationToken> incomingHandler, - Action, IObserver>, CallHierarchyCapability, CancellationToken> outgoingHandler, + Action, IObserver>, CallHierarchyCapability, CancellationToken> + incomingHandler, + Action, IObserver>, CallHierarchyCapability, CancellationToken> + outgoingHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -846,20 +913,25 @@ public static ILanguageServerRegistry OnCallHierarchy( private class DelegatingCallHierarchyHandler : CallHierarchyHandlerBase where T : class?, IHandlerIdentity? { - private readonly Func>?>> _handlePrepare; + private readonly Func>?>> + _handlePrepare; - private readonly Func, CallHierarchyCapability, CancellationToken, Task?>> + private readonly Func, CallHierarchyCapability, CancellationToken, + Task?>> _handleIncomingCalls; - private readonly Func, CallHierarchyCapability, CancellationToken, Task?>> + private readonly Func, CallHierarchyCapability, CancellationToken, + Task?>> _handleOutgoingCalls; private readonly RegistrationOptionsDelegate _registrationOptionsFactory; public DelegatingCallHierarchyHandler( Func>?>> handlePrepare, - Func, CallHierarchyCapability, CancellationToken, Task?>> handleIncomingCalls, - Func, CallHierarchyCapability, CancellationToken, Task?>> handleOutgoingCalls, + Func, CallHierarchyCapability, CancellationToken, Task?>> + handleIncomingCalls, + Func, CallHierarchyCapability, CancellationToken, Task?>> + handleOutgoingCalls, RegistrationOptionsDelegate registrationOptionsFactory ) { @@ -869,30 +941,44 @@ RegistrationOptionsDelegate>?> HandlePrepare(CallHierarchyPrepareParams request, CancellationToken cancellationToken) => - _handlePrepare(request, Capability, cancellationToken); + protected override Task>?> HandlePrepare(CallHierarchyPrepareParams request, CancellationToken cancellationToken) + { + return _handlePrepare(request, Capability, cancellationToken); + } protected override Task?> HandleIncomingCalls( CallHierarchyIncomingCallsParams request, CancellationToken cancellationToken - ) => - _handleIncomingCalls(request, Capability, cancellationToken); + ) + { + return _handleIncomingCalls(request, Capability, cancellationToken); + } protected override Task?> HandleOutgoingCalls( CallHierarchyOutgoingCallsParams request, CancellationToken cancellationToken - ) => - _handleOutgoingCalls(request, Capability, cancellationToken); + ) + { + return _handleOutgoingCalls(request, Capability, cancellationToken); + } - protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions(CallHierarchyCapability capability, ClientCapabilities clientCapabilities) => _registrationOptionsFactory(capability, clientCapabilities); + protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions( + CallHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } } private class DelegatingPartialCallHierarchyHandler : PartialCallHierarchyHandlerBase where T : class?, IHandlerIdentity? { - private readonly Action>>, CallHierarchyCapability, CancellationToken> _handleParams; + private readonly Action>>, CallHierarchyCapability, CancellationToken> + _handleParams; - private readonly Action, IObserver>, CallHierarchyCapability, CancellationToken> + private readonly Action, IObserver>, CallHierarchyCapability, + CancellationToken> _handleIncoming; - private readonly Action, IObserver>, CallHierarchyCapability, CancellationToken> + private readonly Action, IObserver>, CallHierarchyCapability, + CancellationToken> _handleOutgoing; private readonly RegistrationOptionsDelegate _registrationOptionsFactory; @@ -900,8 +986,10 @@ private readonly Action, IObserver>>, CallHierarchyCapability, CancellationToken> handleParams, - Action, IObserver>, CallHierarchyCapability, CancellationToken> handleIncoming, - Action, IObserver>, CallHierarchyCapability, CancellationToken> handleOutgoing, + Action, IObserver>, CallHierarchyCapability, CancellationToken> + handleIncoming, + Action, IObserver>, CallHierarchyCapability, CancellationToken> + handleOutgoing, RegistrationOptionsDelegate registrationOptionsFactory ) : base(progressManager) { @@ -911,18 +999,33 @@ RegistrationOptionsDelegate>> results, CancellationToken cancellationToken) => + protected override void Handle( + CallHierarchyPrepareParams request, IObserver>> results, CancellationToken cancellationToken + ) + { _handleParams(request, results, Capability, cancellationToken); + } protected override void Handle( CallHierarchyIncomingCallsParams request, IObserver> results, CancellationToken cancellationToken - ) => _handleIncoming(request, results, Capability, cancellationToken); + ) + { + _handleIncoming(request, results, Capability, cancellationToken); + } protected override void Handle( CallHierarchyOutgoingCallsParams request, IObserver> results, CancellationToken cancellationToken - ) => _handleOutgoing(request, results, Capability, cancellationToken); + ) + { + _handleOutgoing(request, results, Capability, cancellationToken); + } - protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions(CallHierarchyCapability capability, ClientCapabilities clientCapabilities) => _registrationOptionsFactory(capability, clientCapabilities); + protected internal override CallHierarchyRegistrationOptions CreateRegistrationOptions( + CallHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } } } } diff --git a/src/Protocol/Features/Document/CodeActionFeature.cs b/src/Protocol/Features/Document/CodeActionFeature.cs index c89ea2556..19bf652b9 100644 --- a/src/Protocol/Features/Document/CodeActionFeature.cs +++ b/src/Protocol/Features/Document/CodeActionFeature.cs @@ -24,28 +24,29 @@ namespace Models /// [Parallel] [Method(TextDocumentNames.CodeAction, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(CodeActionRegistrationOptions)), Capability(typeof(CodeActionCapability)), Resolver(typeof(CodeAction))] - public partial record CodeActionParams : ITextDocumentIdentifierParams, IPartialItemsRequest, IWorkDoneProgressParams + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(CodeActionRegistrationOptions))] + [Capability(typeof(CodeActionCapability))] + [Resolver(typeof(CodeAction))] + public partial record CodeActionParams : ITextDocumentIdentifierParams, IPartialItemsRequest, + IWorkDoneProgressParams { /// /// The document in which the command was invoked. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The range for which the command was invoked. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// Context carrying additional information. /// - public CodeActionContext Context { get; init; } + public CodeActionContext Context { get; init; } = null!; } /// @@ -61,7 +62,7 @@ public record CodeActionContext /// that these accurately reflect the error state of the resource. The primary parameter /// to compute code actions is the provided range. /// - public Container Diagnostics { get; init; } + public Container Diagnostics { get; init; } = null!; /// /// Requested kind of actions to return. @@ -76,20 +77,18 @@ public record CodeActionContext [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] [Parallel] [Method(TextDocumentNames.CodeActionResolve, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CodeActionResolve"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)), - GenerateTypedData, - GenerateContainer - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CodeActionResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateTypedData] + [GenerateContainer] [Capability(typeof(CodeActionCapability))] public partial record CodeAction : ICanBeResolved, IRequest, IDoesNotParticipateInRegistration { /// /// A short, human-readable, title for this code action. /// - public string Title { get; init; } + public string Title { get; init; } = null!; /// /// The kind of the code action. @@ -133,19 +132,19 @@ public partial record CodeAction : ICanBeResolved, IRequest, IDoesNo /// /// Marks that the code action cannot currently be applied. - /// + /// /// Clients should follow the following guidelines regarding disabled code actions: - /// - /// - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) - /// code action menu. - /// - /// - Disabled actions are shown as faded out in the code action menu when the user request a more specific type - /// of code action, such as refactorings. - /// - /// - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) - /// that auto applies a code action and only a disabled code actions are returned, the client should show the user an - /// error message with `reason` in the editor. - /// + /// + /// - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) + /// code action menu. + /// + /// - Disabled actions are shown as faded out in the code action menu when the user request a more specific type + /// of code action, such as refactorings. + /// + /// - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) + /// that auto applies a code action and only a disabled code actions are returned, the client should show the user an + /// error message with `reason` in the editor. + /// /// @since 3.16.0 /// [Optional] @@ -161,24 +160,27 @@ public partial record CodeAction : ICanBeResolved, IRequest, IDoesNo private string DebuggerDisplay => $"[{Kind}] {Title}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } /// /// Marks that the code action cannot currently be applied. - /// + /// /// Clients should follow the following guidelines regarding disabled code actions: - /// - /// - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) - /// code action menu. - /// - /// - Disabled actions are shown as faded out in the code action menu when the user request a more specific type - /// of code action, such as refactorings. - /// - /// - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) - /// that auto applies a code action and only a disabled code actions are returned, the client should show the user an - /// error message with `reason` in the editor. - /// + /// + /// - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) + /// code action menu. + /// + /// - Disabled actions are shown as faded out in the code action menu when the user request a more specific type + /// of code action, such as refactorings. + /// + /// - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) + /// that auto applies a code action and only a disabled code actions are returned, the client should show the user an + /// error message with `reason` in the editor. + /// /// @since 3.16.0 /// public record CodeActionDisabled @@ -188,7 +190,7 @@ public record CodeActionDisabled /// /// This is displayed in the code actions UI. /// - public string Reason { get; init; } + public string Reason { get; init; } = null!; } [JsonConverter(typeof(CommandOrCodeActionConverter))] @@ -216,7 +218,8 @@ public CommandOrCodeAction(Command value) public Command? Command { get => _command; - set { + set + { _command = value; _codeAction = null; } @@ -227,7 +230,8 @@ public Command? Command public CodeAction? CodeAction { get => _codeAction; - set { + set + { _command = default; _codeAction = value; } @@ -235,29 +239,52 @@ public CodeAction? CodeAction public object? RawValue { - get { + get + { if (IsCommand) return Command!; if (IsCodeAction) return CodeAction!; return default; } } - public static CommandOrCodeAction From(Command value) => new(value); - public static implicit operator CommandOrCodeAction(Command value) => new(value); + public static CommandOrCodeAction From(Command value) + { + return new(value); + } + + public static implicit operator CommandOrCodeAction(Command value) + { + return new(value); + } + + public static CommandOrCodeAction From(CodeAction value) + { + return new(value); + } + + public static implicit operator CommandOrCodeAction(CodeAction value) + { + return new(value); + } - public static CommandOrCodeAction From(CodeAction value) => new(value); - public static implicit operator CommandOrCodeAction(CodeAction value) => new(value); - public static CommandOrCodeAction From(CodeAction value) where T : class?, IHandlerIdentity? => new(value); + public static CommandOrCodeAction From(CodeAction value) where T : class?, IHandlerIdentity? + { + return new(value); + } private string DebuggerDisplay => $"{( IsCommand ? $"command: {Command}" : IsCodeAction ? $"code action: {CodeAction}" : "..." )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } JToken? ICanBeResolved.Data { get => _codeAction?.Data; - init { + init + { if (_codeAction == null) return; _codeAction = _codeAction with { Data = value }; } @@ -266,7 +293,10 @@ public object? RawValue public partial class CodeActionContainer { - public static implicit operator CommandOrCodeActionContainer(CodeActionContainer container) => new(container.Select(CommandOrCodeAction.From)); + public static implicit operator CommandOrCodeActionContainer(CodeActionContainer container) + { + return new(container.Select(CommandOrCodeAction.From)); + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.CodeActionProvider))] @@ -292,7 +322,7 @@ public partial class CodeActionRegistrationOptions : IWorkDoneProgressOptions, I [Optional] public bool ResolveProvider { get; set; } - class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase + private class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase { private readonly IHandlersManager _handlersManager; @@ -303,7 +333,8 @@ public CodeActionRegistrationOptionsConverter(IHandlersManager handlersManager) public override StaticOptions Convert(CodeActionRegistrationOptions source) { - return new() { + return new() + { CodeActionKinds = source.CodeActionKinds, ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(ICodeActionResolveHandler)), WorkDoneProgress = source.WorkDoneProgress, @@ -408,8 +439,8 @@ public partial class CodeActionCapability : DynamicCapability public bool IsPreferredSupport { get; set; } /// - /// Whether code action supports the `disabled` property. - /// + /// Whether code action supports the `disabled` property. + /// /// @since 3.16.0 /// [Optional] diff --git a/src/Protocol/Features/Document/CodeLensFeature.cs b/src/Protocol/Features/Document/CodeLensFeature.cs index dee397f4d..66d7ea1d5 100644 --- a/src/Protocol/Features/Document/CodeLensFeature.cs +++ b/src/Protocol/Features/Document/CodeLensFeature.cs @@ -19,18 +19,18 @@ namespace Models { [Parallel] [Method(TextDocumentNames.CodeLens, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(CodeLensRegistrationOptions)), Capability(typeof(CodeLensCapability)), Resolver(typeof(CodeLens))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(CodeLensRegistrationOptions))] + [Capability(typeof(CodeLensCapability))] + [Resolver(typeof(CodeLens))] public partial record CodeLensParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, IPartialItemsRequest { /// /// The document to request code lens for. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; } /// @@ -43,20 +43,18 @@ public partial record CodeLensParams : ITextDocumentIdentifierParams, IWorkDoneP [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] [Parallel] [Method(TextDocumentNames.CodeLensResolve, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CodeLensResolve"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)), - GenerateTypedData, - GenerateContainer - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CodeLensResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateTypedData] + [GenerateContainer] [Capability(typeof(CodeLensCapability))] public partial record CodeLens : IRequest, ICanBeResolved, IDoesNotParticipateInRegistration { /// /// The range in which this code lens is valid. Should only span a single line. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The command this code lens represents. @@ -74,7 +72,10 @@ public partial record CodeLens : IRequest, ICanBeResolved, IDoesNotPar private string DebuggerDisplay => $"{Range}{( Command != null ? $" {Command}" : "" )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.CodeLensProvider))] @@ -99,7 +100,8 @@ public CodeLensRegistrationOptionsConverter(IHandlersManager handlersManager) public override StaticOptions Convert(CodeLensRegistrationOptions source) { - return new() { + return new() + { ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(ICodeLensResolveHandler)), WorkDoneProgress = source.WorkDoneProgress }; @@ -112,12 +114,11 @@ namespace Models { [Parallel] [Method(WorkspaceNames.CodeLensRefresh, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(CodeLensWorkspaceClientCapabilities))] - public partial record CodeLensRefreshParams : IRequest - { - } + public partial record CodeLensRefreshParams : IRequest; } namespace Client.Capabilities diff --git a/src/Protocol/Features/Document/ColorFeature.cs b/src/Protocol/Features/Document/ColorFeature.cs index 852868d44..ee8d60b24 100644 --- a/src/Protocol/Features/Document/ColorFeature.cs +++ b/src/Protocol/Features/Document/ColorFeature.cs @@ -15,12 +15,11 @@ namespace Models { [Parallel] [Method(TextDocumentNames.DocumentColor, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentColorRegistrationOptions)), Capability(typeof(ColorProviderCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentColorRegistrationOptions))] + [Capability(typeof(ColorProviderCapability))] public partial record DocumentColorParams : IPartialItemsRequest, ColorInformation>, IWorkDoneProgressParams { /// @@ -43,7 +42,8 @@ public partial record ColorInformation public ColorPresentationParams For(TextDocumentIdentifier textDocumentIdentifier) { - return new ColorPresentationParams() { + return new ColorPresentationParams + { Color = Color, Range = Range, TextDocument = textDocumentIdentifier @@ -53,18 +53,16 @@ public ColorPresentationParams For(TextDocumentIdentifier textDocumentIdentifier [Parallel] [Method(TextDocumentNames.ColorPresentation, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [Capability(typeof(ColorProviderCapability))] public partial record ColorPresentationParams : ColorInformation, IRequest>, IDoesNotParticipateInRegistration { /// /// The document to provide document links for. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; } public partial record ColorPresentation @@ -74,7 +72,7 @@ public partial record ColorPresentation /// picker header. By default this is also the text that is inserted when selecting /// this color presentation. /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// An [edit](#TextEdit) which is applied to a document when selecting @@ -121,7 +119,10 @@ public record DocumentColor private string DebuggerDisplay => $"R:{Red} G:{Green} B:{Blue} A:{Alpha}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.ColorProvider))] diff --git a/src/Protocol/Features/Document/DeclarationFeature.cs b/src/Protocol/Features/Document/DeclarationFeature.cs index 179d73a6e..38654f594 100644 --- a/src/Protocol/Features/Document/DeclarationFeature.cs +++ b/src/Protocol/Features/Document/DeclarationFeature.cs @@ -12,13 +12,13 @@ namespace Models { [Parallel] [Method(TextDocumentNames.Declaration, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DeclarationRegistrationOptions)), Capability(typeof(DeclarationCapability))] - public partial record DeclarationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest { } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DeclarationRegistrationOptions))] + [Capability(typeof(DeclarationCapability))] + public partial record DeclarationParams : TextDocumentPositionParams, IWorkDoneProgressParams, + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.DeclarationProvider))] [RegistrationName(TextDocumentNames.Declaration)] diff --git a/src/Protocol/Features/Document/DefinitionFeature.cs b/src/Protocol/Features/Document/DefinitionFeature.cs index 53bf9f6b2..8da8b62d4 100644 --- a/src/Protocol/Features/Document/DefinitionFeature.cs +++ b/src/Protocol/Features/Document/DefinitionFeature.cs @@ -12,15 +12,13 @@ namespace Models { [Parallel] [Method(TextDocumentNames.Definition, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DefinitionRegistrationOptions)), Capability(typeof(DefinitionCapability))] - public partial record DefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DefinitionRegistrationOptions))] + [Capability(typeof(DefinitionCapability))] + public partial record DefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.DefinitionProvider))] [RegistrationName(TextDocumentNames.Definition)] diff --git a/src/Protocol/Features/Document/DocumentFormattingFeature.cs b/src/Protocol/Features/Document/DocumentFormattingFeature.cs index 672150ca8..71bb4201a 100644 --- a/src/Protocol/Features/Document/DocumentFormattingFeature.cs +++ b/src/Protocol/Features/Document/DocumentFormattingFeature.cs @@ -13,28 +13,29 @@ namespace Models { [Parallel] [Method(TextDocumentNames.DocumentFormatting, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentFormattingRegistrationOptions)), Capability(typeof(DocumentFormattingCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentFormattingRegistrationOptions))] + [Capability(typeof(DocumentFormattingCapability))] public partial record DocumentFormattingParams : ITextDocumentIdentifierParams, IRequest, IWorkDoneProgressParams { /// /// The document to format. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The format options. /// - public FormattingOptions Options { get; init; } + public FormattingOptions Options { get; init; } = null!; } [GenerateRegistrationOptions(nameof(ServerCapabilities.DocumentFormattingProvider))] [RegistrationName(TextDocumentNames.DocumentFormatting)] - public partial class DocumentFormattingRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions { } + public partial class DocumentFormattingRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + } } namespace Client.Capabilities diff --git a/src/Protocol/Features/Document/DocumentHighlightFeature.cs b/src/Protocol/Features/Document/DocumentHighlightFeature.cs index 924186884..552354a3d 100644 --- a/src/Protocol/Features/Document/DocumentHighlightFeature.cs +++ b/src/Protocol/Features/Document/DocumentHighlightFeature.cs @@ -14,15 +14,13 @@ namespace Models { [Parallel] [Method(TextDocumentNames.DocumentHighlight, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentHighlightRegistrationOptions)), Capability(typeof(DocumentHighlightCapability))] - public partial record DocumentHighlightParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentHighlightRegistrationOptions))] + [Capability(typeof(DocumentHighlightCapability))] + public partial record DocumentHighlightParams : TextDocumentPositionParams, IWorkDoneProgressParams, + IPartialItemsRequest; /// /// A document highlight is a range inside a text document which deserves @@ -36,7 +34,7 @@ public partial record DocumentHighlight /// /// The range this highlight applies to. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The highlight kind, default is DocumentHighlightKind.Text. diff --git a/src/Protocol/Features/Document/DocumentLinkFeature.cs b/src/Protocol/Features/Document/DocumentLinkFeature.cs index 9806bc14d..5dd5dd796 100644 --- a/src/Protocol/Features/Document/DocumentLinkFeature.cs +++ b/src/Protocol/Features/Document/DocumentLinkFeature.cs @@ -18,18 +18,19 @@ namespace Models { [Parallel] [Method(TextDocumentNames.DocumentLink, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentLinkRegistrationOptions)), Capability(typeof(DocumentLinkCapability)), Resolver(typeof(DocumentLink))] - public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IPartialItemsRequest, IWorkDoneProgressParams + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentLinkRegistrationOptions))] + [Capability(typeof(DocumentLinkCapability))] + [Resolver(typeof(DocumentLink))] + public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IPartialItemsRequest, + IWorkDoneProgressParams { /// /// The document to provide document links for. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; } /// @@ -39,20 +40,18 @@ public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IParti [Parallel] [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] [Method(TextDocumentNames.DocumentLinkResolve, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "DocumentLinkResolve"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)), - GenerateTypedData, - GenerateContainer - ] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "DocumentLinkResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateTypedData] + [GenerateContainer] [Capability(typeof(DocumentLinkCapability))] public partial record DocumentLink : ICanBeResolved, IRequest, IDoesNotParticipateInRegistration { /// /// The range this link applies to. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The uri this link points to. If missing a resolve request is sent later. @@ -79,10 +78,14 @@ public partial record DocumentLink : ICanBeResolved, IRequest, IDo [Optional] public string? Tooltip { get; init; } - private string DebuggerDisplay => $"{Range}{( Target is not null ? $" {Target}" : "" )}{( string.IsNullOrWhiteSpace(Tooltip) ? $" {Tooltip}" : "" )}"; + private string DebuggerDisplay => + $"{Range}{( Target is not null ? $" {Target}" : "" )}{( string.IsNullOrWhiteSpace(Tooltip) ? $" {Tooltip}" : "" )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.DocumentLinkProvider))] @@ -96,7 +99,7 @@ public partial class DocumentLinkRegistrationOptions : ITextDocumentRegistration [Optional] public bool ResolveProvider { get; set; } - class DocumentLinkRegistrationOptionsConverter : RegistrationOptionsConverterBase + private class DocumentLinkRegistrationOptionsConverter : RegistrationOptionsConverterBase { private readonly IHandlersManager _handlersManager; @@ -105,10 +108,14 @@ public DocumentLinkRegistrationOptionsConverter(IHandlersManager handlersManager _handlersManager = handlersManager; } - public override StaticOptions Convert(DocumentLinkRegistrationOptions source) => new() { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IDocumentLinkResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; + public override StaticOptions Convert(DocumentLinkRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IDocumentLinkResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } } } } diff --git a/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs b/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs index 44d6b9229..548d6704d 100644 --- a/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs +++ b/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs @@ -15,34 +15,33 @@ namespace Models { [Parallel] [Method(TextDocumentNames.OnTypeFormatting, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentOnTypeFormattingRegistrationOptions)), Capability(typeof(DocumentOnTypeFormattingCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentOnTypeFormattingRegistrationOptions))] + [Capability(typeof(DocumentOnTypeFormattingCapability))] public partial record DocumentOnTypeFormattingParams : ITextDocumentIdentifierParams, IRequest { /// /// The document to format. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The position at which this request was sent. /// - public Position Position { get; init; } + public Position Position { get; init; } = null!; /// /// The character that has been typed. /// [JsonProperty("ch")] - public string Character { get; init; } + public string Character { get; init; } = null!; /// /// The format options. /// - public FormattingOptions Options { get; init; } + public FormattingOptions Options { get; init; } = null!; } [GenerateRegistrationOptions(nameof(ServerCapabilities.DocumentOnTypeFormattingProvider))] diff --git a/src/Protocol/Features/Document/DocumentRangeFormattingFeature.cs b/src/Protocol/Features/Document/DocumentRangeFormattingFeature.cs index faca31fcd..3a9d1168b 100644 --- a/src/Protocol/Features/Document/DocumentRangeFormattingFeature.cs +++ b/src/Protocol/Features/Document/DocumentRangeFormattingFeature.cs @@ -13,28 +13,27 @@ namespace Models { [Parallel] [Method(TextDocumentNames.RangeFormatting, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentRangeFormattingRegistrationOptions)), Capability(typeof(DocumentRangeFormattingCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentRangeFormattingRegistrationOptions))] + [Capability(typeof(DocumentRangeFormattingCapability))] public partial record DocumentRangeFormattingParams : ITextDocumentIdentifierParams, IRequest, IWorkDoneProgressParams { /// /// The document to format. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The range to format /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The format options /// - public FormattingOptions Options { get; init; } + public FormattingOptions Options { get; init; } = null!; } [GenerateRegistrationOptions(nameof(ServerCapabilities.DocumentRangeFormattingProvider))] diff --git a/src/Protocol/Features/Document/DocumentSymbolFeature.cs b/src/Protocol/Features/Document/DocumentSymbolFeature.cs index c1974af9a..067e65fbd 100644 --- a/src/Protocol/Features/Document/DocumentSymbolFeature.cs +++ b/src/Protocol/Features/Document/DocumentSymbolFeature.cs @@ -16,20 +16,19 @@ namespace Models { [Parallel] [Method(TextDocumentNames.DocumentSymbol, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DocumentSymbolRegistrationOptions)), Capability(typeof(DocumentSymbolCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DocumentSymbolRegistrationOptions))] + [Capability(typeof(DocumentSymbolCapability))] public partial record DocumentSymbolParams : ITextDocumentIdentifierParams, - IPartialItemsRequest, - IWorkDoneProgressParams + IPartialItemsRequest, + IWorkDoneProgressParams { /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; } [JsonConverter(typeof(SymbolInformationOrDocumentSymbolConverter))] @@ -55,18 +54,34 @@ public SymbolInformationOrDocumentSymbol(SymbolInformation symbolInformation) public bool IsDocumentSymbol => DocumentSymbol != null; public DocumentSymbol? DocumentSymbol { get; } - public static SymbolInformationOrDocumentSymbol Create(SymbolInformation value) => value; + public static SymbolInformationOrDocumentSymbol Create(SymbolInformation value) + { + return value; + } - public static SymbolInformationOrDocumentSymbol Create(DocumentSymbol value) => value; + public static SymbolInformationOrDocumentSymbol Create(DocumentSymbol value) + { + return value; + } - public static implicit operator SymbolInformationOrDocumentSymbol(SymbolInformation value) => new SymbolInformationOrDocumentSymbol(value); + public static implicit operator SymbolInformationOrDocumentSymbol(SymbolInformation value) + { + return new SymbolInformationOrDocumentSymbol(value); + } - public static implicit operator SymbolInformationOrDocumentSymbol(DocumentSymbol value) => new SymbolInformationOrDocumentSymbol(value); + public static implicit operator SymbolInformationOrDocumentSymbol(DocumentSymbol value) + { + return new SymbolInformationOrDocumentSymbol(value); + } - private string DebuggerDisplay => IsDocumentSymbol ? DocumentSymbol!.ToString() : IsDocumentSymbolInformation ? SymbolInformation!.ToString() : string.Empty; + private string DebuggerDisplay => + IsDocumentSymbol ? DocumentSymbol!.ToString() : IsDocumentSymbolInformation ? SymbolInformation!.ToString() : string.Empty; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } /// @@ -80,7 +95,7 @@ public record DocumentSymbol /// /// The name of this symbol. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// More detail for this symbol, e.g the signature of a function. If not provided the @@ -113,13 +128,13 @@ public record DocumentSymbol /// like comments. This information is typically used to determine if the the clients cursor is /// inside the symbol to reveal in the symbol in the UI. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. /// Must be contained by the the `range`. /// - public Range SelectionRange { get; init; } + public Range SelectionRange { get; init; } = null!; /// /// Children of this symbol, e.g. properties of a class. @@ -130,7 +145,10 @@ public record DocumentSymbol private string DebuggerDisplay => $"[{Kind}] {Name} {{ range: {Range}, selection: {SelectionRange}, detail: {Detail ?? string.Empty} }}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.DocumentSymbolProvider))] diff --git a/src/Protocol/Features/Document/FoldingRangeFeature.cs b/src/Protocol/Features/Document/FoldingRangeFeature.cs index e4fdb7652..344114a6c 100644 --- a/src/Protocol/Features/Document/FoldingRangeFeature.cs +++ b/src/Protocol/Features/Document/FoldingRangeFeature.cs @@ -17,18 +17,18 @@ namespace Models { [Parallel] [Method(TextDocumentNames.FoldingRange, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "FoldingRange"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(FoldingRangeRegistrationOptions)), Capability(typeof(FoldingRangeCapability))] - public partial record FoldingRangeRequestParam : ITextDocumentIdentifierParams, IPartialItemsRequest?, FoldingRange>, IWorkDoneProgressParams + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "FoldingRange")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(FoldingRangeRegistrationOptions))] + [Capability(typeof(FoldingRangeCapability))] + public partial record FoldingRangeRequestParam : ITextDocumentIdentifierParams, IPartialItemsRequest?, FoldingRange>, + IWorkDoneProgressParams { /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; } /// @@ -41,7 +41,7 @@ public partial record FoldingRange /// The zero-based line number from where the folded range starts. /// /// - /// in the LSP spec + /// in the LSP spec /// public int StartLine { get; init; } @@ -49,7 +49,7 @@ public partial record FoldingRange /// The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. /// /// - /// in the LSP spec + /// in the LSP spec /// [Optional] public int? StartCharacter { get; init; } @@ -58,7 +58,7 @@ public partial record FoldingRange /// The zero-based line number where the folded range ends. /// /// - /// in the LSP spec + /// in the LSP spec /// public int EndLine { get; init; } @@ -66,7 +66,7 @@ public partial record FoldingRange /// The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. /// /// - /// in the LSP spec + /// in the LSP spec /// [Optional] public int? EndCharacter { get; init; } @@ -83,7 +83,10 @@ public partial record FoldingRange $"[start: (line: {StartLine}{( StartCharacter.HasValue ? $", char: {StartCharacter}" : string.Empty )}), end: (line: {EndLine}, char: {( EndCharacter.HasValue ? $", char: {EndCharacter}" : string.Empty )})]"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } /// @@ -125,7 +128,7 @@ public partial class FoldingRangeCapability : DynamicCapability /// hint, servers are free to follow the limit. /// /// - /// in the LSP spec + /// in the LSP spec /// [Optional] public int? RangeLimit { get; set; } diff --git a/src/Protocol/Features/Document/HoverFeature.cs b/src/Protocol/Features/Document/HoverFeature.cs index 5c04e61c1..beaf09bca 100644 --- a/src/Protocol/Features/Document/HoverFeature.cs +++ b/src/Protocol/Features/Document/HoverFeature.cs @@ -16,15 +16,12 @@ namespace Models { [Parallel] [Method(TextDocumentNames.Hover, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(HoverRegistrationOptions)), Capability(typeof(HoverCapability))] - public partial record HoverParams : TextDocumentPositionParams, IWorkDoneProgressParams, IRequest - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(HoverRegistrationOptions))] + [Capability(typeof(HoverCapability))] + public partial record HoverParams : TextDocumentPositionParams, IWorkDoneProgressParams, IRequest; /// /// The result of a hover request. @@ -35,7 +32,7 @@ public partial record Hover /// /// The hover's content /// - public MarkedStringsOrMarkupContent Contents { get; init; } + public MarkedStringsOrMarkupContent Contents { get; init; } = null!; /// /// An optional range is a range inside a text document @@ -47,12 +44,17 @@ public partial record Hover private string DebuggerDisplay => $"{Contents}{( Range is not null ? $" {Range}" : string.Empty )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.HoverProvider))] [RegistrationName(TextDocumentNames.Hover)] - public partial class HoverRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions { } + public partial class HoverRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + } } namespace Client.Capabilities diff --git a/src/Protocol/Features/Document/ImplementationFeature.cs b/src/Protocol/Features/Document/ImplementationFeature.cs index 668af7fa1..0d0bf5394 100644 --- a/src/Protocol/Features/Document/ImplementationFeature.cs +++ b/src/Protocol/Features/Document/ImplementationFeature.cs @@ -12,18 +12,19 @@ namespace Models { [Parallel] [Method(TextDocumentNames.Implementation, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(ImplementationRegistrationOptions)), Capability(typeof(ImplementationCapability))] - public partial record ImplementationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest { } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(ImplementationRegistrationOptions))] + [Capability(typeof(ImplementationCapability))] + public partial record ImplementationParams : TextDocumentPositionParams, IWorkDoneProgressParams, + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.ImplementationProvider))] [RegistrationName(TextDocumentNames.Implementation)] - public partial class ImplementationRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions { } - + public partial class ImplementationRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions + { + } } namespace Client.Capabilities diff --git a/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs b/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs index 56648f81a..36e2efaf5 100644 --- a/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs +++ b/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs @@ -14,22 +14,20 @@ namespace Models { [Parallel] [Method(TextDocumentNames.LinkedEditingRange, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(LinkedEditingRangeRegistrationOptions)), Capability(typeof(LinkedEditingRangeClientCapabilities))] - public partial record LinkedEditingRangeParams : TextDocumentPositionParams, IWorkDoneProgressParams, IRequest - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(LinkedEditingRangeRegistrationOptions))] + [Capability(typeof(LinkedEditingRangeClientCapabilities))] + public partial record LinkedEditingRangeParams : TextDocumentPositionParams, IWorkDoneProgressParams, IRequest; + public partial record LinkedEditingRanges { /// /// A list of ranges that can be renamed together. The ranges must have /// identical length and contain identical text content. The ranges cannot overlap. /// - public Container Ranges { get; init; } + public Container Ranges { get; init; } = null!; /// /// An optional word pattern (regular expression) that describes valid contents for @@ -39,16 +37,20 @@ public partial record LinkedEditingRanges [Optional] public string? WordPattern { get; init; } } + [GenerateRegistrationOptions(nameof(ServerCapabilities.LinkedEditingRangeProvider))] [RegistrationName(TextDocumentNames.LinkedEditingRange)] - public partial class LinkedEditingRangeRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions { } - + public partial class LinkedEditingRangeRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + } } namespace Client.Capabilities { [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.LinkedEditingRange))] - public partial class LinkedEditingRangeClientCapabilities : DynamicCapability { } + public partial class LinkedEditingRangeClientCapabilities : DynamicCapability + { + } } namespace Document diff --git a/src/Protocol/Features/Document/MonikerFeature.cs b/src/Protocol/Features/Document/MonikerFeature.cs index c01b235bf..fe9cfab03 100644 --- a/src/Protocol/Features/Document/MonikerFeature.cs +++ b/src/Protocol/Features/Document/MonikerFeature.cs @@ -23,15 +23,12 @@ namespace Models /// [Parallel] [Method(TextDocumentNames.Moniker, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(MonikerRegistrationOptions)), Capability(typeof(MonikerCapability))] - public partial record MonikerParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest?, Moniker> - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(MonikerRegistrationOptions))] + [Capability(typeof(MonikerCapability))] + public partial record MonikerParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest?, Moniker>; /// /// Moniker definition to match LSIF 0.5 moniker definition. @@ -41,13 +38,13 @@ public partial record Moniker /// /// The scheme of the moniker. For example tsc or .Net /// - public string Scheme { get; init; } + public string Scheme { get; init; } = null!; /// /// The identifier of the moniker. The value is opaque in LSIF however /// schema owners are allowed to define the structure if they want. /// - public string Identifier { get; init; } + public string Identifier { get; init; } = null!; /// /// The scope in which the moniker is unique @@ -70,18 +67,18 @@ public readonly partial struct MonikerKind /// /// The moniker represent a symbol that is imported into a project /// - public static readonly MonikerKind Import = new MonikerKind("import"); + public static MonikerKind Import { get; } = new MonikerKind("import"); /// /// The moniker represents a symbol that is exported from a project /// - public static readonly MonikerKind Export = new MonikerKind("export"); + public static MonikerKind Export { get; } = new MonikerKind("export"); /// /// The moniker represents a symbol that is local to a project (e.g. a local /// variable of a function, a class not visible outside the project, ...) /// - public static readonly MonikerKind Local = new MonikerKind("local"); + public static MonikerKind Local { get; } = new MonikerKind("local"); } @@ -94,28 +91,29 @@ public readonly partial struct UniquenessLevel /// /// The moniker is only unique inside a document /// - public static readonly UniquenessLevel Document = new UniquenessLevel("document"); + public static UniquenessLevel Document { get; } = new UniquenessLevel("document"); /// /// The moniker is unique inside a project for which a dump got created /// - public static readonly UniquenessLevel Project = new UniquenessLevel("project"); + public static UniquenessLevel Project { get; } = new UniquenessLevel("project"); /// /// The moniker is unique inside the group to which a project belongs /// - public static readonly UniquenessLevel Group = new UniquenessLevel("group"); + public static UniquenessLevel Group { get; } = new UniquenessLevel("group"); /// /// The moniker is unique inside the moniker scheme. /// - public static readonly UniquenessLevel Scheme = new UniquenessLevel("scheme"); + public static UniquenessLevel Scheme { get; } = new UniquenessLevel("scheme"); /// /// The moniker is globally unique /// - public static readonly UniquenessLevel Global = new UniquenessLevel("global"); + public static UniquenessLevel Global { get; } = new UniquenessLevel("global"); } + [GenerateRegistrationOptions(nameof(ServerCapabilities.MonikerProvider))] [RegistrationName(TextDocumentNames.Moniker)] public partial class MonikerRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions diff --git a/src/Protocol/Features/Document/RenameFeature.cs b/src/Protocol/Features/Document/RenameFeature.cs index 5915060e2..48ae01358 100644 --- a/src/Protocol/Features/Document/RenameFeature.cs +++ b/src/Protocol/Features/Document/RenameFeature.cs @@ -16,50 +16,46 @@ namespace Models { [Parallel] [Method(TextDocumentNames.Rename, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(RenameRegistrationOptions)), Capability(typeof(RenameCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(RenameRegistrationOptions))] + [Capability(typeof(RenameCapability))] public partial record RenameParams : ITextDocumentIdentifierParams, IRequest, IWorkDoneProgressParams { /// /// The document to format. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The position at which this request was sent. /// - public Position Position { get; init; } + public Position Position { get; init; } = null!; /// /// The new name of the symbol. If the given name is not valid the /// request must return a [ResponseError](#ResponseError) with an /// appropriate message set. /// - public string NewName { get; init; } + public string NewName { get; init; } = null!; } [Parallel] [Method(TextDocumentNames.PrepareRename, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(RenameRegistrationOptions)), Capability(typeof(RenameCapability))] - public partial record PrepareRenameParams : TextDocumentPositionParams, IRequest - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(RenameRegistrationOptions))] + [Capability(typeof(RenameCapability))] + public partial record PrepareRenameParams : TextDocumentPositionParams, IRequest; [JsonConverter(typeof(RangeOrPlaceholderRangeConverter))] public record RangeOrPlaceholderRange { - private RenameDefaultBehavior? _renameDefaultBehavior; - private Range? _range; - private PlaceholderRange? _placeholderRange; + private readonly RenameDefaultBehavior? _renameDefaultBehavior; + private readonly Range? _range; + private readonly PlaceholderRange? _placeholderRange; public RangeOrPlaceholderRange(Range value) { @@ -81,7 +77,8 @@ public RangeOrPlaceholderRange(RenameDefaultBehavior renameDefaultBehavior) public PlaceholderRange? PlaceholderRange { get => _placeholderRange; - init { + init + { _placeholderRange = value; _renameDefaultBehavior = default; _range = null; @@ -93,7 +90,8 @@ public PlaceholderRange? PlaceholderRange public Range? Range { get => _range; - init { + init + { _placeholderRange = default; _renameDefaultBehavior = default; _range = value; @@ -105,7 +103,8 @@ public Range? Range public RenameDefaultBehavior? DefaultBehavior { get => _renameDefaultBehavior; - init { + init + { _placeholderRange = default; _renameDefaultBehavior = value; _range = default; @@ -114,7 +113,8 @@ public RenameDefaultBehavior? DefaultBehavior public object? RawValue { - get { + get + { if (IsPlaceholderRange) return PlaceholderRange; if (IsRange) return Range; if (IsDefaultBehavior) return DefaultBehavior; @@ -122,15 +122,21 @@ public object? RawValue } } - public static implicit operator RangeOrPlaceholderRange(PlaceholderRange value) => new RangeOrPlaceholderRange(value); + public static implicit operator RangeOrPlaceholderRange(PlaceholderRange value) + { + return new RangeOrPlaceholderRange(value); + } - public static implicit operator RangeOrPlaceholderRange(Range value) => new RangeOrPlaceholderRange(value); + public static implicit operator RangeOrPlaceholderRange(Range value) + { + return new RangeOrPlaceholderRange(value); + } } public record PlaceholderRange { - public Range Range { get; init; } - public string Placeholder { get; init; } + public Range Range { get; init; } = null!; + public string Placeholder { get; init; } = null!; } public record RenameDefaultBehavior diff --git a/src/Protocol/Features/Document/SelectionRangeFeature.cs b/src/Protocol/Features/Document/SelectionRangeFeature.cs index 3f5db9a38..035eea136 100644 --- a/src/Protocol/Features/Document/SelectionRangeFeature.cs +++ b/src/Protocol/Features/Document/SelectionRangeFeature.cs @@ -14,23 +14,23 @@ namespace Models { [Parallel] [Method(TextDocumentNames.SelectionRange, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(SelectionRangeRegistrationOptions)), Capability(typeof(SelectionRangeCapability))] - public partial record SelectionRangeParams : ITextDocumentIdentifierParams, IPartialItemsRequest?, SelectionRange>, IWorkDoneProgressParams + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(SelectionRangeRegistrationOptions))] + [Capability(typeof(SelectionRangeCapability))] + public partial record SelectionRangeParams : ITextDocumentIdentifierParams, IPartialItemsRequest?, SelectionRange>, + IWorkDoneProgressParams { /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The positions inside the text document. /// - public Container Positions { get; init; } + public Container Positions { get; init; } = null!; } [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] @@ -39,22 +39,27 @@ public partial record SelectionRange /// /// The [range](#Range) of this selection range. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The parent selection range containing this range. Therefore `parent.range` must contain `this.range`. /// - public SelectionRange Parent { get; init; } + public SelectionRange Parent { get; init; } = null!; private string DebuggerDisplay => $"{Range} {{{Parent}}}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.SelectionRangeProvider))] [RegistrationName(TextDocumentNames.SelectionRange)] - public partial class SelectionRangeRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions { } + public partial class SelectionRangeRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions + { + } } namespace Client.Capabilities diff --git a/src/Protocol/Features/Document/SemanticTokensFeature.cs b/src/Protocol/Features/Document/SemanticTokensFeature.cs index 99f1236cc..7185fdfca 100644 --- a/src/Protocol/Features/Document/SemanticTokensFeature.cs +++ b/src/Protocol/Features/Document/SemanticTokensFeature.cs @@ -30,19 +30,18 @@ namespace Models /// [Parallel] [Method(TextDocumentNames.SemanticTokensFull, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "SemanticTokensFull"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(SemanticTokensRegistrationOptions)), Capability(typeof(SemanticTokensCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "SemanticTokensFull")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(SemanticTokensRegistrationOptions))] + [Capability(typeof(SemanticTokensCapability))] public partial record SemanticTokensParams : IWorkDoneProgressParams, ITextDocumentIdentifierParams, IPartialItemRequest { /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; } /// @@ -50,24 +49,24 @@ public partial record SemanticTokensParams : IWorkDoneProgressParams, ITextDocum /// [Parallel] [Method(TextDocumentNames.SemanticTokensFullDelta, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(SemanticTokensRegistrationOptions)), Capability(typeof(SemanticTokensCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(SemanticTokensRegistrationOptions))] + [Capability(typeof(SemanticTokensCapability))] public partial record SemanticTokensDeltaParams : IWorkDoneProgressParams, ITextDocumentIdentifierParams, - IPartialItemRequest, IDoesNotParticipateInRegistration + IPartialItemRequest, + IDoesNotParticipateInRegistration { /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The previous result id. /// - public string PreviousResultId { get; init; } + public string PreviousResultId { get; init; } = null!; } /// @@ -75,34 +74,32 @@ public partial record SemanticTokensDeltaParams : IWorkDoneProgressParams, IText /// [Parallel] [Method(TextDocumentNames.SemanticTokensRange, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(SemanticTokensRegistrationOptions)), Capability(typeof(SemanticTokensCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(SemanticTokensRegistrationOptions))] + [Capability(typeof(SemanticTokensCapability))] public partial record SemanticTokensRangeParams : IWorkDoneProgressParams, ITextDocumentIdentifierParams, IPartialItemRequest, IDoesNotParticipateInRegistration { /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The range the semantic tokens are requested for. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; } [Parallel] [Method(WorkspaceNames.SemanticTokensRefresh, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(SemanticTokensWorkspaceCapability))] - public partial record SemanticTokensRefreshParams : IRequest - { - } + public partial record SemanticTokensRefreshParams : IRequest; public interface ISemanticTokenResult { @@ -145,15 +142,19 @@ public SemanticTokens(SemanticTokensPartialResult partialResult) /// https://github.com/microsoft/vscode-extension-samples/blob/5ae1f7787122812dcc84e37427ca90af5ee09f14/semantic-tokens-sample/vscode.proposed.d.ts#L71 /// /// - /// in the LSP spec + /// in the LSP spec /// public ImmutableArray Data { get; init; } [return: NotNullIfNotNull("result")] - public static SemanticTokens? From(SemanticTokensPartialResult? result) => result switch { - not null => new SemanticTokens(result), - _ => null - }; + public static SemanticTokens? From(SemanticTokensPartialResult? result) + { + return result switch + { + not null => new SemanticTokens(result), + _ => null + }; + } } /// @@ -168,9 +169,14 @@ public partial record SemanticTokensPartialResult /// public ImmutableArray Data { get; init; } - public SemanticTokensPartialResult() {} + public SemanticTokensPartialResult() + { + } - internal SemanticTokensPartialResult(SemanticTokens? result) => Data = result?.Data ?? ImmutableArray.Empty; + internal SemanticTokensPartialResult(SemanticTokens? result) + { + Data = result?.Data ?? ImmutableArray.Empty; + } } @@ -201,7 +207,7 @@ public SemanticTokensDelta(SemanticTokensDeltaPartialResult partialResult) /// For a detailed description how these edits are structured pls see /// https://github.com/microsoft/vscode-extension-samples/blob/5ae1f7787122812dcc84e37427ca90af5ee09f14/semantic-tokens-sample/vscode.proposed.d.ts#L131 /// - public Container Edits { get; init; } + public Container Edits { get; init; } = null!; } /// @@ -214,11 +220,16 @@ public record SemanticTokensDeltaPartialResult /// structured pls see /// https://github.com/microsoft/vscode-extension-samples/blob/5ae1f7787122812dcc84e37427ca90af5ee09f14/semantic-tokens-sample/vscode.proposed.d.ts#L71 /// - public Container Edits { get; init; } - public SemanticTokensDeltaPartialResult() {} + public Container Edits { get; init; } = null!; - internal SemanticTokensDeltaPartialResult(SemanticTokensDelta? result) => Edits = result?.Edits ?? new Container(); + public SemanticTokensDeltaPartialResult() + { + } + internal SemanticTokensDeltaPartialResult(SemanticTokensDelta? result) + { + Edits = result?.Edits ?? new Container(); + } } /// @@ -230,7 +241,7 @@ public record SemanticTokensEdit /// The start index of the edit /// /// - /// in the LSP spec + /// in the LSP spec /// public int Start { get; init; } @@ -238,7 +249,7 @@ public record SemanticTokensEdit /// The number of items to delete /// /// - /// in the LSP spec + /// in the LSP spec /// public int DeleteCount { get; init; } @@ -248,7 +259,7 @@ public record SemanticTokensEdit /// https://github.com/microsoft/vscode-extension-samples/blob/5ae1f7787122812dcc84e37427ca90af5ee09f14/semantic-tokens-sample/vscode.proposed.d.ts#L71 /// /// - /// in the LSP spec + /// in the LSP spec /// [Optional] public ImmutableArray? Data { get; init; } = ImmutableArray.Empty; @@ -276,7 +287,8 @@ public SemanticTokensFullOrDelta(SemanticTokensFullOrDeltaPartialResult partialR if (partialResult.IsDelta) { - Delta = new SemanticTokensDelta(partialResult.Delta!) { + Delta = new SemanticTokensDelta(partialResult.Delta!) + { Edits = partialResult.Delta!.Edits }; } @@ -294,41 +306,64 @@ public SemanticTokensFullOrDelta(SemanticTokensFullOrDeltaPartialResult partialR public SemanticTokensDelta? Delta { get; init; } [return: NotNullIfNotNull("semanticTokensDelta")] - public static SemanticTokensFullOrDelta? From(SemanticTokensDelta? semanticTokensDelta) => semanticTokensDelta switch { - not null => new(semanticTokensDelta), - _ => null - }; + public static SemanticTokensFullOrDelta? From(SemanticTokensDelta? semanticTokensDelta) + { + return semanticTokensDelta switch + { + not null => new(semanticTokensDelta), + _ => null + }; + } [return: NotNullIfNotNull("semanticTokensDelta")] - public static implicit operator SemanticTokensFullOrDelta?(SemanticTokensDelta? semanticTokensDelta) => semanticTokensDelta switch { - not null => new(semanticTokensDelta), - _ => null - }; + public static implicit operator SemanticTokensFullOrDelta?(SemanticTokensDelta? semanticTokensDelta) + { + return semanticTokensDelta switch + { + not null => new(semanticTokensDelta), + _ => null + }; + } [return: NotNullIfNotNull("semanticTokens")] - public static SemanticTokensFullOrDelta? From(SemanticTokens? semanticTokens) => semanticTokens switch { - not null => new(semanticTokens), - _ => null - }; + public static SemanticTokensFullOrDelta? From(SemanticTokens? semanticTokens) + { + return semanticTokens switch + { + not null => new(semanticTokens), + _ => null + }; + } [return: NotNullIfNotNull("semanticTokens")] - public static implicit operator SemanticTokensFullOrDelta?(SemanticTokens? semanticTokens) => semanticTokens switch { - not null => new(semanticTokens), - _ => null - }; + public static implicit operator SemanticTokensFullOrDelta?(SemanticTokens? semanticTokens) + { + return semanticTokens switch + { + not null => new(semanticTokens), + _ => null + }; + } [return: NotNullIfNotNull("semanticTokens")] - public static SemanticTokensFullOrDelta? From(SemanticTokensFullOrDeltaPartialResult? semanticTokens) => semanticTokens switch { - not null => new(semanticTokens), - _ => null - }; + public static SemanticTokensFullOrDelta? From(SemanticTokensFullOrDeltaPartialResult? semanticTokens) + { + return semanticTokens switch + { + not null => new(semanticTokens), + _ => null + }; + } [return: NotNullIfNotNull("semanticTokens")] - public static implicit operator SemanticTokensFullOrDelta?(SemanticTokensFullOrDeltaPartialResult? semanticTokens) => - semanticTokens switch { + public static implicit operator SemanticTokensFullOrDelta?(SemanticTokensFullOrDeltaPartialResult? semanticTokens) + { + return semanticTokens switch + { not null => new(semanticTokens), _ => null }; + } } [JsonConverter(typeof(SemanticTokensFullOrDeltaPartialResultConverter))] @@ -369,14 +404,20 @@ public SemanticTokensFullOrDeltaPartialResult(SemanticTokensFullOrDelta delta) public bool IsFull => Full != null; public SemanticTokensPartialResult? Full { get; } - public static implicit operator SemanticTokensFullOrDeltaPartialResult(SemanticTokensPartialResult semanticTokensPartialResult) => - new SemanticTokensFullOrDeltaPartialResult(semanticTokensPartialResult); + public static implicit operator SemanticTokensFullOrDeltaPartialResult(SemanticTokensPartialResult semanticTokensPartialResult) + { + return new SemanticTokensFullOrDeltaPartialResult(semanticTokensPartialResult); + } - public static implicit operator SemanticTokensFullOrDeltaPartialResult(SemanticTokensDeltaPartialResult semanticTokensDeltaPartialResult) => - new SemanticTokensFullOrDeltaPartialResult(semanticTokensDeltaPartialResult); + public static implicit operator SemanticTokensFullOrDeltaPartialResult(SemanticTokensDeltaPartialResult semanticTokensDeltaPartialResult) + { + return new SemanticTokensFullOrDeltaPartialResult(semanticTokensDeltaPartialResult); + } - public static implicit operator SemanticTokensFullOrDelta(SemanticTokensFullOrDeltaPartialResult semanticTokensDeltaPartialResult) => - new SemanticTokensFullOrDelta(semanticTokensDeltaPartialResult); + public static implicit operator SemanticTokensFullOrDelta(SemanticTokensFullOrDeltaPartialResult semanticTokensDeltaPartialResult) + { + return new SemanticTokensFullOrDelta(semanticTokensDeltaPartialResult); + } } /// @@ -468,7 +509,8 @@ public int GetTokenModifiersIdentity(IEnumerable? tokenMo ); } - private void EnsureTokenTypes() => + private void EnsureTokenTypes() + { _tokenTypesData ??= TokenTypes .Select( (value, index) => ( @@ -478,8 +520,10 @@ private void EnsureTokenTypes() => ) .Where(z => !string.IsNullOrWhiteSpace(z.value)) .ToImmutableDictionary(z => z.value, z => z.index); + } - private void EnsureTokenModifiers() => + private void EnsureTokenModifiers() + { _tokenModifiersData ??= TokenModifiers .Select( (value, index) => ( @@ -489,6 +533,7 @@ private void EnsureTokenModifiers() => ) .Where(z => !string.IsNullOrWhiteSpace(z.value)) .ToImmutableDictionary(z => z.value, z => Convert.ToInt32(Math.Pow(2, z.index))); + } } /// @@ -584,7 +629,7 @@ public partial class SemanticTokensRegistrationOptions : ITextDocumentRegistrati [Optional] public BooleanOr? Full { get; set; } - class SemanticTokensRegistrationOptionsConverter : RegistrationOptionsConverterBase + private class SemanticTokensRegistrationOptionsConverter : RegistrationOptionsConverterBase { private readonly IHandlersManager _handlersManager; @@ -595,7 +640,8 @@ public SemanticTokensRegistrationOptionsConverter(IHandlersManager handlersManag public override StaticOptions Convert(SemanticTokensRegistrationOptions source) { - var result = new StaticOptions { + var result = new StaticOptions + { WorkDoneProgress = source.WorkDoneProgress, Legend = source.Legend, Full = source.Full, @@ -607,7 +653,8 @@ public override StaticOptions Convert(SemanticTokensRegistrationOptions source) if (edits) { result.Full = new BooleanOr( - new SemanticTokensCapabilityRequestFull { + new SemanticTokensCapabilityRequestFull + { Delta = true } ); @@ -724,11 +771,10 @@ public class SemanticTokensWorkspaceCapability : ICapability namespace Document { - public abstract class SemanticTokensHandlerBase : - AbstractHandlers.Base, - ISemanticTokensFullHandler, - ISemanticTokensDeltaHandler, - ISemanticTokensRangeHandler + public abstract class SemanticTokensHandlerBase : AbstractHandlers.Base, + ISemanticTokensFullHandler, + ISemanticTokensDeltaHandler, + ISemanticTokensRangeHandler { public virtual async Task Handle(SemanticTokensParams request, CancellationToken cancellationToken) { @@ -755,14 +801,20 @@ public abstract class SemanticTokensHandlerBase : } protected abstract Task Tokenize(SemanticTokensBuilder builder, ITextDocumentIdentifierParams identifier, CancellationToken cancellationToken); - protected abstract Task GetSemanticTokensDocument(ITextDocumentIdentifierParams @params, CancellationToken cancellationToken); + + protected abstract Task GetSemanticTokensDocument( + ITextDocumentIdentifierParams @params, CancellationToken cancellationToken + ); } public static partial class SemanticTokensExtensions { - private static SemanticTokensRegistrationOptions RegistrationOptionsFactory(SemanticTokensCapability capability, ClientCapabilities clientCapabilities) + private static SemanticTokensRegistrationOptions RegistrationOptionsFactory( + SemanticTokensCapability capability, ClientCapabilities clientCapabilities + ) { - var registrationOptions = new SemanticTokensRegistrationOptions { + var registrationOptions = new SemanticTokensRegistrationOptions + { Full = new SemanticTokensCapabilityRequestFull() }; registrationOptions.Range ??= new SemanticTokensCapabilityRequestRange(); @@ -772,7 +824,8 @@ private static SemanticTokensRegistrationOptions RegistrationOptionsFactory(Sema } // Ensure the legend is created properly. - registrationOptions.Legend = new SemanticTokensLegend() { + registrationOptions.Legend = new SemanticTokensLegend + { TokenModifiers = SemanticTokenModifier.Defaults.Join(capability.TokenModifiers, z => z, z => z, (a, _) => a).ToArray(), TokenTypes = SemanticTokenType.Defaults.Join(capability.TokenTypes, z => z, z => z, (a, _) => a).ToArray(), }; @@ -834,7 +887,10 @@ public static ILanguageServerRegistry OnSemanticTokens( private class DelegatingHandlerBase : SemanticTokensHandlerBase { private readonly Func _tokenize; - private readonly Func> _getSemanticTokensDocument; + + private readonly Func> + _getSemanticTokensDocument; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; public DelegatingHandlerBase( @@ -849,40 +905,54 @@ RegistrationOptionsDelegate _tokenize(builder, identifier, Capability, cancellationToken); + { + return _tokenize(builder, identifier, Capability, cancellationToken); + } - protected override Task GetSemanticTokensDocument(ITextDocumentIdentifierParams @params, CancellationToken cancellationToken) - => _getSemanticTokensDocument(@params, Capability, cancellationToken); + protected override Task GetSemanticTokensDocument( + ITextDocumentIdentifierParams @params, CancellationToken cancellationToken + ) + { + return _getSemanticTokensDocument(@params, Capability, cancellationToken); + } protected internal override SemanticTokensRegistrationOptions CreateRegistrationOptions( SemanticTokensCapability capability, ClientCapabilities clientCapabilities - ) => - _registrationOptionsFactory(capability, clientCapabilities); + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } } public static IRequestProgressObservable RequestSemanticTokens( this ITextDocumentLanguageClient mediator, SemanticTokensParams @params, CancellationToken cancellationToken = default - ) => - mediator.ProgressManager.MonitorUntil( + ) + { + return mediator.ProgressManager.MonitorUntil( @params, - (partial, result) => new SemanticTokens { + (partial, result) => new SemanticTokens + { Data = partial.Data, ResultId = result?.ResultId }, - tokens => new SemanticTokensPartialResult(tokens)!, + tokens => new SemanticTokensPartialResult(tokens), cancellationToken ); + } public static IRequestProgressObservable RequestSemanticTokensDelta( this ITextDocumentLanguageClient mediator, SemanticTokensDeltaParams @params, CancellationToken cancellationToken = default - ) => - mediator.ProgressManager.MonitorUntil( - @params, (partial, result) => { + ) + { + return mediator.ProgressManager.MonitorUntil( + @params, (partial, result) => + { if (partial.IsDelta) { return new SemanticTokensFullOrDelta( - new SemanticTokensDelta { + new SemanticTokensDelta + { Edits = partial.Delta!.Edits, ResultId = result?.Delta?.ResultId ?? result?.Full?.ResultId } @@ -892,7 +962,8 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration if (partial.IsFull) { return new SemanticTokensFullOrDelta( - new SemanticTokens { + new SemanticTokens + { Data = partial.Full!.Data, ResultId = result?.Full?.ResultId ?? result?.Delta?.ResultId } @@ -902,20 +973,24 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration return new SemanticTokensFullOrDelta(new SemanticTokens()); }, cancellationToken ); + } public static IRequestProgressObservable RequestSemanticTokensRange( this ITextDocumentLanguageClient mediator, SemanticTokensRangeParams @params, CancellationToken cancellationToken = default - ) => - mediator.ProgressManager.MonitorUntil( + ) + { + return mediator.ProgressManager.MonitorUntil( @params, - (partial, result) => new SemanticTokens { + (partial, result) => new SemanticTokens + { Data = partial.Data, ResultId = result?.ResultId }, tokens => new SemanticTokensPartialResult(tokens)!, cancellationToken ); + } } } } diff --git a/src/Protocol/Features/Document/SignatureHelpFeature.cs b/src/Protocol/Features/Document/SignatureHelpFeature.cs index c96fd7352..9076ecba5 100644 --- a/src/Protocol/Features/Document/SignatureHelpFeature.cs +++ b/src/Protocol/Features/Document/SignatureHelpFeature.cs @@ -18,12 +18,11 @@ namespace Models { [Parallel] [Method(TextDocumentNames.SignatureHelp, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(SignatureHelpRegistrationOptions)), Capability(typeof(SignatureHelpCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(SignatureHelpRegistrationOptions))] + [Capability(typeof(SignatureHelpCapability))] public partial record SignatureHelpParams : TextDocumentPositionParams, IWorkDoneProgressParams, IRequest { /// @@ -32,7 +31,7 @@ public partial record SignatureHelpParams : TextDocumentPositionParams, IWorkDon /// /// @since 3.15.0 /// - public SignatureHelpContext Context { get; init; } + public SignatureHelpContext Context { get; init; } = null!; } /// @@ -134,7 +133,7 @@ public record SignatureInformation /// The label of this signature. Will be shown in /// the UI. /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// The human-readable doc-comment of this signature. Will be shown @@ -162,7 +161,10 @@ public record SignatureInformation private string DebuggerDisplay => $"{Label}{Documentation?.ToString() ?? ""}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } /// @@ -176,7 +178,7 @@ public record ParameterInformation /// The label of this parameter. Will be shown in /// the UI. /// - public ParameterInformationLabel Label { get; init; } + public ParameterInformationLabel Label { get; init; } = null!; /// /// The human-readable doc-comment of this parameter. Will be shown @@ -188,30 +190,48 @@ public record ParameterInformation private string DebuggerDisplay => $"{Label}{( Documentation != null ? $" {Documentation}" : string.Empty )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [JsonConverter(typeof(ParameterInformationLabelConverter))] [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] public record ParameterInformationLabel { - public ParameterInformationLabel((int start, int end) range) => Range = range; + public ParameterInformationLabel((int start, int end) range) + { + Range = range; + } - public ParameterInformationLabel(string label) => Label = label; + public ParameterInformationLabel(string label) + { + Label = label; + } public (int start, int end) Range { get; } public bool IsRange => Label == null; public string? Label { get; } public bool IsLabel => Label != null; - public static implicit operator ParameterInformationLabel(string label) => new ParameterInformationLabel(label); + public static implicit operator ParameterInformationLabel(string label) + { + return new ParameterInformationLabel(label); + } - public static implicit operator ParameterInformationLabel((int start, int end) range) => new ParameterInformationLabel(range); + public static implicit operator ParameterInformationLabel((int start, int end) range) + { + return new ParameterInformationLabel(range); + } private string DebuggerDisplay => IsRange ? $"(start: {Range.start}, end: {Range.end})" : IsLabel ? Label! : string.Empty; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [GenerateRegistrationOptions(nameof(ServerCapabilities.SignatureHelpProvider))] diff --git a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs index 084a25b1d..615df16a0 100644 --- a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs @@ -21,12 +21,11 @@ namespace Models { [Serial] [Method(TextDocumentNames.DidChange, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TextDocumentChangeRegistrationOptions)), Capability(typeof(SynchronizationCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TextDocumentChangeRegistrationOptions))] + [Capability(typeof(SynchronizationCapability))] public partial record DidChangeTextDocumentParams : IRequest { /// @@ -34,12 +33,12 @@ public partial record DidChangeTextDocumentParams : IRequest /// to the version after all provided content changes have /// been applied. /// - public OptionalVersionedTextDocumentIdentifier TextDocument { get; init; } + public OptionalVersionedTextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The actual content changes. /// - public Container ContentChanges { get; init; } + public Container ContentChanges { get; init; } = null!; } /// @@ -71,7 +70,7 @@ public record TextDocumentContentChangeEvent /// The length of the range that got replaced. /// /// - /// in the LSP spec + /// in the LSP spec /// [Optional] public int RangeLength { get; init; } @@ -79,7 +78,7 @@ public record TextDocumentContentChangeEvent /// /// The new text of the document. /// - public string Text { get; init; } + public string Text { get; init; } = null!; } public record TextDocumentEdit @@ -87,25 +86,24 @@ public record TextDocumentEdit /// /// The text document to change. /// - public OptionalVersionedTextDocumentIdentifier TextDocument { get; init; } + public OptionalVersionedTextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The edits to be applied. /// /// - /// This can contain both and + /// This can contain both and /// - public TextEditContainer Edits { get; init; } + public TextEditContainer Edits { get; init; } = null!; } [Serial] [Method(TextDocumentNames.DidOpen, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TextDocumentOpenRegistrationOptions)), Capability(typeof(SynchronizationCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TextDocumentOpenRegistrationOptions))] + [Capability(typeof(SynchronizationCapability))] public partial class DidOpenTextDocumentParams : IRequest { /// @@ -121,12 +119,11 @@ public partial class TextDocumentOpenRegistrationOptions : ITextDocumentRegistra [Parallel] [Method(TextDocumentNames.DidClose, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TextDocumentCloseRegistrationOptions)), Capability(typeof(SynchronizationCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TextDocumentCloseRegistrationOptions))] + [Capability(typeof(SynchronizationCapability))] public partial class DidCloseTextDocumentParams : ITextDocumentIdentifierParams, IRequest { /// @@ -142,12 +139,11 @@ public partial class TextDocumentCloseRegistrationOptions : ITextDocumentRegistr [Serial] [Method(TextDocumentNames.DidSave, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TextDocumentSaveRegistrationOptions)), Capability(typeof(SynchronizationCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TextDocumentSaveRegistrationOptions))] + [Capability(typeof(SynchronizationCapability))] public partial class DidSaveTextDocumentParams : ITextDocumentIdentifierParams, IRequest { /// @@ -199,7 +195,7 @@ public TextDocumentSyncRegistrationOptions(TextDocumentSyncKind syncKind) /// public TextDocumentSyncKind Change { get; set; } - class Converter : RegistrationOptionsConverterBase + private class Converter : RegistrationOptionsConverterBase { private readonly IHandlersManager _handlersManager; @@ -210,7 +206,8 @@ public Converter(IHandlersManager handlersManager) public override StaticOptions Convert(TextDocumentSyncRegistrationOptions source) { - return new() { + return new() + { OpenClose = _handlersManager.Descriptors.Any( z => z.HandlerType == typeof(IDidOpenTextDocumentHandler) || z.HandlerType == typeof(IDidCloseTextDocumentHandler) ), @@ -245,7 +242,8 @@ public partial class StaticOptions : ITextDocumentSyncOptions public static implicit operator TextDocumentSaveRegistrationOptions(TextDocumentSyncRegistrationOptions options) { - return new() { + return new() + { DocumentSelector = options.DocumentSelector, IncludeText = options.Save?.Value?.IncludeText == true }; @@ -253,7 +251,8 @@ public static implicit operator TextDocumentSaveRegistrationOptions(TextDocument public static implicit operator TextDocumentChangeRegistrationOptions(TextDocumentSyncRegistrationOptions options) { - return new() { + return new() + { DocumentSelector = options.DocumentSelector, SyncKind = options.Change, }; @@ -261,14 +260,16 @@ public static implicit operator TextDocumentChangeRegistrationOptions(TextDocume public static implicit operator TextDocumentOpenRegistrationOptions(TextDocumentSyncRegistrationOptions options) { - return new() { + return new() + { DocumentSelector = options.DocumentSelector, }; } public static implicit operator TextDocumentCloseRegistrationOptions(TextDocumentSyncRegistrationOptions options) { - return new() { + return new() + { DocumentSelector = options.DocumentSelector, }; } @@ -279,12 +280,11 @@ public static implicit operator TextDocumentCloseRegistrationOptions(TextDocumen /// [Parallel] [Method(TextDocumentNames.WillSave, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TextDocumenWillSaveRegistrationOptions)), Capability(typeof(SynchronizationCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TextDocumenWillSaveRegistrationOptions))] + [Capability(typeof(SynchronizationCapability))] public partial class WillSaveTextDocumentParams : IRequest { /// @@ -308,12 +308,11 @@ public partial class TextDocumenWillSaveRegistrationOptions : ITextDocumentRegis /// [Parallel] [Method(TextDocumentNames.WillSaveWaitUntil, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TextDocumentWillSaveWaitUntilRegistrationOptions)), Capability(typeof(SynchronizationCapability))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TextDocumentWillSaveWaitUntilRegistrationOptions))] + [Capability(typeof(SynchronizationCapability))] public partial class WillSaveWaitUntilTextDocumentParams : IRequest { /// @@ -376,39 +375,51 @@ public abstract class TextDocumentSyncHandlerBase : ITextDocumentSyncHandler public abstract Task Handle(DidSaveTextDocumentParams request, CancellationToken cancellationToken); public abstract Task Handle(DidCloseTextDocumentParams request, CancellationToken cancellationToken); - private TextDocumentSyncRegistrationOptions? _registrationOptions; - private ClientCapabilities? _clientCapabilities; + protected TextDocumentSyncRegistrationOptions RegistrationOptions { get; private set; } - protected TextDocumentSyncRegistrationOptions RegistrationOptions => _registrationOptions!; - protected ClientCapabilities ClientCapabilities => _clientCapabilities!; + protected ClientCapabilities ClientCapabilities { get; private set; } protected SynchronizationCapability Capability { get; private set; } = default!; - protected abstract TextDocumentSyncRegistrationOptions CreateRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities); + protected abstract TextDocumentSyncRegistrationOptions CreateRegistrationOptions( + SynchronizationCapability capability, ClientCapabilities clientCapabilities + ); private TextDocumentSyncRegistrationOptions AssignRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities) { Capability = capability; - if (_registrationOptions is { }) return _registrationOptions; - _clientCapabilities = clientCapabilities; - return _registrationOptions = CreateRegistrationOptions(capability, clientCapabilities); + if (RegistrationOptions is { }) return RegistrationOptions; + ClientCapabilities = clientCapabilities; + return RegistrationOptions = CreateRegistrationOptions(capability, clientCapabilities); } TextDocumentChangeRegistrationOptions IRegistration.GetRegistrationOptions( SynchronizationCapability capability, ClientCapabilities clientCapabilities - ) => _registrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + ) + { + return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + } TextDocumentOpenRegistrationOptions IRegistration.GetRegistrationOptions( SynchronizationCapability capability, ClientCapabilities clientCapabilities - ) => _registrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + ) + { + return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + } TextDocumentCloseRegistrationOptions IRegistration.GetRegistrationOptions( SynchronizationCapability capability, ClientCapabilities clientCapabilities - ) => _registrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + ) + { + return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + } TextDocumentSaveRegistrationOptions IRegistration.GetRegistrationOptions( SynchronizationCapability capability, ClientCapabilities clientCapabilities - ) => _registrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + ) + { + return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + } } @@ -782,10 +793,17 @@ public override async Task Handle(DidCloseTextDocumentParams request, Canc return Unit.Value; } - protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); + protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions( + SynchronizationCapability capability, ClientCapabilities clientCapabilities + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } - public override TextDocumentAttributes GetTextDocumentAttributes(DocumentUri uri) => _getTextDocumentAttributes.Invoke(uri); + public override TextDocumentAttributes GetTextDocumentAttributes(DocumentUri uri) + { + return _getTextDocumentAttributes.Invoke(uri); + } } } } diff --git a/src/Protocol/Features/Document/TypeDefinitionFeature.cs b/src/Protocol/Features/Document/TypeDefinitionFeature.cs index aee115849..504742323 100644 --- a/src/Protocol/Features/Document/TypeDefinitionFeature.cs +++ b/src/Protocol/Features/Document/TypeDefinitionFeature.cs @@ -12,19 +12,19 @@ namespace Models { [Parallel] [Method(TextDocumentNames.TypeDefinition, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(TypeDefinitionRegistrationOptions)), Capability(typeof(TypeDefinitionCapability))] - public partial record TypeDefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest - { - } + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TypeDefinitionRegistrationOptions))] + [Capability(typeof(TypeDefinitionCapability))] + public partial record TypeDefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.TypeDefinitionProvider))] [RegistrationName(TextDocumentNames.TypeDefinition)] - public partial class TypeDefinitionRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions { } + public partial class TypeDefinitionRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions + { + } } namespace Client.Capabilities diff --git a/src/Protocol/Features/FileOperationsFeature.cs b/src/Protocol/Features/FileOperationsFeature.cs index ac255deb4..b9d1b6829 100644 --- a/src/Protocol/Features/FileOperationsFeature.cs +++ b/src/Protocol/Features/FileOperationsFeature.cs @@ -26,7 +26,7 @@ public abstract record FileOperationParams /// /// An array of all files/folders deleted in this operation. /// - public Container Files { get; init; } + public Container Files { get; init; } = null!; } /// @@ -37,110 +37,118 @@ public abstract record FileOperationItem /// /// A file:// URI for the location of the file/folder being created. /// - public Uri Uri { get; init; } + public Uri Uri { get; init; } = null!; } - /// + /// [Parallel] [Method(WorkspaceNames.DidCreateFiles, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DidCreateFileRegistrationOptions)), Capability(typeof(FileOperationsWorkspaceClientCapabilities))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DidCreateFileRegistrationOptions))] + [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] public partial record DidCreateFileParams : FileOperationParams, IRequest { - public static implicit operator WillCreateFileParams(DidCreateFileParams @params) => new() { Files = @params.Files }; + public static implicit operator WillCreateFileParams(DidCreateFileParams @params) + { + return new() { Files = @params.Files }; + } } - /// + /// [Parallel] [Method(WorkspaceNames.WillCreateFiles, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(WillCreateFileRegistrationOptions)), Capability(typeof(FileOperationsWorkspaceClientCapabilities))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WillCreateFileRegistrationOptions))] + [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] public partial record WillCreateFileParams : FileOperationParams, IRequest { - public static implicit operator DidCreateFileParams(WillCreateFileParams @params) => new() { Files = @params.Files }; + public static implicit operator DidCreateFileParams(WillCreateFileParams @params) + { + return new() { Files = @params.Files }; + } } - /// - public partial record FileCreate : FileOperationItem - { - } - /// + /// + public partial record FileCreate : FileOperationItem; + + /// [Parallel] [Method(WorkspaceNames.DidRenameFiles, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DidRenameFileRegistrationOptions)), Capability(typeof(FileOperationsWorkspaceClientCapabilities))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DidRenameFileRegistrationOptions))] + [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] public partial record DidRenameFileParams : FileOperationParams, IRequest { - public static implicit operator WillRenameFileParams(DidRenameFileParams @params) => new() { Files = @params.Files }; + public static implicit operator WillRenameFileParams(DidRenameFileParams @params) + { + return new() { Files = @params.Files }; + } } - /// + /// [Parallel] [Method(WorkspaceNames.WillRenameFiles, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(WillRenameFileRegistrationOptions)), Capability(typeof(FileOperationsWorkspaceClientCapabilities))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WillRenameFileRegistrationOptions))] + [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] public partial record WillRenameFileParams : FileOperationParams, IRequest { - public static implicit operator DidRenameFileParams(WillRenameFileParams @params) => new() { Files = @params.Files }; + public static implicit operator DidRenameFileParams(WillRenameFileParams @params) + { + return new() { Files = @params.Files }; + } } - /// - public partial record FileRename : FileOperationItem - { - } + /// + public partial record FileRename : FileOperationItem; - /// + /// [Parallel] [Method(WorkspaceNames.DidDeleteFiles, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(DidDeleteFileRegistrationOptions)), Capability(typeof(FileOperationsWorkspaceClientCapabilities))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DidDeleteFileRegistrationOptions))] + [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] public partial record DidDeleteFileParams : FileOperationParams, IRequest { - public static implicit operator WillDeleteFileParams(DidDeleteFileParams @params) => new() { Files = @params.Files }; + public static implicit operator WillDeleteFileParams(DidDeleteFileParams @params) + { + return new() { Files = @params.Files }; + } } - /// + /// [Parallel] [Method(WorkspaceNames.WillDeleteFiles, Direction.ClientToServer)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), - GenerateHandlerMethods, - GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(WillDeleteFileRegistrationOptions)), Capability(typeof(FileOperationsWorkspaceClientCapabilities))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WillDeleteFileRegistrationOptions))] + [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] public partial record WillDeleteFileParams : FileOperationParams, IRequest { - public static implicit operator DidDeleteFileParams(WillDeleteFileParams @params) => new() { Files = @params.Files }; + public static implicit operator DidDeleteFileParams(WillDeleteFileParams @params) + { + return new() { Files = @params.Files }; + } } - /// - public partial record FileDelete : FileOperationItem - { - } + /// + public partial record FileDelete : FileOperationItem; - /// + /// [GenerateRegistrationOptions( - nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), nameof(FileOperationsWorkspaceServerCapabilities.WillCreate) + nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), + nameof(FileOperationsWorkspaceServerCapabilities.WillCreate) )] [RegistrationName(WorkspaceNames.WillCreateFiles)] public partial class WillCreateFileRegistrationOptions : IFileOperationRegistrationOptions @@ -151,9 +159,10 @@ public partial class WillCreateFileRegistrationOptions : IFileOperationRegistrat public Container Filters { get; set; } = new Container(); } - /// + /// [GenerateRegistrationOptions( - nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), nameof(FileOperationsWorkspaceServerCapabilities.DidCreate) + nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), + nameof(FileOperationsWorkspaceServerCapabilities.DidCreate) )] [RegistrationName(WorkspaceNames.DidCreateFiles)] public partial class DidCreateFileRegistrationOptions : IFileOperationRegistrationOptions @@ -164,9 +173,10 @@ public partial class DidCreateFileRegistrationOptions : IFileOperationRegistrati public Container Filters { get; set; } = new Container(); } - /// + /// [GenerateRegistrationOptions( - nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), nameof(FileOperationsWorkspaceServerCapabilities.WillRename) + nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), + nameof(FileOperationsWorkspaceServerCapabilities.WillRename) )] [RegistrationName(WorkspaceNames.WillRenameFiles)] public partial class WillRenameFileRegistrationOptions : IFileOperationRegistrationOptions @@ -177,9 +187,10 @@ public partial class WillRenameFileRegistrationOptions : IFileOperationRegistrat public Container Filters { get; set; } = new Container(); } - /// + /// [GenerateRegistrationOptions( - nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), nameof(FileOperationsWorkspaceServerCapabilities.DidRename) + nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), + nameof(FileOperationsWorkspaceServerCapabilities.DidRename) )] [RegistrationName(WorkspaceNames.DidRenameFiles)] public partial class DidRenameFileRegistrationOptions : IFileOperationRegistrationOptions @@ -190,9 +201,10 @@ public partial class DidRenameFileRegistrationOptions : IFileOperationRegistrati public Container Filters { get; set; } = new Container(); } - /// + /// [GenerateRegistrationOptions( - nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), nameof(FileOperationsWorkspaceServerCapabilities.WillDelete) + nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), + nameof(FileOperationsWorkspaceServerCapabilities.WillDelete) )] [RegistrationName(WorkspaceNames.WillDeleteFiles)] public partial class WillDeleteFileRegistrationOptions : IFileOperationRegistrationOptions @@ -203,9 +215,10 @@ public partial class WillDeleteFileRegistrationOptions : IFileOperationRegistrat public Container Filters { get; set; } = new Container(); } - /// + /// [GenerateRegistrationOptions( - nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), nameof(FileOperationsWorkspaceServerCapabilities.DidDelete) + nameof(ServerCapabilities.Workspace), nameof(WorkspaceServerCapabilities.FileOperations), + nameof(FileOperationsWorkspaceServerCapabilities.DidDelete) )] [RegistrationName(WorkspaceNames.DidDeleteFiles)] public partial class DidDeleteFileRegistrationOptions : IFileOperationRegistrationOptions @@ -216,11 +229,11 @@ public partial class DidDeleteFileRegistrationOptions : IFileOperationRegistrati public Container Filters { get; set; } = new Container(); } - /// + /// /// The options to register for file operations. - /// + /// /// @since 3.16.0 - /// + /// public interface IFileOperationRegistrationOptions { /// @@ -268,12 +281,12 @@ public record FileOperationPattern /// - `?` to match on one character in a path segment /// - `**` to match any number of path segments, including none /// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript - /// and JavaScript files) + /// and JavaScript files) /// - `[]` to declare a range of characters to match in a path segment - /// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + /// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) /// - `[!...]` to negate a range of characters to match in a path segment - /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but - /// not `example.0`) + /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but + /// not `example.0`) /// public string Glob { get; init; } diff --git a/src/Protocol/Features/General/InitializeFeature.cs b/src/Protocol/Features/General/InitializeFeature.cs index 0b337fa11..6ee578274 100644 --- a/src/Protocol/Features/General/InitializeFeature.cs +++ b/src/Protocol/Features/General/InitializeFeature.cs @@ -110,10 +110,11 @@ public record InitializeParams : IInitializeParams public string? RootPath { get => RootUri?.GetFileSystemPath(); - init { + init + { if (!string.IsNullOrEmpty(value)) { - RootUri = DocumentUri.FromFileSystemPath(value!); + RootUri = DocumentUri.FromFileSystemPath(value); } } } @@ -195,7 +196,8 @@ internal InitializeParams(IInitializeParams @params, ClientCapabilities [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.General", Name = "LanguageProtocolInitialize")] [GenerateHandlerMethods(typeof(ILanguageServerRegistry))] [GenerateRequestMethods(typeof(ILanguageClient))] - internal partial record InternalInitializeParams : IInitializeParams, IRequest // This is required for generation to work correctly. + internal partial record + InternalInitializeParams : IInitializeParams, IRequest // This is required for generation to work correctly. { /// /// The process Id of the parent process that started @@ -230,7 +232,7 @@ public string? RootPath /// folder is open. If both `rootPath` and `rootUri` are set /// `rootUri` wins. /// - public DocumentUri RootUri { get; init; } + public DocumentUri RootUri { get; init; } = null!; /// /// User provided initialization options. @@ -240,7 +242,7 @@ public string? RootPath /// /// The capabilities provided by the client (editor or tool) /// - public JObject Capabilities { get; init; } + public JObject Capabilities { get; init; } = null!; /// /// The initial trace setting. If omitted trace is disabled ('off'). diff --git a/src/Protocol/Features/General/InitializedFeature.cs b/src/Protocol/Features/General/InitializedFeature.cs index dc16fee70..fdd35713a 100644 --- a/src/Protocol/Features/General/InitializedFeature.cs +++ b/src/Protocol/Features/General/InitializedFeature.cs @@ -14,8 +14,6 @@ namespace Models [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.General", Name = "LanguageProtocolInitialized")] [GenerateHandlerMethods(typeof(ILanguageServerRegistry))] [GenerateRequestMethods(typeof(ILanguageClient))] - public partial record InitializedParams : IRequest - { - } + public partial record InitializedParams : IRequest; } } diff --git a/src/Protocol/Features/ProgressFeature.cs b/src/Protocol/Features/ProgressFeature.cs index 37e3038c0..9e971f13a 100644 --- a/src/Protocol/Features/ProgressFeature.cs +++ b/src/Protocol/Features/ProgressFeature.cs @@ -21,25 +21,29 @@ namespace Models { [Serial] [Method(GeneralNames.Progress, Direction.Bidirectional)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(IGeneralLanguageClient), typeof(ILanguageClient), typeof(IGeneralLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IGeneralLanguageClient), typeof(ILanguageClient), typeof(IGeneralLanguageServer), typeof(ILanguageServer))] public record ProgressParams : IRequest { - public static ProgressParams Create(ProgressToken token, T value, JsonSerializer jsonSerializer) => - new ProgressParams { + public static ProgressParams Create(ProgressToken token, T value, JsonSerializer jsonSerializer) + { + return new ProgressParams + { Token = token, Value = JToken.FromObject(value, jsonSerializer) }; + } /// /// The progress token provided by the client or server. /// - public ProgressToken Token { get; init; } + public ProgressToken Token { get; init; } = null!; /// /// The progress data. /// - public JToken Value { get; init; } + public JToken Value { get; init; } = null!; } [JsonConverter(typeof(ProgressTokenConverter))] @@ -66,7 +70,8 @@ public ProgressToken(string value) public long Long { get => _long ?? 0; - set { + set + { String = null; _long = value; } @@ -77,26 +82,45 @@ public long Long public string? String { get => _string; - set { + set + { _string = value; _long = null; } } - public static implicit operator ProgressToken(long value) => new ProgressToken(value); + public static implicit operator ProgressToken(long value) + { + return new ProgressToken(value); + } - public static implicit operator ProgressToken(string value) => new ProgressToken(value); + public static implicit operator ProgressToken(string value) + { + return new ProgressToken(value); + } - public ProgressParams Create(T value, JsonSerializer jsonSerializer) => ProgressParams.Create(this, value, jsonSerializer); + public ProgressParams Create(T value, JsonSerializer jsonSerializer) + { + return ProgressParams.Create(this, value, jsonSerializer); + } - public bool Equals(long other) => IsLong && Long == other; + public bool Equals(long other) + { + return IsLong && Long == other; + } - public bool Equals(string other) => IsString && String == other; + public bool Equals(string other) + { + return IsString && String == other; + } private string DebuggerDisplay => IsString ? String! : IsLong ? Long.ToString() : ""; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } @@ -125,7 +149,8 @@ public static IRequestProgressObservable, TResponse> RequestP return requestRouter.ProgressManager.MonitorUntil(@params, factory, cancellationToken); } - private static readonly PropertyInfo PartialResultTokenProperty = typeof(IPartialResultParams).GetProperty(nameof(IPartialResultParams.PartialResultToken))!; + private static readonly PropertyInfo PartialResultTokenProperty = + typeof(IPartialResultParams).GetProperty(nameof(IPartialResultParams.PartialResultToken))!; internal static ProgressToken SetPartialResultToken(this IPartialResultParams @params, ProgressToken? progressToken = null) { diff --git a/src/Protocol/Features/Window/LogMessageFeature.cs b/src/Protocol/Features/Window/LogMessageFeature.cs index bd2f7539f..2fe2edfcd 100644 --- a/src/Protocol/Features/Window/LogMessageFeature.cs +++ b/src/Protocol/Features/Window/LogMessageFeature.cs @@ -11,7 +11,9 @@ namespace Models { [Parallel] [Method(WindowNames.LogMessage, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] public record LogMessageParams : IRequest { /// @@ -22,7 +24,7 @@ public record LogMessageParams : IRequest /// /// The actual message /// - public string Message { get; init; } + public string Message { get; init; } = null!; } } @@ -30,32 +32,55 @@ namespace Window { public static partial class LogMessageExtensions { - public static void Log(this ILanguageServer mediator, LogMessageParams @params) => mediator.SendNotification(@params); + public static void Log(this ILanguageServer mediator, LogMessageParams @params) + { + mediator.SendNotification(@params); + } - public static void LogError(this ILanguageServer mediator, string message) => + public static void LogError(this ILanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Error, Message = message }); + } - public static void Log(this ILanguageServer mediator, string message) => mediator.SendNotification(new LogMessageParams { Type = MessageType.Log, Message = message }); + public static void Log(this ILanguageServer mediator, string message) + { + mediator.SendNotification(new LogMessageParams { Type = MessageType.Log, Message = message }); + } - public static void LogWarning(this ILanguageServer mediator, string message) => + public static void LogWarning(this ILanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Warning, Message = message }); + } - public static void LogInfo(this ILanguageServer mediator, string message) => + public static void LogInfo(this ILanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Info, Message = message }); + } - public static void Log(this IWindowLanguageServer mediator, LogMessageParams @params) => mediator.SendNotification(@params); + public static void Log(this IWindowLanguageServer mediator, LogMessageParams @params) + { + mediator.SendNotification(@params); + } - public static void LogError(this IWindowLanguageServer mediator, string message) => + public static void LogError(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Error, Message = message }); + } - public static void Log(this IWindowLanguageServer mediator, string message) => + public static void Log(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Log, Message = message }); + } - public static void LogWarning(this IWindowLanguageServer mediator, string message) => + public static void LogWarning(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Warning, Message = message }); + } - public static void LogInfo(this IWindowLanguageServer mediator, string message) => + public static void LogInfo(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new LogMessageParams { Type = MessageType.Info, Message = message }); + } } } } diff --git a/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs b/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs index 5872696d3..7a3ed66f9 100644 --- a/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs +++ b/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs @@ -9,7 +9,6 @@ // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol { - namespace Models { /// @@ -19,14 +18,16 @@ namespace Models /// [Parallel] [Method(WindowNames.ShowDocument, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] [Capability(typeof(ShowDocumentClientCapabilities))] public record ShowDocumentParams : IRequest { /// /// The document uri to show. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// Indicates to show the resource in an external program. @@ -77,7 +78,7 @@ namespace Client.Capabilities /// @since 3.16.0 /// [CapabilityKey(nameof(ClientCapabilities.Window), nameof(WindowClientCapabilities.ShowDocument))] - public class ShowDocumentClientCapabilities: ICapability + public class ShowDocumentClientCapabilities : ICapability { /// /// Capabilities specific to the `MessageActionItem` type. diff --git a/src/Protocol/Features/Window/ShowMessageFeature.cs b/src/Protocol/Features/Window/ShowMessageFeature.cs index 46f302731..f116c56dd 100644 --- a/src/Protocol/Features/Window/ShowMessageFeature.cs +++ b/src/Protocol/Features/Window/ShowMessageFeature.cs @@ -7,8 +7,6 @@ // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol { - - namespace Models { /// @@ -16,7 +14,9 @@ namespace Models /// [Parallel] [Method(WindowNames.ShowMessage, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] public record ShowMessageParams : IRequest { /// @@ -27,7 +27,7 @@ public record ShowMessageParams : IRequest /// /// The actual message. /// - public string Message { get; init; } + public string Message { get; init; } = null!; } } @@ -35,29 +35,55 @@ namespace Window { public static partial class ShowMessageExtensions { - public static void Show(this ILanguageServer mediator, ShowMessageParams @params) => mediator.SendNotification(@params); + public static void Show(this ILanguageServer mediator, ShowMessageParams @params) + { + mediator.SendNotification(@params); + } - public static void ShowError(this ILanguageServer mediator, string message) => mediator.SendNotification(new ShowMessageParams { Type = MessageType.Error, Message = message }); + public static void ShowError(this ILanguageServer mediator, string message) + { + mediator.SendNotification(new ShowMessageParams { Type = MessageType.Error, Message = message }); + } - public static void Show(this ILanguageServer mediator, string message) => mediator.SendNotification(new ShowMessageParams { Type = MessageType.Log, Message = message }); + public static void Show(this ILanguageServer mediator, string message) + { + mediator.SendNotification(new ShowMessageParams { Type = MessageType.Log, Message = message }); + } - public static void ShowWarning(this ILanguageServer mediator, string message) => + public static void ShowWarning(this ILanguageServer mediator, string message) + { mediator.SendNotification(new ShowMessageParams { Type = MessageType.Warning, Message = message }); + } - public static void ShowInfo(this ILanguageServer mediator, string message) => mediator.SendNotification(new ShowMessageParams { Type = MessageType.Info, Message = message }); + public static void ShowInfo(this ILanguageServer mediator, string message) + { + mediator.SendNotification(new ShowMessageParams { Type = MessageType.Info, Message = message }); + } - public static void Show(this IWindowLanguageServer mediator, ShowMessageParams @params) => mediator.SendNotification(@params); + public static void Show(this IWindowLanguageServer mediator, ShowMessageParams @params) + { + mediator.SendNotification(@params); + } - public static void ShowError(this IWindowLanguageServer mediator, string message) => + public static void ShowError(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new ShowMessageParams { Type = MessageType.Error, Message = message }); + } - public static void Show(this IWindowLanguageServer mediator, string message) => mediator.SendNotification(new ShowMessageParams { Type = MessageType.Log, Message = message }); + public static void Show(this IWindowLanguageServer mediator, string message) + { + mediator.SendNotification(new ShowMessageParams { Type = MessageType.Log, Message = message }); + } - public static void ShowWarning(this IWindowLanguageServer mediator, string message) => + public static void ShowWarning(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new ShowMessageParams { Type = MessageType.Warning, Message = message }); + } - public static void ShowInfo(this IWindowLanguageServer mediator, string message) => + public static void ShowInfo(this IWindowLanguageServer mediator, string message) + { mediator.SendNotification(new ShowMessageParams { Type = MessageType.Info, Message = message }); + } } } } diff --git a/src/Protocol/Features/Window/ShowMessageRequestFeature.cs b/src/Protocol/Features/Window/ShowMessageRequestFeature.cs index d3ca50f7e..d68c6aa64 100644 --- a/src/Protocol/Features/Window/ShowMessageRequestFeature.cs +++ b/src/Protocol/Features/Window/ShowMessageRequestFeature.cs @@ -12,17 +12,18 @@ // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol { - - namespace Models { /// - /// The show message request is sent from a server to a client to ask the client to display a particular message in the user interface. In addition to the show message notification + /// The show message request is sent from a server to a client to ask the client to display a particular message in the user interface. In addition to the show + /// message notification /// the request allows to pass actions and to wait for an answer from the client. /// [Parallel] [Method(WindowNames.ShowMessageRequest, Direction.ServerToClient)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] public record ShowMessageRequestParams : IRequest { /// @@ -33,7 +34,7 @@ public record ShowMessageRequestParams : IRequest /// /// The actual message /// - public string Message { get; init; } + public string Message { get; init; } = null!; /// /// The message action items to present. @@ -48,10 +49,10 @@ public record MessageActionItem /// /// A short title like 'Retry', 'Open Log' etc. /// - public string Title { get; init; } + public string Title { get; init; } = null!; /// - /// Extension data that may contain additional properties based on + /// Extension data that may contain additional properties based on /// [JsonExtensionData] public IDictionary ExtensionData { get; init; } = new Dictionary(); @@ -59,7 +60,10 @@ public record MessageActionItem private string DebuggerDisplay => Title; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } @@ -79,6 +83,7 @@ public class ShowMessageRequestClientCapabilities [Optional] public ShowMessageRequestMessageActionItemClientCapabilities? MessageActionItem { get; set; } } + public class ShowMessageRequestMessageActionItemClientCapabilities { /// @@ -93,6 +98,5 @@ public class ShowMessageRequestMessageActionItemClientCapabilities namespace Window { - } } diff --git a/src/Protocol/Features/Window/WorkDoneProgressFeature.cs b/src/Protocol/Features/Window/WorkDoneProgressFeature.cs index d53fc071c..f99bb1bd6 100644 --- a/src/Protocol/Features/Window/WorkDoneProgressFeature.cs +++ b/src/Protocol/Features/Window/WorkDoneProgressFeature.cs @@ -87,7 +87,7 @@ public WorkDoneProgressBegin() : base(WorkDoneProgressKind.Begin) /// /// Examples: "Indexing" or "Linking dependencies". /// - public string Title { get; init; } + public string Title { get; init; } = null!; /// /// Controls if a cancel button should show to allow the user to cancel the diff --git a/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs b/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs index 9e27d2bae..13b49b0df 100644 --- a/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs +++ b/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs @@ -26,7 +26,7 @@ public partial record DidChangeWorkspaceFoldersParams : IRequest /// /// The actual workspace folder change event. /// - public WorkspaceFoldersChangeEvent Event { get; init; } + public WorkspaceFoldersChangeEvent Event { get; init; } = null!; } /// @@ -63,12 +63,12 @@ public partial record WorkspaceFolder /// /// The associated URI for this workspace folder. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// The name of the workspace folder. Defaults to the uri's basename. /// - public string Name { get; init; } + public string Name { get; init; } = null!; private string DebuggerDisplay => $"{Name} ({Uri})"; diff --git a/src/Protocol/LanguageProtocolProxy.cs b/src/Protocol/LanguageProtocolProxy.cs index 17402ca00..df5ca6584 100644 --- a/src/Protocol/LanguageProtocolProxy.cs +++ b/src/Protocol/LanguageProtocolProxy.cs @@ -18,7 +18,8 @@ internal abstract class LanguageProtocolProxy : ILanguageProtocolProxy private readonly ILanguageProtocolSettings _languageProtocolSettings; public LanguageProtocolProxy( - IResponseRouter requestRouter, IResolverContext resolverContext, IProgressManager progressManager, ILanguageProtocolSettings languageProtocolSettings + IResponseRouter requestRouter, IResolverContext resolverContext, IProgressManager progressManager, + ILanguageProtocolSettings languageProtocolSettings ) { ProgressManager = progressManager; @@ -32,20 +33,44 @@ public LanguageProtocolProxy( public InitializeResult ServerSettings => _languageProtocolSettings.ServerSettings; - public void SendNotification(string method) => _responseRouter.SendNotification(method); + public void SendNotification(string method) + { + _responseRouter.SendNotification(method); + } - public void SendNotification(string method, T @params) => _responseRouter.SendNotification(method, @params); + public void SendNotification(string method, T @params) + { + _responseRouter.SendNotification(method, @params); + } - public void SendNotification(IRequest request) => _responseRouter.SendNotification(request); + public void SendNotification(IRequest request) + { + _responseRouter.SendNotification(request); + } - public IResponseRouterReturns SendRequest(string method, T @params) => _responseRouter.SendRequest(method, @params); + public IResponseRouterReturns SendRequest(string method, T @params) + { + return _responseRouter.SendRequest(method, @params); + } - public IResponseRouterReturns SendRequest(string method) => _responseRouter.SendRequest(method); + public IResponseRouterReturns SendRequest(string method) + { + return _responseRouter.SendRequest(method); + } + + public Task SendRequest(IRequest request, CancellationToken cancellationToken) + { + return _responseRouter.SendRequest(request, cancellationToken); + } - public Task SendRequest(IRequest request, CancellationToken cancellationToken) => _responseRouter.SendRequest(request, cancellationToken); + bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string? method, [NotNullWhen(true)] out TaskCompletionSource? pendingTask) + { + return _responseRouter.TryGetRequest(id, out method, out pendingTask); + } - bool IResponseRouter.TryGetRequest(long id, [NotNullWhen(true)] out string method, [NotNullWhen(true)]out TaskCompletionSource pendingTask) => - _responseRouter.TryGetRequest(id, out method, out pendingTask); - object IServiceProvider.GetService(Type serviceType) => ResolverContext.GetService(serviceType); + object IServiceProvider.GetService(Type serviceType) + { + return ResolverContext.GetService(serviceType); + } } } diff --git a/src/Protocol/LanguageProtocolRpcOptionsBase.cs b/src/Protocol/LanguageProtocolRpcOptionsBase.cs index 9ad85e0d9..6f5339b15 100644 --- a/src/Protocol/LanguageProtocolRpcOptionsBase.cs +++ b/src/Protocol/LanguageProtocolRpcOptionsBase.cs @@ -6,7 +6,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using ISerializer = OmniSharp.Extensions.JsonRpc.ISerializer; namespace OmniSharp.Extensions.LanguageServer.Protocol { diff --git a/src/Protocol/Models/ClientInfo.cs b/src/Protocol/Models/ClientInfo.cs index 9e7624689..debce3189 100644 --- a/src/Protocol/Models/ClientInfo.cs +++ b/src/Protocol/Models/ClientInfo.cs @@ -14,7 +14,7 @@ public record ClientInfo /// /// The name of the client as defined by the client. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// The client's version as defined by the client. @@ -25,6 +25,9 @@ public record ClientInfo private string DebuggerDisplay => string.IsNullOrWhiteSpace(Version) ? Name : $"{Name} ({Version})"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/Command.cs b/src/Protocol/Models/Command.cs index 2b4221c3c..b21328eb5 100644 --- a/src/Protocol/Models/Command.cs +++ b/src/Protocol/Models/Command.cs @@ -12,13 +12,13 @@ public record Command /// /// Title of the command, like `save`. /// - public string Title { get; init; } + public string Title { get; init; } = null!; /// /// The identifier of the actual command handler. /// [JsonProperty("command")] - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// Arguments that the command handler should be @@ -30,9 +30,19 @@ public record Command private string DebuggerDisplay => $"{Title}{( string.IsNullOrWhiteSpace(Name) ? "" : $" {Name}" )}{( Arguments == null ? "" : string.Join(", ", Arguments.Select(z => z.ToString().Trim('"'))) )}"; - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } - public Command WithArguments(params object[] args) => this with { Arguments = JArray.FromObject(args) }; - public static Command Create(string name, params object[] args) => new() { Name = name, Arguments = JArray.FromObject(args) }; + public Command WithArguments(params object[] args) + { + return this with { Arguments = JArray.FromObject(args) }; + } + + public static Command Create(string name, params object[] args) + { + return new() { Name = name, Arguments = JArray.FromObject(args) }; + } } } diff --git a/src/Protocol/Models/CreateFile.cs b/src/Protocol/Models/CreateFile.cs index 8f4340478..4ddfce1cc 100644 --- a/src/Protocol/Models/CreateFile.cs +++ b/src/Protocol/Models/CreateFile.cs @@ -15,7 +15,7 @@ public record CreateFile : IFile /// /// The resource to create. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// Additional Options diff --git a/src/Protocol/Models/DeleteFile.cs b/src/Protocol/Models/DeleteFile.cs index 0ced6d278..5a9438caf 100644 --- a/src/Protocol/Models/DeleteFile.cs +++ b/src/Protocol/Models/DeleteFile.cs @@ -15,7 +15,7 @@ public record DeleteFile : IFile /// /// The file to delete. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// Delete Options. diff --git a/src/Protocol/Models/Diagnostic.cs b/src/Protocol/Models/Diagnostic.cs index 1c546008d..b8bac7195 100644 --- a/src/Protocol/Models/Diagnostic.cs +++ b/src/Protocol/Models/Diagnostic.cs @@ -16,7 +16,7 @@ public partial record Diagnostic : ICanHaveData /// /// The range at which the message applies. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The diagnostic's severity. Can be omitted. If omitted it is up to the @@ -49,7 +49,7 @@ public partial record Diagnostic : ICanHaveData /// /// The diagnostic's message. /// - public string Message { get; init; } + public string Message { get; init; } = null!; /// /// Additional metadata about the diagnostic. @@ -97,17 +97,29 @@ public DiagnosticCode(string value) } public bool IsLong => String == null; - public long Long { get; } + public long Long { get; } public bool IsString => String != null; - public string? String { get; } + public string? String { get; } - public static implicit operator DiagnosticCode(long value) => new DiagnosticCode(value); + public static implicit operator DiagnosticCode(long value) + { + return new DiagnosticCode(value); + } - public static implicit operator DiagnosticCode(string value) => new DiagnosticCode(value); + public static implicit operator DiagnosticCode(string value) + { + return new DiagnosticCode(value); + } - public static implicit operator long(DiagnosticCode value) => value.IsLong ? value.Long : 0; + public static implicit operator long(DiagnosticCode value) + { + return value.IsLong ? value.Long : 0; + } - public static implicit operator string?(DiagnosticCode value) => value.IsString ? value.String : null; + public static implicit operator string?(DiagnosticCode value) + { + return value.IsString ? value.String : null; + } } [JsonConverter(typeof(NumberEnumConverter))] @@ -168,7 +180,7 @@ public record CodeDescription /// /// An URI to open with more information about the diagnostic error. /// - public Uri Href { get; init; } + public Uri Href { get; init; } = null!; } /// @@ -181,11 +193,11 @@ public record DiagnosticRelatedInformation /// /// The location of this related diagnostic information. /// - public Location Location { get; init; } + public Location Location { get; init; } = null!; /// /// The message of this related diagnostic information. /// - public string Message { get; init; } + public string Message { get; init; } = null!; } } diff --git a/src/Protocol/Models/FileEvent.cs b/src/Protocol/Models/FileEvent.cs index 5b96342d8..9d9f7a413 100644 --- a/src/Protocol/Models/FileEvent.cs +++ b/src/Protocol/Models/FileEvent.cs @@ -11,7 +11,7 @@ public record FileEvent /// /// The file's URI. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// The change type. @@ -21,6 +21,9 @@ public record FileEvent private string DebuggerDisplay => $"[{Type}] {Uri}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/FileSystemWatcher.cs b/src/Protocol/Models/FileSystemWatcher.cs index 22cc7ef76..96ca17de4 100644 --- a/src/Protocol/Models/FileSystemWatcher.cs +++ b/src/Protocol/Models/FileSystemWatcher.cs @@ -16,7 +16,7 @@ public record FileSystemWatcher /// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) /// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) /// - public string GlobPattern { get; init; } + public string GlobPattern { get; init; } = null!; /// /// The kind of events of interest. If omitted it defaults @@ -28,6 +28,9 @@ public record FileSystemWatcher private string DebuggerDisplay => $"[{Kind}] {GlobPattern}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/Location.cs b/src/Protocol/Models/Location.cs index d5729823b..29814a3dd 100644 --- a/src/Protocol/Models/Location.cs +++ b/src/Protocol/Models/Location.cs @@ -10,16 +10,19 @@ public record Location /// /// The uri of the document /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; /// /// The range in side the document given by the uri /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; private string DebuggerDisplay => $"{{{Range} {Uri}}}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/LocationLink.cs b/src/Protocol/Models/LocationLink.cs index f1cb745e7..506b4a7da 100644 --- a/src/Protocol/Models/LocationLink.cs +++ b/src/Protocol/Models/LocationLink.cs @@ -16,19 +16,19 @@ public record LocationLink /// /// The target resource identifier of this link. /// - public DocumentUri TargetUri { get; init; } + public DocumentUri TargetUri { get; init; } = null!; /// /// The full target range of this link. If the target for example is a symbol then target range is the /// range enclosing this symbol not including leading/trailing whitespace but everything else /// like comments. This information is typically used to highlight the range in the editor. /// - public Range TargetRange { get; init; } + public Range TargetRange { get; init; } = null!; /// /// The range that should be selected and revealed when this link is being followed, e.g the name of a function. /// Must be contained by the the `targetRange`. See also `DocumentSymbol#range` /// - public Range TargetSelectionRange { get; init; } + public Range TargetSelectionRange { get; init; } = null!; } } diff --git a/src/Protocol/Models/MarkupContent.cs b/src/Protocol/Models/MarkupContent.cs index c59da7c41..95d0043a3 100644 --- a/src/Protocol/Models/MarkupContent.cs +++ b/src/Protocol/Models/MarkupContent.cs @@ -37,11 +37,14 @@ public record MarkupContent /// /// The content itself /// - public string Value { get; init; } + public string Value { get; init; } = null!; private string DebuggerDisplay => $"[{Kind}] {Value}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/Range.cs b/src/Protocol/Models/Range.cs index 4875704ac..d0816fbf8 100644 --- a/src/Protocol/Models/Range.cs +++ b/src/Protocol/Models/Range.cs @@ -21,16 +21,22 @@ public Range(int startLine, int startCharacter, int endLine, int endCharacter) /// /// The range's start position. /// - public Position Start { get; init; } + public Position Start { get; init; } = null!; /// /// The range's end position. /// - public Position End { get; init; } + public Position End { get; init; } = null!; - public static implicit operator Range((Position start, Position end) value) => new Range(value.start, value.end); + public static implicit operator Range((Position start, Position end) value) + { + return new Range(value.start, value.end); + } /// - public override string ToString() => $"[start: ({Start?.Line}, {Start?.Character}), end: ({End?.Line}, {End?.Character})]"; + public override string ToString() + { + return $"[start: ({Start?.Line}, {Start?.Character}), end: ({End?.Line}, {End?.Character})]"; + } } } diff --git a/src/Protocol/Models/RenameFile.cs b/src/Protocol/Models/RenameFile.cs index 3503b0377..4964dd22a 100644 --- a/src/Protocol/Models/RenameFile.cs +++ b/src/Protocol/Models/RenameFile.cs @@ -15,12 +15,12 @@ public record RenameFile : IFile /// /// The old (existing) location. /// - public DocumentUri OldUri { get; init; } + public DocumentUri OldUri { get; init; } = null!; /// /// The new location. /// - public DocumentUri NewUri { get; init; } + public DocumentUri NewUri { get; init; } = null!; /// /// Rename Options. diff --git a/src/Protocol/Models/ServerInfo.cs b/src/Protocol/Models/ServerInfo.cs index 8e1ecb1c8..c263e32cd 100644 --- a/src/Protocol/Models/ServerInfo.cs +++ b/src/Protocol/Models/ServerInfo.cs @@ -14,7 +14,7 @@ public record ServerInfo /// /// The name of the server as defined by the server. /// - public string Name { get; init; } + public string Name { get; init; } = null!; /// /// The servers's version as defined by the server. @@ -25,6 +25,9 @@ public record ServerInfo private string DebuggerDisplay => string.IsNullOrWhiteSpace(Version) ? Name : $"{Name} ({Version})"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/TextDocumentIdentifier.cs b/src/Protocol/Models/TextDocumentIdentifier.cs index fa0d92cc7..8f071be02 100644 --- a/src/Protocol/Models/TextDocumentIdentifier.cs +++ b/src/Protocol/Models/TextDocumentIdentifier.cs @@ -5,23 +5,37 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] public record TextDocumentIdentifier { - public TextDocumentIdentifier() { } + public TextDocumentIdentifier() + { + } - public TextDocumentIdentifier(DocumentUri uri) => Uri = uri; + public TextDocumentIdentifier(DocumentUri uri) + { + Uri = uri; + } /// /// The text document's URI. /// - public DocumentUri Uri { get; init; } + public DocumentUri Uri { get; init; } = null!; - public static implicit operator TextDocumentIdentifier(DocumentUri uri) => new TextDocumentIdentifier { Uri = uri }; + public static implicit operator TextDocumentIdentifier(DocumentUri uri) + { + return new TextDocumentIdentifier { Uri = uri }; + } - public static implicit operator TextDocumentIdentifier(string uri) => new TextDocumentIdentifier { Uri = uri }; + public static implicit operator TextDocumentIdentifier(string uri) + { + return new TextDocumentIdentifier { Uri = uri }; + } // ReSharper disable once ConstantConditionalAccessQualifier private string DebuggerDisplay => Uri?.ToString() ?? string.Empty; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/TextDocumentItem.cs b/src/Protocol/Models/TextDocumentItem.cs index e3d04bda8..0a51cedf3 100644 --- a/src/Protocol/Models/TextDocumentItem.cs +++ b/src/Protocol/Models/TextDocumentItem.cs @@ -8,7 +8,7 @@ public record TextDocumentItem : TextDocumentIdentifier /// /// The text document's language identifier. /// - public string LanguageId { get; init; } + public string LanguageId { get; init; } = null!; /// /// The version number of this document (it will strictly increase after each @@ -19,11 +19,14 @@ public record TextDocumentItem : TextDocumentIdentifier /// /// The content of the opened text document. /// - public string Text { get; init; } + public string Text { get; init; } = null!; private string DebuggerDisplay => $"({LanguageId}@{Version}) {Uri}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Models/TextDocumentPositionParams.cs b/src/Protocol/Models/TextDocumentPositionParams.cs index deef59a09..0d3c6eb26 100644 --- a/src/Protocol/Models/TextDocumentPositionParams.cs +++ b/src/Protocol/Models/TextDocumentPositionParams.cs @@ -5,11 +5,11 @@ public record TextDocumentPositionParams : ITextDocumentIdentifierParams /// /// The text document. /// - public TextDocumentIdentifier TextDocument { get; init; } + public TextDocumentIdentifier TextDocument { get; init; } = null!; /// /// The position inside the text document. /// - public Position Position { get; init; } + public Position Position { get; init; } = null!; } } diff --git a/src/Protocol/Models/TextEdit.cs b/src/Protocol/Models/TextEdit.cs index 8ce7dbbca..4b6ac9fff 100644 --- a/src/Protocol/Models/TextEdit.cs +++ b/src/Protocol/Models/TextEdit.cs @@ -15,18 +15,22 @@ public record TextEdit /// The range of the text document to be manipulated. To insert /// text into a document create a range where start === end. /// - public Range Range { get; init; } + public Range Range { get; init; } = null!; /// /// The string to be inserted. For delete operations use an /// empty string. /// - public string NewText { get; init; } + public string NewText { get; init; } = null!; - private string DebuggerDisplay => $"{Range} {( string.IsNullOrWhiteSpace(NewText) ? string.Empty : NewText.Length > 30 ? NewText.Substring(0, 30) : NewText )}"; + private string DebuggerDisplay => + $"{Range} {( string.IsNullOrWhiteSpace(NewText) ? string.Empty : NewText.Length > 30 ? NewText.Substring(0, 30) : NewText )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } /// @@ -40,23 +44,26 @@ public record InsertReplaceEdit /// /// The string to be inserted. /// - public string NewText { get; init; } + public string NewText { get; init; } = null!; /// /// The range if the insert is requested /// - public Range Insert { get; init; } + public Range Insert { get; init; } = null!; /// /// The range if the replace is requested. /// - public Range Replace { get; init; } + public Range Replace { get; init; } = null!; private string DebuggerDisplay => $"{Insert} / {Replace} {( string.IsNullOrWhiteSpace(NewText) ? string.Empty : NewText.Length > 30 ? NewText.Substring(0, 30) : NewText )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } [JsonConverter(typeof(TextEditOrInsertReplaceEditConverter))] @@ -84,7 +91,8 @@ public TextEditOrInsertReplaceEdit(InsertReplaceEdit value) public InsertReplaceEdit? InsertReplaceEdit { get => _insertReplaceEdit; - set { + set + { _insertReplaceEdit = value; _textEdit = null; } @@ -95,7 +103,8 @@ public InsertReplaceEdit? InsertReplaceEdit public TextEdit? TextEdit { get => _textEdit; - set { + set + { _insertReplaceEdit = default; _textEdit = value; } @@ -103,23 +112,41 @@ public TextEdit? TextEdit public object? RawValue { - get { + get + { if (IsTextEdit) return TextEdit!; if (IsInsertReplaceEdit) return InsertReplaceEdit!; return default; } } - public static TextEditOrInsertReplaceEdit From(TextEdit value) => new(value); - public static implicit operator TextEditOrInsertReplaceEdit(TextEdit value) => new(value); + public static TextEditOrInsertReplaceEdit From(TextEdit value) + { + return new(value); + } + + public static implicit operator TextEditOrInsertReplaceEdit(TextEdit value) + { + return new(value); + } - public static TextEditOrInsertReplaceEdit From(InsertReplaceEdit value) => new(value); - public static implicit operator TextEditOrInsertReplaceEdit(InsertReplaceEdit value) => new(value); + public static TextEditOrInsertReplaceEdit From(InsertReplaceEdit value) + { + return new(value); + } + + public static implicit operator TextEditOrInsertReplaceEdit(InsertReplaceEdit value) + { + return new(value); + } private string DebuggerDisplay => $"{( IsInsertReplaceEdit ? $"insert: {InsertReplaceEdit}" : IsTextEdit ? $"edit: {TextEdit}" : "..." )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } /// @@ -133,7 +160,7 @@ public record ChangeAnnotation /// A human-readable string describing the actual change. The string /// is rendered prominent in the user interface. /// - public string Label { get; init; } + public string Label { get; init; } = null!; /// /// A flag which indicates that user confirmation is needed @@ -157,11 +184,17 @@ public record ChangeAnnotationIdentifier /// /// @since 3.16.0 /// - public string Identifier { get; init; } + public string Identifier { get; init; } = null!; - public static implicit operator string(ChangeAnnotationIdentifier identifier) => identifier.Identifier; + public static implicit operator string(ChangeAnnotationIdentifier identifier) + { + return identifier.Identifier; + } - public static implicit operator ChangeAnnotationIdentifier(string identifier) => new() { Identifier = identifier }; + public static implicit operator ChangeAnnotationIdentifier(string identifier) + { + return new() { Identifier = identifier }; + } } /// @@ -176,12 +209,15 @@ public record AnnotatedTextEdit : TextEdit /// /// The actual annotation /// - public ChangeAnnotationIdentifier AnnotationId { get; init; } + public ChangeAnnotationIdentifier AnnotationId { get; init; } = null!; private string DebuggerDisplay => $"annotationId: {Range} {( string.IsNullOrWhiteSpace(NewText) ? string.Empty : NewText.Length > 30 ? NewText.Substring(0, 30) : NewText )}"; /// - public override string ToString() => DebuggerDisplay; + public override string ToString() + { + return DebuggerDisplay; + } } } diff --git a/src/Protocol/Progress/PartialItemRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemRequestProgressObservable.cs index 439e672b3..5e921134d 100644 --- a/src/Protocol/Progress/PartialItemRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemRequestProgressObservable.cs @@ -1,5 +1,4 @@ ο»Ώusing System; -using System.Reactive; using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Linq; @@ -8,7 +7,6 @@ using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.LanguageServer.Protocol.Models; @@ -35,14 +33,16 @@ Action onCompleteAction { _serializer = serializer; _dataSubject = new ReplaySubject(1, Scheduler.Immediate); - _disposable = new CompositeDisposable() { _dataSubject }; + _disposable = new CompositeDisposable { _dataSubject }; _task = Observable.Create( - observer => new CompositeDisposable() { + observer => new CompositeDisposable + { _dataSubject .ForkJoin( requestResult .Do( - _ => { + _ => + { if (_receivedPartialData) return; _dataSubject.OnNext(reverseFactory(_)); }, @@ -63,8 +63,15 @@ Action onCompleteAction public ProgressToken ProgressToken { get; } public Type ParamsType { get; } = typeof(TItem); - void IObserver.OnCompleted() => OnCompleted(); - void IObserver.OnError(Exception error) => OnError(error); + void IObserver.OnCompleted() + { + OnCompleted(); + } + + void IObserver.OnError(Exception error) + { + OnError(error); + } private void OnCompleted() { @@ -91,11 +98,20 @@ public void Dispose() _disposable.Dispose(); } - public IDisposable Subscribe(IObserver observer) => _dataSubject.Subscribe(observer); + public IDisposable Subscribe(IObserver observer) + { + return _dataSubject.Subscribe(observer); + } #pragma warning disable VSTHRD003 - public Task AsTask() => _task; + public Task AsTask() + { + return _task; + } #pragma warning restore VSTHRD003 - public TaskAwaiter GetAwaiter() => _task.GetAwaiter(); + public TaskAwaiter GetAwaiter() + { + return _task.GetAwaiter(); + } } } diff --git a/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs index 79a4fa040..3ca17fe7d 100644 --- a/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs @@ -1,7 +1,6 @@ ο»Ώusing System; using System.Collections.Generic; using System.Linq; -using System.Reactive; using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Linq; @@ -17,7 +16,8 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress { - internal class PartialItemsRequestProgressObservable : IRequestProgressObservable, TResult>, IObserver, IDisposable + internal class PartialItemsRequestProgressObservable : IRequestProgressObservable, TResult>, IObserver, + IDisposable where TResult : IEnumerable? { private readonly ISerializer _serializer; @@ -37,13 +37,15 @@ Action onCompleteAction { _serializer = serializer; _dataSubject = new ReplaySubject>(int.MaxValue, Scheduler.Immediate); - _disposable = new CompositeDisposable() { _dataSubject }; + _disposable = new CompositeDisposable { _dataSubject }; _task = Observable.Create( - observer => new CompositeDisposable() { + observer => new CompositeDisposable + { _dataSubject .Aggregate( new List(), - (acc, data) => { + (acc, data) => + { acc.AddRange(data); return acc; } @@ -70,8 +72,15 @@ Action onCompleteAction public ProgressToken ProgressToken { get; } public Type ParamsType { get; } = typeof(TItem); - void IObserver.OnCompleted() => OnCompleted(); - void IObserver.OnError(Exception error) => OnError(error); + void IObserver.OnCompleted() + { + OnCompleted(); + } + + void IObserver.OnError(Exception error) + { + OnError(error); + } private void OnCompleted() { @@ -99,15 +108,25 @@ public void Dispose() } // public IDisposable Subscribe(IObserver> observer) => _disposable.IsDisposed ? Disposable.Empty : _dataSubject.Subscribe(observer); - public IDisposable Subscribe(IObserver> observer) => _dataSubject.Subscribe(observer); + public IDisposable Subscribe(IObserver> observer) + { + return _dataSubject.Subscribe(observer); + } #pragma warning disable VSTHRD003 - public Task AsTask() => _task; + public Task AsTask() + { + return _task; + } #pragma warning restore VSTHRD003 - public TaskAwaiter GetAwaiter() => _task.GetAwaiter(); + public TaskAwaiter GetAwaiter() + { + return _task.GetAwaiter(); + } } - internal class PartialItemsRequestProgressObservable : PartialItemsRequestProgressObservable?>, IRequestProgressObservable + internal class PartialItemsRequestProgressObservable : PartialItemsRequestProgressObservable?>, + IRequestProgressObservable { public PartialItemsRequestProgressObservable( ISerializer serializer, diff --git a/src/Protocol/Serialization/Converters/ChangeAnnotationIdentifierConverter.cs b/src/Protocol/Serialization/Converters/ChangeAnnotationIdentifierConverter.cs index 8e85870a9..d4756e846 100644 --- a/src/Protocol/Serialization/Converters/ChangeAnnotationIdentifierConverter.cs +++ b/src/Protocol/Serialization/Converters/ChangeAnnotationIdentifierConverter.cs @@ -4,7 +4,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters { - internal class ChangeAnnotationIdentifierConverter : JsonConverter + internal class ChangeAnnotationIdentifierConverter : JsonConverter { public override ChangeAnnotationIdentifier? ReadJson( JsonReader reader, Type objectType, ChangeAnnotationIdentifier? existingValue, diff --git a/src/Protocol/Server/Capabilities/IServerCapabilities.cs b/src/Protocol/Server/Capabilities/IServerCapabilities.cs index a94a44e6c..b441b237c 100644 --- a/src/Protocol/Server/Capabilities/IServerCapabilities.cs +++ b/src/Protocol/Server/Capabilities/IServerCapabilities.cs @@ -1,5 +1,4 @@ ο»Ώusing System.Collections.Generic; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.LanguageServer.Protocol.Models; diff --git a/src/Protocol/Server/Capabilities/IWorkspaceServerCapabilities.cs b/src/Protocol/Server/Capabilities/IWorkspaceServerCapabilities.cs index cdf221094..276e1c510 100644 --- a/src/Protocol/Server/Capabilities/IWorkspaceServerCapabilities.cs +++ b/src/Protocol/Server/Capabilities/IWorkspaceServerCapabilities.cs @@ -1,6 +1,4 @@ -ο»Ώusing System.Collections.Generic; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; +ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Models; namespace OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities { diff --git a/src/Protocol/Shared/LspHandlerDescriptor.cs b/src/Protocol/Shared/LspHandlerDescriptor.cs index 870dd9fc2..dd3888669 100644 --- a/src/Protocol/Shared/LspHandlerDescriptor.cs +++ b/src/Protocol/Shared/LspHandlerDescriptor.cs @@ -32,7 +32,8 @@ public LspHandlerDescriptor( ILspHandlerTypeDescriptor? typeDescriptor ) : this( index, - method, key, handler, handlerType, @params, registrationType, registrationMethod, registrationOptions, capabilityType, requestProcessType, disposeAction, + method, key, handler, handlerType, @params, registrationType, registrationMethod, registrationOptions, capabilityType, requestProcessType, + disposeAction, typeDescriptor, null ) { @@ -73,7 +74,7 @@ public LspHandlerDescriptor( .Select(x => x.GetGenericArguments()[0]) .OrderBy(x => x == typeof(Unit)) .FirstOrDefault() - ?? typeDescriptor?.ResponseType ?? typeof(Unit); + ?? typeDescriptor?.ResponseType ?? typeof(Unit); // If multiple are implemented this behavior is unknown CanBeResolvedHandlerType = handler.GetType().GetTypeInfo() @@ -88,7 +89,8 @@ public LspHandlerDescriptor( typeof(DelegatingNotification<>).IsAssignableFrom(@params.GetGenericTypeDefinition()) ); - IsNotification = handlerType.GetInterfaces().Any(z => z.IsGenericType && typeof(IJsonRpcNotificationHandler<>).IsAssignableFrom(z.GetGenericTypeDefinition())); + IsNotification = handlerType.GetInterfaces() + .Any(z => z.IsGenericType && typeof(IJsonRpcNotificationHandler<>).IsAssignableFrom(z.GetGenericTypeDefinition())); IsRequest = !IsNotification; RequestProcessType = requestProcessType; TypeDescriptor = typeDescriptor; @@ -101,7 +103,8 @@ public LspHandlerDescriptor( string key, object? registrationOptions ) : this( - descriptor.Index, descriptor.Method, key, descriptor.Handler, descriptor.HandlerType, descriptor.Params, descriptor.RegistrationType, descriptor.RegistrationMethod, + descriptor.Index, descriptor.Method, key, descriptor.Handler, descriptor.HandlerType, descriptor.Params, descriptor.RegistrationType, + descriptor.RegistrationMethod, registrationOptions, descriptor.CapabilityType, descriptor.RequestProcessType, descriptor._disposeAction, descriptor.TypeDescriptor, descriptor.Id ) { @@ -137,35 +140,54 @@ public LspHandlerDescriptor( public RequestProcessType? RequestProcessType { get; } public ILspHandlerTypeDescriptor? TypeDescriptor { get; } - public void Dispose() => _disposeAction(); + public void Dispose() + { + _disposeAction(); + } - public override bool Equals(object? obj) => Equals(obj as LspHandlerDescriptor); + public override bool Equals(object? obj) + { + return Equals(obj as LspHandlerDescriptor); + } - public bool Equals(LspHandlerDescriptor? other) => - other is not null && + public bool Equals(LspHandlerDescriptor? other) + { + return other is not null && // EqualityComparer.Default.Equals(HandlerType, other.HandlerType) && - Method == other.Method && - Key == other.Key; + Method == other.Method && + Key == other.Key; + } public override int GetHashCode() { var hashCode = -45133801; // hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(HandlerType); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Method); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Key); + hashCode = ( hashCode * -1521134295 ) + EqualityComparer.Default.GetHashCode(Method); + hashCode = ( hashCode * -1521134295 ) + EqualityComparer.Default.GetHashCode(Key); return hashCode; } - public static bool operator ==(LspHandlerDescriptor descriptor1, LspHandlerDescriptor descriptor2) => - EqualityComparer.Default.Equals(descriptor1, descriptor2); + public static bool operator ==(LspHandlerDescriptor descriptor1, LspHandlerDescriptor descriptor2) + { + return EqualityComparer.Default.Equals(descriptor1, descriptor2); + } - public static bool operator !=(LspHandlerDescriptor descriptor1, LspHandlerDescriptor descriptor2) => !( descriptor1 == descriptor2 ); + public static bool operator !=(LspHandlerDescriptor descriptor1, LspHandlerDescriptor descriptor2) + { + return !( descriptor1 == descriptor2 ); + } internal class AllowAllEqualityComparer : IEqualityComparer { - public bool Equals(LspHandlerDescriptor x, LspHandlerDescriptor y) => x.Id == y.Id; - - public int GetHashCode(LspHandlerDescriptor obj) => obj.Id.GetHashCode(); + public bool Equals(LspHandlerDescriptor x, LspHandlerDescriptor y) + { + return x.Id == y.Id; + } + + public int GetHashCode(LspHandlerDescriptor obj) + { + return obj.Id.GetHashCode(); + } } } } diff --git a/src/Protocol/Shared/LspHandlerTypeDescriptorProvider.cs b/src/Protocol/Shared/LspHandlerTypeDescriptorProvider.cs index aa921f0ca..877ed5e31 100644 --- a/src/Protocol/Shared/LspHandlerTypeDescriptorProvider.cs +++ b/src/Protocol/Shared/LspHandlerTypeDescriptorProvider.cs @@ -46,14 +46,27 @@ internal LspHandlerTypeDescriptorProvider(IEnumerable assemblies, bool .FirstOrDefault()?.Method; } - public Type? GetRegistrationType(string method) => KnownHandlers - .SelectMany(z => z) - .FirstOrDefault(z => z.HasRegistration && z.RegistrationMethod == method)?.RegistrationType; + public Type? GetRegistrationType(string method) + { + return KnownHandlers + .SelectMany(z => z) + .FirstOrDefault(z => z.HasRegistration && z.RegistrationMethod == method)?.RegistrationType; + } - public ILspHandlerTypeDescriptor? GetHandlerTypeDescriptor() => GetHandlerTypeDescriptor(typeof(TA)); - IHandlerTypeDescriptor? IHandlerTypeDescriptorProvider.GetHandlerTypeDescriptor(Type type) => GetHandlerTypeDescriptor(type); + public ILspHandlerTypeDescriptor? GetHandlerTypeDescriptor() + { + return GetHandlerTypeDescriptor(typeof(TA)); + } - IHandlerTypeDescriptor? IHandlerTypeDescriptorProvider.GetHandlerTypeDescriptor() => GetHandlerTypeDescriptor(); + IHandlerTypeDescriptor? IHandlerTypeDescriptorProvider.GetHandlerTypeDescriptor(Type type) + { + return GetHandlerTypeDescriptor(type); + } + + IHandlerTypeDescriptor? IHandlerTypeDescriptorProvider.GetHandlerTypeDescriptor() + { + return GetHandlerTypeDescriptor(); + } public ILspHandlerTypeDescriptor? GetHandlerTypeDescriptor(Type type) { @@ -69,12 +82,18 @@ internal LspHandlerTypeDescriptorProvider(IEnumerable assemblies, bool } var methodName = GetMethodName(type); - return string.IsNullOrWhiteSpace(methodName) ? null : KnownHandlers[methodName!].FirstOrDefault(); + return string.IsNullOrWhiteSpace(methodName) ? null : KnownHandlers[methodName].FirstOrDefault(); } - public string? GetMethodName() where T : IJsonRpcHandler => GetMethodName(typeof(T)); + public string? GetMethodName() where T : IJsonRpcHandler + { + return GetMethodName(typeof(T)); + } - public bool IsMethodName(string name, params Type[] types) => types.Any(z => GetMethodName(z)?.Equals(name) == true); + public bool IsMethodName(string name, params Type[] types) + { + return types.Any(z => GetMethodName(z)?.Equals(name) == true); + } public string? GetMethodName(Type type) { diff --git a/src/Server/ClientCapabilityProvider.cs b/src/Server/ClientCapabilityProvider.cs index 1992dcad3..9a560cda7 100644 --- a/src/Server/ClientCapabilityProvider.cs +++ b/src/Server/ClientCapabilityProvider.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Shared; using OmniSharp.Extensions.LanguageServer.Shared; namespace OmniSharp.Extensions.LanguageServer.Server @@ -17,8 +15,9 @@ internal class ClientCapabilityProvider private readonly bool _supportsProgress; public ClientCapabilityProvider( - IHandlerCollection collection, - bool supportsProgress) + IHandlerCollection collection, + bool supportsProgress + ) { _collection = collection; _supportsProgress = supportsProgress; @@ -31,11 +30,13 @@ public bool HasStaticHandler(Supports capability) // However if the client does not tell us it's capabilities we should just assume that they do not support // dynamic registrations but we should report any capabilities statically if (capability.IsSupported && capability.Value != null && capability.Value.DynamicRegistration) return false; - return _collection.Any(z => z.HasCapability &&z.CapabilityType == typeof(T)); + return _collection.Any(z => z.HasCapability && z.CapabilityType == typeof(T)); } public IOptionsGetter GetStaticOptions(Supports capability) where T : DynamicCapability - => !HasStaticHandler(capability) ? Null : new OptionsGetter(_collection, _supportsProgress); + { + return !HasStaticHandler(capability) ? Null : new OptionsGetter(_collection, _supportsProgress); + } private static readonly IOptionsGetter Null = new NullOptionsGetter(); @@ -68,11 +69,17 @@ private class NullOptionsGetter : IOptionsGetter { public TOptions? Get(Func, TOptions> action) where TOptions : class - where TInterface : notnull => null; + where TInterface : notnull + { + return null; + } public TOptions? Reduce(Func, IEnumerable, TOptions> action) where TOptions : class - where TInterface : notnull => null; + where TInterface : notnull + { + return null; + } } private class OptionsGetter : IOptionsGetter diff --git a/src/Server/LanguageServer.cs b/src/Server/LanguageServer.cs index 6838a50c0..ef81d70d8 100644 --- a/src/Server/LanguageServer.cs +++ b/src/Server/LanguageServer.cs @@ -25,7 +25,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Server.WorkDone; using OmniSharp.Extensions.LanguageServer.Protocol.Shared; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using OmniSharp.Extensions.LanguageServer.Server.Abstractions; using OmniSharp.Extensions.LanguageServer.Server.Logging; using OmniSharp.Extensions.LanguageServer.Shared; @@ -35,7 +34,8 @@ namespace OmniSharp.Extensions.LanguageServer.Server { [BuiltIn] - public partial class LanguageServer : JsonRpcServerBase, ILanguageServer, ILanguageProtocolInitializeHandler, ILanguageProtocolInitializedHandler, IAwaitableTermination + public partial class LanguageServer : JsonRpcServerBase, ILanguageServer, ILanguageProtocolInitializeHandler, ILanguageProtocolInitializedHandler, + IAwaitableTermination { private readonly Connection _connection; private ClientVersion? _clientVersion; @@ -63,12 +63,21 @@ public partial class LanguageServer : JsonRpcServerBase, ILanguageServer, ILangu private readonly ILookup _capabilityTypes; private readonly IResolverContext _resolverContext; - internal static IContainer CreateContainer(LanguageServerOptions options, IServiceProvider? outerServiceProvider) => - JsonRpcServerContainer.Create(outerServiceProvider) - .AddLanguageServerInternals(options, outerServiceProvider); + internal static IContainer CreateContainer(LanguageServerOptions options, IServiceProvider? outerServiceProvider) + { + return JsonRpcServerContainer.Create(outerServiceProvider) + .AddLanguageServerInternals(options, outerServiceProvider); + } - public static LanguageServer Create(LanguageServerOptions options) => Create(options, null); - public static LanguageServer Create(Action optionsAction) => Create(optionsAction, null); + public static LanguageServer Create(LanguageServerOptions options) + { + return Create(options, null); + } + + public static LanguageServer Create(Action optionsAction) + { + return Create(optionsAction, null); + } public static LanguageServer Create(Action optionsAction, IServiceProvider? outerServiceProvider) { @@ -77,28 +86,53 @@ public static LanguageServer Create(Action optionsAction, return Create(options, outerServiceProvider); } - public static LanguageServer Create(LanguageServerOptions options, IServiceProvider? outerServiceProvider) => - CreateContainer(options, outerServiceProvider).Resolve(); + public static LanguageServer Create(LanguageServerOptions options, IServiceProvider? outerServiceProvider) + { + return CreateContainer(options, outerServiceProvider).Resolve(); + } + + public static Task From(LanguageServerOptions options) + { + return From(options, null, CancellationToken.None); + } - public static Task From(LanguageServerOptions options) => From(options, null, CancellationToken.None); - public static Task From(Action optionsAction) => From(optionsAction, null, CancellationToken.None); - public static Task From(LanguageServerOptions options, CancellationToken cancellationToken) => From(options, null, cancellationToken); - public static Task From(Action optionsAction, CancellationToken cancellationToken) => From(optionsAction, null, cancellationToken); + public static Task From(Action optionsAction) + { + return From(optionsAction, null, CancellationToken.None); + } - public static Task From(LanguageServerOptions options, IServiceProvider? outerServiceProvider) => - From(options, outerServiceProvider, CancellationToken.None); + public static Task From(LanguageServerOptions options, CancellationToken cancellationToken) + { + return From(options, null, cancellationToken); + } - public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider) => - From(optionsAction, outerServiceProvider, CancellationToken.None); + public static Task From(Action optionsAction, CancellationToken cancellationToken) + { + return From(optionsAction, null, cancellationToken); + } - public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken) + public static Task From(LanguageServerOptions options, IServiceProvider? outerServiceProvider) + { + return From(options, outerServiceProvider, CancellationToken.None); + } + + public static Task From(Action optionsAction, IServiceProvider? outerServiceProvider) + { + return From(optionsAction, outerServiceProvider, CancellationToken.None); + } + + public static Task From( + Action optionsAction, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken + ) { var options = new LanguageServerOptions(); optionsAction(options); return From(options, outerServiceProvider, cancellationToken); } - public static async Task From(LanguageServerOptions options, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken) + public static async Task From( + LanguageServerOptions options, IServiceProvider? outerServiceProvider, CancellationToken cancellationToken + ) { var server = Create(options, outerServiceProvider); await server.Initialize(cancellationToken).ConfigureAwait(false); @@ -112,7 +146,10 @@ public static async Task From(LanguageServerOptions options, ISe /// /// /// - public static LanguageServer PreInit(Action optionsAction) => Create(optionsAction); + public static LanguageServer PreInit(Action optionsAction) + { + return Create(optionsAction); + } /// /// Create the server without connecting to the client @@ -121,7 +158,10 @@ public static async Task From(LanguageServerOptions options, ISe /// /// /// - public static LanguageServer PreInit(LanguageServerOptions options) => Create(options); + public static LanguageServer PreInit(LanguageServerOptions options) + { + return Create(options); + } internal LanguageServer( Connection connection, @@ -358,9 +398,9 @@ out GeneralClientCapabilities generalCapabilities _supportedCapabilities.Initialize(clientCapabilities); foreach (var group in _capabilityTypes) { - foreach (var capabilityType in @group) + foreach (var capabilityType in group) { - if (request.Capabilities.SelectToken(@group.Key) is JObject capabilityData) + if (request.Capabilities.SelectToken(group.Key) is JObject capabilityData) { var capability = capabilityData.ToObject(capabilityType) as ICapability; _supportedCapabilities.Add(capability!); @@ -461,7 +501,9 @@ private InitializeResult ReadServerCapabilities( .Select(x => x.Handler) .OfType() .Select( - x => ( (TextDocumentChangeRegistrationOptions?) x.GetRegistrationOptions(textDocumentCapabilities.Synchronization!, clientCapabilities) ) + x => ( (TextDocumentChangeRegistrationOptions?)x.GetRegistrationOptions( + textDocumentCapabilities.Synchronization!, clientCapabilities + ) ) ?.SyncKind ?? TextDocumentSyncKind.None ) @@ -479,7 +521,8 @@ private InitializeResult ReadServerCapabilities( } else { - serverCapabilities.TextDocumentSync = new TextDocumentSyncOptions { + serverCapabilities.TextDocumentSync = new TextDocumentSyncOptions + { Change = textDocumentSyncKind, OpenClose = _collection.ContainsHandler(typeof(IDidOpenTextDocumentHandler)) || _collection.ContainsHandler(typeof(IDidCloseTextDocumentHandler)), @@ -495,7 +538,8 @@ private InitializeResult ReadServerCapabilities( // TODO: Need a call back here // serverCapabilities.Experimental; - var result = ServerSettings = new InitializeResult { + var result = ServerSettings = new InitializeResult + { Capabilities = serverCapabilities, ServerInfo = _serverInfo }; @@ -523,10 +567,15 @@ public IDisposable Register(Action registryAction) LanguageServerHelpers.InitHandlers(this, result, _supportedCapabilities); } - return LanguageServerHelpers.RegisterHandlers(_initializeComplete.Select(_ => System.Reactive.Unit.Default), Client, WorkDoneManager, _supportedCapabilities, result); + return LanguageServerHelpers.RegisterHandlers( + _initializeComplete.Select(_ => System.Reactive.Unit.Default), Client, WorkDoneManager, _supportedCapabilities, result + ); // return LanguageServerHelpers.RegisterHandlers(_initializingTask ?? _initializeComplete.ToTask(), Client, WorkDoneManager, _supportedCapabilities, result); } - object IServiceProvider.GetService(Type serviceType) => Services.GetService(serviceType); + object IServiceProvider.GetService(Type serviceType) + { + return Services.GetService(serviceType); + } } } diff --git a/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs b/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs index 13240bf60..377e430a9 100644 --- a/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs +++ b/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs @@ -3,12 +3,11 @@ using System.Threading; using System.Threading.Tasks; using MediatR; -using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Models; namespace OmniSharp.Extensions.LanguageServer.Server.Pipelines { - class SemanticTokensDeltaPipeline : IPipelineBehavior + internal class SemanticTokensDeltaPipeline : IPipelineBehavior where TRequest : notnull { public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) @@ -33,9 +32,9 @@ class SemanticTokensDeltaPipeline : IPipelineBehavior(this IContainer container, LanguageProtocolRpcOptionsBase options) where T : IJsonRpcHandlerRegistry + internal static IContainer AddLanguageProtocolInternals(this IContainer container, LanguageProtocolRpcOptionsBase options) + where T : IJsonRpcHandlerRegistry { options.RequestProcessIdentifier ??= options.SupportsContentModified ? new RequestProcessIdentifier(RequestProcessType.Parallel) @@ -29,7 +28,7 @@ internal static IContainer AddLanguageProtocolInternals(this IContainer conta options.Services.AddLogging(builder => options.LoggingBuilderAction?.Invoke(builder)); container = container.AddJsonRpcServerCore(options); - container.RegisterInstanceMany(new LspHandlerTypeDescriptorProvider(options.Assemblies, options.UseAssemblyAttributeScanning), nonPublicServiceTypes: true); + container.RegisterInstanceMany(new LspHandlerTypeDescriptorProvider(options.Assemblies, options.UseAssemblyAttributeScanning), true); container.RegisterInstanceMany(options.Serializer); container.RegisterInstance(options.RequestProcessIdentifier); @@ -38,11 +37,14 @@ internal static IContainer AddLanguageProtocolInternals(this IContainer conta container.RegisterMany(Reuse.Singleton); container.RegisterMany(nonPublicServiceTypes: true, reuse: Reuse.Singleton); container.Register(Reuse.Singleton); - container.RegisterInitializer((identifiers, context) => { identifiers.Add(context.GetServices().ToArray()); }); + container.RegisterInitializer( + (identifiers, context) => { identifiers.Add(context.GetServices().ToArray()); } + ); container.RegisterMany(Reuse.Singleton); container.RegisterMany(nonPublicServiceTypes: true, reuse: Reuse.Singleton); container.RegisterInitializer( - (manager, context) => { + (manager, context) => + { var descriptions = context.Resolve(); descriptions.Populate(context, manager); } @@ -59,7 +61,7 @@ internal static IContainer AddLanguageProtocolInternals(this IContainer conta .SelectMany(z => z.GetCustomAttributes()) .Select(z => z.ConverterType) .Where(z => typeof(IRegistrationOptionsConverter).IsAssignableFrom(z)), - reuse: Reuse.Singleton + Reuse.Singleton ); } else @@ -69,7 +71,7 @@ internal static IContainer AddLanguageProtocolInternals(this IContainer conta .SelectMany(z => z.GetTypes()) .Where(z => z.IsClass && !z.IsAbstract) .Where(z => typeof(IRegistrationOptionsConverter).IsAssignableFrom(z)), - reuse: Reuse.Singleton + Reuse.Singleton ); } diff --git a/test/.editorconfig b/test/.editorconfig index f508dbdfa..c810d8b12 100644 --- a/test/.editorconfig +++ b/test/.editorconfig @@ -1,10 +1,22 @@ [*] dotnet_diagnostic.CA2007.severity = none dotnet_diagnostic.CS0618.severity = none +dotnet_diagnostic.CS0168.severity = none +dotnet_diagnostic.CS0105.severity = none dotnet_diagnostic.CS4014.severity = none +dotnet_diagnostic.CS0162.severity = none +dotnet_diagnostic.CS8602.severity = none +dotnet_diagnostic.CS8604.severity = none +dotnet_diagnostic.CS8618.severity = none +dotnet_diagnostic.CS8619.severity = none +dotnet_diagnostic.CS8620.severity = none +dotnet_diagnostic.CS8625.severity = none +dotnet_diagnostic.CS8762.severity = none +dotnet_diagnostic.CS8767.severity = none dotnet_diagnostic.CS1998.severity = none dotnet_diagnostic.VSTHRD003.severity = none dotnet_diagnostic.VSTHRD103.severity = none dotnet_diagnostic.VSTHRD105.severity = none dotnet_diagnostic.VSTHRD110.severity = none dotnet_diagnostic.VSTHRD200.severity = none +resharper_unused_parameter_local_highlighting = none diff --git a/test/Client.Tests/ClientTests.cs b/test/Client.Tests/ClientTests.cs index e435f3bb9..650968289 100644 --- a/test/Client.Tests/ClientTests.cs +++ b/test/Client.Tests/ClientTests.cs @@ -7,7 +7,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using TestingUtils; using Xunit; using Xunit.Abstractions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; @@ -46,16 +45,20 @@ public async Task Hover_Success() var expectedHoverContent = new MarkedStringsOrMarkupContent("123", "456", "789"); var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( - new HoverCapability { + new HoverCapability + { ContentFormat = new Container(MarkupKind.Markdown, MarkupKind.PlainText), } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnHover( - (request, _) => { + (request, _) => + { Assert.NotNull(request.TextDocument); Assert.Equal( @@ -67,9 +70,11 @@ public async Task Hover_Success() Assert.Equal(column, request.Position.Character); return Task.FromResult( - new Hover { + new Hover + { Contents = expectedHoverContent, - Range = new Range { + Range = new Range + { Start = request.Position, End = request.Position } @@ -81,7 +86,8 @@ public async Task Hover_Success() ); var hover = await client.TextDocument.RequestHover( - new HoverParams { + new HoverParams + { TextDocument = AbsoluteDocumentPath, Position = ( line, column ) } @@ -118,11 +124,14 @@ public async Task Completions_Success() const int column = 5; var expectedDocumentPath = AbsoluteDocumentPath; var expectedDocumentUri = DocumentUri.FromFileSystemPath(expectedDocumentPath); - var expectedCompletionItems = new[] { - new CompletionItem { + var expectedCompletionItems = new[] + { + new CompletionItem + { Kind = CompletionItemKind.Class, Label = "Class1", - TextEdit = new TextEdit { + TextEdit = new TextEdit + { Range = ( ( line, column ), ( line, column ) ), NewText = "Class1", } @@ -130,15 +139,19 @@ public async Task Completions_Success() }; var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( - new CompletionCapability { - CompletionItem = new CompletionItemCapabilityOptions { + new CompletionCapability + { + CompletionItem = new CompletionItemCapabilityOptions + { DeprecatedSupport = true, DocumentationFormat = new Container(MarkupKind.Markdown, MarkupKind.PlainText), PreselectSupport = true, SnippetSupport = true, - TagSupport = new CompletionItemTagSupportCapabilityOptions { + TagSupport = new CompletionItemTagSupportCapabilityOptions + { ValueSet = new[] { CompletionItemTag.Deprecated } }, CommitCharactersSupport = true @@ -146,9 +159,11 @@ public async Task Completions_Success() } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnCompletion( - (request, _) => { + (request, _) => + { Assert.NotNull(request.TextDocument); Assert.Equal(expectedDocumentUri, request.TextDocument.Uri); @@ -168,7 +183,8 @@ public async Task Completions_Success() ); var actualCompletions = await client.TextDocument.RequestCompletion( - new CompletionParams { + new CompletionParams + { TextDocument = AbsoluteDocumentPath, Position = ( line, column ), }, CancellationToken @@ -179,7 +195,8 @@ public async Task Completions_Success() var actualCompletionItems = actualCompletions.Items.ToArray(); Assert.Collection( - actualCompletionItems, actualCompletionItem => { + actualCompletionItems, actualCompletionItem => + { var expectedCompletionItem = expectedCompletionItems[0]; Assert.Equal(expectedCompletionItem.Kind, actualCompletionItem.Kind); @@ -223,15 +240,20 @@ public async Task SignatureHelp_Success() var expectedDocumentPath = AbsoluteDocumentPath; var expectedDocumentUri = DocumentUri.FromFileSystemPath(expectedDocumentPath); - var expectedSignatureHelp = new SignatureHelp { + var expectedSignatureHelp = new SignatureHelp + { ActiveParameter = 0, ActiveSignature = 0, - Signatures = new[] { - new SignatureInformation { + Signatures = new[] + { + new SignatureInformation + { Documentation = new StringOrMarkupContent("test documentation"), Label = "TestSignature", - Parameters = new[] { - new ParameterInformation { + Parameters = new[] + { + new ParameterInformation + { Documentation = "test parameter documentation", Label = "parameter label" } @@ -241,22 +263,28 @@ public async Task SignatureHelp_Success() }; var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( - new SignatureHelpCapability { + new SignatureHelpCapability + { ContextSupport = true, - SignatureInformation = new SignatureInformationCapabilityOptions { + SignatureInformation = new SignatureInformationCapabilityOptions + { DocumentationFormat = new Container(MarkupKind.Markdown), - ParameterInformation = new SignatureParameterInformationCapabilityOptions { + ParameterInformation = new SignatureParameterInformationCapabilityOptions + { LabelOffsetSupport = true } } } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnSignatureHelp( - (request, cancellationToken) => { + (request, cancellationToken) => + { Assert.NotNull(request.TextDocument); Assert.Equal(expectedDocumentUri, request.TextDocument.Uri); @@ -271,7 +299,8 @@ public async Task SignatureHelp_Success() ); var actualSignatureHelp = await client.TextDocument.RequestSignatureHelp( - new SignatureHelpParams { + new SignatureHelpParams + { TextDocument = AbsoluteDocumentPath, Position = ( line, column ), }, CancellationToken @@ -282,7 +311,8 @@ public async Task SignatureHelp_Success() var actualSignatures = actualSignatureHelp.Signatures.ToArray(); Assert.Collection( - actualSignatures, actualSignature => { + actualSignatures, actualSignature => + { var expectedSignature = expectedSignatureHelp.Signatures.ToArray()[0]; Assert.True(actualSignature.Documentation!.HasString); @@ -294,7 +324,8 @@ public async Task SignatureHelp_Success() var actualParameters = actualSignature.Parameters!.ToArray(); Assert.Collection( - actualParameters, actualParameter => { + actualParameters, actualParameter => + { var expectedParameter = expectedParameters[0]; Assert.True(actualParameter.Documentation!.HasString); Assert.Equal(expectedParameter.Documentation!.String, actualParameter.Documentation.String); @@ -318,7 +349,8 @@ public async Task Definition_Success() var expectedDefinitions = new LocationOrLocationLinks( new LocationOrLocationLink( - new Location { + new Location + { Uri = expectedDocumentUri, Range = ( ( line, column ), ( line, column ) ), } @@ -326,16 +358,20 @@ public async Task Definition_Success() ); var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( - new DefinitionCapability { + new DefinitionCapability + { LinkSupport = true } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnDefinition( - (request, cancellationToken) => { + (request, cancellationToken) => + { Assert.NotNull(request.TextDocument); Assert.Equal(expectedDocumentUri, request.TextDocument.Uri); @@ -350,7 +386,8 @@ public async Task Definition_Success() ); var definitions = await client.TextDocument.RequestDefinition( - new DefinitionParams { + new DefinitionParams + { TextDocument = AbsoluteDocumentPath, Position = ( line, column ), }, CancellationToken @@ -358,7 +395,8 @@ public async Task Definition_Success() var actualDefinitions = definitions.ToArray(); Assert.Collection( - actualDefinitions, actualDefinition => { + actualDefinitions, actualDefinition => + { var expectedDefinition = expectedDefinitions.Single(); Assert.NotNull(actualDefinition.Location); @@ -393,21 +431,25 @@ public async Task DocumentHighlights_Success() var expectedDocumentUri = DocumentUri.FromFileSystemPath(expectedDocumentPath); var expectedHighlights = new DocumentHighlightContainer( - new DocumentHighlight { + new DocumentHighlight + { Kind = DocumentHighlightKind.Write, Range = ( ( line, column ), ( line, column ) ), } ); var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( new DocumentHighlightCapability() ); }, - serverOptions => { + serverOptions => + { serverOptions.OnDocumentHighlight( - (request, cancellationToken) => { + (request, cancellationToken) => + { Assert.NotNull(request.TextDocument); Assert.Equal(expectedDocumentUri, request.TextDocument.Uri); @@ -422,7 +464,8 @@ public async Task DocumentHighlights_Success() ); var definitions = await client.TextDocument.RequestDocumentHighlight( - new DocumentHighlightParams { + new DocumentHighlightParams + { TextDocument = AbsoluteDocumentPath, Position = ( line, column ), }, CancellationToken @@ -430,7 +473,8 @@ public async Task DocumentHighlights_Success() var actualDefinitions = definitions!.ToArray(); Assert.Collection( - actualDefinitions, actualHighlight => { + actualDefinitions, actualHighlight => + { var expectedHighlight = expectedHighlights.Single(); Assert.Equal(DocumentHighlightKind.Write, expectedHighlight.Kind); @@ -458,7 +502,8 @@ public async Task DocumentSymbols_DocumentSymbol_Success() var expectedDocumentUri = DocumentUri.FromFileSystemPath(expectedDocumentPath); var detail = "some detail"; - var documentSymbol = new DocumentSymbol { + var documentSymbol = new DocumentSymbol + { Detail = detail, Kind = SymbolKind.Class, Range = new Range(new Position(line, character), new Position(line, character)) @@ -468,26 +513,32 @@ public async Task DocumentSymbols_DocumentSymbol_Success() ); var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( - new DocumentSymbolCapability { + new DocumentSymbolCapability + { DynamicRegistration = true, - SymbolKind = new SymbolKindCapabilityOptions { + SymbolKind = new SymbolKindCapabilityOptions + { ValueSet = new Container( Enum.GetValues(typeof(SymbolKind)).Cast() .ToArray() ) }, - TagSupport = new TagSupportCapabilityOptions { + TagSupport = new TagSupportCapabilityOptions + { ValueSet = new[] { SymbolTag.Deprecated } }, HierarchicalDocumentSymbolSupport = true } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnDocumentSymbol( - (request, cancellationToken) => { + (request, cancellationToken) => + { Assert.NotNull(request.TextDocument); Assert.Equal(expectedDocumentUri, request.TextDocument.Uri); @@ -499,14 +550,16 @@ public async Task DocumentSymbols_DocumentSymbol_Success() ); var symbols = await client.TextDocument.RequestDocumentSymbol( - new DocumentSymbolParams { + new DocumentSymbolParams + { TextDocument = expectedDocumentUri }, CancellationToken ); var actualSymbols = symbols.ToArray(); Assert.Collection( - actualSymbols, actualSymbol => { + actualSymbols, actualSymbol => + { var expectedSymbol = expectedSymbols.Single(); Assert.True(expectedSymbol.IsDocumentSymbol); @@ -541,7 +594,8 @@ public async Task FoldingRanges_Success() var expectedDocumentUri = DocumentUri.FromFileSystemPath(expectedDocumentPath); var expectedFoldingRanges = new Container( - new FoldingRange { + new FoldingRange + { Kind = FoldingRangeKind.Region, StartLine = 5, StartCharacter = 1, @@ -551,17 +605,21 @@ public async Task FoldingRanges_Success() ); var (client, _) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.WithCapability( - new FoldingRangeCapability { + new FoldingRangeCapability + { RangeLimit = 100, LineFoldingOnly = true } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnFoldingRange( - (request, cancellationToken) => { + (request, cancellationToken) => + { Assert.NotNull(request.TextDocument); Assert.Equal(expectedDocumentUri, request.TextDocument.Uri); return Task.FromResult(expectedFoldingRanges)!; @@ -571,14 +629,16 @@ public async Task FoldingRanges_Success() ); var foldingRanges = await client.TextDocument.RequestFoldingRange( - new FoldingRangeRequestParam { + new FoldingRangeRequestParam + { TextDocument = AbsoluteDocumentPath }, CancellationToken ); var actualFoldingRanges = foldingRanges!.ToArray(); Assert.Collection( - actualFoldingRanges, actualFoldingRange => { + actualFoldingRanges, actualFoldingRange => + { var expectedFoldingRange = expectedFoldingRanges.Single(); Assert.Equal(FoldingRangeKind.Region, expectedFoldingRange.Kind); @@ -599,17 +659,22 @@ public async Task Diagnostics_Success() { var documentPath = AbsoluteDocumentPath; var expectedDocumentUri = DocumentUri.FromFileSystemPath(documentPath); - var expectedDiagnostics = new List { - new Diagnostic { + var expectedDiagnostics = new List + { + new Diagnostic + { Source = "Test", Code = new DiagnosticCode(1234), Message = "This is a diagnostic message.", - Range = new Range { - Start = new Position { + Range = new Range + { + Start = new Position + { Line = 2, Character = 5 }, - End = new Position { + End = new Position + { Line = 3, Character = 7 } @@ -624,9 +689,11 @@ public async Task Diagnostics_Success() List? actualDiagnostics = null; var (_, server) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.OnPublishDiagnostics( - request => { + request => + { actualDocumentUri = request.Uri; actualDiagnostics = request.Diagnostics.ToList(); @@ -639,7 +706,8 @@ public async Task Diagnostics_Success() ); server.TextDocument.PublishDiagnostics( - new PublishDiagnosticsParams { + new PublishDiagnosticsParams + { Uri = DocumentUri.FromFileSystemPath(documentPath), Diagnostics = expectedDiagnostics } diff --git a/test/Dap.Tests/DapOutputHandlerTests.cs b/test/Dap.Tests/DapOutputHandlerTests.cs index b86d17e1c..05f336aaa 100644 --- a/test/Dap.Tests/DapOutputHandlerTests.cs +++ b/test/Dap.Tests/DapOutputHandlerTests.cs @@ -5,8 +5,6 @@ using FluentAssertions; using Microsoft.Extensions.Logging.Abstractions; using Newtonsoft.Json.Linq; -using NSubstitute; -using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Client; @@ -20,7 +18,9 @@ public class DapOutputHandlerTests { private static OutputHandler NewHandler(PipeWriter writer) { - return new OutputHandler(writer, new DapProtocolSerializer(), new []{ new AlwaysOutputFilter()}, Scheduler.Immediate, NullLogger.Instance); + return new OutputHandler( + writer, new DapProtocolSerializer(), new[] { new AlwaysOutputFilter() }, Scheduler.Immediate, NullLogger.Instance + ); } [Fact] @@ -51,7 +51,8 @@ public async Task ShouldSerializeNotifications() var pipe = new Pipe(new PipeOptions()); using var handler = NewHandler(pipe.Writer); - var value = new OutgoingNotification { + var value = new OutgoingNotification + { Method = "method", Params = new object() }; @@ -73,7 +74,8 @@ public async Task ShouldSerializeRequests() var pipe = new Pipe(new PipeOptions()); using var handler = NewHandler(pipe.Writer); - var value = new OutgoingRequest { + var value = new OutgoingRequest + { Method = "method", Id = 1, Params = new object(), diff --git a/test/Dap.Tests/DebugAdapterSpecifictionRecieverTests.cs b/test/Dap.Tests/DebugAdapterSpecifictionRecieverTests.cs index 9ea0d05f5..8abb164cf 100644 --- a/test/Dap.Tests/DebugAdapterSpecifictionRecieverTests.cs +++ b/test/Dap.Tests/DebugAdapterSpecifictionRecieverTests.cs @@ -4,7 +4,6 @@ using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; -using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Server.Messages; using Xunit; @@ -39,7 +38,8 @@ public void Should_Camel_Case_As_Expected() { var serializer = new DapProtocolSerializer(); var response = serializer.SerializeObject( - new InitializeResponse() { + new InitializeResponse + { SupportsCancelRequest = true } ); @@ -53,42 +53,48 @@ public SpecificationMessages() { Add( @"{""seq"": ""0"", ""type"": ""request"", ""command"": ""attach"", ""arguments"": { ""__restart"": 3 }}", - new Renor[] { + new Renor[] + { new Request(0, "attach", new JObject { { "__restart", 3 } }) } ); Add( @"{""seq"": ""1"", ""type"": ""request"", ""command"": ""attach""}", - new Renor[] { + new Renor[] + { new Request(1, "attach", new JObject()) } ); Add( @"{""seq"": ""0"", ""type"": ""event"", ""event"": ""breakpoint"", ""body"": { ""reason"": ""new"" }}", - new Renor[] { + new Renor[] + { new Notification("breakpoint", new JObject { { "reason", "new" } }), } ); Add( @"{""seq"": ""1"", ""type"": ""event"", ""event"": ""breakpoint""}", - new Renor[] { + new Renor[] + { new Notification("breakpoint", null) } ); Add( @"{""seq"": ""1"", ""type"": ""response"", ""request_seq"": 3, ""success"": true, ""command"": ""attach"", ""body"": { }}", - new Renor[] { + new Renor[] + { new ServerResponse(3, new JObject()), } ); Add( @"{""seq"": ""1"", ""type"": ""response"", ""request_seq"": 3, ""success"": true, ""command"": ""attach"", ""body"": null}", - new Renor[] { + new Renor[] + { new ServerResponse(3, null), } ); @@ -103,14 +109,16 @@ public SpecificationMessages() Add( @"{""seq"": ""1"", ""type"": ""response"", ""request_seq"": 3, ""success"": false, ""command"": ""attach"", ""body"": null}", - new Renor[] { + new Renor[] + { new ServerError(3, new ServerErrorResult(-1, "Unknown Error", new JObject())), } ); Add( @"[1]", - new Renor[] { + new Renor[] + { new InvalidRequest(string.Empty, "Not an object") } ); diff --git a/test/Dap.Tests/EnumLikeConverterTests.cs b/test/Dap.Tests/EnumLikeConverterTests.cs index 00e7b5465..293b0c202 100644 --- a/test/Dap.Tests/EnumLikeConverterTests.cs +++ b/test/Dap.Tests/EnumLikeConverterTests.cs @@ -1,6 +1,5 @@ using System; using FluentAssertions; -using OmniSharp.Extensions.DebugAdapter.Client; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; @@ -13,19 +12,22 @@ public class EnumLikeConverterTests [Fact] public void PathFormat_Should_Be_Serializable() { - var options = new InitializeRequestArguments() { + var options = new InitializeRequestArguments + { PathFormat = PathFormat.Uri }; Action a = () => new DapSerializer().SerializeObject(options); a.Should().NotThrow(); } + [Fact] public void PathFormat_Should_Be_Deserializable() { - Func a = () => new DapSerializer().DeserializeObject("{\"pathformat\": \"Uri\"}"); + var a = () => new DapSerializer().DeserializeObject("{\"pathformat\": \"Uri\"}"); a.Should().NotThrow().Subject.PathFormat.Should().NotBeNull(); } + [Fact] public void PathFormat_Should_Be_Deserializable_When_Null() { diff --git a/test/Dap.Tests/Integration/ConnectionAndDisconnectionTests.cs b/test/Dap.Tests/Integration/ConnectionAndDisconnectionTests.cs index 6e58eba5f..b0d8b3d2d 100644 --- a/test/Dap.Tests/Integration/ConnectionAndDisconnectionTests.cs +++ b/test/Dap.Tests/Integration/ConnectionAndDisconnectionTests.cs @@ -7,9 +7,9 @@ using OmniSharp.Extensions.DebugAdapter.Testing; using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; + #pragma warning disable CS0162 namespace Dap.Tests.Integration @@ -30,7 +30,7 @@ public async Task Server_Should_Stay_Alive_When_Requests_Throw_An_Exception() var result = await client.SendRequest("keepalive").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => client.SendRequest("throw").ReturningVoid(CancellationToken); + var a = () => client.SendRequest("throw").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await client.SendRequest("keepalive").Returning(CancellationToken); @@ -45,7 +45,7 @@ public async Task Client_Should_Stay_Alive_When_Requests_Throw_An_Exception() var result = await server.SendRequest("keepalive").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => server.SendRequest("throw").ReturningVoid(CancellationToken); + var a = () => server.SendRequest("throw").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await server.SendRequest("keepalive").Returning(CancellationToken); @@ -60,7 +60,7 @@ public async Task Server_Should_Support_Links() var result = await client.SendRequest("ka").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => client.SendRequest("t").ReturningVoid(CancellationToken); + var a = () => client.SendRequest("t").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await client.SendRequest("ka").Returning(CancellationToken); @@ -75,7 +75,7 @@ public async Task Client_Should_Support_Links() var result = await server.SendRequest("ka").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => server.SendRequest("t").ReturningVoid(CancellationToken); + var a = () => server.SendRequest("t").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await server.SendRequest("ka").Returning(CancellationToken); @@ -88,7 +88,8 @@ private void ConfigureClient(DebugAdapterClientOptions options) options.WithLink("keepalive", "ka"); options.WithLink("throw", "t"); options.OnRequest( - "throw", async ct => { + "throw", async ct => + { throw new NotSupportedException(); return Task.CompletedTask; } @@ -101,7 +102,8 @@ private void ConfigureServer(DebugAdapterServerOptions options) options.WithLink("keepalive", "ka"); options.WithLink("throw", "t"); options.OnRequest( - "throw", async ct => { + "throw", async ct => + { throw new NotSupportedException(); return Task.CompletedTask; } diff --git a/test/Dap.Tests/Integration/CustomRequestsTests.cs b/test/Dap.Tests/Integration/CustomRequestsTests.cs index 0d254ee7e..aab4566ae 100644 --- a/test/Dap.Tests/Integration/CustomRequestsTests.cs +++ b/test/Dap.Tests/Integration/CustomRequestsTests.cs @@ -8,7 +8,6 @@ using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; using OmniSharp.Extensions.DebugAdapter.Testing; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; @@ -27,7 +26,8 @@ public async Task Should_Support_Custom_Attach_Request_Using_Base_Class() var (client, _) = await Initialize(options => { }, options => { options.AddHandler(fake); }); await client.Attach( - new CustomAttachRequestArguments { + new CustomAttachRequestArguments + { ComputerName = "computer", RunspaceId = "1234", ProcessId = "4321" @@ -49,7 +49,8 @@ public async Task Should_Support_Custom_Attach_Request_Receiving_Regular_Request var (client, _) = await Initialize(options => { }, options => { options.AddHandler(fake); }); await client.Attach( - new CustomAttachRequestArguments { + new CustomAttachRequestArguments + { ComputerName = "computer", RunspaceId = "1234", ProcessId = "4321" @@ -71,8 +72,10 @@ public async Task Should_Support_Custom_Attach_Request_Using_Extension_Data_Usin var (client, _) = await Initialize(options => { }, options => { options.AddHandler(fake); }); await client.Attach( - new AttachRequestArguments { - ExtensionData = new Dictionary { + new AttachRequestArguments + { + ExtensionData = new Dictionary + { ["ComputerName"] = "computer", ["RunspaceId"] = "1234", ["ProcessId"] = "4321" @@ -95,7 +98,8 @@ public async Task Should_Support_Custom_Launch_Request_Using_Base_Class() var (client, _) = await Initialize(options => { }, options => { options.AddHandler(fake); }); await client.Launch( - new CustomLaunchRequestArguments { + new CustomLaunchRequestArguments + { Script = "build.ps1" } ); @@ -113,7 +117,8 @@ public async Task Should_Support_Custom_Launch_Request_Receiving_Regular_Request var (client, _) = await Initialize(options => { }, options => { options.AddHandler(fake); }); await client.Launch( - new CustomLaunchRequestArguments { + new CustomLaunchRequestArguments + { Script = "build.ps1" } ); @@ -131,8 +136,10 @@ public async Task Should_Support_Custom_Launch_Request_Using_Extension_Data_Base var (client, _) = await Initialize(options => { }, options => { options.AddHandler(fake); }); await client.Launch( - new CustomLaunchRequestArguments { - ExtensionData = new Dictionary { + new CustomLaunchRequestArguments + { + ExtensionData = new Dictionary + { ["Script"] = "build.ps1" } } @@ -151,7 +158,8 @@ public async Task Should_Support_Custom_Attach_Request_Using_Delegate() var (client, _) = await Initialize(options => { }, options => { options.OnAttach(fake); }); await client.Attach( - new CustomAttachRequestArguments { + new CustomAttachRequestArguments + { ComputerName = "computer", RunspaceId = "1234", ProcessId = "4321" @@ -173,7 +181,8 @@ public async Task Should_Support_Custom_Attach_Request_Receiving_Regular_Request var (client, _) = await Initialize(options => { }, options => { options.OnAttach(fake); }); await client.Attach( - new CustomAttachRequestArguments { + new CustomAttachRequestArguments + { ComputerName = "computer", RunspaceId = "1234", ProcessId = "4321" @@ -195,8 +204,10 @@ public async Task Should_Support_Custom_Attach_Request_Using_Extension_Data_Usin var (client, _) = await Initialize(options => { }, options => { options.OnAttach(fake); }); await client.Attach( - new AttachRequestArguments { - ExtensionData = new Dictionary { + new AttachRequestArguments + { + ExtensionData = new Dictionary + { ["ComputerName"] = "computer", ["RunspaceId"] = "1234", ["ProcessId"] = "4321" @@ -219,7 +230,8 @@ public async Task Should_Support_Custom_Launch_Request_Using_Delegate() var (client, _) = await Initialize(options => { }, options => { options.OnLaunch(fake); }); await client.Launch( - new CustomLaunchRequestArguments { + new CustomLaunchRequestArguments + { Script = "build.ps1" } ); @@ -237,7 +249,8 @@ public async Task Should_Support_Custom_Launch_Request_Receiving_Regular_Request var (client, _) = await Initialize(options => { }, options => { options.OnLaunch(fake); }); await client.Launch( - new CustomLaunchRequestArguments { + new CustomLaunchRequestArguments + { Script = "build.ps1" } ); @@ -255,8 +268,10 @@ public async Task Should_Support_Custom_Launch_Request_Using_Extension_Data_Usin var (client, _) = await Initialize(options => { }, options => { options.OnLaunch(fake); }); await client.Launch( - new CustomLaunchRequestArguments { - ExtensionData = new Dictionary { + new CustomLaunchRequestArguments + { + ExtensionData = new Dictionary + { ["Script"] = "build.ps1" } } @@ -270,11 +285,11 @@ await client.Launch( public record CustomAttachRequestArguments : AttachRequestArguments { - public string ComputerName { get; init; } + public string ComputerName { get; init; } = null!; - public string ProcessId { get; init; } + public string ProcessId { get; init; } = null!; - public string RunspaceId { get; init; } + public string RunspaceId { get; init; } = null!; } public record CustomLaunchRequestArguments : LaunchRequestArguments @@ -282,7 +297,7 @@ public record CustomLaunchRequestArguments : LaunchRequestArguments /// /// Gets or sets the absolute path to the script to debug. /// - public string Script { get; init; } + public string Script { get; init; } = null!; } } } diff --git a/test/Dap.Tests/Integration/GenericDapServerTests.cs b/test/Dap.Tests/Integration/GenericDapServerTests.cs index da531ceff..c56c62729 100644 --- a/test/Dap.Tests/Integration/GenericDapServerTests.cs +++ b/test/Dap.Tests/Integration/GenericDapServerTests.cs @@ -5,7 +5,6 @@ using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; using OmniSharp.Extensions.DebugAdapter.Testing; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; diff --git a/test/Dap.Tests/Integration/HandlersManagerIntegrationTests.cs b/test/Dap.Tests/Integration/HandlersManagerIntegrationTests.cs index 035394490..e0bce3483 100644 --- a/test/Dap.Tests/Integration/HandlersManagerIntegrationTests.cs +++ b/test/Dap.Tests/Integration/HandlersManagerIntegrationTests.cs @@ -7,7 +7,6 @@ using OmniSharp.Extensions.DebugAdapter.Testing; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; @@ -22,7 +21,7 @@ public HandlersManagerIntegrationTests(ITestOutputHelper testOutputHelper) : bas [Fact] public async Task Should_Return_Default_Handlers() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); var handlersManager = server.GetRequiredService(); handlersManager.Descriptors.Should().HaveCount(2); @@ -32,24 +31,27 @@ public async Task Should_Return_Default_Handlers() [Fact] public async Task Link_Should_Fail_If_No_Handler_Is_Defined() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); var handlersManager = server.GetRequiredService(); - Action a = () => handlersManager.AddLink(RequestNames.Completions, "my/completions"); + Action a = () => handlersManager.AddLink(RequestNames.Completions, "my/completions"); a.Should().Throw().Which.Message.Should().Contain("Descriptors must be registered before links can be created"); } [Fact] public async Task Link_Should_Fail_If_Link_Is_On_The_Wrong_Side() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); var handlersManager = server.GetRequiredService(); - handlersManager.Add((Substitute.For(new[] { typeof(ICompletionsHandler) }, Array.Empty()) as IJsonRpcHandler)!, new JsonRpcHandlerOptions()); + handlersManager.Add( + ( Substitute.For(new[] { typeof(ICompletionsHandler) }, Array.Empty()) as IJsonRpcHandler )!, new JsonRpcHandlerOptions() + ); - Action a = () => handlersManager.AddLink("my/completions", RequestNames.Completions); - a.Should().Throw().Which.Message.Should().Contain($"Did you mean to link '{RequestNames.Completions}' to 'my/completions' instead"); + Action a = () => handlersManager.AddLink("my/completions", RequestNames.Completions); + a.Should().Throw().Which.Message.Should() + .Contain($"Did you mean to link '{RequestNames.Completions}' to 'my/completions' instead"); } } } diff --git a/test/Dap.Tests/Integration/RequestCancellationTests.cs b/test/Dap.Tests/Integration/RequestCancellationTests.cs index b39fa8c77..59db785a8 100644 --- a/test/Dap.Tests/Integration/RequestCancellationTests.cs +++ b/test/Dap.Tests/Integration/RequestCancellationTests.cs @@ -9,7 +9,6 @@ using OmniSharp.Extensions.DebugAdapter.Testing; using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; @@ -26,7 +25,8 @@ public async Task Should_Cancel_Pending_Requests() { var (client, _) = await Initialize(ConfigureClient, ConfigureServer); - Func> action = () => { + var action = () => + { var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); CancellationToken.Register(cts.Cancel); return client.RequestCompletions(new CompletionsArguments(), cts.Token); @@ -37,9 +37,11 @@ public async Task Should_Cancel_Pending_Requests() [Fact(Skip = "Needs Work")] public async Task Should_Cancel_Requests_After_Timeout() { - Func> action = async () => { + Func> action = async () => + { var (client, _) = await Initialize( - ConfigureClient, x => { + ConfigureClient, x => + { ConfigureServer(x); x.WithMaximumRequestTimeout(TimeSpan.FromMilliseconds(1000)); } @@ -54,12 +56,15 @@ private void ConfigureClient(DebugAdapterClientOptions options) { } - private void ConfigureServer(DebugAdapterServerOptions options) => + private void ConfigureServer(DebugAdapterServerOptions options) + { options.OnCompletions( - async (x, ct) => { + async (x, ct) => + { await Task.Delay(50000, ct); return new CompletionsResponse(); } ); + } } } diff --git a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs index 7d5298c70..3565b53ae 100644 --- a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs +++ b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs @@ -30,6 +30,8 @@ public partial class DeclarationParams : TextDocumentPositionParams, IWorkDonePr using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using Newtonsoft.Json; +using System.ComponentModel; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; namespace Test diff --git a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs index ea2e0b94a..320a396fc 100644 --- a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs +++ b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs @@ -39,7 +39,7 @@ namespace Test { private static readonly Lazy> _defaults = new Lazy>(() => { - return typeof(ThreadEventReason).GetProperties(BindingFlags.Static | BindingFlags.Public).Where(z => z.Name != nameof(Defaults)).Select(z => z.GetValue(null)).Cast().ToArray(); + return new ThreadEventReason[]{Started, Exited}; }); public static IEnumerable Defaults => _defaults.Value; private readonly string _value; diff --git a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs index 02ecefce5..4c22321db 100644 --- a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs +++ b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using OmniSharp.Extensions.JsonRpc.Generators; -using TestingUtils; using Xunit; namespace Generation.Tests @@ -60,6 +59,7 @@ public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protoco #nullable restore"; await GenerationHelpers.AssertGeneratedAsExpected(source, expected); } + [Fact] public async Task Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface() { diff --git a/test/Generation.Tests/GenerationHelpers.cs b/test/Generation.Tests/GenerationHelpers.cs index 7f5f38918..5dc0da1a2 100644 --- a/test/Generation.Tests/GenerationHelpers.cs +++ b/test/Generation.Tests/GenerationHelpers.cs @@ -11,13 +11,13 @@ using Microsoft.CodeAnalysis.Text; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol.Client; -//using OmniSharp.Extensions.DebugAdapter.Protocol.Client; using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.JsonRpc.Generators; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -//using OmniSharp.Extensions.LanguageServer.Protocol.Server; using Xunit; +//using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +//using OmniSharp.Extensions.LanguageServer.Protocol.Server; + namespace Generation.Tests { public static class GenerationHelpers @@ -82,7 +82,10 @@ static GenerationHelpers() return generatedText; } - public static string NormalizeToLf(string input) => input.Replace(CrLf, Lf); + public static string NormalizeToLf(string input) + { + return input.Replace(CrLf, Lf); + } public static async Task> GenerateAsync(string source) where T : IIncrementalGenerator, new() { @@ -154,7 +157,7 @@ public static Project CreateProject(params string[] sources) } } - class NotSureWhatToCallYou : CSharpSyntaxWalker + internal class NotSureWhatToCallYou : CSharpSyntaxWalker { private readonly ISyntaxReceiver _syntaxReceiver; diff --git a/test/Generation.Tests/JsonRpcGenerationTests.cs b/test/Generation.Tests/JsonRpcGenerationTests.cs index 4c2ffe04f..496e8eed2 100644 --- a/test/Generation.Tests/JsonRpcGenerationTests.cs +++ b/test/Generation.Tests/JsonRpcGenerationTests.cs @@ -1,8 +1,6 @@ -using System; using System.Threading.Tasks; using FluentAssertions; using OmniSharp.Extensions.JsonRpc.Generators; -using TestingUtils; using Xunit; using Xunit.Sdk; using static Generation.Tests.GenerationHelpers; @@ -205,7 +203,7 @@ public interface IExitHandler : IJsonRpcNotificationHandler } }"; - Func a = () => AssertGeneratedAsExpected(source, ""); + var a = () => AssertGeneratedAsExpected(source, ""); await a.Should().ThrowAsync().WithMessage("*Could not infer the request router(s)*"); await a.Should().ThrowAsync("cache").WithMessage("*Could not infer the request router(s)*"); } diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 04b2377ef..da2ff3dec 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using OmniSharp.Extensions.JsonRpc.Generators; -using TestingUtils; using Xunit; namespace Generation.Tests diff --git a/test/Generation.Tests/TypedCanBeResolvedTests.cs b/test/Generation.Tests/TypedCanBeResolvedTests.cs index e34a0b47c..2544f5fd7 100644 --- a/test/Generation.Tests/TypedCanBeResolvedTests.cs +++ b/test/Generation.Tests/TypedCanBeResolvedTests.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using OmniSharp.Extensions.JsonRpc.Generators; -using TestingUtils; using Xunit; namespace Generation.Tests diff --git a/test/JsonRpc.Tests/HandlerResolverTests.cs b/test/JsonRpc.Tests/HandlerResolverTests.cs index db0b069b5..d9d706558 100644 --- a/test/JsonRpc.Tests/HandlerResolverTests.cs +++ b/test/JsonRpc.Tests/HandlerResolverTests.cs @@ -2,7 +2,6 @@ using System.Linq; using DryIoc; using FluentAssertions; -using FluentAssertions.Common; using MediatR; using NSubstitute; using OmniSharp.Extensions.JsonRpc; @@ -45,8 +44,14 @@ public interface IJsonRpcNotificationDataHandler : IJsonRpcNotificationHandler(), new AssemblyScanningHandlerTypeDescriptorProvider(new [] { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(HandlerResolverTests).Assembly })) { - (IJsonRpcHandler) Substitute.For(new[] { requestHandler }, Array.Empty()) + var handler = new HandlerCollection( + Substitute.For(), + new AssemblyScanningHandlerTypeDescriptorProvider( + new[] { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(HandlerResolverTests).Assembly } + ) + ) + { + (IJsonRpcHandler)Substitute.For(new[] { requestHandler }, Array.Empty()) }; handler.Should().Contain(x => x.Method == key); } @@ -57,8 +62,14 @@ public void Should_Contain_AllDefinedMethods(Type requestHandler, string key) [InlineData(typeof(IJsonRpcNotificationDataHandler), "notificationdata", null)] public void Should_Have_CorrectParams(Type requestHandler, string key, Type expected) { - var handler = new HandlerCollection(Substitute.For(), new AssemblyScanningHandlerTypeDescriptorProvider(new [] { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(HandlerResolverTests).Assembly })) { - (IJsonRpcHandler) Substitute.For(new[] { requestHandler }, Array.Empty()) + var handler = new HandlerCollection( + Substitute.For(), + new AssemblyScanningHandlerTypeDescriptorProvider( + new[] { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(HandlerResolverTests).Assembly } + ) + ) + { + (IJsonRpcHandler)Substitute.For(new[] { requestHandler }, Array.Empty()) }; handler.First(x => x.Method == key).Params.Should().Be(expected); } diff --git a/test/JsonRpc.Tests/InputHandlerTests.cs b/test/JsonRpc.Tests/InputHandlerTests.cs index 6efb24bdf..ba93492d7 100644 --- a/test/JsonRpc.Tests/InputHandlerTests.cs +++ b/test/JsonRpc.Tests/InputHandlerTests.cs @@ -2,7 +2,6 @@ using System.IO; using System.IO.Pipelines; using System.Linq; -using System.Reactive.Concurrency; using System.Reflection; using System.Text; using System.Threading; @@ -27,7 +26,10 @@ public class InputHandlerTests private readonly TestLoggerFactory _loggerFactory; private readonly OnUnhandledExceptionHandler _unhandledException = Substitute.For(); - public InputHandlerTests(ITestOutputHelper testOutputHelper) => _loggerFactory = new TestLoggerFactory(testOutputHelper); + public InputHandlerTests(ITestOutputHelper testOutputHelper) + { + _loggerFactory = new TestLoggerFactory(testOutputHelper); + } private InputHandler NewHandler( PipeReader inputStream, @@ -37,8 +39,9 @@ private InputHandler NewHandler( ILoggerFactory loggerFactory, IResponseRouter responseRouter, RequestInvoker requestInvoker - ) => - new InputHandler( + ) + { + return new InputHandler( inputStream, outputHandler, receiver, @@ -49,6 +52,7 @@ RequestInvoker requestInvoker _unhandledException, null ); + } [Fact] public async Task Should_Pass_In_Requests() @@ -258,7 +262,9 @@ public async Task Should_Handle_Multiple_Chunked_Requests(string content) [Fact] public async Task Should_Handle_Header_Terminiator_Being_Incomplete() { - var pipe = new Pipe(new PipeOptions(readerScheduler: PipeScheduler.ThreadPool, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false)); + var pipe = new Pipe( + new PipeOptions(readerScheduler: PipeScheduler.ThreadPool, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false) + ); var outputHandler = Substitute.For(); var receiver = Substitute.For(); @@ -407,7 +413,8 @@ public JsonRpcLogs() var msgTypes = data .Select( - z => { + z => + { if (z.MsgKind.EndsWith("response")) { return ( type: "response", kind: z.MsgType ); @@ -426,7 +433,7 @@ public JsonRpcLogs() return ( type: null, kind: null ); } ) - .Where(z => z.type != null) + .Where(z => z.type != null!) .ToLookup(z => z.kind!, z => z.type!); Add(streamName, () => CreateReader(data), msgTypes!); @@ -446,7 +453,8 @@ private PipeReader CreateReader(DataItem[] data) { var outputData = data .Select( - z => { + z => + { if (z.MsgKind.EndsWith("response")) { return new OutgoingResponse(z.MsgId, z.Arg, new Request(z.MsgId, z.MsgType, JValue.CreateNull())); @@ -454,7 +462,8 @@ private PipeReader CreateReader(DataItem[] data) if (z.MsgKind.EndsWith("request")) { - return new OutgoingRequest { + return new OutgoingRequest + { Id = z.MsgId, Method = z.MsgType, Params = z.Arg @@ -463,7 +472,8 @@ private PipeReader CreateReader(DataItem[] data) if (z.MsgKind.EndsWith("notification")) { - return new OutgoingNotification { + return new OutgoingNotification + { Method = z.MsgType, Params = z.Arg }; @@ -478,7 +488,8 @@ private PipeReader CreateReader(DataItem[] data) var serializer = new JsonRpcSerializer(); Task.Run( - async () => { + async () => + { foreach (var item in outputData) { var content = serializer.SerializeObject(item); diff --git a/test/JsonRpc.Tests/IntegrationTests.cs b/test/JsonRpc.Tests/IntegrationTests.cs index 5d912722b..37d5b4341 100644 --- a/test/JsonRpc.Tests/IntegrationTests.cs +++ b/test/JsonRpc.Tests/IntegrationTests.cs @@ -9,7 +9,6 @@ using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Server; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; @@ -50,13 +49,16 @@ public async Task Should_throw_when_sending_requests() { var (client, server) = await Initialize( clientOptions => { clientOptions.OnRequest("myrequest", async (Request request) => new Data { Value = "myresponse" }); }, - serverOptions => { serverOptions.OnRequest("myrequest", async (Request request) => new Data { Value = string.Join("", "myresponse".Reverse()) }); } + serverOptions => + { + serverOptions.OnRequest("myrequest", async (Request request) => new Data { Value = string.Join("", "myresponse".Reverse()) }); + } ); - Func clientRequest = () => client.SendRequest("myrequest", (Request) null!).Returning(CancellationToken); + Func clientRequest = () => client.SendRequest("myrequest", (Request)null!).Returning(CancellationToken); await clientRequest.Should().ThrowAsync(); - Func serverRequest = () => server.SendRequest("myrequest", (Request) null!).Returning(CancellationToken); + Func serverRequest = () => server.SendRequest("myrequest", (Request)null!).Returning(CancellationToken); await serverRequest.Should().ThrowAsync(); } @@ -64,8 +66,8 @@ public async Task Should_throw_when_sending_requests() public async Task Should_throw_when_receiving_requests() { var (client, server) = await Initialize( - clientOptions => { clientOptions.OnRequest("myrequest", async (Request request) => (Data) null!); }, - serverOptions => { serverOptions.OnRequest("myrequest", async (Request request) => (Data) null!); } + clientOptions => { clientOptions.OnRequest("myrequest", async (Request request) => (Data)null!); }, + serverOptions => { serverOptions.OnRequest("myrequest", async (Request request) => (Data)null!); } ); Func clientRequest = () => client.SendRequest("myrequest", new Request()).Returning(CancellationToken); @@ -81,17 +83,21 @@ public async Task Should_Send_and_receive_notifications() var clientNotification = new AsyncSubject(); var serverNotification = new AsyncSubject(); var (client, server) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.OnNotification( - "mynotification", (Data data) => { + "mynotification", (Data data) => + { clientNotification.OnNext(data); clientNotification.OnCompleted(); } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnNotification( - "mynotification", (Data data) => { + "mynotification", (Data data) => + { serverNotification.OnNext(data); serverNotification.OnCompleted(); } @@ -112,17 +118,21 @@ public async Task Should_Send_and_receive_notifications() public async Task Should_Send_and_cancel_requests_immediate() { var (client, server) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.OnRequest( - "myrequest", async ct => { + "myrequest", async ct => + { await Task.Delay(TimeSpan.FromMinutes(1), ct); return new Data { Value = "myresponse" }; } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnRequest( - "myrequest", async ct => { + "myrequest", async ct => + { await Task.Delay(TimeSpan.FromMinutes(1), ct); return new Data { Value = string.Join("", "myresponse".Reverse()) }; } @@ -148,17 +158,21 @@ public async Task Should_Send_and_cancel_requests_immediate() public async Task Should_Send_and_cancel_requests_from_otherside() { var (client, server) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.OnRequest( - "myrequest", async ct => { + "myrequest", async ct => + { await Task.Delay(TimeSpan.FromMinutes(1), ct); return new Data { Value = "myresponse" }; } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnRequest( - "myrequest", async ct => { + "myrequest", async ct => + { await Task.Delay(TimeSpan.FromMinutes(1), ct); return new Data { Value = string.Join("", "myresponse".Reverse()) }; } @@ -185,10 +199,12 @@ public async Task Should_Send_and_cancel_requests_from_otherside() public async Task Should_Cancel_Parallel_Requests_When_Options_Are_Given() { var (client, server) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions.OnRequest( "parallelrequest", - async ct => { + async ct => + { await Task.Delay(TimeSpan.FromSeconds(10), ct); return new Data { Value = "myresponse" }; }, @@ -200,10 +216,12 @@ public async Task Should_Cancel_Parallel_Requests_When_Options_Are_Given() new JsonRpcHandlerOptions { RequestProcessType = RequestProcessType.Serial } ); }, - serverOptions => { + serverOptions => + { serverOptions.OnRequest( "parallelrequest", - async ct => { + async ct => + { await Task.Delay(TimeSpan.FromSeconds(10), ct); return new Data { Value = "myresponse" }; }, @@ -236,13 +254,15 @@ public async Task Should_Cancel_Parallel_Requests_When_Options_Are_Given() public async Task Should_Link_Request_A_to_Request_B() { var (client, server) = await Initialize( - clientOptions => { + clientOptions => + { clientOptions .OnRequest("myrequest", async () => new Data { Value = "myresponse" }) .WithLink("myrequest", "myrequest2") ; }, - serverOptions => { + serverOptions => + { serverOptions .OnRequest("myrequest", async () => new Data { Value = string.Join("", "myresponse".Reverse()) }) .WithLink("myrequest", "myrequest2") diff --git a/test/JsonRpc.Tests/RecursiveResolutionTests.cs b/test/JsonRpc.Tests/RecursiveResolutionTests.cs index 4132326d4..0769ad859 100644 --- a/test/JsonRpc.Tests/RecursiveResolutionTests.cs +++ b/test/JsonRpc.Tests/RecursiveResolutionTests.cs @@ -8,7 +8,6 @@ using NSubstitute; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Testing; -using TestingUtils; using Xunit; using Xunit.Abstractions; @@ -23,7 +22,8 @@ public RecursiveResolutionTests(ITestOutputHelper testOutputHelper) : base(new J [Fact(Skip = "appears to cause a deadlock")] public async Task Server_Can_Be_Injected_Into_Handler_After_Creation_Using_Registration() { - Func a = async () => { + Func a = async () => + { var (_, server) = await Initialize( options => { }, options => { } @@ -82,7 +82,7 @@ public async Task Server_Facade_Can_Be_Injected_Into_Handler_During_Creation_Usi Func a = () => Initialize( options => { }, options => options - .AddHandler>() + .AddHandler>() ); await a.Should().NotThrowAsync(); } @@ -115,7 +115,7 @@ public class ClassRequest : IRequest } [Method(nameof(ClassRequest))] - class ClassHandler : IJsonRpcRequestHandler where T : IJsonRpcServerFacade + private class ClassHandler : IJsonRpcRequestHandler where T : IJsonRpcServerFacade { // ReSharper disable once NotAccessedField.Local private readonly T _jsonRpcServer; @@ -125,7 +125,10 @@ public ClassHandler(T jsonRpcServer) _jsonRpcServer = jsonRpcServer; } - public Task Handle(ClassRequest classRequest, CancellationToken cancellationToken) => throw new NotImplementedException(); + public Task Handle(ClassRequest classRequest, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } [Method(nameof(InterfaceRequest))] @@ -134,7 +137,7 @@ public class InterfaceRequest : IRequest } [Method(nameof(InterfaceRequest))] - class InterfaceHandler : IJsonRpcRequestHandler where T : IJsonRpcServerFacade + private class InterfaceHandler : IJsonRpcRequestHandler where T : IJsonRpcServerFacade { // ReSharper disable once NotAccessedField.Local private readonly T _jsonRpcServer; @@ -144,7 +147,10 @@ public InterfaceHandler(T jsonRpcServer) _jsonRpcServer = jsonRpcServer; } - public Task Handle(InterfaceRequest request, CancellationToken cancellationToken) => throw new NotImplementedException(); + public Task Handle(InterfaceRequest request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } } } diff --git a/test/Lsp.Integration.Tests/ActivityTracingTests.cs b/test/Lsp.Integration.Tests/ActivityTracingTests.cs index 6e9547cc9..4ce70d497 100644 --- a/test/Lsp.Integration.Tests/ActivityTracingTests.cs +++ b/test/Lsp.Integration.Tests/ActivityTracingTests.cs @@ -1,7 +1,6 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; using NSubstitute; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Testing; @@ -10,7 +9,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ActivityTracingTests : LanguageProtocolTestBase { @@ -46,10 +45,10 @@ public async Task Should_Have_Activity_Information_Exchanging_Data() var (client, server) = await Initialize( options => options .WithActivityTracingStrategy(clientStub) - .OnRequest("test", (Func) ( ct => Task.CompletedTask )), + .OnRequest("test", (Func)( ct => Task.CompletedTask )), options => options .WithActivityTracingStrategy(serverStub) - .OnRequest("test", (Func) ( ct => Task.CompletedTask )) + .OnRequest("test", (Func)( ct => Task.CompletedTask )) ); await client.SendRequest("test").ReturningVoid(CancellationToken); diff --git a/test/Lsp.Integration.Tests/ConnectionAndDisconnectionTests.cs b/test/Lsp.Integration.Tests/ConnectionAndDisconnectionTests.cs index 7ccfd30b7..09733cf6b 100644 --- a/test/Lsp.Integration.Tests/ConnectionAndDisconnectionTests.cs +++ b/test/Lsp.Integration.Tests/ConnectionAndDisconnectionTests.cs @@ -7,12 +7,12 @@ using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; using OmniSharp.Extensions.LanguageServer.Server; -using TestingUtils; using Xunit; using Xunit.Abstractions; + #pragma warning disable CS0162 -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ConnectionAndDisconnectionTests : LanguageProtocolTestBase { @@ -30,7 +30,7 @@ public async Task Server_Should_Stay_Alive_When_Requests_Throw_An_Exception() var result = await client.SendRequest("keepalive").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => client.SendRequest("throw").ReturningVoid(CancellationToken); + var a = () => client.SendRequest("throw").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await client.SendRequest("keepalive").Returning(CancellationToken); @@ -45,7 +45,7 @@ public async Task Client_Should_Stay_Alive_When_Requests_Throw_An_Exception() var result = await server.SendRequest("keepalive").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => server.SendRequest("throw").ReturningVoid(CancellationToken); + var a = () => server.SendRequest("throw").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await server.SendRequest("keepalive").Returning(CancellationToken); @@ -60,7 +60,7 @@ public async Task Server_Should_Support_Links() var result = await client.SendRequest("ka").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => client.SendRequest("t").ReturningVoid(CancellationToken); + var a = () => client.SendRequest("t").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await client.SendRequest("ka").Returning(CancellationToken); @@ -75,7 +75,7 @@ public async Task Client_Should_Support_Links() var result = await server.SendRequest("ka").Returning(CancellationToken); result.Should().BeTrue(); - Func a = () => server.SendRequest("t").ReturningVoid(CancellationToken); + var a = () => server.SendRequest("t").ReturningVoid(CancellationToken); await a.Should().ThrowAsync(); result = await server.SendRequest("ka").Returning(CancellationToken); @@ -88,7 +88,8 @@ private void ConfigureClient(LanguageClientOptions options) options.WithLink("keepalive", "ka"); options.WithLink("throw", "t"); options.OnRequest( - "throw", async ct => { + "throw", async ct => + { throw new NotSupportedException(); return Task.CompletedTask; } @@ -101,7 +102,8 @@ private void ConfigureServer(LanguageServerOptions options) options.WithLink("keepalive", "ka"); options.WithLink("throw", "t"); options.OnRequest( - "throw", async ct => { + "throw", async ct => + { throw new NotSupportedException(); return Task.CompletedTask; } diff --git a/test/Lsp.Integration.Tests/CustomRequestsTests.cs b/test/Lsp.Integration.Tests/CustomRequestsTests.cs index 042480be5..e6316fd9a 100644 --- a/test/Lsp.Integration.Tests/CustomRequestsTests.cs +++ b/test/Lsp.Integration.Tests/CustomRequestsTests.cs @@ -13,7 +13,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class CustomRequestsTests : LanguageProtocolTestBase { @@ -27,7 +27,8 @@ public async Task Should_Support_Custom_Telemetry_Using_Base_Class() var fake = Substitute.For>(); var (_, server) = await Initialize(options => { options.AddHandler(fake); }, options => { }); - var @event = new CustomTelemetryEventParams { + var @event = new CustomTelemetryEventParams + { CodeFolding = true, ProfileLoading = false, ScriptAnalysis = true, @@ -51,7 +52,8 @@ public async Task Should_Support_Custom_Telemetry_Receiving_Regular_Telemetry_Us var fake = Substitute.For(); var (_, server) = await Initialize(options => { options.AddHandler(fake); }, options => { }); - var @event = new CustomTelemetryEventParams { + var @event = new CustomTelemetryEventParams + { CodeFolding = true, ProfileLoading = false, ScriptAnalysis = true, @@ -78,8 +80,10 @@ public async Task Should_Support_Custom_Telemetry_Using_Extension_Data_Using_Bas var (_, server) = await Initialize(options => { options.AddHandler(fake); }, options => { }); server.SendTelemetryEvent( - new TelemetryEventParams { - ExtensionData = new Dictionary { + new TelemetryEventParams + { + ExtensionData = new Dictionary + { ["CodeFolding"] = true, ["ProfileLoading"] = false, ["ScriptAnalysis"] = true, @@ -106,7 +110,8 @@ public async Task Should_Support_Custom_Telemetry_Using_Delegate() var fake = Substitute.For>(); var (_, server) = await Initialize(options => { options.OnTelemetryEvent(fake); }, options => { }); - var @event = new CustomTelemetryEventParams { + var @event = new CustomTelemetryEventParams + { CodeFolding = true, ProfileLoading = false, ScriptAnalysis = true, @@ -130,7 +135,8 @@ public async Task Should_Support_Custom_Telemetry_Receiving_Regular_Telemetry_Us var fake = Substitute.For>(); var (_, server) = await Initialize(options => { options.OnTelemetryEvent(fake); }, options => { }); - var @event = new CustomTelemetryEventParams { + var @event = new CustomTelemetryEventParams + { CodeFolding = true, ProfileLoading = false, ScriptAnalysis = true, @@ -157,8 +163,10 @@ public async Task Should_Support_Custom_Telemetry_Using_Extension_Data_Using_Del var (_, server) = await Initialize(options => { options.OnTelemetryEvent(fake); }, options => { }); server.SendTelemetryEvent( - new TelemetryEventParams { - ExtensionData = new Dictionary { + new TelemetryEventParams + { + ExtensionData = new Dictionary + { ["CodeFolding"] = true, ["ProfileLoading"] = false, ["ScriptAnalysis"] = true, diff --git a/test/Lsp.Integration.Tests/DisableDefaultsTests.cs b/test/Lsp.Integration.Tests/DisableDefaultsTests.cs index 87a0998f1..12dae2e72 100644 --- a/test/Lsp.Integration.Tests/DisableDefaultsTests.cs +++ b/test/Lsp.Integration.Tests/DisableDefaultsTests.cs @@ -21,7 +21,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class DisableDefaultsTests : LanguageProtocolTestBase { @@ -55,7 +55,7 @@ public async Task Should_Disable_Workspace_Folder_Manager() var serverAction = Substitute.For>(); var (client, server) = await Initialize( options => options.OnWorkspaceFolders(clientAction), - options => options.OnDidChangeWorkspaceFolders(serverAction, x => new () { Supported = x.Workspace?.WorkspaceFolders.IsSupported == true}) + options => options.OnDidChangeWorkspaceFolders(serverAction, x => new() { Supported = x.Workspace?.WorkspaceFolders.IsSupported == true }) ); var clientManager = client.Services.GetRequiredService(); @@ -63,7 +63,9 @@ public async Task Should_Disable_Workspace_Folder_Manager() clientManager.Descriptors.Should().ContainSingle(f => f.Method == WorkspaceNames.WorkspaceFolders); var serverManager = server.Services.GetRequiredService(); - serverManager.Descriptors.Should().Contain(f => f.Handler is LanguageProtocolDelegatingHandlers.Notification); + serverManager.Descriptors.Should().Contain( + f => f.Handler is LanguageProtocolDelegatingHandlers.Notification + ); serverManager.Descriptors.Should().ContainSingle(f => f.Method == WorkspaceNames.DidChangeWorkspaceFolders); } @@ -74,16 +76,17 @@ public async Task Should_Allow_Custom_Workspace_Folder_Manager_Delegate() var (client, server) = await Initialize( options => { }, options => options - .OnDidChangeWorkspaceFolders(action, x => new () { Supported = x.Workspace?.WorkspaceFolders.IsSupported == true}) + .OnDidChangeWorkspaceFolders(action, x => new() { Supported = x.Workspace?.WorkspaceFolders.IsSupported == true }) ); var config = client.Services.GetRequiredService(); - config.Update("mysection", new Dictionary() { ["data"] = "value" }); + config.Update("mysection", new Dictionary { ["data"] = "value" }); - client.WorkspaceFoldersManager.Add(new WorkspaceFolder() { Name = "foldera", Uri = "/some/path" }); + client.WorkspaceFoldersManager.Add(new WorkspaceFolder { Name = "foldera", Uri = "/some/path" }); await TestHelper.DelayUntil( - () => { + () => + { try { action.Received(1).Invoke(Arg.Any()); @@ -117,7 +120,7 @@ public async Task Should_Allow_Custom_Configuration_Delegate() var action = Substitute.For>(); var (client, server) = await Initialize( options => options - .WithCapability(new DidChangeConfigurationCapability() { DynamicRegistration = true }) + .WithCapability(new DidChangeConfigurationCapability { DynamicRegistration = true }) .WithServices(z => z.AddSingleton()), options => options .WithConfigurationSection("mysection") @@ -131,10 +134,11 @@ public async Task Should_Allow_Custom_Configuration_Delegate() serverManager.ContainsHandler(typeof(IDidChangeConfigurationHandler)).Should().BeTrue(); var config = client.Services.GetRequiredService(); - config.Update("mysection", new Dictionary() { ["data"] = "value" }); + config.Update("mysection", new Dictionary { ["data"] = "value" }); await TestHelper.DelayUntil( - () => { + () => + { try { action.Received(1).Invoke(Arg.Is(z => Equals(z.Settings, JValue.CreateNull()))); diff --git a/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs b/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs index d5059a3cb..f7787981d 100644 --- a/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs +++ b/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs @@ -4,25 +4,21 @@ using System.Reactive.Linq; using System.Threading.Tasks; using FluentAssertions; -using ImTools; -using Lsp.Tests.Integration.Fixtures; +using Lsp.Integration.Tests.Fixtures; using NSubstitute; -using NSubstitute.ReceivedExtensions; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Server; using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public static class DynamicRegistration { @@ -61,7 +57,8 @@ public async Task Should_Register_Dynamically_While_Server_Is_Running() x => x .OnCompletion( (@params, token) => Task.FromResult(new CompletionList()), - (_, _) => new CompletionRegistrationOptions { + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("vb") } ) @@ -110,7 +107,8 @@ public async Task Should_Unregister_Dynamically_While_Server_Is_Running() var disposable = server.Register( x => x.OnCompletion( (@params, token) => Task.FromResult(new CompletionList()), - (_, _) => new CompletionRegistrationOptions { + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("vb") } ) @@ -146,10 +144,13 @@ public async Task Should_Only_Register_Semantic_Tokens_Registration_Once() var tokens = Substitute.For(); tokens.CreateRegistrationOptions(Arg.Any(), Arg.Any()) .Returns(new SemanticTokensRegistrationOptions()); - var (client, server) = await Initialize(new ConfigureClient().Configure, options => { - new ConfigureServer().Configure(options); - options.AddHandler(tokens); - }); + var (client, server) = await Initialize( + new ConfigureClient().Configure, options => + { + new ConfigureServer().Configure(options); + options.AddHandler(tokens); + } + ); await TestHelper.DelayUntil( () => client.RegistrationManager.CurrentRegistrations, @@ -162,7 +163,10 @@ await TestHelper.DelayUntil( client.RegistrationManager.CurrentRegistrations.Should().ContainSingle(x => x.Method == TextDocumentNames.SemanticTokensRegistration); } - private bool SelectorMatches(Registration registration, Func documentFilter) => SelectorMatches(registration.RegisterOptions!, documentFilter); + private bool SelectorMatches(Registration registration, Func documentFilter) + { + return SelectorMatches(registration.RegisterOptions!, documentFilter); + } private bool SelectorMatches(object options, Func documentFilter) { @@ -193,9 +197,11 @@ public async Task Should_Gather_Static_Registrations() { var (client, _) = await Initialize( new ConfigureClient().Configure, - options => { + options => + { new ConfigureServer().Configure(options); - var semanticRegistrationOptions = new SemanticTokensRegistrationOptions { + var semanticRegistrationOptions = new SemanticTokensRegistrationOptions + { Id = Guid.NewGuid().ToString(), Legend = new SemanticTokensLegend(), Full = new SemanticTokensCapabilityRequestFull { Delta = true }, @@ -206,8 +212,10 @@ public async Task Should_Gather_Static_Registrations() // Our server only statically registers when it detects a server that does not support dynamic capabilities // This forces it to do that. options.OnInitialized( - (server, request, response, token) => { - response.Capabilities.SemanticTokensProvider = new SemanticTokensRegistrationOptions.StaticOptions { Id = semanticRegistrationOptions.Id }; + (server, request, response, token) => + { + response.Capabilities.SemanticTokensProvider = new SemanticTokensRegistrationOptions.StaticOptions + { Id = semanticRegistrationOptions.Id }; return Task.CompletedTask; } ); @@ -227,35 +235,42 @@ await TestHelper.DelayUntil( public async Task Should_Register_Static_When_Dynamic_Is_Disabled() { var (client, server) = await Initialize( - options => { + options => + { new ConfigureClient().Configure(options); options.DisableDynamicRegistration(); }, new ConfigureServer().Configure ); client.ServerSettings.Capabilities.CompletionProvider.Should().BeEquivalentTo( - new CompletionRegistrationOptions.StaticOptions { + new CompletionRegistrationOptions.StaticOptions + { ResolveProvider = true, TriggerCharacters = new Container("a", "b"), AllCommitCharacters = new Container("1", "2"), }, x => x.Excluding(z => z.WorkDoneProgress) ); server.ClientSettings.Capabilities!.TextDocument!.Completion.Value.Should().BeEquivalentTo( - new CompletionCapability { - CompletionItem = new CompletionItemCapabilityOptions { + new CompletionCapability + { + CompletionItem = new CompletionItemCapabilityOptions + { DeprecatedSupport = true, DocumentationFormat = new[] { MarkupKind.Markdown }, PreselectSupport = true, SnippetSupport = true, - TagSupport = new CompletionItemTagSupportCapabilityOptions { - ValueSet = new[] { + TagSupport = new CompletionItemTagSupportCapabilityOptions + { + ValueSet = new[] + { CompletionItemTag.Deprecated } }, CommitCharactersSupport = true }, ContextSupport = true, - CompletionItemKind = new CompletionItemKindCapabilityOptions { + CompletionItemKind = new CompletionItemKindCapabilityOptions + { ValueSet = new Container( Enum.GetValues(typeof(CompletionItemKind)) .Cast() @@ -264,21 +279,26 @@ public async Task Should_Register_Static_When_Dynamic_Is_Disabled() }, x => x.ConfigureForSupports().Excluding(z => z.DynamicRegistration) ); client.ClientSettings.Capabilities!.TextDocument!.Completion.Value.Should().BeEquivalentTo( - new CompletionCapability { - CompletionItem = new CompletionItemCapabilityOptions { + new CompletionCapability + { + CompletionItem = new CompletionItemCapabilityOptions + { DeprecatedSupport = true, DocumentationFormat = new[] { MarkupKind.Markdown }, PreselectSupport = true, SnippetSupport = true, - TagSupport = new CompletionItemTagSupportCapabilityOptions { - ValueSet = new[] { + TagSupport = new CompletionItemTagSupportCapabilityOptions + { + ValueSet = new[] + { CompletionItemTag.Deprecated } }, CommitCharactersSupport = true }, ContextSupport = true, - CompletionItemKind = new CompletionItemKindCapabilityOptions { + CompletionItemKind = new CompletionItemKindCapabilityOptions + { ValueSet = new Container( Enum.GetValues(typeof(CompletionItemKind)) .Cast() @@ -298,21 +318,26 @@ public void Configure(LanguageClientOptions options) { options.EnableDynamicRegistration(); options.WithCapability( - new CompletionCapability { - CompletionItem = new CompletionItemCapabilityOptions { + new CompletionCapability + { + CompletionItem = new CompletionItemCapabilityOptions + { DeprecatedSupport = true, DocumentationFormat = new[] { MarkupKind.Markdown }, PreselectSupport = true, SnippetSupport = true, - TagSupport = new CompletionItemTagSupportCapabilityOptions { - ValueSet = new[] { + TagSupport = new CompletionItemTagSupportCapabilityOptions + { + ValueSet = new[] + { CompletionItemTag.Deprecated } }, CommitCharactersSupport = true }, ContextSupport = true, - CompletionItemKind = new CompletionItemKindCapabilityOptions { + CompletionItemKind = new CompletionItemKindCapabilityOptions + { ValueSet = new Container( Enum.GetValues(typeof(CompletionItemKind)) .Cast() @@ -322,7 +347,8 @@ public void Configure(LanguageClientOptions options) ); options.WithCapability( - new SemanticTokensCapability { + new SemanticTokensCapability + { TokenModifiers = SemanticTokenModifier.Defaults.ToArray(), TokenTypes = SemanticTokenType.Defaults.ToArray() } @@ -336,7 +362,8 @@ public void Configure(LanguageServerOptions options) { options.OnCompletion( (@params, token) => Task.FromResult(new CompletionList()), - (_, _) => new CompletionRegistrationOptions { + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("csharp"), ResolveProvider = true, TriggerCharacters = new Container("a", "b"), diff --git a/test/Lsp.Integration.Tests/ErroringHandlingTests.cs b/test/Lsp.Integration.Tests/ErroringHandlingTests.cs index cc8edf89a..ef8b12034 100644 --- a/test/Lsp.Integration.Tests/ErroringHandlingTests.cs +++ b/test/Lsp.Integration.Tests/ErroringHandlingTests.cs @@ -1,5 +1,4 @@ using System; -using System.Threading; using System.Threading.Tasks; using FluentAssertions; using NSubstitute; @@ -8,14 +7,13 @@ using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Server; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using TestingUtils; +using OmniSharp.Extensions.LanguageServer.Server; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ErroringHandlingTests : LanguageProtocolTestBase { @@ -28,15 +26,19 @@ public async Task Should_Handle_Malformed_Request() { var (client, server) = await Initialize(ConfigureClient, ConfigureServer); - var codeActionParams = new { - Range = new { + var codeActionParams = new + { + Range = new + { Start = new { Line = 1, Character = double.Parse("1.0E300") }, End = new { Line = 2, Character = 9999999999999999999 } }, - TextDocument = new { + TextDocument = new + { Uri = DocumentUri.From("/path/to/file") }, - Context = new { + Context = new + { Diagnostics = new Container() } }; @@ -51,22 +53,27 @@ public async Task Should_Handle_Malformed_Notification() { var (client, server) = await Initialize(ConfigureClient, ConfigureServer); - var notification = new { - ContentChanges = new[] { - new { + var notification = new + { + ContentChanges = new[] + { + new + { Text = "Text change", - Range = new { + Range = new + { Start = new { Line = 1, Character = double.Parse("1.0E300") }, End = new { Line = 2, Character = 9999999999999999999 } }, } }, - TextDocument = new { + TextDocument = new + { Uri = DocumentUri.From("/path/to/file") }, }; - Action a = () => client.SendNotification(TextDocumentNames.DidChange, notification); + var a = () => client.SendNotification(TextDocumentNames.DidChange, notification); a.Should().NotThrow(); } @@ -77,7 +84,9 @@ private void ConfigureClient(LanguageClientOptions options) private void ConfigureServer(LanguageServerOptions options) { - options.OnCodeAction(@params => Task.FromResult(new CommandOrCodeActionContainer()), (capability, capabilities) => new CodeActionRegistrationOptions()); + options.OnCodeAction( + @params => Task.FromResult(new CommandOrCodeActionContainer()), (capability, capabilities) => new CodeActionRegistrationOptions() + ); } } } diff --git a/test/Lsp.Integration.Tests/EventingTests.cs b/test/Lsp.Integration.Tests/EventingTests.cs index 1a9cc5164..482b409a5 100644 --- a/test/Lsp.Integration.Tests/EventingTests.cs +++ b/test/Lsp.Integration.Tests/EventingTests.cs @@ -10,16 +10,14 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using OmniSharp.Extensions.LanguageServer.Server; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -using Arg = NSubstitute.Arg; + // ReSharper disable SuspiciousTypeConversion.Global -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class EventingTests : LanguageProtocolTestBase { @@ -59,12 +57,14 @@ public async Task Initialize_Delegate_Is_Supported() public async Task Initialize_Interface_Is_Supported_On_Handlers() { var onLanguageClientInitialize = - (IOnLanguageClientInitialize) Substitute.For(new[] { typeof(IOnLanguageClientInitialize), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty()); + (IOnLanguageClientInitialize)Substitute.For( + new[] { typeof(IOnLanguageClientInitialize), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty() + ); var onLanguageServerInitialize = - (IOnLanguageServerInitialize) Substitute.For(new[] { typeof(IOnLanguageServerInitialize), typeof(CompletionHandlerBase) }, new object[] { }); + (IOnLanguageServerInitialize)Substitute.For(new[] { typeof(IOnLanguageServerInitialize), typeof(CompletionHandlerBase) }, new object[] { }); var (client, server) = await Initialize( - options => options.AddHandler((IJsonRpcHandler) onLanguageClientInitialize!), - options => options.AddHandler((IJsonRpcHandler) onLanguageServerInitialize!) + options => options.AddHandler((IJsonRpcHandler)onLanguageClientInitialize), + options => options.AddHandler((IJsonRpcHandler)onLanguageServerInitialize) ); await onLanguageClientInitialize.Received(1).OnInitialize(client, client.ClientSettings, Arg.Any()); @@ -75,16 +75,18 @@ public async Task Initialize_Interface_Is_Supported_On_Handlers() public async Task Initialize_Interface_Is_Supported_On_Handlers_After_Startup() { var onLanguageClientInitialize = - (IOnLanguageClientInitialize) Substitute.For(new[] { typeof(IOnLanguageClientInitialize), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty()); + (IOnLanguageClientInitialize)Substitute.For( + new[] { typeof(IOnLanguageClientInitialize), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty() + ); var onLanguageServerInitialize = - (IOnLanguageServerInitialize) Substitute.For(new[] { typeof(IOnLanguageServerInitialize), typeof(CompletionHandlerBase) }, new object[] { }); + (IOnLanguageServerInitialize)Substitute.For(new[] { typeof(IOnLanguageServerInitialize), typeof(CompletionHandlerBase) }, new object[] { }); var (client, server) = await Initialize(o => { }, o => { }); await onLanguageClientInitialize.Received(0).OnInitialize(client, client.ClientSettings, Arg.Any()); await onLanguageServerInitialize.Received(0).OnInitialize(server, server.ClientSettings, Arg.Any()); - client.Register(r => r.AddHandler((IJsonRpcHandler) onLanguageClientInitialize!)); - server.Register(r => r.AddHandler((IJsonRpcHandler) onLanguageServerInitialize!)); + client.Register(r => r.AddHandler((IJsonRpcHandler)onLanguageClientInitialize)); + server.Register(r => r.AddHandler((IJsonRpcHandler)onLanguageServerInitialize)); await onLanguageClientInitialize.Received(1).OnInitialize(client, client.ClientSettings, Arg.Any()); await onLanguageServerInitialize.Received(1).OnInitialize(server, server.ClientSettings, Arg.Any()); @@ -122,12 +124,14 @@ public async Task Initialized_Delegate_Is_Supported() public async Task Initialized_Interface_Is_Supported_On_Handlers() { var onLanguageClientInitialized = - (IOnLanguageClientInitialized) Substitute.For(new[] { typeof(IOnLanguageClientInitialized), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty()); + (IOnLanguageClientInitialized)Substitute.For( + new[] { typeof(IOnLanguageClientInitialized), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty() + ); var onLanguageServerInitialized = - (IOnLanguageServerInitialized) Substitute.For(new[] { typeof(IOnLanguageServerInitialized), typeof(CompletionHandlerBase) }, new object[] { }); + (IOnLanguageServerInitialized)Substitute.For(new[] { typeof(IOnLanguageServerInitialized), typeof(CompletionHandlerBase) }, new object[] { }); var (client, server) = await Initialize( - options => options.AddHandler((IJsonRpcHandler) onLanguageClientInitialized!), - options => options.AddHandler((IJsonRpcHandler) onLanguageServerInitialized!) + options => options.AddHandler((IJsonRpcHandler)onLanguageClientInitialized!), + options => options.AddHandler((IJsonRpcHandler)onLanguageServerInitialized!) ); await onLanguageClientInitialized.Received(1).OnInitialized(client, client.ClientSettings, client.ServerSettings, Arg.Any()); @@ -138,16 +142,18 @@ public async Task Initialized_Interface_Is_Supported_On_Handlers() public async Task Initialized_Interface_Is_Supported_On_Handlers_After_Startup() { var onLanguageClientInitialized = - (IOnLanguageClientInitialized) Substitute.For(new[] { typeof(IOnLanguageClientInitialized), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty()); + (IOnLanguageClientInitialized)Substitute.For( + new[] { typeof(IOnLanguageClientInitialized), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty() + ); var onLanguageServerInitialized = - (IOnLanguageServerInitialized) Substitute.For(new[] { typeof(IOnLanguageServerInitialized), typeof(CompletionHandlerBase) }, new object[] { }); + (IOnLanguageServerInitialized)Substitute.For(new[] { typeof(IOnLanguageServerInitialized), typeof(CompletionHandlerBase) }, new object[] { }); var (client, server) = await Initialize(o => { }, o => { }); await onLanguageClientInitialized.Received(0).OnInitialized(client, client.ClientSettings, client.ServerSettings, Arg.Any()); await onLanguageServerInitialized.Received(0).OnInitialized(server, server.ClientSettings, server.ServerSettings, Arg.Any()); - client.Register(r => r.AddHandler((IJsonRpcHandler) onLanguageClientInitialized!)); - server.Register(r => r.AddHandler((IJsonRpcHandler) onLanguageServerInitialized!)); + client.Register(r => r.AddHandler((IJsonRpcHandler)onLanguageClientInitialized!)); + server.Register(r => r.AddHandler((IJsonRpcHandler)onLanguageServerInitialized!)); await onLanguageClientInitialized.Received(1).OnInitialized(client, client.ClientSettings, client.ServerSettings, Arg.Any()); await onLanguageServerInitialized.Received(1).OnInitialized(server, server.ClientSettings, server.ServerSettings, Arg.Any()); @@ -185,12 +191,14 @@ public async Task Started_Delegate_Is_Supported() public async Task Started_Interface_Is_Supported_On_Handlers() { var onLanguageClientStarted = - (IOnLanguageClientStarted) Substitute.For(new[] { typeof(IOnLanguageClientStarted), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty()); + (IOnLanguageClientStarted)Substitute.For( + new[] { typeof(IOnLanguageClientStarted), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty() + ); var onLanguageServerStarted = - (IOnLanguageServerStarted) Substitute.For(new[] { typeof(IOnLanguageServerStarted), typeof(CompletionHandlerBase) }, new object[] { }); + (IOnLanguageServerStarted)Substitute.For(new[] { typeof(IOnLanguageServerStarted), typeof(CompletionHandlerBase) }, new object[] { }); var (client, server) = await Initialize( - options => options.AddHandler((IJsonRpcHandler) onLanguageClientStarted!), - options => options.AddHandler((IJsonRpcHandler) onLanguageServerStarted!) + options => options.AddHandler((IJsonRpcHandler)onLanguageClientStarted!), + options => options.AddHandler((IJsonRpcHandler)onLanguageServerStarted!) ); await onLanguageClientStarted.Received(1).OnStarted(client, Arg.Any()); @@ -201,16 +209,18 @@ public async Task Started_Interface_Is_Supported_On_Handlers() public async Task Started_Interface_Is_Supported_On_Handlers_After_Startup() { var onLanguageClientStarted = - (IOnLanguageClientStarted) Substitute.For(new[] { typeof(IOnLanguageClientStarted), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty()); + (IOnLanguageClientStarted)Substitute.For( + new[] { typeof(IOnLanguageClientStarted), typeof(PublishDiagnosticsHandlerBase) }, Array.Empty() + ); var onLanguageServerStarted = - (IOnLanguageServerStarted) Substitute.For(new[] { typeof(IOnLanguageServerStarted), typeof(CompletionHandlerBase) }, new object[] { }); + (IOnLanguageServerStarted)Substitute.For(new[] { typeof(IOnLanguageServerStarted), typeof(CompletionHandlerBase) }, new object[] { }); var (client, server) = await Initialize(o => { }, o => { }); await onLanguageClientStarted.Received(0).OnStarted(client, Arg.Any()); await onLanguageServerStarted.Received(0).OnStarted(server, Arg.Any()); - client.Register(r => r.AddHandler((IJsonRpcHandler) onLanguageClientStarted!)); - server.Register(r => r.AddHandler((IJsonRpcHandler) onLanguageServerStarted!)); + client.Register(r => r.AddHandler((IJsonRpcHandler)onLanguageClientStarted!)); + server.Register(r => r.AddHandler((IJsonRpcHandler)onLanguageServerStarted!)); await onLanguageClientStarted.Received(1).OnStarted(client, Arg.Any()); await onLanguageServerStarted.Received(1).OnStarted(server, Arg.Any()); diff --git a/test/Lsp.Integration.Tests/ExecuteCommandTests.cs b/test/Lsp.Integration.Tests/ExecuteCommandTests.cs index d059aa2b9..5cf75ae98 100644 --- a/test/Lsp.Integration.Tests/ExecuteCommandTests.cs +++ b/test/Lsp.Integration.Tests/ExecuteCommandTests.cs @@ -15,12 +15,11 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ExecuteCommandTests : LanguageProtocolTestBase { @@ -33,12 +32,15 @@ public async Task Should_Execute_A_Command() { var command = Substitute.For>(); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", false) } ) @@ -47,7 +49,8 @@ public async Task Should_Execute_A_Command() ); options.OnExecuteCommand( - command, (_, _) => new ExecuteCommandRegistrationOptions { + command, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-a") } ); @@ -71,18 +74,23 @@ public async Task Should_Execute_The_Correct_Command() var commanda = Substitute.For>(); var commandb = Substitute.For>(); var (client, _) = await Initialize( - options => { + options => + { options.WithCapability( - new ExecuteCommandCapability { + new ExecuteCommandCapability + { DynamicRegistration = false } ); - }, options => { + }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-b", 1, "2", false) } ) @@ -91,13 +99,15 @@ public async Task Should_Execute_The_Correct_Command() ); options.OnExecuteCommand( - commanda, (_, _) => new ExecuteCommandRegistrationOptions { + commanda, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-a") } ); options.OnExecuteCommand( - commandb, (_, _) => new ExecuteCommandRegistrationOptions { + commandb, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-b") } ); @@ -122,12 +132,15 @@ public async Task Should_Execute_The_Correct_Command() public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Is_Defined() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", false) } ) @@ -143,7 +156,7 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Is_Defined() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().ThrowAsync(); } @@ -152,13 +165,17 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given { var command = Substitute.For>(); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Arguments = JArray.FromObject(new object[] { 1, "2", false }) } } @@ -168,7 +185,8 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given ); options.OnExecuteCommand( - command, (_, _) => new ExecuteCommandRegistrationOptions { + command, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-a") } ); @@ -181,7 +199,7 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().ThrowAsync(); await command.Received(0).Invoke(Arg.Any()); @@ -193,12 +211,15 @@ public async Task Should_Fail_To_Execute_A_Command() var commandc = Substitute.For>(); var commandb = Substitute.For>(); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", false) } ) @@ -207,13 +228,15 @@ public async Task Should_Fail_To_Execute_A_Command() ); options.OnExecuteCommand( - commandb, (_, _) => new ExecuteCommandRegistrationOptions { + commandb, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-b") } ); options.OnExecuteCommand( - commandc, (_, _) => new ExecuteCommandRegistrationOptions { + commandc, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-c") } ); @@ -226,7 +249,7 @@ public async Task Should_Fail_To_Execute_A_Command() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().ThrowAsync(); await commandc.Received(0).Invoke(Arg.Any()); @@ -237,12 +260,15 @@ public async Task Should_Fail_To_Execute_A_Command() public async Task Should_Execute_1_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1) } ) @@ -251,7 +277,8 @@ public async Task Should_Execute_1_Args() ); options.OnExecuteCommand( - "execute-a", i => { + "execute-a", i => + { i.Should().Be(1); return Task.CompletedTask; @@ -266,7 +293,7 @@ public async Task Should_Execute_1_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -274,12 +301,15 @@ public async Task Should_Execute_1_Args() public async Task Should_Execute_2_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2") } ) @@ -288,7 +318,8 @@ public async Task Should_Execute_2_Args() ); options.OnExecuteCommand( - "execute-a", (i, s) => { + "execute-a", (i, s) => + { i.Should().Be(1); s.Should().Be("2"); @@ -304,7 +335,7 @@ public async Task Should_Execute_2_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -312,12 +343,15 @@ public async Task Should_Execute_2_Args() public async Task Should_Execute_3_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", true) } ) @@ -326,7 +360,8 @@ public async Task Should_Execute_3_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3) => { + "execute-a", (i, s, arg3) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); @@ -343,7 +378,7 @@ public async Task Should_Execute_3_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -351,13 +386,16 @@ public async Task Should_Execute_3_Args() public async Task Should_Execute_4_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = Command.Create("execute-a", 1, "2", true, new Range((0, 1), (1, 1))) + new CompletionItem + { + Command = Command.Create("execute-a", 1, "2", true, new Range(( 0, 1 ), ( 1, 1 ))) } ) ); @@ -365,11 +403,12 @@ public async Task Should_Execute_4_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3, arg4) => { + "execute-a", (i, s, arg3, arg4) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - arg4.Should().Be(new Range((0, 1), (1, 1))); + arg4.Should().Be(new Range(( 0, 1 ), ( 1, 1 ))); return Task.CompletedTask; } @@ -383,7 +422,7 @@ public async Task Should_Execute_4_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -391,14 +430,18 @@ public async Task Should_Execute_4_Args() public async Task Should_Execute_5_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create( - "execute-a", 1, "2", true, new Range((0, 1), (1, 1)), new Dictionary { ["a"] = "123", ["b"] = "456" } + "execute-a", 1, "2", true, new Range(( 0, 1 ), ( 1, 1 )), + new Dictionary { ["a"] = "123", ["b"] = "456" } ) } ) @@ -407,11 +450,12 @@ public async Task Should_Execute_5_Args() ); options.OnExecuteCommand>( - "execute-a", (i, s, arg3, arg4, arg5) => { + "execute-a", (i, s, arg3, arg4, arg5) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - arg4.Should().Be(new Range((0, 1), (1, 1))); + arg4.Should().Be(new Range(( 0, 1 ), ( 1, 1 ))); arg5.Should().ContainKeys("a", "b"); return Task.CompletedTask; @@ -426,7 +470,7 @@ public async Task Should_Execute_5_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -434,14 +478,18 @@ public async Task Should_Execute_5_Args() public async Task Should_Execute_6_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create( - "execute-a", 1, "2", true, new Range((0, 1), (1, 1)), new Dictionary { ["a"] = "123", ["b"] = "456" }, + "execute-a", 1, "2", true, new Range(( 0, 1 ), ( 1, 1 )), + new Dictionary { ["a"] = "123", ["b"] = "456" }, Guid.NewGuid() ) } @@ -451,11 +499,12 @@ public async Task Should_Execute_6_Args() ); options.OnExecuteCommand, Guid>( - "execute-a", (i, s, arg3, arg4, arg5, arg6) => { + "execute-a", (i, s, arg3, arg4, arg5, arg6) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - arg4.Should().Be(new Range((0, 1), (1, 1))); + arg4.Should().Be(new Range(( 0, 1 ), ( 1, 1 ))); arg5.Should().ContainKeys("a", "b"); arg6.Should().NotBeEmpty(); @@ -471,7 +520,7 @@ public async Task Should_Execute_6_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -479,12 +528,15 @@ public async Task Should_Execute_6_Args() public async Task Should_Execute_1_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -493,7 +545,8 @@ public async Task Should_Execute_1_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", i => { + "execute-a", i => + { i.Should().Be(default); return Task.CompletedTask; @@ -508,7 +561,7 @@ public async Task Should_Execute_1_With_Missing_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -516,12 +569,15 @@ public async Task Should_Execute_1_With_Missing_Args() public async Task Should_Execute_2_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -530,7 +586,8 @@ public async Task Should_Execute_2_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", (i, s) => { + "execute-a", (i, s) => + { i.Should().Be(default); s.Should().Be(default); @@ -546,7 +603,7 @@ public async Task Should_Execute_2_With_Missing_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -554,12 +611,15 @@ public async Task Should_Execute_2_With_Missing_Args() public async Task Should_Execute_3_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -568,7 +628,8 @@ public async Task Should_Execute_3_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3) => { + "execute-a", (i, s, arg3) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -585,7 +646,7 @@ public async Task Should_Execute_3_With_Missing_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -593,12 +654,15 @@ public async Task Should_Execute_3_With_Missing_Args() public async Task Should_Execute_4_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -607,7 +671,8 @@ public async Task Should_Execute_4_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3, arg4) => { + "execute-a", (i, s, arg3, arg4) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -625,7 +690,7 @@ public async Task Should_Execute_4_With_Missing_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -633,12 +698,15 @@ public async Task Should_Execute_4_With_Missing_Args() public async Task Should_Execute_5_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -647,7 +715,8 @@ public async Task Should_Execute_5_With_Missing_Args() ); options.OnExecuteCommand>( - "execute-a", (i, s, arg3, arg4, arg5) => { + "execute-a", (i, s, arg3, arg4, arg5) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -666,7 +735,7 @@ public async Task Should_Execute_5_With_Missing_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -674,12 +743,15 @@ public async Task Should_Execute_5_With_Missing_Args() public async Task Should_Execute_6_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -688,7 +760,8 @@ public async Task Should_Execute_6_With_Missing_Args() ); options.OnExecuteCommand, Guid>( - "execute-a", (i, s, arg3, arg4, arg5, arg6) => { + "execute-a", (i, s, arg3, arg4, arg5, arg6) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -708,7 +781,7 @@ public async Task Should_Execute_6_With_Missing_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -716,12 +789,15 @@ public async Task Should_Execute_6_With_Missing_Args() public async Task Should_Execute_1_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -730,7 +806,8 @@ public async Task Should_Execute_1_Null_Args() ); options.OnExecuteCommand( - "execute-a", i => { + "execute-a", i => + { i.Should().Be(default); return Task.CompletedTask; @@ -745,7 +822,7 @@ public async Task Should_Execute_1_Null_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -753,12 +830,15 @@ public async Task Should_Execute_1_Null_Args() public async Task Should_Execute_2_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -767,7 +847,8 @@ public async Task Should_Execute_2_Null_Args() ); options.OnExecuteCommand( - "execute-a", (i, s) => { + "execute-a", (i, s) => + { i.Should().Be(default); s.Should().Be(default); @@ -783,7 +864,7 @@ public async Task Should_Execute_2_Null_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -791,12 +872,15 @@ public async Task Should_Execute_2_Null_Args() public async Task Should_Execute_3_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -805,7 +889,8 @@ public async Task Should_Execute_3_Null_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3) => { + "execute-a", (i, s, arg3) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -822,7 +907,7 @@ public async Task Should_Execute_3_Null_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -830,12 +915,15 @@ public async Task Should_Execute_3_Null_Args() public async Task Should_Execute_4_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -844,7 +932,8 @@ public async Task Should_Execute_4_Null_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3, arg4) => { + "execute-a", (i, s, arg3, arg4) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -862,7 +951,7 @@ public async Task Should_Execute_4_Null_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -870,12 +959,15 @@ public async Task Should_Execute_4_Null_Args() public async Task Should_Execute_5_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -884,7 +976,8 @@ public async Task Should_Execute_5_Null_Args() ); options.OnExecuteCommand>( - "execute-a", (i, s, arg3, arg4, arg5) => { + "execute-a", (i, s, arg3, arg4, arg5) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -903,7 +996,7 @@ public async Task Should_Execute_5_Null_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } @@ -911,12 +1004,15 @@ public async Task Should_Execute_5_Null_Args() public async Task Should_Execute_6_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -925,7 +1021,8 @@ public async Task Should_Execute_6_Null_Args() ); options.OnExecuteCommand, Guid>( - "execute-a", (i, s, arg3, arg4, arg5, arg6) => { + "execute-a", (i, s, arg3, arg4, arg5, arg6) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -945,7 +1042,7 @@ public async Task Should_Execute_6_Null_Args() item.Command.Should().NotBeNull(); - Func action = () => client.ExecuteCommand(item.Command!); + var action = () => client.ExecuteCommand(item.Command!); await action.Should().NotThrowAsync(); } } diff --git a/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs b/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs index 4caf445ae..b57001dc8 100644 --- a/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs +++ b/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs @@ -15,12 +15,11 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ExecuteTypedCommandTests : LanguageProtocolTestBase { @@ -32,14 +31,17 @@ public ExecuteTypedCommandTests(ITestOutputHelper outputHelper) : base(new JsonR public async Task Should_Execute_A_Command() { var command = Substitute.For, Task>>(); - command.Invoke(Arg.Any>()).Returns(new CommandResponse() { Value = "1234" }); + command.Invoke(Arg.Any>()).Returns(new CommandResponse { Value = "1234" }); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", false) } ) @@ -48,7 +50,8 @@ public async Task Should_Execute_A_Command() ); options.OnExecuteCommand( - command, (_, _) => new ExecuteCommandRegistrationOptions { + command, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-a") } ); @@ -70,22 +73,28 @@ public async Task Should_Execute_A_Command() public async Task Should_Execute_The_Correct_Command() { var commanda = Substitute.For, Task>>(); - commanda.Invoke(Arg.Any>()).Returns(new CommandResponse() { Value = "1234" }); - var commandb = Substitute.For,ExecuteCommandCapability, CancellationToken, Task>>(); - commandb.Invoke(Arg.Any>(), Arg.Any(), Arg.Any()).Returns(new CommandResponse() { Value = "4321" }); + commanda.Invoke(Arg.Any>()).Returns(new CommandResponse { Value = "1234" }); + var commandb = Substitute.For, ExecuteCommandCapability, CancellationToken, Task>>(); + commandb.Invoke(Arg.Any>(), Arg.Any(), Arg.Any()) + .Returns(new CommandResponse { Value = "4321" }); var (client, _) = await Initialize( - options => { + options => + { options.WithCapability( - new ExecuteCommandCapability { + new ExecuteCommandCapability + { DynamicRegistration = false } ); - }, options => { + }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-b", 1, "2", false) } ) @@ -94,13 +103,15 @@ public async Task Should_Execute_The_Correct_Command() ); options.OnExecuteCommand( - commanda, (_, _) => new ExecuteCommandRegistrationOptions { + commanda, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-a") } ); options.OnExecuteCommand( - commandb, (_, _) => new ExecuteCommandRegistrationOptions { + commandb, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-b") } ); @@ -117,7 +128,9 @@ public async Task Should_Execute_The_Correct_Command() response.Value.Should().Be("4321"); await commanda.Received(0).Invoke(Arg.Any>()); - await commandb.Received(1).Invoke(Arg.Any>(), Arg.Any(), Arg.Any()); + await commandb.Received(1).Invoke( + Arg.Any>(), Arg.Any(), Arg.Any() + ); var arg = commandb.ReceivedCalls().Single().GetArguments()[1]; arg.Should().BeOfType(); } @@ -125,16 +138,20 @@ public async Task Should_Execute_The_Correct_Command() [Fact] public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given() { - var command = Substitute.For,Task>>(); - command.Invoke(Arg.Any>()).Returns(new CommandResponse() { Value = "1234" }); + var command = Substitute.For, Task>>(); + command.Invoke(Arg.Any>()).Returns(new CommandResponse { Value = "1234" }); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Arguments = JArray.FromObject(new object[] { 1, "2", false }) } } @@ -144,7 +161,8 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given ); options.OnExecuteCommand( - command, (_, _) => new ExecuteCommandRegistrationOptions { + command, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-a") } ); @@ -157,7 +175,7 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().ThrowAsync(); await command.Received(0).Invoke(Arg.Any>()); @@ -166,17 +184,20 @@ public async Task Should_Fail_To_Execute_A_Command_When_No_Command_Name_Is_Given [Fact] public async Task Should_Fail_To_Execute_A_Command() { - var commandc = Substitute.For,Task>>(); - commandc.Invoke(Arg.Any>()).Returns(new CommandResponse() { Value = "1234" }); - var commandb = Substitute.For,Task>>(); - commandb.Invoke(Arg.Any>()).Returns(new CommandResponse() { Value = "1234" }); + var commandc = Substitute.For, Task>>(); + commandc.Invoke(Arg.Any>()).Returns(new CommandResponse { Value = "1234" }); + var commandb = Substitute.For, Task>>(); + commandb.Invoke(Arg.Any>()).Returns(new CommandResponse { Value = "1234" }); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", false) } ) @@ -185,13 +206,15 @@ public async Task Should_Fail_To_Execute_A_Command() ); options.OnExecuteCommand( - commandb, (_, _) => new ExecuteCommandRegistrationOptions { + commandb, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-b") } ); options.OnExecuteCommand( - commandc, (_, _) => new ExecuteCommandRegistrationOptions { + commandc, (_, _) => new ExecuteCommandRegistrationOptions + { Commands = new Container("execute-c") } ); @@ -204,7 +227,7 @@ public async Task Should_Fail_To_Execute_A_Command() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().ThrowAsync(); await commandc.Received(0).Invoke(Arg.Any>()); @@ -215,12 +238,15 @@ public async Task Should_Fail_To_Execute_A_Command() public async Task Should_Execute_1_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1) } ) @@ -229,10 +255,11 @@ public async Task Should_Execute_1_Args() ); options.OnExecuteCommand( - "execute-a", i => { + "execute-a", i => + { i.Should().Be(1); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -244,7 +271,7 @@ public async Task Should_Execute_1_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -252,12 +279,15 @@ public async Task Should_Execute_1_Args() public async Task Should_Execute_2_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2") } ) @@ -266,11 +296,12 @@ public async Task Should_Execute_2_Args() ); options.OnExecuteCommand( - "execute-a", (i, s) => { + "execute-a", (i, s) => + { i.Should().Be(1); s.Should().Be("2"); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -290,12 +321,15 @@ public async Task Should_Execute_2_Args() public async Task Should_Execute_3_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a", 1, "2", true) } ) @@ -304,12 +338,13 @@ public async Task Should_Execute_3_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3) => { + "execute-a", (i, s, arg3) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -321,7 +356,7 @@ public async Task Should_Execute_3_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -329,13 +364,16 @@ public async Task Should_Execute_3_Args() public async Task Should_Execute_4_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = Command.Create("execute-a", 1, "2", true, new Range((0, 1), (1, 1))) + new CompletionItem + { + Command = Command.Create("execute-a", 1, "2", true, new Range(( 0, 1 ), ( 1, 1 ))) } ) ); @@ -343,13 +381,14 @@ public async Task Should_Execute_4_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3, arg4) => { + "execute-a", (i, s, arg3, arg4) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - arg4.Should().Be(new Range((0, 1), (1, 1))); + arg4.Should().Be(new Range(( 0, 1 ), ( 1, 1 ))); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -361,7 +400,7 @@ public async Task Should_Execute_4_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -369,14 +408,18 @@ public async Task Should_Execute_4_Args() public async Task Should_Execute_5_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create( - "execute-a", 1, "2", true, new Range((0, 1), (1, 1)), new Dictionary { ["a"] = "123", ["b"] = "456" } + "execute-a", 1, "2", true, new Range(( 0, 1 ), ( 1, 1 )), + new Dictionary { ["a"] = "123", ["b"] = "456" } ) } ) @@ -385,14 +428,15 @@ public async Task Should_Execute_5_Args() ); options.OnExecuteCommand, CommandResponse>( - "execute-a", (i, s, arg3, arg4, arg5) => { + "execute-a", (i, s, arg3, arg4, arg5) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - arg4.Should().Be(new Range((0, 1), (1, 1))); + arg4.Should().Be(new Range(( 0, 1 ), ( 1, 1 ))); arg5.Should().ContainKeys("a", "b"); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -404,7 +448,7 @@ public async Task Should_Execute_5_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -412,14 +456,18 @@ public async Task Should_Execute_5_Args() public async Task Should_Execute_6_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create( - "execute-a", 1, "2", true, new Range((0, 1), (1, 1)), new Dictionary { ["a"] = "123", ["b"] = "456" }, + "execute-a", 1, "2", true, new Range(( 0, 1 ), ( 1, 1 )), + new Dictionary { ["a"] = "123", ["b"] = "456" }, Guid.NewGuid() ) } @@ -429,15 +477,16 @@ public async Task Should_Execute_6_Args() ); options.OnExecuteCommand, Guid, CommandResponse>( - "execute-a", (i, s, arg3, arg4, arg5, arg6) => { + "execute-a", (i, s, arg3, arg4, arg5, arg6) => + { i.Should().Be(1); s.Should().Be("2"); arg3.Should().BeTrue(); - arg4.Should().Be(new Range((0, 1), (1, 1))); + arg4.Should().Be(new Range(( 0, 1 ), ( 1, 1 ))); arg5.Should().ContainKeys("a", "b"); arg6.Should().NotBeEmpty(); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -449,7 +498,7 @@ public async Task Should_Execute_6_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -457,12 +506,15 @@ public async Task Should_Execute_6_Args() public async Task Should_Execute_1_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -471,10 +523,11 @@ public async Task Should_Execute_1_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", i => { + "execute-a", i => + { i.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -486,7 +539,7 @@ public async Task Should_Execute_1_With_Missing_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -494,12 +547,15 @@ public async Task Should_Execute_1_With_Missing_Args() public async Task Should_Execute_2_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -508,11 +564,12 @@ public async Task Should_Execute_2_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", (i, s) => { + "execute-a", (i, s) => + { i.Should().Be(default); s.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -524,7 +581,7 @@ public async Task Should_Execute_2_With_Missing_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -532,12 +589,15 @@ public async Task Should_Execute_2_With_Missing_Args() public async Task Should_Execute_3_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -546,12 +606,13 @@ public async Task Should_Execute_3_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3) => { + "execute-a", (i, s, arg3) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -563,7 +624,7 @@ public async Task Should_Execute_3_With_Missing_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -571,12 +632,15 @@ public async Task Should_Execute_3_With_Missing_Args() public async Task Should_Execute_4_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -585,13 +649,14 @@ public async Task Should_Execute_4_With_Missing_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3, arg4) => { + "execute-a", (i, s, arg3, arg4) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); arg4.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -603,7 +668,7 @@ public async Task Should_Execute_4_With_Missing_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -611,12 +676,15 @@ public async Task Should_Execute_4_With_Missing_Args() public async Task Should_Execute_5_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -625,14 +693,15 @@ public async Task Should_Execute_5_With_Missing_Args() ); options.OnExecuteCommand, CommandResponse>( - "execute-a", (i, s, arg3, arg4, arg5) => { + "execute-a", (i, s, arg3, arg4, arg5) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); arg4.Should().Be(default); arg5.Should().BeNull(); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -644,7 +713,7 @@ public async Task Should_Execute_5_With_Missing_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -652,12 +721,15 @@ public async Task Should_Execute_5_With_Missing_Args() public async Task Should_Execute_6_With_Missing_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -666,7 +738,8 @@ public async Task Should_Execute_6_With_Missing_Args() ); options.OnExecuteCommand, Guid, CommandResponse>( - "execute-a", (i, s, arg3, arg4, arg5, arg6) => { + "execute-a", (i, s, arg3, arg4, arg5, arg6) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -674,7 +747,7 @@ public async Task Should_Execute_6_With_Missing_Args() arg5.Should().BeNull(); arg6.Should().BeEmpty(); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -686,7 +759,7 @@ public async Task Should_Execute_6_With_Missing_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -694,12 +767,15 @@ public async Task Should_Execute_6_With_Missing_Args() public async Task Should_Execute_1_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -708,10 +784,11 @@ public async Task Should_Execute_1_Null_Args() ); options.OnExecuteCommand( - "execute-a", i => { + "execute-a", i => + { i.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -723,7 +800,7 @@ public async Task Should_Execute_1_Null_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -731,12 +808,15 @@ public async Task Should_Execute_1_Null_Args() public async Task Should_Execute_2_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -745,11 +825,12 @@ public async Task Should_Execute_2_Null_Args() ); options.OnExecuteCommand( - "execute-a", (i, s) => { + "execute-a", (i, s) => + { i.Should().Be(default); s.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -761,7 +842,7 @@ public async Task Should_Execute_2_Null_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -769,12 +850,15 @@ public async Task Should_Execute_2_Null_Args() public async Task Should_Execute_3_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -783,12 +867,13 @@ public async Task Should_Execute_3_Null_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3) => { + "execute-a", (i, s, arg3) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -800,7 +885,7 @@ public async Task Should_Execute_3_Null_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -808,12 +893,15 @@ public async Task Should_Execute_3_Null_Args() public async Task Should_Execute_4_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -822,13 +910,14 @@ public async Task Should_Execute_4_Null_Args() ); options.OnExecuteCommand( - "execute-a", (i, s, arg3, arg4) => { + "execute-a", (i, s, arg3, arg4) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); arg4.Should().Be(default); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -840,7 +929,7 @@ public async Task Should_Execute_4_Null_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -848,12 +937,15 @@ public async Task Should_Execute_4_Null_Args() public async Task Should_Execute_5_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -862,14 +954,15 @@ public async Task Should_Execute_5_Null_Args() ); options.OnExecuteCommand, CommandResponse>( - "execute-a", (i, s, arg3, arg4, arg5) => { + "execute-a", (i, s, arg3, arg4, arg5) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); arg4.Should().Be(default); arg5.Should().BeNull(); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -881,7 +974,7 @@ public async Task Should_Execute_5_Null_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } @@ -889,12 +982,15 @@ public async Task Should_Execute_5_Null_Args() public async Task Should_Execute_6_Null_Args() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - x => { + x => + { return Task.FromResult( new CompletionList( - new CompletionItem { + new CompletionItem + { Command = Command.Create("execute-a") } ) @@ -903,7 +999,8 @@ public async Task Should_Execute_6_Null_Args() ); options.OnExecuteCommand, Guid, CommandResponse>( - "execute-a", (i, s, arg3, arg4, arg5, arg6) => { + "execute-a", (i, s, arg3, arg4, arg5, arg6) => + { i.Should().Be(default); s.Should().Be(default); arg3.Should().Be(default); @@ -911,7 +1008,7 @@ public async Task Should_Execute_6_Null_Args() arg5.Should().BeNull(); arg6.Should().BeEmpty(); - return Task.FromResult(new CommandResponse() { Value = "1234" }); + return Task.FromResult(new CommandResponse { Value = "1234" }); } ); } @@ -923,7 +1020,7 @@ public async Task Should_Execute_6_Null_Args() item.Command.Should().NotBeNull(); - Func> action = () => client.ExecuteCommandWithResponse(item.Command!); + var action = () => client.ExecuteCommandWithResponse(item.Command!); await action.Should().NotThrowAsync(); } diff --git a/test/Lsp.Integration.Tests/ExtensionTests.cs b/test/Lsp.Integration.Tests/ExtensionTests.cs index 1405c7c81..5c67a0b61 100644 --- a/test/Lsp.Integration.Tests/ExtensionTests.cs +++ b/test/Lsp.Integration.Tests/ExtensionTests.cs @@ -1,27 +1,25 @@ using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; using System.Threading; using System.Threading.Tasks; using FluentAssertions; +using Lsp.Integration.Tests.Fixtures; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; -using Serilog.Events; -using Xunit; -using Xunit.Abstractions; -using Lsp.Tests.Integration.Fixtures; -using Microsoft.Extensions.DependencyInjection; -using Newtonsoft.Json.Linq; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Shared; +using Serilog.Events; using TestingUtils; +using Xunit; +using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ExtensionTests : LanguageProtocolTestBase { @@ -41,23 +39,26 @@ public async Task Should_Support_Custom_Capabilities() .Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); var (client, server) = await Initialize( - options => { + options => + { options.UseAssemblyAttributeScanning = false; options .WithAssemblies(typeof(UnitTestCapability).Assembly) .WithCapability( - new UnitTestCapability() { + new UnitTestCapability + { DynamicRegistration = true, Property = "Abcd" } ); - }, options => { + }, options => + { options.UseAssemblyAttributeScanning = false; options - .WithAssemblies(typeof(UnitTestCapability).Assembly) - .OnDiscoverUnitTests(onDiscoverHandler, (_, _) => new UnitTestRegistrationOptions()) + .WithAssemblies(typeof(UnitTestCapability).Assembly).OnDiscoverUnitTests(onDiscoverHandler, (_, _) => new UnitTestRegistrationOptions()) .OnRunUnitTest( - onRunUnitHandler, (_, _) => new UnitTestRegistrationOptions() { + onRunUnitHandler, (_, _) => new UnitTestRegistrationOptions + { SupportsDebugging = true, WorkDoneProgress = true } @@ -86,14 +87,17 @@ public async Task Should_Support_Custom_Capabilities() } await client.RequestDiscoverUnitTests( - new DiscoverUnitTestsParams() { + new DiscoverUnitTestsParams + { PartialResultToken = new ProgressToken(1), WorkDoneToken = new ProgressToken(1), }, CancellationToken ); await client.RunUnitTest(new UnitTest(), CancellationToken); - onDiscoverHandler.Received(1).Invoke(Arg.Any(), Arg.Is(x => x.Property == "Abcd"), Arg.Any()); + onDiscoverHandler.Received(1).Invoke( + Arg.Any(), Arg.Is(x => x.Property == "Abcd"), Arg.Any() + ); onRunUnitHandler.Received(1).Invoke(Arg.Any(), Arg.Is(x => x.Property == "Abcd"), Arg.Any()); } @@ -109,11 +113,13 @@ public async Task Should_Support_Custom_Capabilities_Using_Json() .Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); var (client, server) = await Initialize( - options => { + options => + { options.UseAssemblyAttributeScanning = false; - options.ClientCapabilities.Workspace!.ExtensionData["unitTests"] = JToken.FromObject(new { property = "Abcd", dynamicRegistration = true }); }, - options => { - + options.ClientCapabilities.Workspace!.ExtensionData["unitTests"] = JToken.FromObject(new { property = "Abcd", dynamicRegistration = true }); + }, + options => + { options.UseAssemblyAttributeScanning = false; options.OnDiscoverUnitTests(onDiscoverHandler, (_, _) => new UnitTestRegistrationOptions()); options.OnRunUnitTest(onRunUnitHandler, (_, _) => new UnitTestRegistrationOptions()); @@ -138,7 +144,9 @@ public async Task Should_Support_Custom_Capabilities_Using_Json() await client.RequestDiscoverUnitTests(new DiscoverUnitTestsParams(), CancellationToken); await client.RunUnitTest(new UnitTest(), CancellationToken); - onDiscoverHandler.Received(1).Invoke(Arg.Any(), Arg.Is(x => x.Property == "Abcd"), Arg.Any()); + onDiscoverHandler.Received(1).Invoke( + Arg.Any(), Arg.Is(x => x.Property == "Abcd"), Arg.Any() + ); onRunUnitHandler.Received(1).Invoke(Arg.Any(), Arg.Is(x => x.Property == "Abcd"), Arg.Any()); } @@ -148,18 +156,21 @@ public async Task Should_Support_Custom_Static_Options() var onDiscoverHandler = Substitute.For>>>(); var onRunUnitHandler = Substitute.For>(); var (_, server) = await Initialize( - options => { + options => + { options.UseAssemblyAttributeScanning = false; options.WithCapability( - new UnitTestCapability() { + new UnitTestCapability + { DynamicRegistration = false, Property = "Abcd" } ); - }, options => { + }, options => + { options.UseAssemblyAttributeScanning = false; - options.OnDiscoverUnitTests(onDiscoverHandler, (_, _) => new UnitTestRegistrationOptions() { SupportsDebugging = true }); - options.OnRunUnitTest(onRunUnitHandler, (_, _) => new UnitTestRegistrationOptions() { SupportsDebugging = true }); + options.OnDiscoverUnitTests(onDiscoverHandler, (_, _) => new UnitTestRegistrationOptions { SupportsDebugging = true }); + options.OnRunUnitTest(onRunUnitHandler, (_, _) => new UnitTestRegistrationOptions { SupportsDebugging = true }); } ); @@ -184,14 +195,18 @@ public async Task Should_Support_Custom_Static_Options() public async Task Should_Convert_Registration_Options_Into_Static_Options_As_Required() { var (client, _) = await Initialize( - options => { + options => + { options.UseAssemblyAttributeScanning = false; options.DisableDynamicRegistration(); options.WithCapability( - new CodeActionCapability() { + new CodeActionCapability + { DynamicRegistration = false, - CodeActionLiteralSupport = new CodeActionLiteralSupportOptions() { - CodeActionKind = new CodeActionKindCapabilityOptions() { + CodeActionLiteralSupport = new CodeActionLiteralSupportOptions + { + CodeActionKind = new CodeActionKindCapabilityOptions + { ValueSet = new Container( CodeActionKind.Empty, CodeActionKind.Refactor, @@ -207,11 +222,13 @@ public async Task Should_Convert_Registration_Options_Into_Static_Options_As_Req } ); }, - options => { + options => + { options.UseAssemblyAttributeScanning = false; options.OnCodeAction( (@params, capability, token) => Task.FromResult(new CommandOrCodeActionContainer()), - (_, _) => new CodeActionRegistrationOptions() { + (_, _) => new CodeActionRegistrationOptions + { CodeActionKinds = new Container( CodeActionKind.RefactorExtract, CodeActionKind.RefactorInline, diff --git a/test/Lsp.Integration.Tests/FileOperationTests.cs b/test/Lsp.Integration.Tests/FileOperationTests.cs index 6fc4fb275..94f8851de 100644 --- a/test/Lsp.Integration.Tests/FileOperationTests.cs +++ b/test/Lsp.Integration.Tests/FileOperationTests.cs @@ -15,16 +15,24 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class FileOperationTests : LanguageProtocolTestBase { private readonly Action _didCreateFileHandler = Substitute.For>(); - private readonly Func> _willCreateFileHandler = Substitute.For>>(); + + private readonly Func> _willCreateFileHandler = + Substitute.For>>(); + private readonly Action _didRenameFileHandler = Substitute.For>(); - private readonly Func> _willRenameFileHandler = Substitute.For>>(); + + private readonly Func> _willRenameFileHandler = + Substitute.For>>(); + private readonly Action _didDeleteFileHandler = Substitute.For>(); - private readonly Func> _willDeleteFileHandler = Substitute.For>>(); + + private readonly Func> _willDeleteFileHandler = + Substitute.For>>(); public FileOperationTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) { @@ -36,13 +44,15 @@ public async Task Should_Handle_FileCreate() var (client, server) = await Initialize(Configure, Configure); await client.RequestWillCreateFile( - new WillCreateFileParams() { - Files = Container.From(new FileCreate() { Uri = new Uri("file://asdf") }) + new WillCreateFileParams + { + Files = Container.From(new FileCreate { Uri = new Uri("file://asdf") }) } ); client.DidCreateFile( - new DidCreateFileParams() { - Files = Container.From(new FileCreate() { Uri = new Uri("file://asdf") }) + new DidCreateFileParams + { + Files = Container.From(new FileCreate { Uri = new Uri("file://asdf") }) } ); @@ -82,13 +92,15 @@ public async Task Should_Handle_FileRename() var (client, server) = await Initialize(Configure, Configure); await client.RequestWillRenameFile( - new WillRenameFileParams() { - Files = Container.From(new FileRename() { Uri = new Uri("file://asdf") }) + new WillRenameFileParams + { + Files = Container.From(new FileRename { Uri = new Uri("file://asdf") }) } ); client.DidRenameFile( - new DidRenameFileParams() { - Files = Container.From(new FileRename() { Uri = new Uri("file://asdf") }) + new DidRenameFileParams + { + Files = Container.From(new FileRename { Uri = new Uri("file://asdf") }) } ); @@ -128,13 +140,15 @@ public async Task Should_Handle_FileDelete() var (client, server) = await Initialize(Configure, Configure); await client.RequestWillDeleteFile( - new WillDeleteFileParams() { - Files = Container.From(new FileDelete() { Uri = new Uri("file://asdf") }) + new WillDeleteFileParams + { + Files = Container.From(new FileDelete { Uri = new Uri("file://asdf") }) } ); client.DidDeleteFile( - new DidDeleteFileParams() { - Files = Container.From(new FileDelete() { Uri = new Uri("file://asdf") }) + new DidDeleteFileParams + { + Files = Container.From(new FileDelete { Uri = new Uri("file://asdf") }) } ); @@ -171,7 +185,8 @@ static void VerifyClientSettings(InitializeParams result) private void Configure(LanguageClientOptions options) { options.WithCapability( - new FileOperationsWorkspaceClientCapabilities() { + new FileOperationsWorkspaceClientCapabilities + { DidCreate = true, DidRename = true, DidDelete = true, @@ -185,11 +200,14 @@ private void Configure(LanguageClientOptions options) private void Configure(LanguageServerOptions options) { var filters = Container.From( - new FileOperationFilter() { - Scheme = "file", Pattern = new FileOperationPattern() { + new FileOperationFilter + { + Scheme = "file", Pattern = new FileOperationPattern + { Glob = "**/*.cs", Matches = FileOperationPatternKind.File, - Options = new FileOperationPatternOptions() { + Options = new FileOperationPatternOptions + { IgnoreCase = true } } diff --git a/test/Lsp.Integration.Tests/Fixtures/DefaultClient.cs b/test/Lsp.Integration.Tests/Fixtures/DefaultClient.cs index 0fdc6afb3..bea286c1b 100644 --- a/test/Lsp.Integration.Tests/Fixtures/DefaultClient.cs +++ b/test/Lsp.Integration.Tests/Fixtures/DefaultClient.cs @@ -1,10 +1,8 @@ ο»Ώusing System; -using System.ComponentModel; -using Newtonsoft.Json; using OmniSharp.Extensions.LanguageServer.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public sealed class DefaultClient : IConfigureLanguageClientOptions { diff --git a/test/Lsp.Integration.Tests/Fixtures/DefaultOptions.cs b/test/Lsp.Integration.Tests/Fixtures/DefaultOptions.cs index 2cf45a9d4..6819556b8 100644 --- a/test/Lsp.Integration.Tests/Fixtures/DefaultOptions.cs +++ b/test/Lsp.Integration.Tests/Fixtures/DefaultOptions.cs @@ -1,9 +1,12 @@ ο»Ώusing OmniSharp.Extensions.JsonRpc.Testing; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public sealed class DefaultOptions : IConfigureLanguageProtocolFixture { - public JsonRpcTestOptions Configure(JsonRpcTestOptions options) => options; + public JsonRpcTestOptions Configure(JsonRpcTestOptions options) + { + return options; + } } -} \ No newline at end of file +} diff --git a/test/Lsp.Integration.Tests/Fixtures/DefaultServer.cs b/test/Lsp.Integration.Tests/Fixtures/DefaultServer.cs index c8f37e8d4..9879d8f50 100644 --- a/test/Lsp.Integration.Tests/Fixtures/DefaultServer.cs +++ b/test/Lsp.Integration.Tests/Fixtures/DefaultServer.cs @@ -1,6 +1,6 @@ ο»Ώusing OmniSharp.Extensions.LanguageServer.Server; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public sealed class DefaultServer : IConfigureLanguageServerOptions { diff --git a/test/Lsp.Integration.Tests/Fixtures/ExampleExtensions.cs b/test/Lsp.Integration.Tests/Fixtures/ExampleExtensions.cs index 11ec8a37a..3215b72b3 100644 --- a/test/Lsp.Integration.Tests/Fixtures/ExampleExtensions.cs +++ b/test/Lsp.Integration.Tests/Fixtures/ExampleExtensions.cs @@ -1,4 +1,3 @@ -using MediatR; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol; @@ -9,24 +8,26 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams { } + [Parallel] + [Method("tests/discover", Direction.ClientToServer)] + [GenerateHandler] + [GenerateHandlerMethods(typeof(ILanguageServerRegistry))] + [GenerateRequestMethods(typeof(ILanguageClient))] + [RegistrationOptions(typeof(UnitTestRegistrationOptions))] + [Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + } - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler(Name = "RunUnitTest"), - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + [Parallel] + [Method("tests/run", Direction.ClientToServer)] + [GenerateHandler(Name = "RunUnitTest")] + [GenerateHandlerMethods(typeof(ILanguageServerRegistry))] + [GenerateRequestMethods(typeof(ILanguageClient))] + [RegistrationOptions(typeof(UnitTestRegistrationOptions))] + [Capability(typeof(UnitTestCapability))] public partial class UnitTest : IJsonRpcRequest, IDoesNotParticipateInRegistration { public string Name { get; set; } = null!; diff --git a/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageClientOptions.cs b/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageClientOptions.cs index 59b2e8b35..e745faadd 100644 --- a/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageClientOptions.cs +++ b/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageClientOptions.cs @@ -1,6 +1,6 @@ ο»Ώusing OmniSharp.Extensions.LanguageServer.Client; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public interface IConfigureLanguageClientOptions { diff --git a/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageProtocolFixture.cs b/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageProtocolFixture.cs index d3ffe1b54..8d4be6e0e 100644 --- a/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageProtocolFixture.cs +++ b/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageProtocolFixture.cs @@ -1,9 +1,9 @@ ο»Ώusing OmniSharp.Extensions.JsonRpc.Testing; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public interface IConfigureLanguageProtocolFixture { JsonRpcTestOptions Configure(JsonRpcTestOptions options); } -} \ No newline at end of file +} diff --git a/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageServerOptions.cs b/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageServerOptions.cs index cdacaecca..4314b7436 100644 --- a/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageServerOptions.cs +++ b/test/Lsp.Integration.Tests/Fixtures/IConfigureLanguageServerOptions.cs @@ -1,9 +1,9 @@ ο»Ώusing OmniSharp.Extensions.LanguageServer.Server; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public interface IConfigureLanguageServerOptions { void Configure(LanguageServerOptions options); } -} \ No newline at end of file +} diff --git a/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixture.cs b/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixture.cs index fd9543ab0..b5c96eff7 100644 --- a/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixture.cs +++ b/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixture.cs @@ -7,7 +7,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public class LanguageProtocolFixture : LanguageProtocolTestBase, IAsyncLifetime where TConfigureFixture : IConfigureLanguageProtocolFixture, new() @@ -47,6 +47,9 @@ public async Task InitializeAsync() Server = server; } - public Task DisposeAsync() => Task.CompletedTask; + public Task DisposeAsync() + { + return Task.CompletedTask; + } } } diff --git a/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixtureTest.cs b/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixtureTest.cs index a7b12cad3..bbd7dc5a6 100644 --- a/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixtureTest.cs +++ b/test/Lsp.Integration.Tests/Fixtures/LanguageProtocolFixtureTest.cs @@ -8,7 +8,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration.Fixtures +namespace Lsp.Integration.Tests.Fixtures { public abstract class LanguageProtocolFixtureTest : IClassFixture> @@ -18,7 +18,9 @@ public abstract class LanguageProtocolFixtureTest Fixture { get; } - protected LanguageProtocolFixtureTest(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) + protected LanguageProtocolFixtureTest( + ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture + ) { Fixture = fixture; Client = fixture.Client; @@ -38,7 +40,15 @@ protected LanguageProtocolFixtureTest(ITestOutputHelper testOutputHelper, Langua protected ISettler ClientEvents { get; } protected ISettler ServerEvents { get; } protected ISettler Events { get; } - protected Task SettleNext() => Events.SettleNext(); - protected IObservable Settle() => Events.Settle(); + + protected Task SettleNext() + { + return Events.SettleNext(); + } + + protected IObservable Settle() + { + return Events.Settle(); + } } -} \ No newline at end of file +} diff --git a/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs b/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs index 6c12fb871..bba67f668 100644 --- a/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs +++ b/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs @@ -1,50 +1,48 @@ -using System; using FluentAssertions.Equivalency; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using Microsoft.Extensions.Options; using NSubstitute; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -namespace Lsp.Tests +namespace Lsp.Integration.Tests { public static class FluentAssertionsExtensions { - public static EquivalencyAssertionOptions ConfigureForSupports(this EquivalencyAssertionOptions options, ILogger? logger = null) => - options - .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>(); + public static EquivalencyAssertionOptions ConfigureForSupports(this EquivalencyAssertionOptions options, ILogger? logger = null) + { + return options + .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>(); + } } } diff --git a/test/Lsp.Integration.Tests/HandlersManagerIntegrationTests.cs b/test/Lsp.Integration.Tests/HandlersManagerIntegrationTests.cs index f5050a773..081acb611 100644 --- a/test/Lsp.Integration.Tests/HandlersManagerIntegrationTests.cs +++ b/test/Lsp.Integration.Tests/HandlersManagerIntegrationTests.cs @@ -8,11 +8,10 @@ using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class HandlersManagerIntegrationTests : LanguageProtocolTestBase { @@ -23,7 +22,7 @@ public HandlersManagerIntegrationTests(ITestOutputHelper testOutputHelper) : bas [Fact] public async Task Should_Return_Default_Handlers() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); var handlersManager = server.GetRequiredService(); handlersManager.Descriptors.Should().HaveCount(9); @@ -33,9 +32,13 @@ public async Task Should_Return_Default_Handlers() [Fact] public async Task Should_Return_Additional_Handlers() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); - server.Register(o => o.AddHandler((IJsonRpcHandler) Substitute.For(new[] { typeof (ICompletionHandler), typeof(ICompletionResolveHandler) }, Array.Empty()))); + server.Register( + o => o.AddHandler( + (IJsonRpcHandler)Substitute.For(new[] { typeof(ICompletionHandler), typeof(ICompletionResolveHandler) }, Array.Empty()) + ) + ); var handlersManager = server.GetRequiredService(); handlersManager.Descriptors.Should().HaveCount(11); handlersManager.GetHandlers().Should().HaveCount(7); @@ -44,24 +47,29 @@ public async Task Should_Return_Additional_Handlers() [Fact] public async Task Link_Should_Fail_If_No_Handler_Is_Defined() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); var handlersManager = server.GetRequiredService(); - Action a = () => handlersManager.AddLink(TextDocumentNames.Completion, "my/completion"); + Action a = () => handlersManager.AddLink(TextDocumentNames.Completion, "my/completion"); a.Should().Throw().Which.Message.Should().Contain("Descriptors must be registered before links can be created"); } [Fact] public async Task Link_Should_Fail_If_Link_Is_On_The_Wrong_Side() { - var (_, server) = await Initialize(options => {}, options => {}); + var (_, server) = await Initialize(options => { }, options => { }); - server.Register(o => o.AddHandler((IJsonRpcHandler) Substitute.For(new[] { typeof (ICompletionHandler), typeof(ICompletionResolveHandler) }, Array.Empty()))); + server.Register( + o => o.AddHandler( + (IJsonRpcHandler)Substitute.For(new[] { typeof(ICompletionHandler), typeof(ICompletionResolveHandler) }, Array.Empty()) + ) + ); var handlersManager = server.GetRequiredService(); - Action a = () => handlersManager.AddLink("my/completion", TextDocumentNames.Completion); - a.Should().Throw().Which.Message.Should().Contain($"Did you mean to link '{TextDocumentNames.Completion}' to 'my/completion' instead"); + Action a = () => handlersManager.AddLink("my/completion", TextDocumentNames.Completion); + a.Should().Throw().Which.Message.Should() + .Contain($"Did you mean to link '{TextDocumentNames.Completion}' to 'my/completion' instead"); } } } diff --git a/test/Lsp.Integration.Tests/InitializationTests.cs b/test/Lsp.Integration.Tests/InitializationTests.cs index 6c783cf6c..3afead878 100644 --- a/test/Lsp.Integration.Tests/InitializationTests.cs +++ b/test/Lsp.Integration.Tests/InitializationTests.cs @@ -1,15 +1,12 @@ ο»Ώusing System; using System.Collections.Generic; -using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading; using System.Threading.Tasks; using FluentAssertions; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; using NSubstitute; -using NSubstitute.ReceivedExtensions; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; @@ -21,11 +18,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Window; using OmniSharp.Extensions.LanguageServer.Server; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class InitializationTests : LanguageProtocolTestBase { @@ -57,29 +53,33 @@ public async Task Facades_should_be_resolvable() [Fact] public async Task Should_Not_Be_Able_To_Send_Messages_Unit_Initialization() { - if (!(TestOptions.ClientLoggerFactory is TestLoggerFactory loggerFactory)) throw new Exception("wtf"); + if (!( TestOptions.ClientLoggerFactory is TestLoggerFactory loggerFactory )) throw new Exception("wtf"); var logs = new List(); var onInitializeNotify = Substitute.For(); var onInitializedNotify = Substitute.For(); using var _ = loggerFactory.Where(z => z.Level == LogEventLevel.Warning).Subscribe(z => logs.Add(z)); var (client, server) = await Initialize( - options => { + options => + { ConfigureClient(options); options .OnNotification("OnInitializeNotify", onInitializeNotify) .OnNotification("OnInitializedNotify", onInitializedNotify); - }, options => { + }, options => + { ConfigureServer(options); options .OnInitialize( - (languageServer, request, token) => { + (languageServer, request, token) => + { languageServer.SendNotification("OnInitializeNotify"); return Task.CompletedTask; } ) .OnInitialized( - (languageServer, request, response, token) => { + (languageServer, request, response, token) => + { languageServer.SendNotification("OnInitializedNotify"); return Task.CompletedTask; } @@ -119,35 +119,51 @@ await Observable.FromAsync(client.Initialize) response.Should().NotBeNull(); } - class CodeLensHandlerA : CodeLensHandlerBase + private class CodeLensHandlerA : CodeLensHandlerBase { public CodeLensHandlerA(ILanguageServerFacade languageServerFacade) { languageServerFacade.Should().NotBeNull(); } - public override Task Handle(CodeLensParams request, CancellationToken cancellationToken) => Task.FromResult(new CodeLensContainer()); + public override Task Handle(CodeLensParams request, CancellationToken cancellationToken) + { + return Task.FromResult(new CodeLensContainer()); + } + + public override Task Handle(CodeLens request, CancellationToken cancellationToken) + { + return Task.FromResult(request); + } - public override Task Handle(CodeLens request, CancellationToken cancellationToken) => Task.FromResult(request); - protected internal override CodeLensRegistrationOptions CreateRegistrationOptions(CodeLensCapability capability, ClientCapabilities clientCapabilities) => new (); + protected internal override CodeLensRegistrationOptions CreateRegistrationOptions( + CodeLensCapability capability, ClientCapabilities clientCapabilities + ) + { + return new(); + } } private readonly List _logs = new List(); - private void ConfigureClient(LanguageClientOptions options) => + private void ConfigureClient(LanguageClientOptions options) + { options.OnLogMessage(log => { _logs.Add(log.Message); }); + } private void ConfigureServer(LanguageServerOptions options) { options.OnInitialize( - (server, request, token) => { + (server, request, token) => + { server.Window.LogInfo("OnInitialize"); return Task.CompletedTask; } ); options.AddHandler(); options.OnInitialized( - (server, request, response, token) => { + (server, request, response, token) => + { server.Window.LogInfo("OnInitialized"); return Task.CompletedTask; } diff --git a/test/Lsp.Integration.Tests/IntegrationTestingExtensions.cs b/test/Lsp.Integration.Tests/IntegrationTestingExtensions.cs index 58c8d600f..13febf0d5 100644 --- a/test/Lsp.Integration.Tests/IntegrationTestingExtensions.cs +++ b/test/Lsp.Integration.Tests/IntegrationTestingExtensions.cs @@ -1,4 +1,4 @@ -ο»Ώnamespace Lsp.Tests.Integration +ο»Ώnamespace Lsp.Integration.Tests { public static class IntegrationTestingExtensions { diff --git a/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs b/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs index b40359ede..134c4fc87 100644 --- a/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs +++ b/test/Lsp.Integration.Tests/LanguageServerConfigurationTests.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Options; using Newtonsoft.Json.Linq; using NSubstitute; -using NSubstitute.Extensions; using NSubstitute.ReceivedExtensions; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; @@ -24,11 +23,13 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class LanguageServerConfigurationTests : LanguageProtocolTestBase { - public LanguageServerConfigurationTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) + public LanguageServerConfigurationTests(ITestOutputHelper outputHelper) : base( + new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose) + ) { } @@ -50,13 +51,15 @@ public async Task Should_Not_Support_Configuration_It_Not_Configured() public async Task Should_Allow_Null_Response() { var (client, server) = await Initialize( - options => { + options => + { options.WithCapability(new DidChangeConfigurationCapability()); options.OnConfiguration(@params => Task.FromResult(new Container(@params.Items.Select(z => (JToken?)null)))); ConfigureClient(options); - }, ConfigureServer); + }, ConfigureServer + ); - Func a = () => server.Configuration.GetConfiguration(new ConfigurationItem() { Section = "mysection" }); + Func a = () => server.Configuration.GetConfiguration(new ConfigurationItem { Section = "mysection" }); await a.Should().NotThrowAsync(); } @@ -78,7 +81,7 @@ public async Task Should_Update_Configuration_On_Server() [Fact] public async Task Should_Update_Configuration_On_Server_After_Starting() { - var (_, server, configuration) = await InitializeWithConfiguration(ConfigureClient, options => {}); + var (_, server, configuration) = await InitializeWithConfiguration(ConfigureClient, options => { }); server.Configuration.AsEnumerable().Should().BeEmpty(); server.Configuration.AddSection("mysection", "othersection"); @@ -212,10 +215,13 @@ public async Task Should_Support_Configuration_Binding() [Fact] public async Task Should_Support_Options() { - var (_, server, configuration) = await InitializeWithConfiguration(ConfigureClient, options => { - ConfigureServer(options); - options.Services.Configure("mysection"); - }); + var (_, server, configuration) = await InitializeWithConfiguration( + ConfigureClient, options => + { + ConfigureServer(options); + options.Services.Configure("mysection"); + } + ); configuration.Update("mysection", new Dictionary { ["host"] = "localhost", ["port"] = "443" }); configuration.Update("notmysection", new Dictionary { ["host"] = "127.0.0.1", ["port"] = "123" }); @@ -237,10 +243,13 @@ public async Task Should_Support_Options() [Fact] public async Task Should_Support_Options_Monitor() { - var (_, server, configuration) = await InitializeWithConfiguration(ConfigureClient, options => { - ConfigureServer(options); - options.Services.Configure("mysection"); - }); + var (_, server, configuration) = await InitializeWithConfiguration( + ConfigureClient, options => + { + ConfigureServer(options); + options.Services.Configure("mysection"); + } + ); var options = server.GetService>(); var sub = Substitute.For>(); @@ -265,7 +274,7 @@ public async Task Should_Support_Options_Monitor() sub.Received(Quantity.Within(2, int.MaxValue)).Invoke(Arg.Any()); } - class BinderSourceUrl + private class BinderSourceUrl { public string Host { get; set; } public int Port { get; set; } @@ -275,6 +284,9 @@ private void ConfigureClient(LanguageClientOptions options) { } - private void ConfigureServer(LanguageServerOptions options) => options.WithConfigurationSection("mysection").WithConfigurationSection("othersection"); + private void ConfigureServer(LanguageServerOptions options) + { + options.WithConfigurationSection("mysection").WithConfigurationSection("othersection"); + } } } diff --git a/test/Lsp.Integration.Tests/LanguageServerLoggingTests.cs b/test/Lsp.Integration.Tests/LanguageServerLoggingTests.cs index 273dcffef..bcef7bce2 100644 --- a/test/Lsp.Integration.Tests/LanguageServerLoggingTests.cs +++ b/test/Lsp.Integration.Tests/LanguageServerLoggingTests.cs @@ -1,12 +1,10 @@ ο»Ώusing System; using System.Collections.Concurrent; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using FluentAssertions; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Protocol.Models; @@ -17,7 +15,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class LanguageServerLoggingTests : LanguageProtocolTestBase { @@ -31,7 +29,8 @@ public async Task Logs_Are_Sent_To_Client_From_Server() var logs = new ConcurrentBag(); var (client, server) = await Initialize( options => { options.Trace = InitializeTrace.Verbose; }, - options => { + options => + { options.ConfigureLogging( z => z .AddLanguageProtocolLogging() @@ -70,7 +69,8 @@ public async Task Logs_Are_Sent_To_Client_From_Server_Respecting_SetMinimumLevel var logs = new ConcurrentBag(); var (client, server) = await Initialize( options => { }, - options => { + options => + { options.ConfigureLogging( z => z .AddLanguageProtocolLogging() @@ -109,7 +109,8 @@ public async Task Logs_Are_Sent_To_Client_From_Server_Respecting_TraceLevel() var logs = new ConcurrentBag(); var (client, server) = await Initialize( options => { options.Trace = InitializeTrace.Messages; }, - options => { + options => + { options.ConfigureLogging( z => z .AddLanguageProtocolLogging() @@ -148,7 +149,8 @@ public async Task Client_Can_Dynamically_Change_Server_Trace_Level_Off_To_Verbos var logs = new ConcurrentBag(); var (client, server) = await Initialize( options => { }, - options => { + options => + { options.ConfigureLogging( z => z .AddLanguageProtocolLogging() @@ -214,10 +216,9 @@ public async Task Client_Can_Dynamically_Change_Server_Trace_Level_Verbose_To_Of { var logs = new ConcurrentBag(); var (client, server) = await Initialize( - options => { - options.Trace = InitializeTrace.Verbose; - }, - options => { + options => { options.Trace = InitializeTrace.Verbose; }, + options => + { options.ConfigureLogging( z => z .AddLanguageProtocolLogging() diff --git a/test/Lsp.Integration.Tests/LogMessageTests.cs b/test/Lsp.Integration.Tests/LogMessageTests.cs index 6a4869a85..a19bb457c 100644 --- a/test/Lsp.Integration.Tests/LogMessageTests.cs +++ b/test/Lsp.Integration.Tests/LogMessageTests.cs @@ -13,7 +13,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class LogMessageTests : LanguageProtocolTestBase { @@ -33,12 +33,14 @@ public async Task Should_Log_Messages_Through_Window_Extension_Methods() server.Window.LogWarning("Uh-oh..."); server.Window.Log("Just gotta let you know!"); server.Window.Log( - new LogMessageParams { + new LogMessageParams + { Type = MessageType.Log, Message = "1234" } ); server.Window.LogMessage( - new LogMessageParams { + new LogMessageParams + { Type = MessageType.Log, Message = "1234" } ); @@ -62,12 +64,14 @@ public async Task Should_Log_Messages_Through_Server_Extension_Methods() server.LogWarning("Uh-oh..."); server.Log("Just gotta let you know!"); server.Log( - new LogMessageParams { + new LogMessageParams + { Type = MessageType.Log, Message = "1234" } ); server.LogMessage( - new LogMessageParams { + new LogMessageParams + { Type = MessageType.Log, Message = "1234" } ); @@ -81,7 +85,10 @@ public async Task Should_Log_Messages_Through_Server_Extension_Methods() _receivedMessages.Should().Contain(z => z.Type == MessageType.Log).And.Subject.Count(z => z.Type == MessageType.Log).Should().Be(3); } - private void ConfigureClient(LanguageClientOptions options) => options.OnLogMessage(request => { _receivedMessages.Add(request); }); + private void ConfigureClient(LanguageClientOptions options) + { + options.OnLogMessage(request => { _receivedMessages.Add(request); }); + } private void ConfigureServer(LanguageServerOptions options) { diff --git a/test/Lsp.Integration.Tests/MonikerTests.cs b/test/Lsp.Integration.Tests/MonikerTests.cs index 6b5c37aaf..cfaee34c7 100644 --- a/test/Lsp.Integration.Tests/MonikerTests.cs +++ b/test/Lsp.Integration.Tests/MonikerTests.cs @@ -9,18 +9,17 @@ using OmniSharp.Extensions.LanguageServer.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Server; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class MonikerTests : LanguageProtocolTestBase { private readonly Func?>> _request; + public MonikerTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) { _request = Substitute.For?>>>(); @@ -30,16 +29,17 @@ public MonikerTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOption public async Task Should_Get_Monikers() { _request.Invoke(Arg.Any(), Arg.Any()) - .Returns(new Container( - new[] { - new Moniker() { - Identifier = "abcd", - Kind = MonikerKind.Export, - Scheme = "http", - Unique = UniquenessLevel.Document - }, - } - )); + .Returns( + new Container( + new Moniker + { + Identifier = "abcd", + Kind = MonikerKind.Export, + Scheme = "http", + Unique = UniquenessLevel.Document + } + ) + ); var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); @@ -53,7 +53,8 @@ public async Task Should_Get_Monikers() private void ServerOptionsAction(LanguageServerOptions obj) { obj.OnMoniker( - _request, (_, _) => new MonikerRegistrationOptions() { + _request, (_, _) => new MonikerRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("csharp"), } ); diff --git a/test/Lsp.Integration.Tests/OverrideHandlerTests.cs b/test/Lsp.Integration.Tests/OverrideHandlerTests.cs index e0e961e2a..435f2cf3b 100644 --- a/test/Lsp.Integration.Tests/OverrideHandlerTests.cs +++ b/test/Lsp.Integration.Tests/OverrideHandlerTests.cs @@ -12,11 +12,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class OverrideHandlerTests : LanguageProtocolTestBase { @@ -28,15 +27,12 @@ public OverrideHandlerTests(ITestOutputHelper testOutputHelper) : base(new JsonR public async Task Should_Support_Custom_Execute_Command_Handlers() { var (client, _) = await Initialize( - options => { - - }, options => { - options.AddHandler(); - } + options => { }, options => { options.AddHandler(); } ); var response = await client.SendRequest( - new CustomExecuteCommandParams() { + new CustomExecuteCommandParams + { Command = "mycommand", }, CancellationToken ); @@ -48,23 +44,24 @@ public async Task Should_Support_Custom_Execute_Command_Handlers() public async Task Should_Support_Mixed_Execute_Command_Handlers() { var (client, _) = await Initialize( - options => { - - }, options => { + options => { }, options => + { options.AddHandler(); options.OnExecuteCommand("myothercommand", (a, ct) => Unit.Task); } ); var normalResponse = await client.SendRequest( - new ExecuteCommandParams() { + new ExecuteCommandParams + { Command = "myothercommand", Arguments = new JArray(new JObject()) }, CancellationToken ); var customResponse = await client.SendRequest( - new CustomExecuteCommandParams() { + new CustomExecuteCommandParams + { Command = "mycommand", }, CancellationToken ); @@ -75,11 +72,14 @@ public async Task Should_Support_Mixed_Execute_Command_Handlers() } [Method(WorkspaceNames.ExecuteCommand)] - public class CustomExecuteCommandHandler : IJsonRpcRequestHandler, IRegistration + public class CustomExecuteCommandHandler : IJsonRpcRequestHandler, + IRegistration { // ReSharper disable once NotAccessedField.Local private ExecuteCommandCapability? _capability; - private readonly ExecuteCommandRegistrationOptions _executeCommandRegistrationOptions = new ExecuteCommandRegistrationOptions() { + + private readonly ExecuteCommandRegistrationOptions _executeCommandRegistrationOptions = new ExecuteCommandRegistrationOptions + { WorkDoneProgress = true, Commands = new Container("mycommand") }; diff --git a/test/Lsp.Integration.Tests/PartialItemTests.cs b/test/Lsp.Integration.Tests/PartialItemTests.cs index bbf7c21d8..dfd280b3e 100644 --- a/test/Lsp.Integration.Tests/PartialItemTests.cs +++ b/test/Lsp.Integration.Tests/PartialItemTests.cs @@ -5,22 +5,22 @@ using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; +using Lsp.Integration.Tests.Fixtures; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Server; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public static class PartialItemTests { public class Delegates : LanguageProtocolFixtureTest { - public Delegates(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base(testOutputHelper, fixture) + public Delegates(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base( + testOutputHelper, fixture + ) { } @@ -28,7 +28,7 @@ public Delegates(ITestOutputHelper testOutputHelper, LanguageProtocolFixture(), (acc, v) => { + new List(), (acc, v) => + { acc.Add(v); return acc; } @@ -56,7 +57,9 @@ public async Task Should_Behave_Like_An_Observable() [Fact] public async Task Should_Behave_Like_An_Observable_Without_Progress_Support() { - var response = await Client.SendRequest(new SemanticTokensParams { TextDocument = new TextDocumentIdentifier(@"c:\test.cs") }, CancellationToken); + var response = await Client.SendRequest( + new SemanticTokensParams { TextDocument = new TextDocumentIdentifier(@"c:\test.cs") }, CancellationToken + ); response.Should().NotBeNull(); response!.Data.Should().HaveCount(3); @@ -64,14 +67,18 @@ public async Task Should_Behave_Like_An_Observable_Without_Progress_Support() public class DelegateServer : IConfigureLanguageServerOptions { - public void Configure(LanguageServerOptions options) => options.ObserveSemanticTokensFull( - (@params, observer, arg3) => { - observer.OnNext(new SemanticTokensPartialResult() { Data = new[] { 0 }.ToImmutableArray() }); - observer.OnNext(new SemanticTokensPartialResult() { Data = new[] { 0, 1 }.ToImmutableArray() }); - observer.OnNext(new SemanticTokensPartialResult() { Data = new[] { 0, 1, 2 }.ToImmutableArray() }); - observer.OnCompleted(); - }, (_, _) => new SemanticTokensRegistrationOptions() - ); + public void Configure(LanguageServerOptions options) + { + options.ObserveSemanticTokensFull( + (@params, observer, arg3) => + { + observer.OnNext(new SemanticTokensPartialResult { Data = new[] { 0 }.ToImmutableArray() }); + observer.OnNext(new SemanticTokensPartialResult { Data = new[] { 0, 1 }.ToImmutableArray() }); + observer.OnNext(new SemanticTokensPartialResult { Data = new[] { 0, 1, 2 }.ToImmutableArray() }); + observer.OnCompleted(); + }, (_, _) => new SemanticTokensRegistrationOptions() + ); + } } } } diff --git a/test/Lsp.Integration.Tests/PartialItemsTests.cs b/test/Lsp.Integration.Tests/PartialItemsTests.cs index d3243a697..823ab721d 100644 --- a/test/Lsp.Integration.Tests/PartialItemsTests.cs +++ b/test/Lsp.Integration.Tests/PartialItemsTests.cs @@ -7,7 +7,8 @@ using System.Threading; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; +using Lsp.Integration.Tests.Fixtures; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Client.WorkDone; using OmniSharp.Extensions.LanguageServer.Protocol.Document; @@ -19,13 +20,15 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public static class PartialItemsTests { public class Delegates : LanguageProtocolFixtureTest { - public Delegates(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base(testOutputHelper, fixture) + public Delegates(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base( + testOutputHelper, fixture + ) { } @@ -33,7 +36,8 @@ public Delegates(ITestOutputHelper testOutputHelper, LanguageProtocolFixture(), (acc, v) => { + new List(), (acc, v) => + { acc.AddRange(v); return acc; } @@ -67,7 +73,8 @@ public async Task Should_Behave_Like_An_Observable() public async Task Should_Behave_Like_An_Observable_Without_Progress_Support() { var response = await Client.SendRequest( - new CodeLensParams { + new CodeLensParams + { TextDocument = new TextDocumentIdentifier(@"c:\test.cs") }, CancellationToken ); @@ -78,31 +85,42 @@ public async Task Should_Behave_Like_An_Observable_Without_Progress_Support() public class DelegateServer : IConfigureLanguageServerOptions { - public void Configure(LanguageServerOptions options) => + public void Configure(LanguageServerOptions options) + { options.ObserveCodeLens( - (@params, observer, capability, cancellationToken) => { + (@params, observer, capability, cancellationToken) => + { observer.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 1" } }, } ); observer.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 2" } }, } ); observer.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 3" } }, @@ -111,12 +129,15 @@ public void Configure(LanguageServerOptions options) => observer.OnCompleted(); }, (_, _) => new CodeLensRegistrationOptions() ); + } } } public class Handlers : LanguageProtocolFixtureTest { - public Handlers(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base(testOutputHelper, fixture) + public Handlers(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base( + testOutputHelper, fixture + ) { } @@ -128,9 +149,11 @@ public async Task Should_Behave_Like_An_Observable_With_WorkDone() Client.TextDocument .ObserveWorkDone( new CodeLensParams { TextDocument = new TextDocumentIdentifier(@"c:\test.cs") }, - (client, request) => CodeLensExtensions.RequestCodeLens(client, request, CancellationToken), + (client, request) => client.RequestCodeLens(request, CancellationToken), Observer.Create(z => work.Add(z)) - ).Subscribe(x => items.AddRange(x)); + ).Subscribe( + x => items.AddRange(x) + ); await work.DelayUntilCount(6, CancellationToken); @@ -147,7 +170,10 @@ public async Task Should_Behave_Like_An_Observable_With_WorkDone() public class HandlersServer : IConfigureLanguageServerOptions { - public void Configure(LanguageServerOptions options) => options.AddHandler(); + public void Configure(LanguageServerOptions options) + { + options.AddHandler(); + } } } @@ -166,75 +192,93 @@ public override async Task Handle(CodeLensParams request, Can { var partial = _progressManager.For(request, cancellationToken); var workDone = _workDoneManager.For( - request, new WorkDoneProgressBegin { + request, new WorkDoneProgressBegin + { Cancellable = true, Message = "Begin", Percentage = 0, Title = "Work is pending" - }, onComplete: () => new WorkDoneProgressEnd { + }, onComplete: () => new WorkDoneProgressEnd + { Message = "End" } ); partial.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 1" } }, } ); workDone.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 10, Message = "Report 1" } ); partial.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 2" } }, } ); workDone.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 20, Message = "Report 2" } ); partial.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 3" } }, } ); workDone.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 30, Message = "Report 3" } ); partial.OnNext( - new[] { - new CodeLens { - Command = new Command { + new[] + { + new CodeLens + { + Command = new Command + { Name = "CodeLens 4" } }, } ); workDone.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 40, Message = "Report 4" } @@ -247,8 +291,17 @@ public override async Task Handle(CodeLensParams request, Can return new CodeLensContainer(); } - public override Task Handle(CodeLens request, CancellationToken cancellationToken) => Task.FromResult(request); - protected internal override CodeLensRegistrationOptions CreateRegistrationOptions(CodeLensCapability capability, ClientCapabilities clientCapabilities) => new CodeLensRegistrationOptions(); + public override Task Handle(CodeLens request, CancellationToken cancellationToken) + { + return Task.FromResult(request); + } + + protected internal override CodeLensRegistrationOptions CreateRegistrationOptions( + CodeLensCapability capability, ClientCapabilities clientCapabilities + ) + { + return new CodeLensRegistrationOptions(); + } } } } diff --git a/test/Lsp.Integration.Tests/ProgressTests.cs b/test/Lsp.Integration.Tests/ProgressTests.cs index e61bb7e56..6c7dad46a 100644 --- a/test/Lsp.Integration.Tests/ProgressTests.cs +++ b/test/Lsp.Integration.Tests/ProgressTests.cs @@ -7,7 +7,7 @@ using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; +using Lsp.Integration.Tests.Fixtures; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; @@ -15,11 +15,13 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ProgressTests : LanguageProtocolFixtureTest { - public ProgressTests(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base(testOutputHelper, fixture) + public ProgressTests(ITestOutputHelper testOutputHelper, LanguageProtocolFixture fixture) : base( + testOutputHelper, fixture + ) { } @@ -34,32 +36,39 @@ public async Task Should_Send_Progress_From_Server_To_Client() var token = new ProgressToken(Guid.NewGuid().ToString()); using var observer = Client.ProgressManager.For(token, CancellationToken); - var workDoneObservable = Server.ProgressManager.Monitor(token, x => x.ToObject(Server.Services.GetRequiredService().JsonSerializer)); + var workDoneObservable = Server.ProgressManager.Monitor( + token, x => x.ToObject(Server.Services.GetRequiredService().JsonSerializer) + ); var observable = workDoneObservable.Replay(); using var _ = observable.Connect(); observer.OnNext( - new Data { + new Data + { Value = "1" } ); observer.OnNext( - new Data { + new Data + { Value = "3" } ); observer.OnNext( - new Data { + new Data + { Value = "2" } ); observer.OnNext( - new Data { + new Data + { Value = "4" } ); observer.OnNext( - new Data { + new Data + { Value = "5" } ); @@ -67,7 +76,8 @@ public async Task Should_Send_Progress_From_Server_To_Client() observer.OnCompleted(); await Observable.Create( - innerObserver => new CompositeDisposable() { + innerObserver => new CompositeDisposable + { observable.Take(5).Select(z => z.Value).Subscribe(v => innerObserver.OnNext(Unit.Default), innerObserver.OnCompleted), workDoneObservable } @@ -75,7 +85,7 @@ await Observable.Create( var data = await observable.Select(z => z.Value).ToArray().ToTask(CancellationToken); - data.Should().ContainInOrder(new[] { "1", "3", "2", "4", "5" }); + data.Should().ContainInOrder("1", "3", "2", "4", "5"); } [Fact] @@ -84,32 +94,39 @@ public async Task Should_Send_Progress_From_Client_To_Server() var token = new ProgressToken(Guid.NewGuid().ToString()); using var observer = Server.ProgressManager.For(token, CancellationToken); - var workDoneObservable = Client.ProgressManager.Monitor(token, x => x.ToObject(Client.Services.GetRequiredService().JsonSerializer)); + var workDoneObservable = Client.ProgressManager.Monitor( + token, x => x.ToObject(Client.Services.GetRequiredService().JsonSerializer) + ); var observable = workDoneObservable.Replay(); using var _ = observable.Connect(); observer.OnNext( - new Data { + new Data + { Value = "1" } ); observer.OnNext( - new Data { + new Data + { Value = "3" } ); observer.OnNext( - new Data { + new Data + { Value = "2" } ); observer.OnNext( - new Data { + new Data + { Value = "4" } ); observer.OnNext( - new Data { + new Data + { Value = "5" } ); @@ -117,7 +134,8 @@ public async Task Should_Send_Progress_From_Client_To_Server() observer.OnCompleted(); await Observable.Create( - innerObserver => new CompositeDisposable() { + innerObserver => new CompositeDisposable + { observable .Take(5) .Select(z => z.Value) @@ -128,7 +146,7 @@ await Observable.Create( var data = await observable.Select(z => z.Value).ToArray().ToTask(CancellationToken); - data.Should().ContainInOrder(new[] { "1", "3", "2", "4", "5" }); + data.Should().ContainInOrder("1", "3", "2", "4", "5"); } [Fact] @@ -148,39 +166,45 @@ public async Task Should_Support_Creating_Work_Done_From_Sever_To_Client() using var _ = observable.Connect(); using var workDoneObserver = await Server.WorkDoneManager.Create( - token, new WorkDoneProgressBegin { + token, new WorkDoneProgressBegin + { Cancellable = true, Message = "Begin", Percentage = 0, Title = "Work is pending" - }, onComplete: () => new WorkDoneProgressEnd { + }, onComplete: () => new WorkDoneProgressEnd + { Message = "End" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 10, Message = "Report 1" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 20, Message = "Report 2" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 30, Message = "Report 3" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 40, Message = "Report 4" } @@ -189,7 +213,8 @@ public async Task Should_Support_Creating_Work_Done_From_Sever_To_Client() workDoneObserver.OnCompleted(); var results = await observable.Select( - z => z switch { + z => z switch + { WorkDoneProgressBegin begin => begin.Message, WorkDoneProgressReport begin => begin.Message, WorkDoneProgressEnd begin => begin.Message, @@ -210,39 +235,45 @@ public async Task Should_Support_Observing_Work_Done_From_Client_To_Server_Reque using var _ = observable.Connect(); using var workDoneObserver = await Server.WorkDoneManager.Create( - token, new WorkDoneProgressBegin { + token, new WorkDoneProgressBegin + { Cancellable = true, Message = "Begin", Percentage = 0, Title = "Work is pending" - }, onComplete: () => new WorkDoneProgressEnd { + }, onComplete: () => new WorkDoneProgressEnd + { Message = "End" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 10, Message = "Report 1" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 20, Message = "Report 2" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 30, Message = "Report 3" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 40, Message = "Report 4" } @@ -251,7 +282,8 @@ public async Task Should_Support_Observing_Work_Done_From_Client_To_Server_Reque workDoneObserver.OnCompleted(); var results = await observable.Select( - z => z switch { + z => z switch + { WorkDoneProgressBegin begin => begin.Message, WorkDoneProgressReport begin => begin.Message, WorkDoneProgressEnd begin => begin.Message, @@ -272,25 +304,29 @@ public async Task Should_Support_Cancelling_Work_Done_From_Client_To_Server_Requ using var _ = workDoneObservable.Subscribe(x => data.Add(x)); using var workDoneObserver = await Server.WorkDoneManager.Create( - token, new WorkDoneProgressBegin { + token, new WorkDoneProgressBegin + { Cancellable = true, Message = "Begin", Percentage = 0, Title = "Work is pending" - }, onComplete: () => new WorkDoneProgressEnd { + }, onComplete: () => new WorkDoneProgressEnd + { Message = "End" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 10, Message = "Report 1" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 20, Message = "Report 2" } @@ -301,14 +337,16 @@ public async Task Should_Support_Cancelling_Work_Done_From_Client_To_Server_Requ workDoneObservable.Dispose(); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 30, Message = "Report 3" } ); workDoneObserver.OnNext( - new WorkDoneProgressReport { + new WorkDoneProgressReport + { Percentage = 40, Message = "Report 4" } @@ -318,7 +356,8 @@ public async Task Should_Support_Cancelling_Work_Done_From_Client_To_Server_Requ var results = data .Select( - z => z switch { + z => z switch + { WorkDoneProgressBegin begin => begin.Message, WorkDoneProgressReport begin => begin.Message, WorkDoneProgressEnd begin => begin.Message, diff --git a/test/Lsp.Integration.Tests/Properties.cs b/test/Lsp.Integration.Tests/Properties.cs index 80a070195..627fca850 100644 --- a/test/Lsp.Integration.Tests/Properties.cs +++ b/test/Lsp.Integration.Tests/Properties.cs @@ -1,3 +1,3 @@ -using System; +using Xunit; -[assembly: Xunit.CollectionBehavior(MaxParallelThreads = 10)] +[assembly: CollectionBehavior(MaxParallelThreads = 10)] diff --git a/test/Lsp.Integration.Tests/ProposalTests.cs b/test/Lsp.Integration.Tests/ProposalTests.cs index 002834c5e..d03efd0ae 100644 --- a/test/Lsp.Integration.Tests/ProposalTests.cs +++ b/test/Lsp.Integration.Tests/ProposalTests.cs @@ -1,25 +1,15 @@ -ο»Ώusing System; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; -using System.Threading.Tasks; +ο»Ώusing System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; -using Microsoft.Extensions.DependencyInjection; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ProposalTests : LanguageProtocolTestBase { @@ -31,11 +21,7 @@ public ProposalTests(ITestOutputHelper testOutputHelper) : base(new JsonRpcTestO public async Task Server_Should_Deserialize_Capabilities_As_Proposal_Types() { var (_, server) = await Initialize( - options => { - options.EnableProposals().EnableAllCapabilities(); - }, options => { - options.EnableProposals(); - } + options => { options.EnableProposals().EnableAllCapabilities(); }, options => { options.EnableProposals(); } ); server.ServerSettings.Capabilities.Should().BeOfType(); @@ -51,11 +37,7 @@ public async Task Server_Should_Deserialize_Capabilities_As_Proposal_Types() public async Task Client_Should_Deserialize_Capabilities_As_Proposal_Types() { var (client, _) = await Initialize( - options => { - options.EnableProposals().EnableAllCapabilities(); - }, options => { - options.EnableProposals(); - } + options => { options.EnableProposals().EnableAllCapabilities(); }, options => { options.EnableProposals(); } ); client.ServerSettings.Capabilities.Should().BeOfType(); diff --git a/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs b/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs index 205cca543..7cc1a14f1 100644 --- a/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs +++ b/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs @@ -18,7 +18,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class RecursiveResolutionTests : LanguageProtocolTestBase { @@ -31,7 +31,8 @@ public RecursiveResolutionTests(ITestOutputHelper testOutputHelper) : base(new J [InlineData(Side.Server)] public async Task Server_Can_Be_Injected_Into_Handler_After_Creation_Using_Registration(Side side) { - Func a = async () => { + Func a = async () => + { var (client, server) = await Initialize( options => { }, options => { } @@ -64,7 +65,8 @@ public async Task Server_Can_Be_Injected_Into_Handler_After_Creation_Using_Regis public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Registration(Side side) { Func a = () => Initialize( - options => { + options => + { if (side == Side.Client) { options @@ -72,7 +74,8 @@ public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_R .AddHandler>(); } }, - options => { + options => + { if (side == Side.Server) { options @@ -91,7 +94,8 @@ public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_R public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Description(Side side) { Func a = () => Initialize( - options => { + options => + { if (side == Side.Client) { options.Services @@ -99,7 +103,8 @@ public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_D .AddSingleton(JsonRpcHandlerDescription.Infer(typeof(ClassHandler))); } }, - options => { + options => + { if (side == Side.Server) { options.Services @@ -118,7 +123,8 @@ public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_D public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_Injection(Side side) { Func a = () => Initialize( - options => { + options => + { if (side == Side.Client) { options.Services @@ -126,7 +132,8 @@ public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_I .AddSingleton>(); } }, - options => { + options => + { if (side == Side.Server) { options.Services @@ -145,14 +152,16 @@ public async Task Server_Cannot_Be_Injected_Into_Handler_During_Creation_Using_I public async Task Server_Facade_Can_Be_Injected_Into_Handler_During_Creation_Using_Registration(Side side) { Func a = () => Initialize( - options => { + options => + { if (side == Side.Client) { options .AddHandler>(); } }, - options => { + options => + { if (side == Side.Server) { options @@ -169,14 +178,16 @@ public async Task Server_Facade_Can_Be_Injected_Into_Handler_During_Creation_Usi public async Task Server_Facade_Can_Be_Injected_Into_Handler_During_Creation_Using_Description(Side side) { Func a = () => Initialize( - options => { + options => + { if (side == Side.Client) { options.Services .AddSingleton(JsonRpcHandlerDescription.Infer(typeof(InterfaceHandler))); } }, - options => { + options => + { if (side == Side.Server) { options.Services @@ -193,14 +204,16 @@ public async Task Server_Facade_Can_Be_Injected_Into_Handler_During_Creation_Usi public async Task Server_Facade_Can_Injected_Into_Handler_During_Creation_Using_Injection(Side side) { Func a = () => Initialize( - options => { + options => + { if (side == Side.Client) { options.Services .AddSingleton>(); } }, - options => { + options => + { if (side == Side.Server) { options.Services @@ -217,13 +230,15 @@ public async Task Server_Facade_Can_Injected_Into_Handler_During_Creation_Using_ public async Task Should_Allow_Nested_Registration_During_Creation_Using_Registration(Side side) { var (client, server) = await Initialize( - options => { + options => + { if (side == Side.Client) { options.AddHandler(); } }, - options => { + options => + { if (side == Side.Server) { options.AddHandler(); @@ -254,13 +269,15 @@ public async Task Should_Allow_Nested_Registration_During_Creation_Using_Registr public async Task Should_Allow_Nested_Registration_During_Creation_Using_Description(Side side) { var (client, server) = await Initialize( - options => { + options => + { if (side == Side.Client) { options.Services.AddSingleton(JsonRpcHandlerDescription.Infer(typeof(NestedClientHandler))); } }, - options => { + options => + { if (side == Side.Server) { options.Services.AddSingleton(JsonRpcHandlerDescription.Infer(typeof(NestedServerHandler))); @@ -291,13 +308,15 @@ public async Task Should_Allow_Nested_Registration_During_Creation_Using_Descrip public async Task Should_Allow_Nested_Registration_During_Creation_Using_Injection(Side side) { var (client, server) = await Initialize( - options => { + options => + { if (side == Side.Client) { options.Services.AddSingleton(); } }, - options => { + options => + { if (side == Side.Server) { options.Services.AddSingleton(); @@ -334,7 +353,7 @@ public class ClassRequest : IRequest } [Method(nameof(ClassRequest))] - class ClassHandler : IJsonRpcRequestHandler where T : class + private class ClassHandler : IJsonRpcRequestHandler where T : class { // ReSharper disable once NotAccessedField.Local private readonly T _jsonRpcServer; @@ -344,7 +363,10 @@ public ClassHandler(T jsonRpcServer) _jsonRpcServer = jsonRpcServer; } - public Task Handle(ClassRequest classRequest, CancellationToken cancellationToken) => throw new NotImplementedException(); + public Task Handle(ClassRequest classRequest, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } [Method(nameof(InterfaceRequest))] @@ -353,7 +375,7 @@ public class InterfaceRequest : IRequest } [Method(nameof(InterfaceRequest))] - class InterfaceHandler : IJsonRpcRequestHandler + private class InterfaceHandler : IJsonRpcRequestHandler { // ReSharper disable once NotAccessedField.Local private readonly T _jsonRpcServer; @@ -363,7 +385,10 @@ public InterfaceHandler(T jsonRpcServer) _jsonRpcServer = jsonRpcServer; } - public Task Handle(InterfaceRequest request, CancellationToken cancellationToken) => throw new NotImplementedException(); + public Task Handle(InterfaceRequest request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } [Method(nameof(NestedRequest))] @@ -372,7 +397,7 @@ public class NestedRequest : IRequest } [Method(nameof(NestedRequest))] - class NestedClientHandler : IJsonRpcRequestHandler + private class NestedClientHandler : IJsonRpcRequestHandler { // ReSharper disable once NotAccessedField.Local private readonly ILanguageClientFacade _languageClientFacade; @@ -383,11 +408,14 @@ public NestedClientHandler(ILanguageClientFacade languageClientFacade) languageClientFacade.Register(r => r.AddHandler>()); } - public Task Handle(NestedRequest request, CancellationToken cancellationToken) => throw new NotImplementedException(); + public Task Handle(NestedRequest request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } [Method(nameof(NestedRequest))] - class NestedServerHandler : IJsonRpcRequestHandler + private class NestedServerHandler : IJsonRpcRequestHandler { // ReSharper disable once NotAccessedField.Local private readonly ILanguageServerFacade _languageClientFacade; @@ -398,7 +426,10 @@ public NestedServerHandler(ILanguageServerFacade languageClientFacade) languageClientFacade.Register(z => z.AddHandler>()); } - public Task Handle(NestedRequest request, CancellationToken cancellationToken) => throw new NotImplementedException(); + public Task Handle(NestedRequest request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } } } diff --git a/test/Lsp.Integration.Tests/RenameTests.cs b/test/Lsp.Integration.Tests/RenameTests.cs index 1ea72c999..cffef9bc7 100644 --- a/test/Lsp.Integration.Tests/RenameTests.cs +++ b/test/Lsp.Integration.Tests/RenameTests.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using FluentAssertions; using NSubstitute; -using NSubstitute.Callbacks; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; @@ -19,7 +18,7 @@ using Xunit.Abstractions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class RenameTests : LanguageProtocolTestBase { @@ -37,7 +36,8 @@ public async Task Should_Handle_Rename_With_No_Value() { _prepareRename.Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns( - call => { + call => + { var pos = call.Arg().Position; return new RangeOrPlaceholderRange( new Range( @@ -50,17 +50,24 @@ public async Task Should_Handle_Rename_With_No_Value() _rename.Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns( - new WorkspaceEdit() { - DocumentChanges = new Container(new WorkspaceEditDocumentChange(new CreateFile() { - Uri = DocumentUri.FromFileSystemPath("/abcd/create.cs") - })) + new WorkspaceEdit + { + DocumentChanges = new Container( + new WorkspaceEditDocumentChange( + new CreateFile + { + Uri = DocumentUri.FromFileSystemPath("/abcd/create.cs") + } + ) + ) } ); var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); var result = await client.PrepareRename( - new PrepareRenameParams() { + new PrepareRenameParams + { Position = ( 1, 1 ), TextDocument = DocumentUri.FromFileSystemPath("/abcd/file.cs") }, @@ -70,7 +77,8 @@ public async Task Should_Handle_Rename_With_No_Value() result.Should().NotBeNull(); var renameResponse = await client.RequestRename( - new RenameParams() { + new RenameParams + { Position = result!.Range!.Start, NewName = "newname", TextDocument = DocumentUri.FromFileSystemPath("/abcd/file.cs") @@ -96,7 +104,8 @@ public async Task Should_Handle_Prepare_Rename_With_No_Value() var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); var result = await client.PrepareRename( - new PrepareRenameParams() { + new PrepareRenameParams + { Position = ( 1, 1 ), TextDocument = DocumentUri.FromFileSystemPath("/abcd/file.cs") }, @@ -111,7 +120,8 @@ public async Task Should_Handle_Prepare_Rename_With_Range() { _prepareRename.Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns( - call => { + call => + { var pos = call.Arg().Position; return new RangeOrPlaceholderRange( new Range( @@ -125,7 +135,8 @@ public async Task Should_Handle_Prepare_Rename_With_Range() var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); var result = await client.PrepareRename( - new PrepareRenameParams() { + new PrepareRenameParams + { Position = ( 1, 1 ), TextDocument = DocumentUri.FromFileSystemPath("/abcd/file.cs") }, @@ -140,10 +151,12 @@ public async Task Should_Handle_Prepare_Rename_With_PlaceholderRange() { _prepareRename.Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns( - call => { + call => + { var pos = call.Arg().Position; return new RangeOrPlaceholderRange( - new PlaceholderRange() { + new PlaceholderRange + { Range = new Range( pos, @@ -158,7 +171,8 @@ public async Task Should_Handle_Prepare_Rename_With_PlaceholderRange() var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); var result = await client.PrepareRename( - new PrepareRenameParams() { + new PrepareRenameParams + { Position = ( 1, 1 ), TextDocument = DocumentUri.FromFileSystemPath("/abcd/file.cs") }, @@ -174,7 +188,8 @@ public async Task Should_Handle_Prepare_Rename_With_DefaultBehavior() _prepareRename.Invoke(Arg.Any(), Arg.Any(), Arg.Any()) .Returns( call => new RangeOrPlaceholderRange( - new RenameDefaultBehavior() { + new RenameDefaultBehavior + { DefaultBehavior = true } ) @@ -183,7 +198,8 @@ public async Task Should_Handle_Prepare_Rename_With_DefaultBehavior() var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); var result = await client.PrepareRename( - new PrepareRenameParams() { + new PrepareRenameParams + { Position = ( 1, 1 ), TextDocument = DocumentUri.FromFileSystemPath("/abcd/file.cs") }, @@ -210,12 +226,14 @@ await client.DelayUntil( private void ServerOptionsAction(LanguageServerOptions obj) { obj.OnPrepareRename( - _prepareRename, (_, _) => new RenameRegistrationOptions() { + _prepareRename, (_, _) => new RenameRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("csharp") } ); obj.OnRename( - _rename, (_, _) =>new RenameRegistrationOptions() { + _rename, (_, _) => new RenameRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("csharp"), PrepareProvider = true, } @@ -225,7 +243,8 @@ private void ServerOptionsAction(LanguageServerOptions obj) private void ClientOptionsAction(LanguageClientOptions obj) { obj.WithCapability( - new RenameCapability() { + new RenameCapability + { PrepareSupport = true, PrepareSupportDefaultBehavior = PrepareSupportDefaultBehavior.Identifier } diff --git a/test/Lsp.Integration.Tests/RequestCancellationTests.cs b/test/Lsp.Integration.Tests/RequestCancellationTests.cs index d028392cc..3185bfc59 100644 --- a/test/Lsp.Integration.Tests/RequestCancellationTests.cs +++ b/test/Lsp.Integration.Tests/RequestCancellationTests.cs @@ -18,7 +18,7 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class RequestCancellationTests : LanguageProtocolTestBase { @@ -31,11 +31,13 @@ public async Task Should_Cancel_Pending_Requests() { var (client, _) = await Initialize(ConfigureClient, ConfigureServer); - Func> action = () => { + var action = () => + { var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(10)); CancellationToken.Register(cts.Cancel); return client.TextDocument.RequestCompletion( - new CompletionParams { + new CompletionParams + { TextDocument = "/a/file.cs" }, cts.Token ).AsTask(); @@ -49,14 +51,17 @@ public async Task Should_Abandon_Pending_Requests_For_Text_Changes() var (client, _) = await Initialize(ConfigureClient, ConfigureServer); var request1 = client.TextDocument.RequestCompletion( - new CompletionParams { + new CompletionParams + { TextDocument = "/a/file.cs" }, CancellationToken ).AsTask(); client.TextDocument.DidChangeTextDocument( - new DidChangeTextDocumentParams { - TextDocument = new OptionalVersionedTextDocumentIdentifier { + new DidChangeTextDocumentParams + { + TextDocument = new OptionalVersionedTextDocumentIdentifier + { Uri = "/a/file.cs", Version = 123, }, @@ -71,16 +76,19 @@ public async Task Should_Abandon_Pending_Requests_For_Text_Changes() [Fact] public async Task Should_Cancel_Requests_After_Timeout() { - Func action = async () => { + Func action = async () => + { var (client, _) = await Initialize( - ConfigureClient, x => { + ConfigureClient, x => + { ConfigureServer(x); x.WithMaximumRequestTimeout(TimeSpan.FromMilliseconds(3000)); } ); await client.TextDocument.RequestCompletion( - new CompletionParams { + new CompletionParams + { TextDocument = "/a/file.cs" }, CancellationToken ).AsTask(); @@ -91,16 +99,19 @@ await client.TextDocument.RequestCompletion( [Fact] public async Task Should_Cancel_Requests_After_Timeout_without_Content_Modified() { - Func action = async () => { + Func action = async () => + { var (client, _) = await Initialize( - ConfigureClient, x => { + ConfigureClient, x => + { ConfigureServer(x); x.WithContentModifiedSupport(false).WithMaximumRequestTimeout(TimeSpan.FromMilliseconds(3000)); } ); await client.TextDocument.RequestCompletion( - new CompletionParams { + new CompletionParams + { TextDocument = "/a/file.cs" }, CancellationToken ).AsTask(); @@ -112,16 +123,19 @@ await client.TextDocument.RequestCompletion( public async Task Can_Publish_Diagnostics_Delayed() { var (_, server) = await Initialize( - ConfigureClient, x => { + ConfigureClient, x => + { ConfigureServer(x); x.WithMaximumRequestTimeout(TimeSpan.FromMilliseconds(10000)); } ); server.TextDocument.PublishDiagnostics( - new PublishDiagnosticsParams { + new PublishDiagnosticsParams + { Diagnostics = new Container( - new Diagnostic { + new Diagnostic + { Message = "asdf", } ), @@ -137,11 +151,14 @@ public async Task Can_Publish_Diagnostics_Delayed() _diagnostics.Should().HaveCount(1); } - private readonly ConcurrentDictionary> _diagnostics = new ConcurrentDictionary>(); + private readonly ConcurrentDictionary> _diagnostics = + new ConcurrentDictionary>(); - private void ConfigureClient(LanguageClientOptions options) => + private void ConfigureClient(LanguageClientOptions options) + { options.OnPublishDiagnostics( - async (request, ct) => { + async (request, ct) => + { try { TestOptions.ClientLoggerFactory.CreateLogger("test").LogCritical("start"); @@ -154,17 +171,19 @@ private void ConfigureClient(LanguageClientOptions options) => } } ); + } private void ConfigureServer(LanguageServerOptions options) { options.WithContentModifiedSupport(true); options.OnCompletion( - async (x, ct) => { + async (x, ct) => + { await Task.Delay(50000, ct); return new CompletionList(); }, (_, _) => new CompletionRegistrationOptions() ); - options.OnDidChangeTextDocument(async x => { await Task.Delay(20); }, (_, _) =>new TextDocumentChangeRegistrationOptions()); + options.OnDidChangeTextDocument(async x => { await Task.Delay(20); }, (_, _) => new TextDocumentChangeRegistrationOptions()); } } } diff --git a/test/Lsp.Integration.Tests/ShowMessageTests.cs b/test/Lsp.Integration.Tests/ShowMessageTests.cs index 92cd016af..3424cf64f 100644 --- a/test/Lsp.Integration.Tests/ShowMessageTests.cs +++ b/test/Lsp.Integration.Tests/ShowMessageTests.cs @@ -14,11 +14,13 @@ using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class ShowMessageTests : LanguageProtocolTestBase { - public ShowMessageTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper).WithWaitTime(TimeSpan.FromMilliseconds(500))) + public ShowMessageTests(ITestOutputHelper outputHelper) : base( + new JsonRpcTestOptions().ConfigureForXUnit(outputHelper).WithWaitTime(TimeSpan.FromMilliseconds(500)) + ) { } @@ -34,12 +36,14 @@ public async Task Should_Show_Messages_Through_Window_Extension_Methods() server.Window.ShowWarning("Uh-oh..."); server.Window.Show("Just gotta let you know!"); server.Window.Show( - new ShowMessageParams { + new ShowMessageParams + { Type = MessageType.Log, Message = "1234" } ); server.Window.ShowMessage( - new ShowMessageParams { + new ShowMessageParams + { Type = MessageType.Log, Message = "1234" } ); @@ -63,12 +67,14 @@ public async Task Should_Show_Messages_Through_Server_Extension_Methods() server.ShowWarning("Uh-oh..."); server.Show("Just gotta let you know!"); server.Show( - new ShowMessageParams { + new ShowMessageParams + { Type = MessageType.Log, Message = "1234" } ); server.ShowMessage( - new ShowMessageParams { + new ShowMessageParams + { Type = MessageType.Log, Message = "1234" } ); @@ -82,7 +88,10 @@ public async Task Should_Show_Messages_Through_Server_Extension_Methods() _receivedMessages.Should().Contain(z => z.Type == MessageType.Log).And.Subject.Count(z => z.Type == MessageType.Log).Should().Be(3); } - private void ConfigureClient(LanguageClientOptions options) => options.OnShowMessage(request => { _receivedMessages.Add(request); }); + private void ConfigureClient(LanguageClientOptions options) + { + options.OnShowMessage(request => { _receivedMessages.Add(request); }); + } private void ConfigureServer(LanguageServerOptions options) { diff --git a/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs b/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs index 252524f53..3da1c2560 100644 --- a/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs +++ b/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs @@ -1,28 +1,22 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Lsp.Integration.Tests.Fixtures; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class TypedCallHierarchyTests : LanguageProtocolTestBase { @@ -38,7 +32,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() var outgoingHandlerA = Substitute.For, Task?>>>(); var outgoingHandlerB = Substitute.For, Task?>>>(); var (client, _) = await Initialize( - options => { options.EnableAllCapabilities(); }, options => { + options => { options.EnableAllCapabilities(); }, options => + { var identifier = Substitute.For(); identifier.GetTextDocumentAttributes(Arg.Any()).Returns( call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") @@ -48,11 +43,14 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnCallHierarchy( @params => Task.FromResult( new Container?>( - new CallHierarchyItem { + new CallHierarchyItem + { Name = "Test", Kind = SymbolKind.Boolean, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -63,7 +61,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() )!, incomingHandlerA, outgoingHandlerA, - (_, _) => new() { + (_, _) => new() + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); @@ -71,10 +70,12 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnCallHierarchy( @params => Task.FromResult( new Container?>( - new CallHierarchyItem { + new CallHierarchyItem + { Name = "Test Nested", Kind = SymbolKind.Constant, - Data = new Nested { + Data = new Nested + { Date = DateTimeOffset.MinValue } } @@ -82,7 +83,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() )!, incomingHandlerB, outgoingHandlerB, - (_, _) => new() { + (_, _) => new() + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); @@ -90,7 +92,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); var items = await client.RequestCallHierarchyPrepare( - new CallHierarchyPrepareParams() { + new CallHierarchyPrepareParams + { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); @@ -98,10 +101,14 @@ public async Task Should_Aggregate_With_All_Related_Handlers() var lens = items.ToArray(); lens.Select(z => z.Name).Should().Contain(new[] { "Test", "Test Nested" }); - var incomingItems = await Task.WhenAll(lens.Select(z => client.RequestCallHierarchyIncoming(new CallHierarchyIncomingCallsParams() { Item = z }).AsTask())); + var incomingItems = await Task.WhenAll( + lens.Select(z => client.RequestCallHierarchyIncoming(new CallHierarchyIncomingCallsParams { Item = z }).AsTask()) + ); incomingHandlerA.Received(1).Invoke(Arg.Any>()); incomingHandlerB.Received(1).Invoke(Arg.Any>()); - var outgoingItems = await Task.WhenAll(lens.Select(z => client.RequestCallHierarchyOutgoing(new CallHierarchyOutgoingCallsParams() { Item = z }).AsTask())); + var outgoingItems = await Task.WhenAll( + lens.Select(z => client.RequestCallHierarchyOutgoing(new CallHierarchyOutgoingCallsParams { Item = z }).AsTask()) + ); outgoingHandlerA.Received(1).Invoke(Arg.Any>()); outgoingHandlerB.Received(1).Invoke(Arg.Any>()); } @@ -112,15 +119,19 @@ public async Task Should_Resolve_With_Data_Capability() var incomingHandler = Substitute.For, Task?>>>(); var outgoingHandler = Substitute.For, Task?>>>(); var (client, _) = await Initialize( - options => { options.EnableAllCapabilities(); }, options => { + options => { options.EnableAllCapabilities(); }, options => + { options.OnCallHierarchy( @params => Task.FromResult( new Container?>( - new CallHierarchyItem { + new CallHierarchyItem + { Name = "Test", Kind = SymbolKind.Boolean, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -131,7 +142,8 @@ public async Task Should_Resolve_With_Data_Capability() )!, incomingHandler, outgoingHandler, - (_, _) => new() { + (_, _) => new() + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); @@ -139,16 +151,17 @@ public async Task Should_Resolve_With_Data_Capability() ); var items = await client.RequestCallHierarchyPrepare( - new CallHierarchyPrepareParams() { + new CallHierarchyPrepareParams + { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); var item = items.Single(); - var incomingItems = await client.RequestCallHierarchyIncoming(new CallHierarchyIncomingCallsParams() { Item = item }); + var incomingItems = await client.RequestCallHierarchyIncoming(new CallHierarchyIncomingCallsParams { Item = item }); incomingHandler.Received(1).Invoke(Arg.Any>()); - var outgoingItems = await client.RequestCallHierarchyOutgoing(new CallHierarchyOutgoingCallsParams() { Item = item }); + var outgoingItems = await client.RequestCallHierarchyOutgoing(new CallHierarchyOutgoingCallsParams { Item = item }); outgoingHandler.Received(1).Invoke(Arg.Any>()); } @@ -158,16 +171,21 @@ public async Task Should_Resolve_With_Partial_Data_Capability() var incomingHandler = Substitute.For, IObserver>>>(); var outgoingHandler = Substitute.For, IObserver>>>(); var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCallHierarchy( - (completionParams, observer) => { + (completionParams, observer) => + { var a = new Container?>( new Container?>( - new CallHierarchyItem { + new CallHierarchyItem + { Name = "Test", Kind = SymbolKind.Boolean, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -180,12 +198,14 @@ public async Task Should_Resolve_With_Partial_Data_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (a, b) => { + (a, b) => + { incomingHandler(a, b); b.OnNext(Enumerable.Empty()); b.OnCompleted(); }, - (a, b) => { + (a, b) => + { outgoingHandler(a, b); b.OnNext(Enumerable.Empty()); b.OnCompleted(); @@ -196,19 +216,19 @@ public async Task Should_Resolve_With_Partial_Data_Capability() ); var items = await client - .RequestCallHierarchyPrepare(new CallHierarchyPrepareParams() { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), }) + .RequestCallHierarchyPrepare(new CallHierarchyPrepareParams { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), }) .Take(1) .ToTask(CancellationToken); var item = items.Single(); var incomingItems = await client - .RequestCallHierarchyIncoming(new CallHierarchyIncomingCallsParams() { Item = item }) + .RequestCallHierarchyIncoming(new CallHierarchyIncomingCallsParams { Item = item }) .Take(1) .ToTask(CancellationToken); incomingHandler.Received(1).Invoke(Arg.Any>(), Arg.Any>>()); var outgoingItems = await client - .RequestCallHierarchyOutgoing(new CallHierarchyOutgoingCallsParams() { Item = item }) + .RequestCallHierarchyOutgoing(new CallHierarchyOutgoingCallsParams { Item = item }) .Take(1) .ToTask(CancellationToken); outgoingHandler.Received(1).Invoke(Arg.Any>(), Arg.Any>>()); diff --git a/test/Lsp.Integration.Tests/TypedCodeActionTests.cs b/test/Lsp.Integration.Tests/TypedCodeActionTests.cs index 02373175d..d155a5a4b 100644 --- a/test/Lsp.Integration.Tests/TypedCodeActionTests.cs +++ b/test/Lsp.Integration.Tests/TypedCodeActionTests.cs @@ -1,12 +1,10 @@ using System; -using System.ComponentModel; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; -using Newtonsoft.Json; +using Lsp.Integration.Tests.Fixtures; using Newtonsoft.Json.Linq; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; @@ -15,12 +13,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -using Nested = Lsp.Tests.Integration.Fixtures.Nested; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class TypedCodeActionTests : LanguageProtocolTestBase { @@ -32,7 +28,8 @@ public TypedCodeActionTests(ITestOutputHelper outputHelper) : base(new JsonRpcTe public async Task Should_Aggregate_With_All_Related_Handlers() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { var identifier = Substitute.For(); identifier.GetTextDocumentAttributes(Arg.Any()).Returns( call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") @@ -40,18 +37,23 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.AddTextDocumentIdentifier(identifier); options.OnCodeAction( - codeActionParams => { + codeActionParams => + { return Task.FromResult( - new CodeActionContainer( - new CodeAction { + new CodeActionContainer( + new CodeAction + { Title = "data-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "data-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -61,48 +63,53 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - action => { - return Task.FromResult(action with { Command = action.Command with { Name = "resolved-a" } }); - }, - (_, _) => new CodeActionRegistrationOptions { + action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-a" } }); }, + (_, _) => new CodeActionRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCodeAction( - codeActionParams => { + codeActionParams => + { return Task.FromResult( new CodeActionContainer( - new CodeAction { + new CodeAction + { Title = "nested-b", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "nested-b", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Nested { + Data = new Nested + { Date = DateTimeOffset.Now } } ) ); }, - action => { - return Task.FromResult(action with { Command = action.Command with { Name = "resolved-b" } }); - }, - (_, _) => new CodeActionRegistrationOptions { + action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-b" } }); }, + (_, _) => new CodeActionRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCodeAction( - codeActionParams => { + codeActionParams => + { return Task.FromResult( new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "no-data-c", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "no-data-c", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -110,22 +117,24 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - action => { - return Task.FromResult(action with { Command = action.Command with { Name = "resolved-c" } }); - }, - (_, _) => new CodeActionRegistrationOptions { + action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-c" } }); }, + (_, _) => new CodeActionRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCodeAction( - codeActionParams => { + codeActionParams => + { return Task.FromResult( new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "not-included", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "not-included", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -133,10 +142,9 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - action => { - return Task.FromResult(action with { Command = action.Command with { Name = "resolved-d" } }); - }, - (_, _) => new CodeActionRegistrationOptions { + action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-d" } }); }, + (_, _) => new CodeActionRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("vb") } ); @@ -144,7 +152,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); var codeAction = await client.RequestCodeAction( - new CodeActionParams { + new CodeActionParams + { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); @@ -161,20 +170,26 @@ public async Task Should_Aggregate_With_All_Related_Handlers() public async Task Should_Resolve_With_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeAction( - (codeActionParams, capability, token) => { + (codeActionParams, capability, token) => + { return Task.FromResult( - new CodeActionContainer( - new CodeAction { + new CodeActionContainer( + new CodeAction + { Title = "name", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -184,7 +199,8 @@ public async Task Should_Resolve_With_Data_Capability() ) ); }, - (codeAction, capability, token) => { + (codeAction, capability, token) => + { codeAction.Data.Id.Should().NotBeEmpty(); codeAction.Data.Child.Should().NotBeNull(); codeAction.Data.Name.Should().Be("name"); @@ -207,19 +223,25 @@ public async Task Should_Resolve_With_Data_Capability() public async Task Should_Resolve_With_Partial_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveCodeAction( - (codeActionParams, observer, capability, token) => { - var a = new CodeActionContainer( - new CodeAction { + options => { }, options => + { + options.ObserveCodeAction( + (codeActionParams, observer, capability, token) => + { + var a = new CodeActionContainer( + new CodeAction + { Title = "name", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -231,7 +253,8 @@ public async Task Should_Resolve_With_Partial_Data_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (codeAction, capability, token) => { + (codeAction, capability, token) => + { codeAction.Data.Id.Should().NotBeEmpty(); codeAction.Data.Child.Should().NotBeNull(); codeAction.Data.Name.Should().Be("name"); @@ -252,20 +275,26 @@ public async Task Should_Resolve_With_Partial_Data_Capability() public async Task Should_Resolve_With_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeAction( - (codeActionParams, token) => { + (codeActionParams, token) => + { return Task.FromResult( - new CodeActionContainer( - new CodeAction { + new CodeActionContainer( + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -275,7 +304,8 @@ public async Task Should_Resolve_With_Data_CancellationToken() ) ); }, - (codeAction, token) => { + (codeAction, token) => + { codeAction.Data.Id.Should().NotBeEmpty(); codeAction.Data.Child.Should().NotBeNull(); codeAction.Data.Name.Should().Be("name"); @@ -298,19 +328,25 @@ public async Task Should_Resolve_With_Data_CancellationToken() public async Task Should_Resolve_With_Partial_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveCodeAction( - (codeActionParams, observer, token) => { - var a = new CodeActionContainer( - new CodeAction { + options => { }, options => + { + options.ObserveCodeAction( + (codeActionParams, observer, token) => + { + var a = new CodeActionContainer( + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -322,7 +358,8 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (codeAction, token) => { + (codeAction, token) => + { codeAction.Data.Id.Should().NotBeEmpty(); codeAction.Data.Child.Should().NotBeNull(); codeAction.Data.Name.Should().Be("name"); @@ -343,20 +380,26 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() public async Task Should_Resolve_With_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeAction( - codeActionParams => { + codeActionParams => + { return Task.FromResult( - new CodeActionContainer( - new CodeAction { + new CodeActionContainer( + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -366,7 +409,8 @@ public async Task Should_Resolve_With_Data() ) ); }, - codeAction => { + codeAction => + { codeAction.Data.Id.Should().NotBeEmpty(); codeAction.Data.Child.Should().NotBeNull(); codeAction.Data.Name.Should().Be("name"); @@ -389,19 +433,25 @@ public async Task Should_Resolve_With_Data() public async Task Should_Resolve_With_Partial_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeAction( - (codeActionParams, observer) => { + (codeActionParams, observer) => + { var a = new CodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -413,7 +463,8 @@ public async Task Should_Resolve_With_Partial_Data() observer.OnNext(a); observer.OnCompleted(); }, - codeAction => { + codeAction => + { codeAction.Data.Id.Should().NotBeEmpty(); codeAction.Data.Child.Should().NotBeNull(); codeAction.Data.Name.Should().Be("name"); @@ -435,15 +486,19 @@ public async Task Should_Resolve_With_Partial_Data() public async Task Should_Resolve_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeAction( - (codeActionParams, capability, token) => { + (codeActionParams, capability, token) => + { return Task.FromResult( new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -451,7 +506,8 @@ public async Task Should_Resolve_Capability() ) ); }, - (codeAction, capability, token) => { + (codeAction, capability, token) => + { return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); }, (_, _) => new CodeActionRegistrationOptions() @@ -471,14 +527,18 @@ public async Task Should_Resolve_Capability() public async Task Should_Resolve_Partial_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeAction( - (codeActionParams, observer, capability, token) => { + (codeActionParams, observer, capability, token) => + { var a = new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -488,7 +548,8 @@ public async Task Should_Resolve_Partial_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (codeAction, capability, token) => { + (codeAction, capability, token) => + { return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); }, (_, _) => new CodeActionRegistrationOptions() @@ -506,15 +567,19 @@ public async Task Should_Resolve_Partial_Capability() public async Task Should_Resolve_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeAction( - (codeActionParams, token) => { + (codeActionParams, token) => + { return Task.FromResult( new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -522,9 +587,7 @@ public async Task Should_Resolve_CancellationToken() ) ); }, - (codeAction, token) => { - return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); - }, + (codeAction, token) => { return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); }, (_, _) => new CodeActionRegistrationOptions() ); } @@ -542,14 +605,18 @@ public async Task Should_Resolve_CancellationToken() public async Task Should_Resolve_Partial_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeAction( - (codeActionParams, observer, token) => { + (codeActionParams, observer, token) => + { var a = new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -559,9 +626,7 @@ public async Task Should_Resolve_Partial_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (codeAction, token) => { - return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); - }, + (codeAction, token) => { return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); }, (_, _) => new CodeActionRegistrationOptions() ); } @@ -577,15 +642,19 @@ public async Task Should_Resolve_Partial_CancellationToken() public async Task Should_Resolve() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeAction( - codeActionParams => { + codeActionParams => + { return Task.FromResult( new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -593,9 +662,7 @@ public async Task Should_Resolve() ) ); }, - codeAction => { - return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); - }, + codeAction => { return Task.FromResult(codeAction with { Command = codeAction.Command with { Name = "resolved" } }); }, (_, _) => new CodeActionRegistrationOptions() ); } @@ -613,14 +680,18 @@ public async Task Should_Resolve() public async Task Should_Resolve_Partial() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeAction( - (codeActionParams, observer) => { + (codeActionParams, observer) => + { var a = new CommandOrCodeActionContainer( - new CodeAction { + new CodeAction + { Title = "execute-a", Kind = CodeActionKind.QuickFix, - Command = new Command { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -630,9 +701,7 @@ public async Task Should_Resolve_Partial() observer.OnNext(a); observer.OnCompleted(); }, - codeAction => { - return Task.FromResult(codeAction with { Command = codeAction.Command! with { Name = "resolved"}}); - }, + codeAction => { return Task.FromResult(codeAction with { Command = codeAction.Command! with { Name = "resolved" } }); }, (_, _) => new CodeActionRegistrationOptions() ); } diff --git a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs index 7e70e8bf0..0737fd0fa 100644 --- a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs +++ b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs @@ -1,12 +1,10 @@ using System; -using System.ComponentModel; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; -using Newtonsoft.Json; +using Lsp.Integration.Tests.Fixtures; using Newtonsoft.Json.Linq; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; @@ -15,13 +13,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -using IHandlerIdentity = OmniSharp.Extensions.LanguageServer.Protocol.Models.IHandlerIdentity; -using Nested = Lsp.Tests.Integration.Fixtures.Nested; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class TypedCodeLensTests : LanguageProtocolTestBase { @@ -33,7 +28,8 @@ public TypedCodeLensTests(ITestOutputHelper outputHelper) : base(new JsonRpcTest public async Task Should_Aggregate_With_All_Related_Handlers() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { var identifier = Substitute.For(); identifier.GetTextDocumentAttributes(Arg.Any()).Returns( call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") @@ -41,16 +37,21 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.AddTextDocumentIdentifier(identifier); options.OnCodeLens( - codeLensParams => { + codeLensParams => + { return Task.FromResult( - new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLensContainer( + new CodeLens + { + Command = new Command + { Name = "data-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -61,21 +62,26 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-a" } }); }, - (_, _) => new CodeLensRegistrationOptions { + (_, _) => new CodeLensRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCodeLens( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "nested-b", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Nested { + Data = new Nested + { Date = DateTimeOffset.Now } } @@ -83,17 +89,21 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-b" } }); }, - (_, _) => new CodeLensRegistrationOptions { + (_, _) => new CodeLensRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCodeLens( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "no-data-c", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -102,17 +112,21 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-c" } }); }, - (_, _) => new CodeLensRegistrationOptions { + (_, _) => new CodeLensRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCodeLens( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "not-included", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -121,7 +135,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-d" } }); }, - (_, _) => new CodeLensRegistrationOptions { + (_, _) => new CodeLensRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("vb") } ); @@ -129,7 +144,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); var codeLens = await client.RequestCodeLens( - new CodeLensParams { + new CodeLensParams + { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); @@ -146,18 +162,24 @@ public async Task Should_Aggregate_With_All_Related_Handlers() public async Task Should_Resolve_With_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeLens( - (codeLensParams, capability, token) => { + (codeLensParams, capability, token) => + { return Task.FromResult( - new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLensContainer( + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -167,7 +189,8 @@ public async Task Should_Resolve_With_Data_Capability() ) ); }, - (lens, capability, token) => { + (lens, capability, token) => + { lens.Data.Id.Should().NotBeEmpty(); lens.Data.Child.Should().NotBeNull(); lens.Data.Name.Should().Be("name"); @@ -191,17 +214,23 @@ public async Task Should_Resolve_With_Data_Capability() public async Task Should_Resolve_With_Partial_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveCodeLens( - (codeLensParams, observer, capability, token) => { - var a = new CodeLensContainer( - new CodeLens { - Command = new Command { + options => { }, options => + { + options.ObserveCodeLens( + (codeLensParams, observer, capability, token) => + { + var a = new CodeLensContainer( + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -213,7 +242,8 @@ public async Task Should_Resolve_With_Partial_Data_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (codeLens, capability, token) => { + (codeLens, capability, token) => + { codeLens.Data.Id.Should().NotBeEmpty(); codeLens.Data.Child.Should().NotBeNull(); codeLens.Data.Name.Should().Be("name"); @@ -235,18 +265,24 @@ public async Task Should_Resolve_With_Partial_Data_Capability() public async Task Should_Resolve_With_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeLens( - (codeLensParams, token) => { + (codeLensParams, token) => + { return Task.FromResult( - new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLensContainer( + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -256,7 +292,8 @@ public async Task Should_Resolve_With_Data_CancellationToken() ) ); }, - (codeLens, token) => { + (codeLens, token) => + { codeLens.Data.Id.Should().NotBeEmpty(); codeLens.Data.Child.Should().NotBeNull(); codeLens.Data.Name.Should().Be("name"); @@ -280,17 +317,23 @@ public async Task Should_Resolve_With_Data_CancellationToken() public async Task Should_Resolve_With_Partial_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveCodeLens( - (codeLensParams, observer, token) => { - var a = new CodeLensContainer( - new CodeLens { - Command = new Command { + options => { }, options => + { + options.ObserveCodeLens( + (codeLensParams, observer, token) => + { + var a = new CodeLensContainer( + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -302,7 +345,8 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (codeLens, token) => { + (codeLens, token) => + { codeLens.Data.Id.Should().NotBeEmpty(); codeLens.Data.Child.Should().NotBeNull(); codeLens.Data.Name.Should().Be("name"); @@ -324,18 +368,24 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() public async Task Should_Resolve_With_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeLens( - codeLensParams => { + codeLensParams => + { return Task.FromResult( - new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLensContainer( + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -345,7 +395,8 @@ public async Task Should_Resolve_With_Data() ) ); }, - codeLens => { + codeLens => + { codeLens.Data.Id.Should().NotBeEmpty(); codeLens.Data.Child.Should().NotBeNull(); codeLens.Data.Name.Should().Be("name"); @@ -369,17 +420,23 @@ public async Task Should_Resolve_With_Data() public async Task Should_Resolve_With_Partial_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeLens( - (codeLensParams, observer) => { + (codeLensParams, observer) => + { var a = new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -391,7 +448,8 @@ public async Task Should_Resolve_With_Partial_Data() observer.OnNext(a); observer.OnCompleted(); }, - codeLens => { + codeLens => + { codeLens.Data.Id.Should().NotBeEmpty(); codeLens.Data.Child.Should().NotBeNull(); codeLens.Data.Name.Should().Be("name"); @@ -414,13 +472,17 @@ public async Task Should_Resolve_With_Partial_Data() public async Task Should_Resolve_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeLens( - (codeLensParams, capability, token) => { + (codeLensParams, capability, token) => + { return Task.FromResult( new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -428,7 +490,8 @@ public async Task Should_Resolve_Capability() ) ); }, - (codeLens, capability, token) => { + (codeLens, capability, token) => + { return Task.FromResult(codeLens with { Command = codeLens.Command with { Name = "resolved" } }); return Task.FromResult(codeLens); }, @@ -449,12 +512,16 @@ public async Task Should_Resolve_Capability() public async Task Should_Resolve_Partial_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeLens( - (codeLensParams, observer, capability, token) => { + (codeLensParams, observer, capability, token) => + { var a = new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -464,7 +531,8 @@ public async Task Should_Resolve_Partial_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (codeLens, capability, token) => { + (codeLens, capability, token) => + { return Task.FromResult(codeLens with { Command = codeLens.Command with { Name = "resolved" } }); return Task.FromResult(codeLens); }, @@ -483,13 +551,17 @@ public async Task Should_Resolve_Partial_Capability() public async Task Should_Resolve_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeLens( - (codeLensParams, token) => { + (codeLensParams, token) => + { return Task.FromResult( new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -497,7 +569,8 @@ public async Task Should_Resolve_CancellationToken() ) ); }, - (codeLens, token) => { + (codeLens, token) => + { return Task.FromResult(codeLens with { Command = codeLens.Command with { Name = "resolved" } }); return Task.FromResult(codeLens); }, @@ -518,12 +591,16 @@ public async Task Should_Resolve_CancellationToken() public async Task Should_Resolve_Partial_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeLens( - (codeLensParams, observer, token) => { + (codeLensParams, observer, token) => + { var a = new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -533,7 +610,8 @@ public async Task Should_Resolve_Partial_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (codeLens, token) => { + (codeLens, token) => + { return Task.FromResult(codeLens with { Command = codeLens.Command with { Name = "resolved" } }); return Task.FromResult(codeLens); }, @@ -552,13 +630,17 @@ public async Task Should_Resolve_Partial_CancellationToken() public async Task Should_Resolve() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCodeLens( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -566,7 +648,8 @@ public async Task Should_Resolve() ) ); }, - codeLens => { + codeLens => + { return Task.FromResult(codeLens with { Command = codeLens.Command with { Name = "resolved" } }); return Task.FromResult(codeLens); }, @@ -587,12 +670,16 @@ public async Task Should_Resolve() public async Task Should_Resolve_Partial() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCodeLens( - (codeLensParams, observer) => { + (codeLensParams, observer) => + { var a = new CodeLensContainer( - new CodeLens { - Command = new Command { + new CodeLens + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -602,7 +689,8 @@ public async Task Should_Resolve_Partial() observer.OnNext(a); observer.OnCompleted(); }, - codeLens => { + codeLens => + { return Task.FromResult(codeLens with { Command = codeLens.Command with { Name = "resolved" } }); return Task.FromResult(codeLens); }, diff --git a/test/Lsp.Integration.Tests/TypedCompletionTests.cs b/test/Lsp.Integration.Tests/TypedCompletionTests.cs index ac238921a..61cc6faaa 100644 --- a/test/Lsp.Integration.Tests/TypedCompletionTests.cs +++ b/test/Lsp.Integration.Tests/TypedCompletionTests.cs @@ -1,12 +1,10 @@ using System; -using System.ComponentModel; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; -using Newtonsoft.Json; +using Lsp.Integration.Tests.Fixtures; using Newtonsoft.Json.Linq; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; @@ -15,13 +13,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -using IHandlerIdentity = OmniSharp.Extensions.LanguageServer.Protocol.Models.IHandlerIdentity; -using Nested = Lsp.Tests.Integration.Fixtures.Nested; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class TypedCompletionTests : LanguageProtocolTestBase { @@ -33,7 +28,8 @@ public TypedCompletionTests(ITestOutputHelper outputHelper) : base(new JsonRpcTe public async Task Should_Aggregate_With_All_Related_Handlers() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { var identifier = Substitute.For(); identifier.GetTextDocumentAttributes(Arg.Any()).Returns( call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") @@ -41,16 +37,21 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.AddTextDocumentIdentifier(identifier); options.OnCompletion( - codeLensParams => { + codeLensParams => + { return Task.FromResult( - new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionList( + new CompletionItem + { + Command = new Command + { Name = "data-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -61,21 +62,26 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-a" } }); }, - (_, _) => new CompletionRegistrationOptions { + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCompletion( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "nested-b", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Nested { + Data = new Nested + { Date = DateTimeOffset.Now } } @@ -83,17 +89,21 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-b" } }); }, - (_, _) => new CompletionRegistrationOptions { + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCompletion( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "no-data-c", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -102,17 +112,21 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); }, completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-c" } }); }, - (_, _) => new CompletionRegistrationOptions { + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnCompletion( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "not-included", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -120,8 +134,9 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-d" }}); }, - (_, _) => new CompletionRegistrationOptions { + completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-d" } }); }, + (_, _) => new CompletionRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("vb") } ); @@ -129,7 +144,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); var items = await client.RequestCompletion( - new CompletionParams { + new CompletionParams + { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); @@ -146,18 +162,24 @@ public async Task Should_Aggregate_With_All_Related_Handlers() public async Task Should_Resolve_With_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - (completionParams, capability, token) => { + (completionParams, capability, token) => + { return Task.FromResult( - new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionList( + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -167,15 +189,17 @@ public async Task Should_Resolve_With_Data_Capability() ) ); }, - (completionItem, capability, token) => { + (completionItem, capability, token) => + { completionItem.Data!.Id.Should().NotBeEmpty(); completionItem.Data!.Child.Should().NotBeNull(); completionItem.Data!.Name.Should().Be("name"); return Task.FromResult(completionItem with { Detail = "resolved" }); return Task.FromResult( - completionItem with { + completionItem with + { Detail = "resolved" - } + } ); }, (_, _) => new CompletionRegistrationOptions() @@ -195,17 +219,23 @@ completionItem with { public async Task Should_Resolve_With_Partial_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveCompletion( - (completionParams, observer, capability, token) => { - var a = new CompletionList( - new CompletionItem { - Command = new Command { + options => { }, options => + { + options.ObserveCompletion( + (completionParams, observer, capability, token) => + { + var a = new CompletionList( + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -217,12 +247,13 @@ public async Task Should_Resolve_With_Partial_Data_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (completionItem, capability, token) => { + (completionItem, capability, token) => + { completionItem.Data!.Id.Should().NotBeEmpty(); completionItem.Data!.Child.Should().NotBeNull(); completionItem.Data!.Name.Should().Be("name"); return Task.FromResult(completionItem with { Detail = "resolved" }); - }, + }, (_, _) => new CompletionRegistrationOptions() ); } @@ -239,18 +270,24 @@ public async Task Should_Resolve_With_Partial_Data_Capability() public async Task Should_Resolve_With_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - (completionParams, token) => { + (completionParams, token) => + { return Task.FromResult( - new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionList( + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -260,7 +297,8 @@ public async Task Should_Resolve_With_Data_CancellationToken() ) ); }, - (completionItem, token) => { + (completionItem, token) => + { completionItem.Data!.Id.Should().NotBeEmpty(); completionItem.Data!.Child.Should().NotBeNull(); completionItem.Data!.Name.Should().Be("name"); @@ -283,17 +321,23 @@ public async Task Should_Resolve_With_Data_CancellationToken() public async Task Should_Resolve_With_Partial_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveCompletion( - (completionParams, observer, token) => { - var a = new CompletionList( - new CompletionItem { - Command = new Command { + options => { }, options => + { + options.ObserveCompletion( + (completionParams, observer, token) => + { + var a = new CompletionList( + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -305,7 +349,8 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (completionItem, token) => { + (completionItem, token) => + { completionItem.Data!.Id.Should().NotBeEmpty(); completionItem.Data!.Child.Should().NotBeNull(); completionItem.Data!.Name.Should().Be("name"); @@ -326,18 +371,24 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() public async Task Should_Resolve_With_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - completionParams => { + completionParams => + { return Task.FromResult( - new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionList( + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -347,7 +398,8 @@ public async Task Should_Resolve_With_Data() ) ); }, - completionItem => { + completionItem => + { completionItem.Data!.Id.Should().NotBeEmpty(); completionItem.Data!.Child.Should().NotBeNull(); completionItem.Data!.Name.Should().Be("name"); @@ -370,17 +422,23 @@ public async Task Should_Resolve_With_Data() public async Task Should_Resolve_With_Partial_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCompletion( - (completionParams, observer) => { + (completionParams, observer) => + { var a = new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -392,7 +450,8 @@ public async Task Should_Resolve_With_Partial_Data() observer.OnNext(a); observer.OnCompleted(); }, - completionItem => { + completionItem => + { completionItem.Data!.Id.Should().NotBeEmpty(); completionItem.Data!.Child.Should().NotBeNull(); completionItem.Data!.Name.Should().Be("name"); @@ -414,13 +473,17 @@ public async Task Should_Resolve_With_Partial_Data() public async Task Should_Resolve_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - (completionParams, capability, token) => { + (completionParams, capability, token) => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) } @@ -446,12 +509,16 @@ public async Task Should_Resolve_Capability() public async Task Should_Resolve_Partial_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCompletion( - (completionParams, observer, capability, token) => { + (completionParams, observer, capability, token) => + { var a = new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -477,13 +544,17 @@ public async Task Should_Resolve_Partial_Capability() public async Task Should_Resolve_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - (completionParams, token) => { + (completionParams, token) => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -509,12 +580,16 @@ public async Task Should_Resolve_CancellationToken() public async Task Should_Resolve_Partial_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCompletion( - (completionParams, observer, token) => { + (completionParams, observer, token) => + { var a = new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -540,13 +615,17 @@ public async Task Should_Resolve_Partial_CancellationToken() public async Task Should_Resolve() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnCompletion( - completionParams => { + completionParams => + { return Task.FromResult( new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, @@ -572,12 +651,16 @@ public async Task Should_Resolve() public async Task Should_Resolve_Partial() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveCompletion( - (completionParams, observer) => { + (completionParams, observer) => + { var a = new CompletionList( - new CompletionItem { - Command = new Command { + new CompletionItem + { + Command = new Command + { Name = "execute-a", Arguments = JArray.FromObject(new object[] { 1, "2", false }) }, diff --git a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs index 0cd4ebd54..2ea362015 100644 --- a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs +++ b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs @@ -1,12 +1,10 @@ using System; -using System.ComponentModel; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using FluentAssertions; -using Lsp.Tests.Integration.Fixtures; -using Newtonsoft.Json; +using Lsp.Integration.Tests.Fixtures; using NSubstitute; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; @@ -14,12 +12,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -using Nested = Lsp.Tests.Integration.Fixtures.Nested; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public partial class TypedDocumentLinkTests : LanguageProtocolTestBase { @@ -31,7 +27,8 @@ public TypedDocumentLinkTests(ITestOutputHelper outputHelper) : base(new JsonRpc public async Task Should_Aggregate_With_All_Related_Handlers() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { var identifier = Substitute.For(); identifier.GetTextDocumentAttributes(Arg.Any()).Returns( call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") @@ -39,13 +36,17 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.AddTextDocumentIdentifier(identifier); options.OnDocumentLink( - codeLensParams => { + codeLensParams => + { return Task.FromResult( - new DocumentLinkContainer( - new DocumentLink { + new DocumentLinkContainer( + new DocumentLink + { Tooltip = "data-a", - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -55,67 +56,70 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - documentLink => { - return Task.FromResult(documentLink with { Tooltip = "resolved-a" }); - }, - (_, _) => new DocumentLinkRegistrationOptions { + documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-a" }); }, + (_, _) => new DocumentLinkRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnDocumentLink( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "nested-b", - Data = new Nested { + Data = new Nested + { Date = DateTimeOffset.Now } } ) ); }, - documentLink => { - return Task.FromResult(documentLink with { Tooltip = "resolved-b" }); - }, - (_, _) => new DocumentLinkRegistrationOptions { + documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-b" }); }, + (_, _) => new DocumentLinkRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnDocumentLink( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "no-data-c", } ) ); }, - documentLink => { - return Task.FromResult(documentLink with { Tooltip = "resolved-c" }); - }, - (_, _) => new DocumentLinkRegistrationOptions { + documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-c" }); }, + (_, _) => new DocumentLinkRegistrationOptions + { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") } ); options.OnDocumentLink( - codeLensParams => { + codeLensParams => + { return Task.FromResult( new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "not-included", } ) ); }, - documentLink => { - return Task.FromResult(documentLink with { Tooltip = "resolved-d" }); - }, - (_, _) => new DocumentLinkRegistrationOptions { + documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-d" }); }, + (_, _) => new DocumentLinkRegistrationOptions + { DocumentSelector = DocumentSelector.ForLanguage("vb") } ); @@ -123,7 +127,8 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ); var items = await client.RequestDocumentLink( - new DocumentLinkParams { + new DocumentLinkParams + { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); @@ -140,15 +145,20 @@ public async Task Should_Aggregate_With_All_Related_Handlers() public async Task Should_Resolve_With_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnDocumentLink( - (documentLinkParams, capability, token) => { + (documentLinkParams, capability, token) => + { return Task.FromResult( - new DocumentLinkContainer( - new DocumentLink { + new DocumentLinkContainer( + new DocumentLink + { Tooltip = "execute-a", - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -158,7 +168,8 @@ public async Task Should_Resolve_With_Data_Capability() ) ); }, - (documentLink, capability, token) => { + (documentLink, capability, token) => + { documentLink.Data.Id.Should().NotBeEmpty(); documentLink.Data.Child.Should().NotBeNull(); documentLink.Data.Name.Should().Be("name"); @@ -181,14 +192,19 @@ public async Task Should_Resolve_With_Data_Capability() public async Task Should_Resolve_With_Partial_Data_Capability() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveDocumentLink( - (documentLinkParams, observer, capability, token) => { - var a = new DocumentLinkContainer( - new DocumentLink { + options => { }, options => + { + options.ObserveDocumentLink( + (documentLinkParams, observer, capability, token) => + { + var a = new DocumentLinkContainer( + new DocumentLink + { Tooltip = "execute-a", - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -200,7 +216,8 @@ public async Task Should_Resolve_With_Partial_Data_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (documentLink, capability, token) => { + (documentLink, capability, token) => + { documentLink.Data.Id.Should().NotBeEmpty(); documentLink.Data.Child.Should().NotBeNull(); documentLink.Data.Name.Should().Be("name"); @@ -221,15 +238,20 @@ public async Task Should_Resolve_With_Partial_Data_Capability() public async Task Should_Resolve_With_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnDocumentLink( - (documentLinkParams, token) => { + (documentLinkParams, token) => + { return Task.FromResult( - new DocumentLinkContainer( - new DocumentLink { + new DocumentLinkContainer( + new DocumentLink + { Tooltip = "execute-a", - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -239,7 +261,8 @@ public async Task Should_Resolve_With_Data_CancellationToken() ) ); }, - (documentLink, token) => { + (documentLink, token) => + { documentLink.Data.Id.Should().NotBeEmpty(); documentLink.Data.Child.Should().NotBeNull(); documentLink.Data.Name.Should().Be("name"); @@ -262,14 +285,19 @@ public async Task Should_Resolve_With_Data_CancellationToken() public async Task Should_Resolve_With_Partial_Data_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { - options.ObserveDocumentLink( - (documentLinkParams, observer, token) => { - var a = new DocumentLinkContainer( - new DocumentLink { + options => { }, options => + { + options.ObserveDocumentLink( + (documentLinkParams, observer, token) => + { + var a = new DocumentLinkContainer( + new DocumentLink + { Tooltip = "execute-a", - Data = new Fixtures.Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -281,7 +309,8 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (documentLink, token) => { + (documentLink, token) => + { documentLink.Data.Id.Should().NotBeEmpty(); documentLink.Data.Child.Should().NotBeNull(); documentLink.Data.Name.Should().Be("name"); @@ -302,15 +331,20 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() public async Task Should_Resolve_With_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnDocumentLink( - documentLinkParams => { + documentLinkParams => + { return Task.FromResult( - new DocumentLinkContainer( - new DocumentLink { + new DocumentLinkContainer( + new DocumentLink + { Tooltip = "execute-a", - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -320,7 +354,8 @@ public async Task Should_Resolve_With_Data() ) ); }, - documentLink => { + documentLink => + { documentLink.Data.Id.Should().NotBeEmpty(); documentLink.Data.Child.Should().NotBeNull(); documentLink.Data.Name.Should().Be("name"); @@ -343,14 +378,19 @@ public async Task Should_Resolve_With_Data() public async Task Should_Resolve_With_Partial_Data() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveDocumentLink( - (documentLinkParams, observer) => { + (documentLinkParams, observer) => + { var a = new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", - Data = new Data { - Child = new Nested { + Data = new Data + { + Child = new Nested + { Date = DateTimeOffset.MinValue }, Id = Guid.NewGuid(), @@ -362,7 +402,8 @@ public async Task Should_Resolve_With_Partial_Data() observer.OnNext(a); observer.OnCompleted(); }, - documentLink => { + documentLink => + { documentLink.Data.Id.Should().NotBeEmpty(); documentLink.Data.Child.Should().NotBeNull(); documentLink.Data.Name.Should().Be("name"); @@ -384,20 +425,21 @@ public async Task Should_Resolve_With_Partial_Data() public async Task Should_Resolve_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnDocumentLink( - (documentLinkParams, capability, token) => { + (documentLinkParams, capability, token) => + { return Task.FromResult( new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", } ) ); }, - (documentLink, capability, token) => { - return Task.FromResult(documentLink with { Tooltip = "resolved" }); - }, + (documentLink, capability, token) => { return Task.FromResult(documentLink with { Tooltip = "resolved" }); }, (_, _) => new DocumentLinkRegistrationOptions() ); } @@ -415,11 +457,14 @@ public async Task Should_Resolve_Capability() public async Task Should_Resolve_Partial_Capability() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveDocumentLink( - (documentLinkParams, observer, capability, token) => { + (documentLinkParams, observer, capability, token) => + { var a = new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", } ); @@ -427,9 +472,7 @@ public async Task Should_Resolve_Partial_Capability() observer.OnNext(a); observer.OnCompleted(); }, - (documentLink, capability, token) => { - return Task.FromResult(documentLink with { Tooltip = "resolved" }); - }, + (documentLink, capability, token) => { return Task.FromResult(documentLink with { Tooltip = "resolved" }); }, (_, _) => new DocumentLinkRegistrationOptions() ); } @@ -445,20 +488,21 @@ public async Task Should_Resolve_Partial_Capability() public async Task Should_Resolve_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnDocumentLink( - (documentLinkParams, token) => { + (documentLinkParams, token) => + { return Task.FromResult( new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", } ) ); }, - (documentLink, token) => { - return Task.FromResult(documentLink with { Tooltip = "resolved" }); - }, + (documentLink, token) => { return Task.FromResult(documentLink with { Tooltip = "resolved" }); }, (_, _) => new DocumentLinkRegistrationOptions() ); } @@ -476,11 +520,14 @@ public async Task Should_Resolve_CancellationToken() public async Task Should_Resolve_Partial_CancellationToken() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveDocumentLink( - (documentLinkParams, observer, token) => { + (documentLinkParams, observer, token) => + { var a = new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", } ); @@ -488,9 +535,7 @@ public async Task Should_Resolve_Partial_CancellationToken() observer.OnNext(a); observer.OnCompleted(); }, - (documentLink, token) => { - return Task.FromResult(documentLink with { Tooltip = "resolved" }); - }, + (documentLink, token) => { return Task.FromResult(documentLink with { Tooltip = "resolved" }); }, (_, _) => new DocumentLinkRegistrationOptions() ); } @@ -506,20 +551,21 @@ public async Task Should_Resolve_Partial_CancellationToken() public async Task Should_Resolve() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.OnDocumentLink( - documentLinkParams => { + documentLinkParams => + { return Task.FromResult( new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", } ) ); }, - documentLink => { - return Task.FromResult(documentLink with { Tooltip = "resolved" }); - }, + documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved" }); }, (_, _) => new DocumentLinkRegistrationOptions() ); } @@ -537,11 +583,14 @@ public async Task Should_Resolve() public async Task Should_Resolve_Partial() { var (client, _) = await Initialize( - options => { }, options => { + options => { }, options => + { options.ObserveDocumentLink( - (documentLinkParams, observer) => { + (documentLinkParams, observer) => + { var a = new DocumentLinkContainer( - new DocumentLink { + new DocumentLink + { Tooltip = "execute-a", } ); @@ -549,9 +598,7 @@ public async Task Should_Resolve_Partial() observer.OnNext(a); observer.OnCompleted(); }, - documentLink => { - return Task.FromResult(documentLink with { Tooltip = "resolved" }); - }, + documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved" }); }, (_, _) => new DocumentLinkRegistrationOptions() ); } diff --git a/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs b/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs index 240394788..0a38d9877 100644 --- a/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs +++ b/test/Lsp.Integration.Tests/WorkspaceFolderTests.cs @@ -17,11 +17,10 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using OmniSharp.Extensions.LanguageServer.Server; using Serilog.Events; -using TestingUtils; using Xunit; using Xunit.Abstractions; -namespace Lsp.Tests.Integration +namespace Lsp.Integration.Tests { public class WorkspaceFolderTests : LanguageProtocolTestBase { @@ -37,7 +36,8 @@ public WorkspaceFolderTests(ITestOutputHelper outputHelper) : base( public async Task Should_Disable_If_Not_Supported() { var (_, server) = await Initialize( - options => { + options => + { options.DisableAllCapabilities(); options.OnInitialize(async (languageClient, request, token) => { request.Capabilities!.Workspace!.WorkspaceFolders = false; }); }, ConfigureServer @@ -75,10 +75,12 @@ public async Task Should_Add_A_Workspace_Folder() public async Task Should_Allow_Null_Response() { var (client, server) = await Initialize( - options => { + options => + { ConfigureClient(options); options.OnWorkspaceFolders(@params => Task.FromResult?>(null)); - }, ConfigureServer); + }, ConfigureServer + ); Func a = () => server.WorkspaceFolderManager.Refresh().LastOrDefaultAsync().ToTask(); await a.Should().NotThrowAsync(); @@ -87,7 +89,9 @@ public async Task Should_Allow_Null_Response() [Fact] public async Task Should_Have_Workspace_Folder_At_Startup() { - var (_, server) = await Initialize(options => { options.WithWorkspaceFolder("/abcd/", nameof(Should_Have_Workspace_Folder_At_Startup)); }, ConfigureServer); + var (_, server) = await Initialize( + options => { options.WithWorkspaceFolder("/abcd/", nameof(Should_Have_Workspace_Folder_At_Startup)); }, ConfigureServer + ); var folder = server.WorkspaceFolderManager.CurrentWorkspaceFolders.Should().HaveCount(1).And.Subject.First(); folder.Name.Should().Be(nameof(Should_Have_Workspace_Folder_At_Startup)); @@ -96,7 +100,9 @@ public async Task Should_Have_Workspace_Folder_At_Startup() [Fact] public async Task Should_Remove_Workspace_Folder_by_name() { - var (client, server) = await Initialize(options => { options.WithWorkspaceFolder("/abcd/", nameof(Should_Remove_Workspace_Folder_by_name)); }, ConfigureServer); + var (client, server) = await Initialize( + options => { options.WithWorkspaceFolder("/abcd/", nameof(Should_Remove_Workspace_Folder_by_name)); }, ConfigureServer + ); var folders = new List(); server.WorkspaceFolderManager.Changed.Subscribe(x => folders.Add(x)); @@ -116,7 +122,9 @@ public async Task Should_Remove_Workspace_Folder_by_name() [Fact] public async Task Should_Remove_Workspace_Folder_by_uri() { - var (client, server) = await Initialize(options => { options.WithWorkspaceFolder("/abcd/", nameof(Should_Remove_Workspace_Folder_by_uri)); }, ConfigureServer); + var (client, server) = await Initialize( + options => { options.WithWorkspaceFolder("/abcd/", nameof(Should_Remove_Workspace_Folder_by_uri)); }, ConfigureServer + ); var folders = new List(); server.WorkspaceFolderManager.Changed.Subscribe(x => folders.Add(x)); @@ -139,9 +147,12 @@ public async Task Should_Handle_Null_Workspace_Folders() var workspaceLanguageServer = Substitute.For(); var languageServer = Substitute.For(); languageServer.ClientSettings.Returns( - new InitializeParams() { - Capabilities = new ClientCapabilities() { - Workspace = new WorkspaceClientCapabilities() { + new InitializeParams + { + Capabilities = new ClientCapabilities + { + Workspace = new WorkspaceClientCapabilities + { WorkspaceFolders = true } }, @@ -149,8 +160,10 @@ public async Task Should_Handle_Null_Workspace_Folders() } ); var workspaceFolders = new LanguageServerWorkspaceFolderManager(workspaceLanguageServer); - ( (IRegistration) workspaceFolders ).GetRegistrationOptions(languageServer!.ClientSettings!.Capabilities!); - var started = (IOnLanguageServerStarted) workspaceFolders; + ( (IRegistration)workspaceFolders ).GetRegistrationOptions( + languageServer!.ClientSettings!.Capabilities! + ); + var started = (IOnLanguageServerStarted)workspaceFolders; await started.OnStarted(languageServer, CancellationToken); } @@ -160,19 +173,24 @@ public async Task Should_Handle_Null_Workspace_Folders_On_Refresh() var workspaceLanguageServer = Substitute.For(); var languageServer = Substitute.For(); languageServer.ClientSettings.Returns( - new InitializeParams() { - Capabilities = new ClientCapabilities() { - Workspace = new WorkspaceClientCapabilities() { + new InitializeParams + { + Capabilities = new ClientCapabilities + { + Workspace = new WorkspaceClientCapabilities + { WorkspaceFolders = true } }, WorkspaceFolders = null } ); - languageServer.SendRequest(Arg.Any(), Arg.Any()).Returns((Container? ) null); + languageServer.SendRequest(Arg.Any(), Arg.Any()).Returns((Container?)null); var workspaceFolders = new LanguageServerWorkspaceFolderManager(workspaceLanguageServer); - ( (IRegistration) workspaceFolders ).GetRegistrationOptions(languageServer!.ClientSettings!.Capabilities!); - var started = (IOnLanguageServerStarted) workspaceFolders; + ( (IRegistration)workspaceFolders ).GetRegistrationOptions( + languageServer!.ClientSettings!.Capabilities! + ); + var started = (IOnLanguageServerStarted)workspaceFolders; await started.OnStarted(languageServer, CancellationToken); var result = await workspaceFolders.Refresh().ToArray(); @@ -180,14 +198,18 @@ public async Task Should_Handle_Null_Workspace_Folders_On_Refresh() result.Should().BeEmpty(); } - private void ConfigureClient(LanguageClientOptions options) => + private void ConfigureClient(LanguageClientOptions options) + { options.WithClientCapabilities( - new ClientCapabilities { - Workspace = new WorkspaceClientCapabilities { + new ClientCapabilities + { + Workspace = new WorkspaceClientCapabilities + { WorkspaceFolders = true } } ); + } private void ConfigureServer(LanguageServerOptions options) { diff --git a/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs b/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs index b6b3a4eea..cb2b69557 100644 --- a/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs +++ b/test/Lsp.Tests/Capabilities/Server/TextDocumentSyncKindTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using TestingUtils; using Xunit; namespace Lsp.Tests.Capabilities.Server diff --git a/test/Lsp.Tests/ClientCapabilityProviderTests.cs b/test/Lsp.Tests/ClientCapabilityProviderTests.cs index 4d0000117..4168c7d8d 100644 --- a/test/Lsp.Tests/ClientCapabilityProviderTests.cs +++ b/test/Lsp.Tests/ClientCapabilityProviderTests.cs @@ -10,10 +10,8 @@ using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Shared; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using OmniSharp.Extensions.LanguageServer.Server; using OmniSharp.Extensions.LanguageServer.Shared; using Xunit; @@ -23,7 +21,9 @@ namespace Lsp.Tests public class ClientCapabilityProviderTests { private static readonly Type[] Capabilities = typeof(ClientCapabilities).Assembly.GetTypes() - .Where(x => typeof(ICapability).IsAssignableFrom(x) && x.IsClass && !x.IsAbstract) + .Where( + x => typeof(ICapability).IsAssignableFrom(x) && x.IsClass && !x.IsAbstract + ) .Where(z => typeof(IDynamicCapability).IsAssignableFrom(z)) .ToArray(); @@ -38,8 +38,10 @@ public void Should_AllowSupportedCapabilities(IJsonRpcHandler handler, object in new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) @@ -50,13 +52,16 @@ public void Should_AllowSupportedCapabilities(IJsonRpcHandler handler, object in HasHandler(provider, instance).Should().BeTrue(); } - public static IEnumerable AllowSupportedCapabilities() => - GetItems( - Capabilities, type => { + public static IEnumerable AllowSupportedCapabilities() + { + return GetItems( + Capabilities, type => + { var handlerTypes = GetHandlerTypes(type); if (handlerTypes is { Length: 0 }) return null; var handler = Substitute.For(handlerTypes.ToArray(), new object[0]); - return new[] { + return new[] + { handler, Activator.CreateInstance( typeof(Supports<>).MakeGenericType(type), true, @@ -65,6 +70,7 @@ public void Should_AllowSupportedCapabilities(IJsonRpcHandler handler, object in }; } ); + } [Theory] [MemberData(nameof(AllowUnsupportedCapabilities))] @@ -77,8 +83,10 @@ public void Should_AllowUnsupportedCapabilities(IJsonRpcHandler handler, object new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) @@ -89,15 +97,18 @@ public void Should_AllowUnsupportedCapabilities(IJsonRpcHandler handler, object HasHandler(provider, instance).Should().BeTrue(); } - public static IEnumerable AllowUnsupportedCapabilities() => - GetItems( - Capabilities, type => { + public static IEnumerable AllowUnsupportedCapabilities() + { + return GetItems( + Capabilities, type => + { var handlerTypes = GetHandlerTypes(type); if (handlerTypes is { Length: 0 }) return null; var handler = Substitute.For(handlerTypes, new object[0]); return new[] { handler, Activator.CreateInstance(typeof(Supports<>).MakeGenericType(type), false) }; } ); + } [Theory] [MemberData(nameof(AllowNullSupportsCapabilities))] @@ -110,8 +121,10 @@ public void Should_AllowNullSupportedCapabilities(IJsonRpcHandler handler, objec new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) @@ -122,15 +135,18 @@ public void Should_AllowNullSupportedCapabilities(IJsonRpcHandler handler, objec HasHandler(provider, instance).Should().BeTrue(); } - public static IEnumerable AllowNullSupportsCapabilities() => - GetItems( - Capabilities, type => { + public static IEnumerable AllowNullSupportsCapabilities() + { + return GetItems( + Capabilities, type => + { var handlerTypes = GetHandlerTypes(type); if (handlerTypes is { Length: 0 }) return null; var handler = Substitute.For(handlerTypes.ToArray(), new object[0]); return new[] { handler, Activator.CreateInstance(typeof(Supports<>).MakeGenericType(type), true) }; } ); + } [Theory] @@ -144,8 +160,10 @@ public void Should_DisallowDynamicSupportedCapabilities(IJsonRpcHandler handler, new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) @@ -156,9 +174,11 @@ public void Should_DisallowDynamicSupportedCapabilities(IJsonRpcHandler handler, HasHandler(provider, instance).Should().BeFalse(); } - public static IEnumerable? DisallowDynamicSupportsCapabilities() => - GetItems( - Capabilities, type => { + public static IEnumerable? DisallowDynamicSupportsCapabilities() + { + return GetItems( + Capabilities, type => + { var handlerTypes = GetHandlerTypes(type); if (handlerTypes is { Length: 0 }) return null; var handler = Substitute.For(handlerTypes.ToArray(), new object[0]); @@ -168,6 +188,7 @@ public void Should_DisallowDynamicSupportedCapabilities(IJsonRpcHandler handler, { handler, Activator.CreateInstance(typeof(Supports<>).MakeGenericType(type), true, capability) }; } ); + } [Fact] public void Should_Handle_Mixed_Capabilities() @@ -183,23 +204,29 @@ public void Should_Handle_Mixed_Capabilities() new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) ) { textDocumentSyncHandler, codeActionHandler, definitionHandler, typeDefinitionHandler }; var provider = new ClientCapabilityProvider(collection, true); - var capabilities = new ClientCapabilities { - TextDocument = new TextDocumentClientCapabilities { + var capabilities = new ClientCapabilities + { + TextDocument = new TextDocumentClientCapabilities + { CodeAction = new Supports( - true, new CodeActionCapability { + true, new CodeActionCapability + { DynamicRegistration = false, } ), TypeDefinition = new Supports( - true, new TypeDefinitionCapability { + true, new TypeDefinitionCapability + { DynamicRegistration = true, } ) @@ -222,17 +249,22 @@ public void GH162_TextDocumentSync_Should_Work_Without_WillSave_Or_WillSaveWaitU new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) ) { textDocumentSyncHandler }; var provider = new ClientCapabilityProvider(collection, true); - var capabilities = new ClientCapabilities { - TextDocument = new TextDocumentClientCapabilities { - Synchronization = new SynchronizationCapability { + var capabilities = new ClientCapabilities + { + TextDocument = new TextDocumentClientCapabilities + { + Synchronization = new SynchronizationCapability + { DidSave = true, DynamicRegistration = false, WillSave = true, @@ -257,19 +289,25 @@ public void GH162_TextDocumentSync_Should_Work_With_WillSave_Or_WillSaveWaitUnti new SharedHandlerCollection( SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider( - new[] { - typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, + new[] + { + typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, + typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly } ) - ) { + ) + { textDocumentSyncHandler, willSaveTextDocumentHandler, willSaveWaitUntilTextDocumentHandler, didSaveTextDocumentHandler }; - var provider = new ClientCapabilityProvider(collection ,true); - var capabilities = new ClientCapabilities { - TextDocument = new TextDocumentClientCapabilities { - Synchronization = new SynchronizationCapability { + var provider = new ClientCapabilityProvider(collection, true); + var capabilities = new ClientCapabilities + { + TextDocument = new TextDocumentClientCapabilities + { + Synchronization = new SynchronizationCapability + { DidSave = true, DynamicRegistration = false, WillSave = true, @@ -281,29 +319,38 @@ public void GH162_TextDocumentSync_Should_Work_With_WillSave_Or_WillSaveWaitUnti provider.HasStaticHandler(capabilities.TextDocument.Synchronization).Should().BeTrue(); } - private static bool HasHandler(ClientCapabilityProvider provider, object instance) => - (bool) typeof(ClientCapabilityProviderTests).GetTypeInfo() - .GetMethod(nameof(GenericHasHandler), BindingFlags.Static | BindingFlags.NonPublic)! - .MakeGenericMethod(instance.GetType().GetTypeInfo().GetGenericArguments()[0]) - .Invoke(null, new[] { provider, instance })!; + private static bool HasHandler(ClientCapabilityProvider provider, object instance) + { + return (bool)typeof(ClientCapabilityProviderTests).GetTypeInfo() + .GetMethod(nameof(GenericHasHandler), BindingFlags.Static | BindingFlags.NonPublic)! + .MakeGenericMethod(instance.GetType().GetTypeInfo().GetGenericArguments()[0]) + .Invoke(null, new[] { provider, instance })!; + } private static bool GenericHasHandler(ClientCapabilityProvider provider, Supports supports) - where T : DynamicCapability => - provider.HasStaticHandler(supports); - - private static IEnumerable GetItems(IEnumerable types, Func?> func) => - types.Select(func).Where(z => z is not null).Select(z => z!.ToArray()); - - private static Type[] GetHandlerTypes(Type type) => - HandlerProvider.KnownHandlers - .SelectMany(z => z.AsEnumerable()) - .Where(x => x.HasCapability && x.CapabilityType == type) - .Select(z => z.HandlerType) - .Where(z => z.IsInterface && !z.IsGenericType) // only testing our interfaces - .ToArray(); - - private static LspHandlerTypeDescriptorProvider HandlerProvider = new LspHandlerTypeDescriptorProvider( - new[] { + where T : DynamicCapability + { + return provider.HasStaticHandler(supports); + } + + private static IEnumerable GetItems(IEnumerable types, Func?> func) + { + return types.Select(func).Where(z => z is not null).Select(z => z!.ToArray()); + } + + private static Type[] GetHandlerTypes(Type type) + { + return HandlerProvider.KnownHandlers + .SelectMany(z => z.AsEnumerable()) + .Where(x => x.HasCapability && x.CapabilityType == type) + .Select(z => z.HandlerType) + .Where(z => z.IsInterface && !z.IsGenericType) // only testing our interfaces + .ToArray(); + } + + private static readonly LspHandlerTypeDescriptorProvider HandlerProvider = new LspHandlerTypeDescriptorProvider( + new[] + { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(LspHandlerTypeDescriptorProvider).Assembly, typeof(LanguageServer).Assembly, diff --git a/test/Lsp.Tests/DiagnosticKindTests.cs b/test/Lsp.Tests/DiagnosticKindTests.cs index 6ebd6a48f..8391071b2 100644 --- a/test/Lsp.Tests/DiagnosticKindTests.cs +++ b/test/Lsp.Tests/DiagnosticKindTests.cs @@ -1,6 +1,4 @@ ο»Ώusing FluentAssertions; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using Xunit; @@ -14,7 +12,8 @@ public void DefaultBehavior_Should_Only_Support_InitialDiagnosticTags() { var serializer = new LspSerializer(); var json = serializer.SerializeObject( - new Diagnostic { + new Diagnostic + { Tags = new Container(DiagnosticTag.Deprecated) } ); diff --git a/test/Lsp.Tests/FluentAssertionsExtensions.cs b/test/Lsp.Tests/FluentAssertionsExtensions.cs index 6c12fb871..abfc4ba60 100644 --- a/test/Lsp.Tests/FluentAssertionsExtensions.cs +++ b/test/Lsp.Tests/FluentAssertionsExtensions.cs @@ -1,10 +1,6 @@ -using System; using FluentAssertions.Equivalency; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using Microsoft.Extensions.Options; using NSubstitute; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; @@ -13,38 +9,40 @@ namespace Lsp.Tests { public static class FluentAssertionsExtensions { - public static EquivalencyAssertionOptions ConfigureForSupports(this EquivalencyAssertionOptions options, ILogger? logger = null) => - options - .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>() - .ComparingByMembers>(); + public static EquivalencyAssertionOptions ConfigureForSupports(this EquivalencyAssertionOptions options, ILogger? logger = null) + { + return options + .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>() + .ComparingByMembers>(); + } } } diff --git a/test/Lsp.Tests/FoundationTests.cs b/test/Lsp.Tests/FoundationTests.cs index 22a1bcfab..88d01deee 100644 --- a/test/Lsp.Tests/FoundationTests.cs +++ b/test/Lsp.Tests/FoundationTests.cs @@ -18,7 +18,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Progress; using OmniSharp.Extensions.LanguageServer.Protocol.Server; @@ -34,11 +33,17 @@ public class FoundationTests { private readonly ILogger _logger; - public FoundationTests(ITestOutputHelper outputHelper) => _logger = new TestLoggerFactory(outputHelper).CreateLogger(typeof(FoundationTests)); + public FoundationTests(ITestOutputHelper outputHelper) + { + _logger = new TestLoggerFactory(outputHelper).CreateLogger(typeof(FoundationTests)); + } [Theory] [ClassData(typeof(ActionDelegateData))] - public void All_Create_Methods_Should_Work(ActionDelegate createDelegate) => createDelegate.Method.Should().NotThrow(); + public void All_Create_Methods_Should_Work(ActionDelegate createDelegate) + { + createDelegate.Method.Should().NotThrow(); + } public class ActionDelegateData : TheoryData { @@ -62,7 +67,8 @@ void BaseDelegate(LanguageServerOptions o) Add(new ActionDelegate("from (server): options, cancellationToken", () => LanguageServer.From(baseOptions, CancellationToken.None))); Add( new ActionDelegate( - "from (server): options, serviceProvider, cancellationToken", () => LanguageServer.From(baseOptions, serviceProvider, CancellationToken.None) + "from (server): options, serviceProvider, cancellationToken", + () => LanguageServer.From(baseOptions, serviceProvider, CancellationToken.None) ) ); Add(new ActionDelegate("from (server): options, serviceProvider", () => LanguageServer.From(baseOptions, serviceProvider))); @@ -70,7 +76,8 @@ void BaseDelegate(LanguageServerOptions o) Add(new ActionDelegate("from (server): action, cancellationToken", () => LanguageServer.From(BaseDelegate, CancellationToken.None))); Add( new ActionDelegate( - "from (server): action, serviceProvider, cancellationToken", () => LanguageServer.From(BaseDelegate, serviceProvider, CancellationToken.None) + "from (server): action, serviceProvider, cancellationToken", + () => LanguageServer.From(BaseDelegate, serviceProvider, CancellationToken.None) ) ); Add(new ActionDelegate("from (server): action, serviceProvider", () => LanguageServer.From(BaseDelegate, serviceProvider))); @@ -93,7 +100,8 @@ void BaseDelegate(LanguageClientOptions o) Add(new ActionDelegate("from (client): options, cancellationToken", () => LanguageClient.From(baseOptions, CancellationToken.None))); Add( new ActionDelegate( - "from (client): options, serviceProvider, cancellationToken", () => LanguageClient.From(baseOptions, serviceProvider, CancellationToken.None) + "from (client): options, serviceProvider, cancellationToken", + () => LanguageClient.From(baseOptions, serviceProvider, CancellationToken.None) ) ); Add(new ActionDelegate("from (client): options, serviceProvider", () => LanguageClient.From(baseOptions, serviceProvider))); @@ -101,7 +109,8 @@ void BaseDelegate(LanguageClientOptions o) Add(new ActionDelegate("from (client): action, cancellationToken", () => LanguageClient.From(BaseDelegate, CancellationToken.None))); Add( new ActionDelegate( - "from (client): action, serviceProvider, cancellationToken", () => LanguageClient.From(BaseDelegate, serviceProvider, CancellationToken.None) + "from (client): action, serviceProvider, cancellationToken", + () => LanguageClient.From(BaseDelegate, serviceProvider, CancellationToken.None) ) ); Add(new ActionDelegate("from (client): action, serviceProvider", () => LanguageClient.From(BaseDelegate, serviceProvider))); @@ -120,7 +129,10 @@ public ActionDelegate(string name, Action method) Method = method; } - public override string ToString() => _name; + public override string ToString() + { + return _name; + } } @@ -130,8 +142,8 @@ public void Debugger_Display_Should_Not_Throw(Type type) { var instance = Activator.CreateInstance(type); var property = type.GetProperty("DebuggerDisplay", BindingFlags.NonPublic | BindingFlags.Instance)!; - Func a1 = () => ( property.GetValue(instance) as string )!; - Func a2 = () => instance!.ToString()!; + var a1 = () => ( property.GetValue(instance) as string )!; + var a2 = () => instance!.ToString()!; a1.Should().NotThrow().And.NotBeNull(); a2.Should().NotThrow().And.NotBeNull(); @@ -143,9 +155,12 @@ public DebuggerDisplayTypes() { foreach (var item in typeof(DocumentSymbol).Assembly.ExportedTypes .Where(z => !z.IsGenericTypeDefinition) - .Where(z => z.GetCustomAttributes().Any(x => x.Value.StartsWith("{DebuggerDisplay"))) + .Where( + z => z.GetCustomAttributes() + .Any(x => x.Value.StartsWith("{DebuggerDisplay")) + ) .Where(z => z.GetConstructors().Any(x => x.GetParameters().Length == 0)) - ) + ) { Add(item); } @@ -154,15 +169,19 @@ public DebuggerDisplayTypes() [Theory(DisplayName = "Params types should have a method attribute")] [ClassData(typeof(ParamsShouldHaveMethodAttributeData))] - public void ParamsShouldHaveMethodAttribute(Type type) => + public void ParamsShouldHaveMethodAttribute(Type type) + { MethodAttribute.AllFrom(type).Any(z => z.Direction != Direction.Unspecified).Should() .Be(true, $"{type.Name} is missing a method attribute or the direction is not specified"); + } [Theory(DisplayName = "Handler interfaces should have a method attribute")] [ClassData(typeof(HandlersShouldHaveMethodAttributeData))] - public void HandlersShouldHaveMethodAttribute(Type type) => + public void HandlersShouldHaveMethodAttribute(Type type) + { MethodAttribute.AllFrom(type).Any(z => z.Direction != Direction.Unspecified).Should() .Be(true, $"{type.Name} is missing a method attribute or the direction is not specified"); + } [Theory(DisplayName = "Handler method should match params method")] [ClassData(typeof(HandlersShouldHaveMethodAttributeData))] @@ -192,7 +211,8 @@ public void HandlersShouldAbstractClass(ILspHandlerTypeDescriptor descriptor) { _logger.LogInformation("Handler: {Type}", descriptor.HandlerType); // This test requires a refactor, the delegating handlers have been removed and replaced by shared implementations - var abstractHandler = descriptor.HandlerType.Assembly.ExportedTypes.FirstOrDefault(z => z.IsAbstract && z.IsClass && descriptor.HandlerType.IsAssignableFrom(z)); + var abstractHandler = + descriptor.HandlerType.Assembly.ExportedTypes.FirstOrDefault(z => z.IsAbstract && z.IsClass && descriptor.HandlerType.IsAssignableFrom(z)); abstractHandler.Should().NotBeNull($"{descriptor.HandlerType.FullName} is missing abstract base class"); var delegatingHandler = descriptor.HandlerType.Assembly.DefinedTypes.FirstOrDefault( @@ -206,7 +226,7 @@ public void HandlersShouldAbstractClass(ILspHandlerTypeDescriptor descriptor) _logger.LogInformation("Delegating Handler: {Type}", delegatingHandler); delegatingHandler.DeclaringType.Should().NotBeNull(); delegatingHandler.DeclaringType!.GetMethods(BindingFlags.Public | BindingFlags.Static).Any(z => z.Name.StartsWith("On")).Should() - .BeTrue($"{descriptor.HandlerType.FullName} is missing delegating extension method"); + .BeTrue($"{descriptor.HandlerType.FullName} is missing delegating extension method"); } } @@ -225,9 +245,11 @@ public void HandlersShouldExtensionMethodClassWithMethods( ); extensionClass.Should().NotBeNull($"{descriptor.HandlerType.FullName} is missing extension method class"); - extensionClass.GetMethods().Any(z => z.Name == onMethodName && typeof(IJsonRpcHandlerRegistry).IsAssignableFrom(z.GetParameters()[0].ParameterType)).Should() + extensionClass.GetMethods().Any(z => z.Name == onMethodName && typeof(IJsonRpcHandlerRegistry).IsAssignableFrom(z.GetParameters()[0].ParameterType)) + .Should() .BeTrue($"{descriptor.HandlerType.FullName} is missing event extension methods named {onMethodName}"); - extensionClass.GetMethods().Any(z => z.Name == sendMethodName && typeof(IResponseRouter).IsAssignableFrom(z.GetParameters()[0].ParameterType)).Should() + extensionClass.GetMethods().Any(z => z.Name == sendMethodName && typeof(IResponseRouter).IsAssignableFrom(z.GetParameters()[0].ParameterType)) + .Should() .BeTrue($"{descriptor.HandlerType.FullName} is missing execute extension methods named {sendMethodName}"); var registries = extensionClass.GetMethods(BindingFlags.Static | BindingFlags.Public) @@ -289,17 +311,26 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection( extensionClass, extensionClassName, onMethodName, sendMethodName ); - var expectedEventRegistries = descriptor.Direction switch { - Direction.ClientToServer => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ) }, - Direction.ServerToClient => new (string type, Func matcher)[] { ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) }, + var expectedEventRegistries = descriptor.Direction switch + { + Direction.ClientToServer => new (string type, Func matcher)[] + { ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ) }, + Direction.ServerToClient => new (string type, Func matcher)[] + { ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) }, Direction.Bidirectional => new (string type, Func matcher)[] - { ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ), ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) }, + { + ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ), + ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) + }, _ => throw new NotImplementedException(descriptor.HandlerType.FullName) }; - var expectedRequestHandlers = descriptor.Direction switch { - Direction.ClientToServer => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("Client") ) }, - Direction.ServerToClient => new (string type, Func matcher)[] { ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) }, + var expectedRequestHandlers = descriptor.Direction switch + { + Direction.ClientToServer => new (string type, Func matcher)[] + { ( "Server", info => info.ParameterType.Name.EndsWith("Client") ) }, + Direction.ServerToClient => new (string type, Func matcher)[] + { ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) }, Direction.Bidirectional => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("Client") ), ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) }, _ => throw new NotImplementedException(descriptor.HandlerType.FullName) @@ -354,7 +385,9 @@ Func ForAnyParameter(Func m) return info => info.GetParameters().Any(m); } - var containsCancellationToken = ForAnyParameter(info => info.ParameterType.GetGenericArguments().Reverse().Take(2).Any(x => x == typeof(CancellationToken))); + var containsCancellationToken = ForAnyParameter( + info => info.ParameterType.GetGenericArguments().Reverse().Take(2).Any(x => x == typeof(CancellationToken)) + ); var returnType = descriptor.HasResponseType ? typeof(Task<>).MakeGenericType(descriptor.ResponseType!) : typeof(Task); var returns = ForAnyParameter(info => info.ParameterType.GetGenericArguments().LastOrDefault() == returnType); var isAction = ForAnyParameter(info => info.ParameterType.Name.StartsWith(nameof(Action))); @@ -365,24 +398,33 @@ Func ForAnyParameter(Func m) if (descriptor.IsRequest && TypeHandlerExtensionData.HandlersToSkip.All(z => descriptor.HandlerType != z)) { matcher.Match($"Func<{descriptor.ParamsType!.Name}, {returnType.Name}>", isFunc, takesParameter, returns); - matcher.Match($"Func<{descriptor.ParamsType.Name}, CancellationToken, {returnType.Name}>", isFunc, takesParameter, containsCancellationToken, returns); + matcher.Match( + $"Func<{descriptor.ParamsType.Name}, CancellationToken, {returnType.Name}>", isFunc, takesParameter, containsCancellationToken, returns + ); if (descriptor.HasCapability) { matcher.Match( - $"Func<{descriptor.ParamsType.Name}, {descriptor.CapabilityType!.Name}, CancellationToken, {returnType.Name}>", isFunc, takesParameter, + $"Func<{descriptor.ParamsType.Name}, {descriptor.CapabilityType!.Name}, CancellationToken, {returnType.Name}>", isFunc, + takesParameter, takesCapability, containsCancellationToken, returns ); } if (descriptor.HasPartialItem) { - var capability = ForAnyParameter(info => info.ParameterType.GetGenericArguments().Skip(2).FirstOrDefault() == descriptor.CapabilityType); + var capability = ForAnyParameter( + info => info.ParameterType.GetGenericArguments().Skip(2).FirstOrDefault() == descriptor.CapabilityType + ); var observesPartialResultType = ForAnyParameter( info => - info.ParameterType.GetGenericArguments().Skip(1).FirstOrDefault() == typeof(IObserver<>).MakeGenericType(descriptor.PartialItemType!) + info.ParameterType.GetGenericArguments().Skip(1).FirstOrDefault() + == typeof(IObserver<>).MakeGenericType(descriptor.PartialItemType!) ); - matcher.Match($"Action<{descriptor.ParamsType.Name}, IObserver<{descriptor.PartialItemType!.Name}>>", isAction, takesParameter, observesPartialResultType); + matcher.Match( + $"Action<{descriptor.ParamsType.Name}, IObserver<{descriptor.PartialItemType!.Name}>>", isAction, takesParameter, + observesPartialResultType + ); // matcher.Match($"Func<{descriptor.ParamsType.Name}, IObserver<{descriptor.PartialItemType.Name}>, Task>", isFunc, takesParameter, observesPartialResultType, returnsTask); matcher.Match( $"Action<{descriptor.ParamsType.Name}, IObserver<{descriptor.PartialItemType.Name}>, CancellationToken>", isAction, takesParameter, @@ -408,7 +450,9 @@ Func ForAnyParameter(Func m) if (descriptor.HasPartialItems) { - var capability = ForAnyParameter(info => info.ParameterType.GetGenericArguments().Skip(2).FirstOrDefault() == descriptor.CapabilityType); + var capability = ForAnyParameter( + info => info.ParameterType.GetGenericArguments().Skip(2).FirstOrDefault() == descriptor.CapabilityType + ); var observesPartialResultType = ForAnyParameter( info => info.ParameterType.GetGenericArguments().Skip(1).FirstOrDefault() == @@ -449,17 +493,21 @@ Func ForAnyParameter(Func m) if (descriptor.IsNotification) { matcher.Match($"Func<{descriptor.ParamsType!.Name}, {returnType.Name}>", isFunc, takesParameter, returns); - matcher.Match($"Func<{descriptor.ParamsType.Name}, CancellationToken, {returnType.Name}>", isFunc, takesParameter, containsCancellationToken, returns); + matcher.Match( + $"Func<{descriptor.ParamsType.Name}, CancellationToken, {returnType.Name}>", isFunc, takesParameter, containsCancellationToken, returns + ); matcher.Match($"Action<{descriptor.ParamsType.Name}>", isAction, takesParameter); matcher.Match($"Action<{descriptor.ParamsType.Name}, CancellationToken>", isAction, takesParameter, containsCancellationToken); if (descriptor.HasCapability) { matcher.Match( - $"Func<{descriptor.ParamsType.Name}, {descriptor.CapabilityType!.Name}, CancellationToken, {returnType.Name}>", isFunc, takesParameter, + $"Func<{descriptor.ParamsType.Name}, {descriptor.CapabilityType!.Name}, CancellationToken, {returnType.Name}>", isFunc, + takesParameter, takesCapability, containsCancellationToken, returns ); matcher.Match( - $"Action<{descriptor.ParamsType.Name}, {descriptor.CapabilityType.Name}, CancellationToken>", isAction, takesParameter, takesCapability, + $"Action<{descriptor.ParamsType.Name}, {descriptor.CapabilityType.Name}, CancellationToken>", isAction, takesParameter, + takesCapability, containsCancellationToken ); } @@ -467,7 +515,8 @@ Func ForAnyParameter(Func m) } { var matcher = new MethodMatcher(sendMethodRegistries, descriptor, extensionClass); - Func containsCancellationToken = info => info.GetParameters().Reverse().Take(2).Any(x => x.ParameterType == typeof(CancellationToken)); + Func containsCancellationToken = + info => info.GetParameters().Reverse().Take(2).Any(x => x.ParameterType == typeof(CancellationToken)); var returnType = descriptor.HasResponseType ? typeof(Task<>).MakeGenericType(descriptor.ResponseType!) : typeof(Task); Func returns = info => info.ReturnType == returnType; Func isAction = info => info.ReturnType.Name == "Void"; @@ -476,7 +525,9 @@ Func ForAnyParameter(Func m) if (descriptor.IsRequest && descriptor.HasPartialItems) { Func partialReturnType = info => - typeof(IRequestProgressObservable<,>).MakeGenericType(typeof(IEnumerable<>).MakeGenericType(descriptor.PartialItemsType!), descriptor.ResponseType!) + typeof(IRequestProgressObservable<,>).MakeGenericType( + typeof(IEnumerable<>).MakeGenericType(descriptor.PartialItemsType!), descriptor.ResponseType! + ) .IsAssignableFrom(info.ReturnType); matcher.Match( $"Func<{descriptor.ParamsType!.Name}, CancellationToken, IProgressObservable, {descriptor.ResponseType!.Name}>>", @@ -486,7 +537,8 @@ Func ForAnyParameter(Func m) else if (descriptor.IsRequest && descriptor.HasPartialItem) { Func partialReturnType = info => - typeof(IRequestProgressObservable<,>).MakeGenericType(descriptor.PartialItemType!, descriptor.ResponseType!).IsAssignableFrom(info.ReturnType); + typeof(IRequestProgressObservable<,>).MakeGenericType(descriptor.PartialItemType!, descriptor.ResponseType!) + .IsAssignableFrom(info.ReturnType); matcher.Match( $"Func<{descriptor.ParamsType!.Name}, CancellationToken, IProgressObservable<{descriptor.PartialItemType!.Name}, {descriptor.ResponseType!.Name}>>", takesParameter, containsCancellationToken, partialReturnType @@ -494,7 +546,9 @@ Func ForAnyParameter(Func m) } else if (descriptor.IsRequest) { - matcher.Match($"Func<{descriptor.ParamsType!.Name}, CancellationToken, {returnType.Name}>", takesParameter, containsCancellationToken, returns); + matcher.Match( + $"Func<{descriptor.ParamsType!.Name}, CancellationToken, {returnType.Name}>", takesParameter, containsCancellationToken, returns + ); } else if (descriptor.IsNotification) { @@ -548,7 +602,8 @@ public void Match(string description, params Func[] matchers) method.Invoke( null, - new[] { + new[] + { registrySub, Substitute.For(new[] { method.GetParameters()[1].ParameterType }, Array.Empty()), }.Concat( method.GetParameters().Skip(2).Select( @@ -563,7 +618,8 @@ public void Match(string description, params Func[] matchers) registrySub.Received().ReceivedCalls() .Any( - z => z.GetMethodInfo().Name == nameof(IJsonRpcHandlerRegistry>.AddHandler) && + z => z.GetMethodInfo().Name + == nameof(IJsonRpcHandlerRegistry>.AddHandler) && z.GetArguments().Length == 3 && z.GetArguments()[0].Equals(_descriptor.Method) ) @@ -615,9 +671,11 @@ public class ParamsShouldHaveMethodAttributeData : TheoryData public ParamsShouldHaveMethodAttributeData() { foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes.Where( - z => - z.IsClass && !z.IsAbstract && z.GetInterfaces().Any(x => x.IsGenericType && typeof(IRequest<>).IsAssignableFrom(x.GetGenericTypeDefinition())) - )) + z => + z.IsClass && !z.IsAbstract && z.GetInterfaces().Any( + x => x.IsGenericType && typeof(IRequest<>).IsAssignableFrom(x.GetGenericTypeDefinition()) + ) + )) { Add(type); } @@ -631,7 +689,7 @@ public HandlersShouldHaveMethodAttributeData() foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes.Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) .Except(new[] { typeof(ITextDocumentSyncHandler) }) - ) + ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; Add(type); @@ -648,7 +706,7 @@ public RegistrationConverters() .Where(z => z.IsClass && !z.IsAbstract && typeof(IRegistrationOptionsConverter).IsAssignableFrom(z)) .Where(z => z.BaseType?.IsGenericType == true && z.BaseType.GetGenericArguments().Length == 2) .Where(z => !z.FullName?.Contains("TextDocumentSyncRegistrationOptions") == true) - ) + ) { Add(type); } @@ -661,7 +719,8 @@ public TypeHandlerData() { var handlerTypeDescriptorProvider = new LspHandlerTypeDescriptorProvider( - new[] { + new[] + { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(LspHandlerTypeDescriptorProvider).Assembly, typeof(LanguageServer).Assembly, @@ -673,7 +732,7 @@ public TypeHandlerData() foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes.Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) .Except(new[] { typeof(ITextDocumentSyncHandler), typeof(IExecuteCommandHandler<>) }) - ) + ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; Add(handlerTypeDescriptorProvider.GetHandlerTypeDescriptor(type)!); @@ -683,7 +742,8 @@ public TypeHandlerData() public class TypeHandlerExtensionData : TheoryData { - public static Type[] HandlersToSkip = { + public static Type[] HandlersToSkip = + { typeof(ISemanticTokensFullHandler), typeof(ISemanticTokensDeltaHandler), typeof(ISemanticTokensRangeHandler), @@ -694,7 +754,8 @@ public TypeHandlerExtensionData() { var handlerTypeDescriptorProvider = new LspHandlerTypeDescriptorProvider( - new[] { + new[] + { typeof(AssemblyScanningHandlerTypeDescriptorProvider).Assembly, typeof(LspHandlerTypeDescriptorProvider).Assembly, typeof(LanguageServer).Assembly, @@ -707,14 +768,15 @@ public TypeHandlerExtensionData() .Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) .Except(new[] { typeof(ITextDocumentSyncHandler) }) - ) + ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; if (type.Name.EndsWith("Manager")) continue; if (type == typeof(IExecuteCommandHandler<>)) continue; if (type == typeof(ICompletionResolveHandler) || type == typeof(ICodeLensResolveHandler) || type == typeof(IDocumentLinkResolveHandler) || type == typeof(ICodeActionResolveHandler)) continue; - if (type == typeof(ISemanticTokensFullHandler) || type == typeof(ISemanticTokensDeltaHandler) || type == typeof(ISemanticTokensRangeHandler)) continue; + if (type == typeof(ISemanticTokensFullHandler) || type == typeof(ISemanticTokensDeltaHandler) + || type == typeof(ISemanticTokensRangeHandler)) continue; var descriptor = handlerTypeDescriptorProvider.GetHandlerTypeDescriptor(type); if (descriptor == null) @@ -733,14 +795,19 @@ public TypeHandlerExtensionData() } } - private static string GetExtensionClassName(IHandlerTypeDescriptor descriptor) => SpecialCasedHandlerName(descriptor) + "Extensions"; + private static string GetExtensionClassName(IHandlerTypeDescriptor descriptor) + { + return SpecialCasedHandlerName(descriptor) + "Extensions"; + } - private static string SpecialCasedHandlerName(IHandlerTypeDescriptor descriptor) => - new Regex(@"(\w+(?:\`\d)?)$") + private static string SpecialCasedHandlerName(IHandlerTypeDescriptor descriptor) + { + return new Regex(@"(\w+(?:\`\d)?)$") .Replace( descriptor.HandlerType.Name, descriptor.HandlerType.Name.Substring(1, descriptor.HandlerType.Name.IndexOf("Handler", StringComparison.Ordinal) - 1) ); + } private static Type GetExtensionClass(IHandlerTypeDescriptor descriptor) { @@ -749,7 +816,10 @@ private static Type GetExtensionClass(IHandlerTypeDescriptor descriptor) .FirstOrDefault(z => z.IsClass && z.IsAbstract && ( z.Name == name || z.Name == name + "Base" ))!; } - private static string GetOnMethodName(IHandlerTypeDescriptor descriptor) => "On" + SpecialCasedHandlerName(descriptor); + private static string GetOnMethodName(IHandlerTypeDescriptor descriptor) + { + return "On" + SpecialCasedHandlerName(descriptor); + } private static string GetSendMethodName(ILspHandlerTypeDescriptor descriptor) { diff --git a/test/Lsp.Tests/Models/CodeLensTests.cs b/test/Lsp.Tests/Models/CodeLensTests.cs index aece16f03..fe8f94dda 100644 --- a/test/Lsp.Tests/Models/CodeLensTests.cs +++ b/test/Lsp.Tests/Models/CodeLensTests.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; -using System.Reflection; using FluentAssertions; -using FluentAssertions.Equivalency; using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; using NSubstitute; @@ -28,14 +26,17 @@ public CodeLensTests(ITestOutputHelper testOutputHelper) [JsonFixture] public void SimpleTest(string expected) { - var model = new CodeLens { - Command = new Command { + var model = new CodeLens + { + Command = new Command + { Arguments = new JArray { 1, "2", true }, Name = "abc", Title = "Cool story bro" }, Data = JObject.FromObject( - new Dictionary { + new Dictionary + { { "somethingCool", 1 } } ), diff --git a/test/Lsp.Tests/Models/CompletionItemKindTests.cs b/test/Lsp.Tests/Models/CompletionItemKindTests.cs index 96eeda557..5f5b7c846 100644 --- a/test/Lsp.Tests/Models/CompletionItemKindTests.cs +++ b/test/Lsp.Tests/Models/CompletionItemKindTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs b/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs index e39cbbfa0..731ae8f2b 100644 --- a/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs +++ b/test/Lsp.Tests/Models/DiagnosticSeverityTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs b/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs index 93222c6dd..64318b694 100644 --- a/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs +++ b/test/Lsp.Tests/Models/DocumentHighlightKindTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/FileChangeTypeTests.cs b/test/Lsp.Tests/Models/FileChangeTypeTests.cs index ebbb01dc0..f61096fc4 100644 --- a/test/Lsp.Tests/Models/FileChangeTypeTests.cs +++ b/test/Lsp.Tests/Models/FileChangeTypeTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/InsertTextFormatTests.cs b/test/Lsp.Tests/Models/InsertTextFormatTests.cs index 296c57361..97927005f 100644 --- a/test/Lsp.Tests/Models/InsertTextFormatTests.cs +++ b/test/Lsp.Tests/Models/InsertTextFormatTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/MessageTypeTests.cs b/test/Lsp.Tests/Models/MessageTypeTests.cs index 1bc6410a6..cf1dd7647 100644 --- a/test/Lsp.Tests/Models/MessageTypeTests.cs +++ b/test/Lsp.Tests/Models/MessageTypeTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/SymbolKindTests.cs b/test/Lsp.Tests/Models/SymbolKindTests.cs index 9db4cef02..6a192c19f 100644 --- a/test/Lsp.Tests/Models/SymbolKindTests.cs +++ b/test/Lsp.Tests/Models/SymbolKindTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs b/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs index 28111a0ac..75a6e2aa4 100644 --- a/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs +++ b/test/Lsp.Tests/Models/TextDocumentSaveReasonTests.cs @@ -2,7 +2,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using TestingUtils; using Xunit; namespace Lsp.Tests.Models diff --git a/test/Lsp.Tests/SemanticTokensDocumentTests.cs b/test/Lsp.Tests/SemanticTokensDocumentTests.cs index 0e780a36f..0c240ac45 100644 --- a/test/Lsp.Tests/SemanticTokensDocumentTests.cs +++ b/test/Lsp.Tests/SemanticTokensDocumentTests.cs @@ -4,13 +4,11 @@ using System.Linq; using System.Text; using Bogus; -using Bogus.Extensions; using FluentAssertions; using Microsoft.Extensions.Logging; using NSubstitute; using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Xunit; using Xunit.Abstractions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; @@ -28,47 +26,50 @@ public SemanticTokensDocumentTests(ITestOutputHelper testOutputHelper) { var loggerFactory = new TestLoggerFactory(testOutputHelper); _logger = loggerFactory.CreateLogger(); - _legend = new SemanticTokensLegend { + _legend = new SemanticTokensLegend + { // specify a specific set so that additions to the default list do not cause breaks in the tests. - TokenModifiers = new[] { - new SemanticTokenModifier("documentation"), - new SemanticTokenModifier("declaration"), - new SemanticTokenModifier("definition"), - new SemanticTokenModifier("static"), - new SemanticTokenModifier("async"), - new SemanticTokenModifier("abstract"), - new SemanticTokenModifier("deprecated"), - new SemanticTokenModifier("readonly"), - new SemanticTokenModifier("modification"), - new SemanticTokenModifier("defaultLibrary") - } - .ToArray(), - TokenTypes = new[] { - new SemanticTokenType("comment"), - new SemanticTokenType("keyword"), - new SemanticTokenType("string"), - new SemanticTokenType("number"), - new SemanticTokenType("regexp"), - new SemanticTokenType("operator"), - new SemanticTokenType("namespace"), - new SemanticTokenType("type"), - new SemanticTokenType("struct"), - new SemanticTokenType("class"), - new SemanticTokenType("interface"), - new SemanticTokenType("enum"), - new SemanticTokenType("typeParameter"), - new SemanticTokenType("function"), - new SemanticTokenType("member"), - new SemanticTokenType("property"), - new SemanticTokenType("macro"), - new SemanticTokenType("variable"), - new SemanticTokenType("parameter"), - new SemanticTokenType("label"), - new SemanticTokenType("modifier"), - new SemanticTokenType("event"), - new SemanticTokenType("enumMember"), - } - .ToArray(), + TokenModifiers = new[] + { + new SemanticTokenModifier("documentation"), + new SemanticTokenModifier("declaration"), + new SemanticTokenModifier("definition"), + new SemanticTokenModifier("static"), + new SemanticTokenModifier("async"), + new SemanticTokenModifier("abstract"), + new SemanticTokenModifier("deprecated"), + new SemanticTokenModifier("readonly"), + new SemanticTokenModifier("modification"), + new SemanticTokenModifier("defaultLibrary") + } + .ToArray(), + TokenTypes = new[] + { + new SemanticTokenType("comment"), + new SemanticTokenType("keyword"), + new SemanticTokenType("string"), + new SemanticTokenType("number"), + new SemanticTokenType("regexp"), + new SemanticTokenType("operator"), + new SemanticTokenType("namespace"), + new SemanticTokenType("type"), + new SemanticTokenType("struct"), + new SemanticTokenType("class"), + new SemanticTokenType("interface"), + new SemanticTokenType("enum"), + new SemanticTokenType("typeParameter"), + new SemanticTokenType("function"), + new SemanticTokenType("member"), + new SemanticTokenType("property"), + new SemanticTokenType("macro"), + new SemanticTokenType("variable"), + new SemanticTokenType("parameter"), + new SemanticTokenType("label"), + new SemanticTokenType("modifier"), + new SemanticTokenType("event"), + new SemanticTokenType("enumMember"), + } + .ToArray(), }; } @@ -87,13 +88,19 @@ public void ReturnDocumentTokensFromScratch() result.ResultId.Should().Be(document.Id); var data = Normalize(ExampleDocumentText, result.Data).ToArray(); _logger.LogInformation("Some Data {Data}", data.AsEnumerable()); - var expectedResponse = new NormalizedToken[] { - "using (macro:async|deprecated)", "System (macro:async|deprecated)", "using (event:none)", "System (number:none)", "Collections (struct:readonly)", - "Generic (class:none)", "using (variable:modification|defaultLibrary)", "System (comment:static|deprecated)", "Linq (comment:definition)", "using (comment:none)", - "System (enumMember:none)", "Text (comment:static|deprecated)", "using (comment:none)", "System (comment:declaration)", "Threading (comment:static|defaultLibrary)", + var expectedResponse = new NormalizedToken[] + { + "using (macro:async|deprecated)", "System (macro:async|deprecated)", "using (event:none)", "System (number:none)", + "Collections (struct:readonly)", + "Generic (class:none)", "using (variable:modification|defaultLibrary)", "System (comment:static|deprecated)", "Linq (comment:definition)", + "using (comment:none)", + "System (enumMember:none)", "Text (comment:static|deprecated)", "using (comment:none)", "System (comment:declaration)", + "Threading (comment:static|defaultLibrary)", "Tasks (comment:none)", "namespace (comment:readonly)", "CSharpTutorials (comment:none)", "{ (struct:documentation)", "class (enumMember:none)", - "Program (comment:none)", "{ (comment:none)", "static (regexp:documentation)", "void (macro:none)", "Main (macro:none)", "string[] (property:declaration|abstract)", - "args (macro:none)", "{ (interface:documentation|declaration|deprecated)", "string (struct:none)", "message (enum:none)", "= (label:none)", "Hello (comment:none)", + "Program (comment:none)", "{ (comment:none)", "static (regexp:documentation)", "void (macro:none)", "Main (macro:none)", + "string[] (property:declaration|abstract)", + "args (macro:none)", "{ (interface:documentation|declaration|deprecated)", "string (struct:none)", "message (enum:none)", "= (label:none)", + "Hello (comment:none)", "World!! (enum:none)", "Console (interface:static)", "WriteLine (event:async|modification)", "message (interface:static)", "} (operator:none)", "} (enum:async|deprecated)", "} (function:declaration|async)" }; @@ -124,50 +131,66 @@ public class ReturnDocumentTokensFromScratchForRangeData : TheoryData expectedTokens builder.Commit(); originalTokens = document.GetSemanticTokens(); builder = document.Edit( - new SemanticTokensDeltaParams { + new SemanticTokensDeltaParams + { PreviousResultId = document.Id, } ); @@ -209,7 +233,7 @@ IEnumerable expectedTokens var edit1Tokens = originalTokens.Data .RemoveRange(edit1.Start, edit1.DeleteCount) - .InsertRange(edit1.Start, edit1.Data); + .InsertRange(edit1.Start, edit1.Data!); var edit1Data = Normalize(modifiedText, edit1Tokens).ToArray(); _logger.LogDebug("Some Data {Data}", edit1Data.AsEnumerable()); @@ -223,26 +247,36 @@ public ReturnDocumentEditsData() Add( ExampleDocumentText, ExampleDocumentText.Replace("namespace CSharpTutorials", "namespace Something.Else.Entirely"), - new NormalizedToken[] { - "using (macro:async|deprecated)", "System (macro:async|deprecated)", "using (event:none)", "System (number:none)", "Collections (struct:readonly)", - "Generic (class:none)", "using (variable:modification|defaultLibrary)", "System (comment:static|deprecated)", "Linq (comment:definition)", - "using (comment:none)", "System (enumMember:none)", "Text (comment:static|deprecated)", "using (comment:none)", "System (comment:declaration)", - "Threading (comment:static|defaultLibrary)", "Tasks (comment:none)", "namespace (property:defaultLibrary)", "Something (property:defaultLibrary)", - "Else (enum:deprecated)", "Entirely (operator:declaration|deprecated|modification)", "{ (struct:documentation)", "class (enumMember:none)", + new NormalizedToken[] + { + "using (macro:async|deprecated)", "System (macro:async|deprecated)", "using (event:none)", "System (number:none)", + "Collections (struct:readonly)", + "Generic (class:none)", "using (variable:modification|defaultLibrary)", "System (comment:static|deprecated)", + "Linq (comment:definition)", + "using (comment:none)", "System (enumMember:none)", "Text (comment:static|deprecated)", "using (comment:none)", + "System (comment:declaration)", + "Threading (comment:static|defaultLibrary)", "Tasks (comment:none)", "namespace (property:defaultLibrary)", + "Something (property:defaultLibrary)", + "Else (enum:deprecated)", "Entirely (operator:declaration|deprecated|modification)", "{ (struct:documentation)", + "class (enumMember:none)", "Program (comment:none)", "{ (comment:none)", "static (regexp:documentation)", "void (macro:none)", "Main (macro:none)", - "string[] (property:declaration|abstract)", "args (macro:none)", "{ (interface:documentation|declaration|deprecated)", "string (struct:none)", + "string[] (property:declaration|abstract)", "args (macro:none)", "{ (interface:documentation|declaration|deprecated)", + "string (struct:none)", "message (enum:none)", "= (label:none)", "Hello (comment:none)", "World!! (enum:none)", "Console (interface:static)", - "WriteLine (event:async|modification)", "message (interface:static)", "} (operator:none)", "} (enum:async|deprecated)", "} (function:declaration|async)" + "WriteLine (event:async|modification)", "message (interface:static)", "} (operator:none)", "} (enum:async|deprecated)", + "} (function:declaration|async)" } ); Add( "using", "using System;", - new NormalizedToken[] { + new NormalizedToken[] + { "using (macro:async|deprecated)", "System (macro:async|deprecated)" } ); Add( - "using System;", "using", new NormalizedToken[] { + "using System;", "using", new NormalizedToken[] + { "using (macro:async|deprecated)" } ); @@ -253,8 +287,11 @@ private class TokenizationValue { // ReSharper disable once UnusedAutoPropertyAccessor.Local public SemanticTokenType Type { get; set; } + // ReSharper disable once UnusedAutoPropertyAccessor.Local - public SemanticTokenModifier[] Modifiers { get; set; } = Array.Empty(); +#pragma warning disable CS8618 + public SemanticTokenModifier[] Modifiers { get; set; } +#pragma warning restore CS8618 } private void Tokenize(string document, SemanticTokensBuilder builder) @@ -276,7 +313,7 @@ private void Tokenize(string document, SemanticTokensBuilder builder) .OrNull(f, 0.2f) ); - foreach (var (line, text) in document.Split('\n').Select((text, line) => (line, text))) + foreach (var (line, text) in document.Split('\n').Select((text, line) => ( line, text ))) { var parts = text.TrimEnd().Split(';', ' ', '.', '"', '(', ')'); var index = 0; @@ -295,7 +332,7 @@ private void Tokenize(string document, SemanticTokensBuilder builder) else { // ensure range gets some love - builder.Push(((line, index), (line, part.Length + index)), item.Type, item.Modifiers); + builder.Push(( ( line, index ), ( line, part.Length + index ) ), item.Type, item.Modifiers); } } } @@ -326,7 +363,10 @@ public NormalizedToken(string text, SemanticTokenType type, params SemanticToken Modifiers = modifiers; } - public bool Equals(string? other) => string.Equals(ToString(), other); + public bool Equals(string? other) + { + return string.Equals(ToString(), other); + } public bool Equals(NormalizedToken? other) { @@ -342,7 +382,10 @@ public override bool Equals(object? obj) return obj.GetType() == GetType() && Equals((NormalizedToken)obj); } - public override int GetHashCode() => HashCode.Combine(Text, Type, Modifiers); + public override int GetHashCode() + { + return HashCode.Combine(Text, Type, Modifiers); + } public override string ToString() { @@ -373,9 +416,15 @@ public static implicit operator NormalizedToken(string value) ); } - public static bool operator ==(NormalizedToken left, NormalizedToken right) => Equals(left, right); + public static bool operator ==(NormalizedToken left, NormalizedToken right) + { + return Equals(left, right); + } - public static bool operator !=(NormalizedToken left, NormalizedToken right) => !Equals(left, right); + public static bool operator !=(NormalizedToken left, NormalizedToken right) + { + return !Equals(left, right); + } public string Text { get; } public SemanticTokenType Type { get; } @@ -386,8 +435,8 @@ public static implicit operator NormalizedToken(string value) { var parts = Decompose(values).ToArray(); return parts - .Select((item, index) => GetNormalizedToken(document, parts, index)) - .Where(z => z != null) + .Select((item, index) => GetNormalizedToken(document, parts, index)!) + .Where(z => z != null!) .ToArray(); } @@ -432,7 +481,7 @@ IReadOnlyList values { for (var i = 0; i < values.Count; i += 5) { - yield return (values[i], values[i + 1], values[i + 2], values[i + 3], values[i + 4]); + yield return ( values[i], values[i + 1], values[i + 2], values[i + 3], values[i + 4] ); } } diff --git a/test/Lsp.Tests/SemanticTokensLegendTests.cs b/test/Lsp.Tests/SemanticTokensLegendTests.cs index 48f962c46..8d376399d 100644 --- a/test/Lsp.Tests/SemanticTokensLegendTests.cs +++ b/test/Lsp.Tests/SemanticTokensLegendTests.cs @@ -2,7 +2,6 @@ using FluentAssertions; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; using Xunit; @@ -16,30 +15,34 @@ public void CustomBehavior_When_SymbolKind_Defined_By_Client() { var serializer = new LspSerializer(); serializer.SetClientCapabilities( - new ClientCapabilities { - TextDocument = new TextDocumentClientCapabilities { - SemanticTokens = new SemanticTokensCapability() { + new ClientCapabilities + { + TextDocument = new TextDocumentClientCapabilities + { + SemanticTokens = new SemanticTokensCapability + { DynamicRegistration = true, Formats = new Container(SemanticTokenFormat.Relative), MultilineTokenSupport = true, OverlappingTokenSupport = true, TokenModifiers = new Container(SemanticTokenModifier.Deprecated), TokenTypes = new Container(SemanticTokenType.Comment), - Requests = new SemanticTokensCapabilityRequests() { - Full = new SemanticTokensCapabilityRequestFull() { + Requests = new SemanticTokensCapabilityRequests + { + Full = new SemanticTokensCapabilityRequestFull + { Delta = true }, - Range = new SemanticTokensCapabilityRequestRange() { - } + Range = new SemanticTokensCapabilityRequestRange() } }, - } } ); var json = serializer.SerializeObject( - new SemanticTokensLegend { + new SemanticTokensLegend + { TokenModifiers = new Container(SemanticTokenModifier.Deprecated), TokenTypes = new Container(SemanticTokenType.Comment), } @@ -55,12 +58,16 @@ public void CustomBehavior_When_SymbolKind_Defined_By_Server() { var serializer = new LspSerializer(); serializer.SetServerCapabilities( - new ServerCapabilities { - SemanticTokensProvider = new SemanticTokensRegistrationOptions.StaticOptions() { - Full = new SemanticTokensCapabilityRequestFull { + new ServerCapabilities + { + SemanticTokensProvider = new SemanticTokensRegistrationOptions.StaticOptions + { + Full = new SemanticTokensCapabilityRequestFull + { Delta = true }, - Legend = new SemanticTokensLegend { + Legend = new SemanticTokensLegend + { TokenModifiers = new Container(SemanticTokenModifier.Deprecated), TokenTypes = new Container(SemanticTokenType.Comment), }, @@ -70,7 +77,8 @@ public void CustomBehavior_When_SymbolKind_Defined_By_Server() ); var json = serializer.SerializeObject( - new SemanticTokensLegend { + new SemanticTokensLegend + { TokenModifiers = new Container(SemanticTokenModifier.Deprecated), TokenTypes = new Container(SemanticTokenType.Comment), } diff --git a/test/Lsp.Tests/SupportedCapabilitiesFixture.cs b/test/Lsp.Tests/SupportedCapabilitiesFixture.cs index 030681472..1df0e5a83 100644 --- a/test/Lsp.Tests/SupportedCapabilitiesFixture.cs +++ b/test/Lsp.Tests/SupportedCapabilitiesFixture.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Shared; using OmniSharp.Extensions.LanguageServer.Shared; @@ -18,9 +14,15 @@ private class AlwaysTrueSupportedCapabilities : SupportedCapabilitiesBase, ISupp { // ReSharper disable once UnusedParameter.Local // ReSharper disable once UnusedMember.Local - public bool AllowsDynamicRegistration(ILspHandlerDescriptor descriptor) => true; + public bool AllowsDynamicRegistration(ILspHandlerDescriptor descriptor) + { + return true; + } - public bool AllowsDynamicRegistration(Type capabilityType) => true; + public bool AllowsDynamicRegistration(Type capabilityType) + { + return true; + } protected override bool TryGetCapability(Type capabilityType, [NotNullWhen(true)] out object? capability) { @@ -33,9 +35,15 @@ private class AlwaysFalseSupportedCapabilities : SupportedCapabilitiesBase, ISup { // ReSharper disable once UnusedParameter.Local // ReSharper disable once UnusedMember.Local - public bool AllowsDynamicRegistration(ILspHandlerDescriptor descriptor) => false; + public bool AllowsDynamicRegistration(ILspHandlerDescriptor descriptor) + { + return false; + } - public bool AllowsDynamicRegistration(Type capabilityType) => false; + public bool AllowsDynamicRegistration(Type capabilityType) + { + return false; + } protected override bool TryGetCapability(Type capabilityType, [NotNullWhen(true)] out object? capability) { diff --git a/test/TestingUtils/AutoNSubstitute/TestLogger.cs b/test/TestingUtils/AutoNSubstitute/TestLogger.cs index bf9a8f3dc..e974b4405 100644 --- a/test/TestingUtils/AutoNSubstitute/TestLogger.cs +++ b/test/TestingUtils/AutoNSubstitute/TestLogger.cs @@ -2,13 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Reactive.Disposables; -using Castle.DynamicProxy.Contributors; using Microsoft.Extensions.Logging; // ReSharper disable once CheckNamespace namespace NSubstitute { - class TestLogger : ILogger + internal class TestLogger : ILogger { private readonly IEnumerable _loggers; diff --git a/test/TestingUtils/AutoNSubstitute/TestLoggerFactory.cs b/test/TestingUtils/AutoNSubstitute/TestLoggerFactory.cs index efc57e822..4840f5393 100644 --- a/test/TestingUtils/AutoNSubstitute/TestLoggerFactory.cs +++ b/test/TestingUtils/AutoNSubstitute/TestLoggerFactory.cs @@ -4,7 +4,6 @@ using System.Reactive.Subjects; using System.Threading; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions.Internal; using Serilog; using Serilog.Events; using Serilog.Extensions.Logging; @@ -42,7 +41,7 @@ public TestLoggerFactory( ILogger ILoggerFactory.CreateLogger(string categoryName) { return _additionalLoggerProviders.Count > 0 - ? new TestLogger(new [] { _loggerProvider }.Concat(_additionalLoggerProviders).Select(z => z.CreateLogger(categoryName))) + ? new TestLogger(new[] { _loggerProvider }.Concat(_additionalLoggerProviders).Select(z => z.CreateLogger(categoryName))) : _loggerProvider.CreateLogger(categoryName); } @@ -75,11 +74,20 @@ public void Swap(ITestOutputHelper testOutputHelper) Interlocked.Exchange(ref _testOutputHelper, testOutputHelper); } - public void WriteLine(string message) => _testOutputHelper?.WriteLine(message); + public void WriteLine(string message) + { + _testOutputHelper?.WriteLine(message); + } - public void WriteLine(string format, params object[] args) => _testOutputHelper?.WriteLine(format, args); + public void WriteLine(string format, params object[] args) + { + _testOutputHelper?.WriteLine(format, args); + } } - public IDisposable Subscribe(IObserver observer) => _subject.Subscribe(observer); + public IDisposable Subscribe(IObserver observer) + { + return _subject.Subscribe(observer); + } } } diff --git a/test/TestingUtils/FactWithSkipOnAttribute.cs b/test/TestingUtils/FactWithSkipOnAttribute.cs index ba1122eca..212dfd786 100644 --- a/test/TestingUtils/FactWithSkipOnAttribute.cs +++ b/test/TestingUtils/FactWithSkipOnAttribute.cs @@ -1,5 +1,4 @@ -ο»Ώusing System.Collections; -using System.Linq; +ο»Ώusing System.Linq; using Xunit; namespace TestingUtils diff --git a/test/TestingUtils/RetryTheoryAttribute.cs b/test/TestingUtils/RetryTheoryAttribute.cs index c8181eafa..bbd11ebef 100644 --- a/test/TestingUtils/RetryTheoryAttribute.cs +++ b/test/TestingUtils/RetryTheoryAttribute.cs @@ -1,8 +1,6 @@ // See https://github.com/JoshKeegan/xRetry using System; -using System.Linq; -using System.Reflection; using Xunit.Sdk; namespace TestingUtils @@ -15,7 +13,11 @@ namespace TestingUtils [AttributeUsage(AttributeTargets.Method)] public class RetryTheoryAttribute : RetryFactAttribute { - /// - public RetryTheoryAttribute(int maxRetries = 3, int delayBetweenRetriesMs = 0, params SkipOnPlatform[] skipOn) : base(maxRetries, delayBetweenRetriesMs, skipOn) { } + /// + public RetryTheoryAttribute(int maxRetries = 3, int delayBetweenRetriesMs = 0, params SkipOnPlatform[] skipOn) : base( + maxRetries, delayBetweenRetriesMs, skipOn + ) + { + } } } From 03cdd0032224cebda7773c91683944974bbac6ff Mon Sep 17 00:00:00 2001 From: LazyTaz <56768449+LazyTaz@users.noreply.github.com> Date: Thu, 28 Apr 2022 05:57:08 +0200 Subject: [PATCH 025/647] Update lsp.md (#774) "oin" -> "on" --- docs/lsp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lsp.md b/docs/lsp.md index 305ad1f2b..49267c860 100644 --- a/docs/lsp.md +++ b/docs/lsp.md @@ -5,7 +5,7 @@ The goal of this library is to implement [Language Server Protocol](https://micr Included in this library is a full-fidelity `LanguageServer` but also full `LanguageClient` implementation that could be implemented in an editor, but mainly it is used to help make Unit Testing easier, more consistent (and maybe even fun!). # Concepts -The language server is built oin a few concepts. At it's core is the [MediatR](https://github.com/jbogard/MediatR) library that you will build language specific handlers around. Around that core is a bunch of knowledge of the LSP protocol +The language server is built on a few concepts. At it's core is the [MediatR](https://github.com/jbogard/MediatR) library that you will build language specific handlers around. Around that core is a bunch of knowledge of the LSP protocol with the goal of making it more ".NET" like and less protocol centric. LSP revolves around features ( eg Completion, Hover, etc ) that define the inputs (request object) the outputs (response object) as well as Client Capabilities and Server Registration Options. From 897b5f0b68cb0d28da834b78def9cda28ad776d3 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Wed, 27 Apr 2022 23:57:59 -0400 Subject: [PATCH 026/647] Switched to new central package versioning (#817) --- .build/Solution.cs | 85 ++++- .editorconfig | 6 - .github/dependabot.yml | 28 -- .github/label-commenter-dependabot.yml | 5 - .github/labels.yml | 114 +++--- .github/renovate.json | 196 +++++++++++ .github/workflows/ci-ignore.yml | 80 +++++ .github/workflows/ci.yml | 47 ++- .github/workflows/close-milestone.yml | 12 +- .github/workflows/dependabot-merge.yml | 62 +++- .github/workflows/draft-release.yml | 52 +-- .github/workflows/publish-nuget.yml | 38 ++ .github/workflows/sync-labels.yml | 13 +- .github/workflows/update-milestone.yml | 37 +- .husky/pre-commit | 2 + Directory.Build.props | 19 +- Directory.Build.targets | 47 +-- Directory.Packages.props | 63 ++++ Directory.Packages.supports.props | 15 + LSP.sln | 2 + benchmarks/Pipeline/Pipeline.csproj | 2 +- sample/SampleServer/SampleServer.csproj | 22 +- sample/SampleServer/TextDocumentHandler.cs | 2 + src/.editorconfig | 2 + src/Client/Client.csproj | 13 +- src/Dap.Client/Dap.Client.csproj | 7 +- .../Dap.Protocol.Proposals.csproj | 9 +- src/Dap.Protocol/Dap.Protocol.csproj | 29 +- .../Feature/Requests/ThreadsFeature.cs | 1 + src/Dap.Server/Dap.Server.csproj | 7 +- src/Dap.Shared/Dap.Shared.csproj | 15 +- src/Dap.Testing/Dap.Testing.csproj | 10 +- src/JsonRpc.Testing/JsonRpc.Testing.csproj | 8 +- src/JsonRpc/DryIoc/DryIocAdapter.cs | 328 +++++++++--------- .../DryIocServiceProviderCapabilities.cs | 46 +++ .../DryIoc/DryIocServiceProviderFactory.cs | 119 ++++--- src/JsonRpc/DryIoc/DryIocServiceScope.cs | 32 +- .../DryIoc/DryIocServiceScopeFactory.cs | 10 +- src/JsonRpc/JsonRpc.csproj | 2 +- src/JsonRpc/JsonRpcServerContainer.cs | 2 +- ...sonRpcServerServiceCollectionExtensions.cs | 16 +- .../Protocol.Proposals.csproj | 13 +- .../Document/SemanticTokensBuilder.cs | 2 +- .../Document/SemanticTokensDocument.cs | 2 +- src/Protocol/Protocol.csproj | 25 +- .../RangeOrPlaceholderRangeConverter.cs | 2 +- .../Converters/TextEditConverter.cs | 2 +- src/Protocol/Usings.global.cs | 1 + src/Server/Server.csproj | 13 +- src/Shared/Shared.csproj | 13 +- src/Testing/TestContent.cs | 2 +- src/Testing/TestSourceHelpers.cs | 2 +- src/Testing/Testing.csproj | 10 +- src/Testing/Usings.global.cs | 1 + test/.editorconfig | 45 +-- test/Client.Tests/ClientTests.cs | 1 + .../GeneratedRegistrationOptionsTests.cs | 5 +- .../TypedCanBeResolvedTests.cs | 4 - .../ExecuteCommandTests.cs | 2 +- .../ExecuteTypedCommandTests.cs | 2 +- .../Lsp.Integration.Tests.csproj | 10 +- test/Lsp.Integration.Tests/RenameTests.cs | 2 +- test/Lsp.Integration.Tests/Usings.global.cs | 1 + test/Lsp.Tests/Lsp.Tests.csproj | 10 +- ...rTestsRequestHandlerOfTRequestTResponse.cs | 1 - .../Models/ApplyWorkspaceEditParamsTests.cs | 1 - .../Lsp.Tests/Models/CodeActionParamsTests.cs | 2 +- test/Lsp.Tests/Models/DiagnosticTests.cs | 2 +- test/Lsp.Tests/Models/DocumentLinkTests.cs | 2 +- .../Models/DocumentSymbolInformationTests.cs | 2 +- .../Models/LocationOrLocationLinksTests.cs | 2 +- test/Lsp.Tests/Models/LocationTests.cs | 2 +- .../Models/PublishDiagnosticsParamsTests.cs | 2 +- .../Lsp.Tests/Models/TextDocumentEditTests.cs | 2 +- test/Lsp.Tests/Models/WorkspaceEditTests.cs | 2 +- .../Models/WorkspaceSymbolInformationTests.cs | 2 +- test/Lsp.Tests/SemanticTokensDocumentTests.cs | 2 +- test/Lsp.Tests/Usings.global.cs | 1 + .../AutoNSubstitute/DryIocExtensions.cs | 4 +- .../AutoNSubstitute/TestLogger.cs | 2 +- test/TestingUtils/TestingUtils.csproj | 2 +- 81 files changed, 1224 insertions(+), 584 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/label-commenter-dependabot.yml create mode 100644 .github/renovate.json create mode 100644 .github/workflows/ci-ignore.yml create mode 100644 .github/workflows/publish-nuget.yml create mode 100644 Directory.Packages.props create mode 100644 Directory.Packages.supports.props create mode 100644 src/.editorconfig create mode 100644 src/JsonRpc/DryIoc/DryIocServiceProviderCapabilities.cs create mode 100644 src/Protocol/Usings.global.cs create mode 100644 src/Testing/Usings.global.cs create mode 100644 test/Lsp.Integration.Tests/Usings.global.cs create mode 100644 test/Lsp.Tests/Usings.global.cs diff --git a/.build/Solution.cs b/.build/Solution.cs index 83230b184..15cf58c19 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -1,10 +1,48 @@ using System.Collections.Generic; using System.Linq; using Nuke.Common.CI.GitHubActions; +using Nuke.Common.CI.GitHubActions.Configuration; using Rocket.Surgery.Nuke.ContinuousIntegration; using Rocket.Surgery.Nuke.DotNetCore; using Rocket.Surgery.Nuke.GithubActions; + +internal class LocalConstants +{ + public static string[] PathsIgnore = + { + ".codecov.yml", + ".editorconfig", + ".gitattributes", + ".gitignore", + ".gitmodules", + ".lintstagedrc.js", + ".prettierignore", + ".prettierrc", + "LICENSE", + "nukeeper.settings.json", + "omnisharp.json", + "package-lock.json", + "package.json", + "Readme.md", + ".github/dependabot.yml", + ".github/labels.yml", + ".github/release.yml", + ".github/renovate.json", + }; +} + +[GitHubActionsSteps( + "ci-ignore", + GitHubActionsImage.WindowsLatest, + GitHubActionsImage.UbuntuLatest, + AutoGenerate = false, + On = new[] { GitHubActionsTrigger.Push }, + OnPushTags = new[] { "v*" }, + OnPushBranches = new[] { "master", "main", "next" }, + OnPullRequestBranches = new[] { "master", "main", "next" }, + Enhancements = new[] { nameof(CiIgnoreMiddleware) } +)] [GitHubActionsSteps( "ci", GitHubActionsImage.MacOsLatest, @@ -27,7 +65,7 @@ nameof(Default) }, ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) }, - Enhancements = new[] { nameof(Middleware) } + Enhancements = new[] { nameof(CiMiddleware) } )] [PrintBuildVersion] [PrintCIEnvironment] @@ -35,8 +73,36 @@ [TitleEvents] public partial class Solution { - public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGitHubActionsConfiguration configuration) + public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware( + RocketSurgeonGitHubActionsConfiguration configuration + ) { + foreach (var item in configuration.DetailedTriggers.OfType()) + { + item.IncludePaths = LocalConstants.PathsIgnore; + } + + configuration.Jobs.RemoveAt(1); + ( (RocketSurgeonsGithubActionsJob)configuration.Jobs[0] ).Steps = new List + { + new RunStep("N/A") + { + Run = "echo \"No build required\"" + } + }; + + return configuration; + } + + public static RocketSurgeonGitHubActionsConfiguration CiMiddleware( + RocketSurgeonGitHubActionsConfiguration configuration + ) + { + foreach (var item in configuration.DetailedTriggers.OfType()) + { + item.ExcludePaths = LocalConstants.PathsIgnore; + } + var buildJob = configuration.Jobs.OfType().First(z => z.Name == "Build"); buildJob.FailFast = false; var checkoutStep = buildJob.Steps.OfType().Single(); @@ -44,7 +110,8 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi checkoutStep.FetchDepth = 0; buildJob.Environment["NUGET_PACKAGES"] = "${{ github.workspace }}/.nuget/packages"; buildJob.Steps.InsertRange( - buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] + buildJob.Steps.IndexOf(checkoutStep) + 1, + new BaseGitHubActionsStep[] { new RunStep("Fetch all history for all tags and branches") { @@ -58,7 +125,7 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi ["path"] = "${{ github.workspace }}/.nuget/packages", // keep in mind using central package versioning here ["key"] = - "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Build.targets', '**/Directory.Build.props', '**/*.csproj') }}", + "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}", ["restore-keys"] = @"| ${{ runner.os }}-nuget-" } @@ -81,7 +148,6 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi With = new Dictionary { ["name"] = "actions-${{ matrix.os }}", - ["fail_ci_if_error"] = "true", } } ); @@ -122,6 +188,15 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi } ); + buildJob.Steps.Add( + new UploadArtifactStep("Publish Docs") + { + Name = "docs", + Path = "artifacts/docs/", + If = "always()" + } + ); + return configuration; } } diff --git a/.editorconfig b/.editorconfig index 737469427..bb7e8b5d2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1009,12 +1009,6 @@ resharper_web_config_type_not_resolved_highlighting = warning resharper_web_config_wrong_module_highlighting = warning resharper_partial_type_with_single_part_highlighting = none -# .NET Analzyer settings -# VSTHRD200: Use "Async" suffix for awaitable methods -dotnet_diagnostic.VSTHRD200.severity = none -# CA2007: Do not directly await a Task -dotnet_diagnostic.CA2007.severity = error - ij_xml_align_attributes = true ij_xml_align_text = false ij_xml_attribute_wrap = normal diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index eba8bd573..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -updates: - - package-ecosystem: 'github-actions' - directory: '/' - schedule: - interval: 'daily' - assignees: - - 'david-driscoll' - open-pull-requests-limit: 100 - - - package-ecosystem: 'npm' - directory: '/' - schedule: - interval: 'daily' - assignees: - - 'david-driscoll' - open-pull-requests-limit: 100 - - - package-ecosystem: 'nuget' - directory: '/' - schedule: - interval: 'daily' - assignees: - - 'david-driscoll' - ignore: - - dependency-name: Microsoft.Extensions.* - - dependency-name: Microsoft.AspNetCore.* - open-pull-requests-limit: 100 diff --git a/.github/label-commenter-dependabot.yml b/.github/label-commenter-dependabot.yml deleted file mode 100644 index 0e71df27b..000000000 --- a/.github/label-commenter-dependabot.yml +++ /dev/null @@ -1,5 +0,0 @@ -labels: - - name: 'merge' - labeled: - pr: - body: '@dependabot squash and merge' diff --git a/.github/labels.yml b/.github/labels.yml index a94e5d5d9..bee0d5482 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,54 +1,66 @@ -- name: "bug" - color: "d73a4a" +- name: 'bug' + color: 'd73a4a' description: "Something isn't working" -- name: "documentation" +- name: 'documentation' color: 0075ca - description: "Improvements or additions to documentation" -- name: "duplicate" - color: "cfd3d7" - description: "This issue or pull request already exists" -- name: "enhancement" - color: "a2eeef" - description: "New feature or request" -- name: "help wanted" - color: "008672" - description: "Extra attention is needed" -- name: "good first issue" - color: "7057ff" - description: "Good for newcomers" -- name: "invalid" - color: "e4e669" + description: 'Improvements or additions to documentation' +- name: 'duplicate' + color: 'cfd3d7' + description: 'This issue or pull request already exists' +- name: 'enhancement' + color: 'a2eeef' + description: 'New feature or request' +- name: 'help wanted' + color: '008672' + description: 'Extra attention is needed' +- name: 'good first issue' + color: '7057ff' + description: 'Good for newcomers' +- name: 'invalid' + color: 'e4e669' description: "This doesn't seem right" -- name: "question" - color: "d876e3" - description: "Further information is requested" -- name: "wontfix" - color: "ffffff" - description: "This will not be worked on" -- name: "feature" - color: "ccf5ff" - description: "This adds some form of new functionality" -- name: "breaking change" - color: "efa7ae" - description: "This breaks existing behavior" -- name: "mysterious" - color: "cccccc" - description: "We forgot to label this" -- name: "chore" - color: "27127c" - description: "Just keeping things neat and tidy" -- name: "dependencies" - color: "edc397" - description: "Pull requests that update a dependency file" -- name: "merge" - color: "98ed98" - description: "Shipit!" -- name: "deprecated" - color: "dd824d" - description: "Deprecated functionality" -- name: "removed" - color: "fce99f" - description: "Removed functionality" -- name: "security" - color: "cbce1e" - description: "Security related issue" +- name: 'question' + color: 'd876e3' + description: 'Further information is requested' +- name: 'wontfix' + color: 'ffffff' + description: 'This will not be worked on' +- name: 'feature' + color: 'ccf5ff' + description: 'This adds some form of new functionality' +- name: 'breaking change' + color: 'efa7ae' + description: 'This breaks existing behavior' +- name: 'mysterious' + color: 'cccccc' + description: 'We forgot to label this' +- name: 'chore' + color: '27127c' + description: 'Just keeping things neat and tidy' +- name: 'dependencies' + color: 'edc397' + description: 'Pull requests that update a dependency file' +- name: 'merge' + color: '98ed98' + description: 'Shipit!' +- name: 'deprecated' + color: 'dd824d' + description: 'Deprecated functionality' +- name: 'removed' + color: 'fce99f' + description: 'Removed functionality' +- name: 'security' + color: 'cbce1e' + description: 'Security related issue' +- name: 'private-dependencies' + color: 'edc397' + description: 'Private dependency' +- name: 'rebase' + color: 'ffcc66' + description: 'Rebase branch' +- name: 'stop updating' + color: '800000' + description: 'Stop Updating' +- name: 'blocked' + color: 'FF5600' + description: 'Issue is blocked waiting for something or someone' diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 000000000..1769b4f1d --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,196 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base", + ":automergePatch", + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":enableVulnerabilityAlertsWithLabel(:old_key: security)", + ":dependencyDashboard" + ], + "prHourlyLimit": 10, + "prConcurrentLimit": 0, + "hostRules": [ + { + "concurrentRequestLimit": 999 + } + ], + "platformAutomerge": true, + "automergeType": "pr", + "automergeStrategy": "rebase", + "rebaseWhen": "auto", + "labels": [":package: dependencies"], + "rebaseLabel": ":trident: rebase", + "stopUpdatingLabel": ":vertical_traffic_light: stop updating", + "github-actions": { + "fileMatch": ["(^workflow-templates|\\.github\\/workflows)\\/[^/]+\\.ya?ml$", "(^|\\/)action\\.ya?ml$"], + "automerge": true, + "groupName": "github actions", + "labels": [":truck: private-dependencies"] + }, + "packageRules": [ + { + "matchManagers": ["nuget"], + "groupName": "build dependencies", + "matchPackagePatterns": ["^Nuke.Common", "^Microsoft\\.NET\\.Test\\.Sdk$", "^Rocket\\.Surgery\\.MSBuild$", "^Rocket\\.Surgery\\.Nuke$"], + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^Roslynator"], + "groupName": "roslynator", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^FluentAssertions"], + "groupName": "fluentassertions", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^NSubstitute"], + "groupName": "nsubstitute", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^Moq"], + "groupName": "moq", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^FakeItEasy"], + "groupName": "fakeiteasy", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^coverlet"], + "groupName": "coverlet", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^Bogus"], + "groupName": "bogus", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^ReportGenerator", "^reportgenerator", "^dotnet-reportgenerator"], + "groupName": "reportgenerator", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^JetBrains", "^jetbrains"], + "groupName": "jetbrains", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^GitVersion", "^gitversion"], + "groupName": "gitversion", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^xunit"], + "groupName": "xunit", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^bunit"], + "groupName": "bunit", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^FluentValidation"], + "groupName": "fluentvalidation", + "labels": [":package: dependencies"], + "automerge": false + }, + { + "matchPackagePatterns": ["^NodaTime"], + "groupName": "nodatime", + "labels": [":package: dependencies"], + "automerge": false + }, + { + "matchPackagePatterns": ["^DryIoc"], + "groupName": "dryioc", + "labels": [":package: dependencies"], + "automerge": false + }, + { + "matchPackagePatterns": ["^FluentAssertions"], + "groupName": "fluentassertions", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchPackagePatterns": ["^Verify"], + "groupName": "verify", + "labels": [":truck: private-dependencies"], + "automerge": true + }, + { + "matchManagers": ["nuget"], + "matchPackagePatterns": ["^System\\.Collections\\.Immutable", "^System\\.Interactive", "^System\\.Reactive", "^Humanizer"], + "labels": [":package: dependencies"], + "automerge": true + }, + { + "matchSourceUrlPrefixes": ["https://github.com/RocketSurgeonsGuild"], + "labels": [":package: dependencies"], + "groupName": "Rocket Surgery Other" + }, + { + "matchSourceUrlPrefixes": ["https://github.com/RocketSurgeonsGuild/Conventions"], + "labels": [":package: dependencies"], + "groupName": "Rocket Surgery Conventions" + }, + { + "matchSourceUrlPrefixes": ["https://github.com/RocketSurgeonsGuild/Testing"], + "labels": [":truck: private-dependencies"], + "groupName": "Rocket Surgery Testing" + }, + { + "matchSourceUrlPrefixes": ["https://github.com/RocketSurgeonsGuild/Extensions"], + "labels": [":package: dependencies"], + "groupName": "Rocket Surgery Extensions" + }, + { + "description": "dotnet monorepo", + "groupName": "dotnet monorepo", + "enabled": false, + "matchSourceUrlPrefixes": [ + "https://github.com/dotnet/aspnetcore", + "https://github.com/dotnet/efcore", + "https://github.com/dotnet/extensions", + "https://github.com/dotnet/runtime" + ] + }, + { + "description": "dotnet monorepo [minor/patch]", + "groupName": "dotnet monorepo [minor/patch]", + "enabled": true, + "matchUpdateTypes": ["minor", "patch"], + "matchSourceUrlPrefixes": [ + "https://github.com/dotnet/aspnetcore", + "https://github.com/dotnet/efcore", + "https://github.com/dotnet/extensions", + "https://github.com/dotnet/runtime" + ] + }, + { + "description": "dotnet msbuild", + "groupName": "dotnet msbuild", + "matchSourceUrlPrefixes": ["https://github.com/dotnet/msbuild"] + } + ] +} diff --git a/.github/workflows/ci-ignore.yml b/.github/workflows/ci-ignore.yml new file mode 100644 index 000000000..a5c03cbb6 --- /dev/null +++ b/.github/workflows/ci-ignore.yml @@ -0,0 +1,80 @@ +# ------------------------------------------------------------------------------ +# +# +# This code was generated. +# +# - To turn off auto-generation set: +# +# [GitHubActionsSteps (AutoGenerate = false)] +# +# - To trigger manual generation invoke: +# +# nuke --generate-configuration GitHubActions_ci-ignore --host GitHubActions +# +# +# ------------------------------------------------------------------------------ + +name: ci-ignore + +on: + push: + branches: + - 'master' + - 'main' + - 'next' + tags: + - 'v*' + paths: + - '.codecov.yml' + - '.editorconfig' + - '.gitattributes' + - '.gitignore' + - '.gitmodules' + - '.lintstagedrc.js' + - '.prettierignore' + - '.prettierrc' + - 'LICENSE' + - 'nukeeper.settings.json' + - 'omnisharp.json' + - 'package-lock.json' + - 'package.json' + - 'Readme.md' + - '.github/dependabot.yml' + - '.github/labels.yml' + - '.github/release.yml' + - '.github/renovate.json' + pull_request: + branches: + - 'master' + - 'main' + - 'next' + paths: + - '.codecov.yml' + - '.editorconfig' + - '.gitattributes' + - '.gitignore' + - '.gitmodules' + - '.lintstagedrc.js' + - '.prettierignore' + - '.prettierrc' + - 'LICENSE' + - 'nukeeper.settings.json' + - 'omnisharp.json' + - 'package-lock.json' + - 'package.json' + - 'Readme.md' + - '.github/dependabot.yml' + - '.github/labels.yml' + - '.github/release.yml' + - '.github/renovate.json' + +jobs: + Build: + strategy: + matrix: + os: [windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: N/A + run: | + echo "No build required" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc540b305..cb85f7c67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,11 +24,49 @@ on: - 'next' tags: - 'v*' + paths-ignore: + - '.codecov.yml' + - '.editorconfig' + - '.gitattributes' + - '.gitignore' + - '.gitmodules' + - '.lintstagedrc.js' + - '.prettierignore' + - '.prettierrc' + - 'LICENSE' + - 'nukeeper.settings.json' + - 'omnisharp.json' + - 'package-lock.json' + - 'package.json' + - 'Readme.md' + - '.github/dependabot.yml' + - '.github/labels.yml' + - '.github/release.yml' + - '.github/renovate.json' pull_request: branches: - 'master' - 'main' - 'next' + paths-ignore: + - '.codecov.yml' + - '.editorconfig' + - '.gitattributes' + - '.gitignore' + - '.gitmodules' + - '.lintstagedrc.js' + - '.prettierignore' + - '.prettierrc' + - 'LICENSE' + - 'nukeeper.settings.json' + - 'omnisharp.json' + - 'package-lock.json' + - 'package.json' + - 'Readme.md' + - '.github/dependabot.yml' + - '.github/labels.yml' + - '.github/release.yml' + - '.github/renovate.json' jobs: Build: @@ -52,7 +90,7 @@ jobs: uses: actions/cache@v2 with: path: '${{ github.workspace }}/.nuget/packages' - key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Build.targets', '**/Directory.Build.props', '**/*.csproj') }}" + key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}" restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK @@ -82,7 +120,6 @@ jobs: uses: codecov/codecov-action@v1 with: name: 'actions-${{ matrix.os }}' - fail_ci_if_error: 'true' - name: 🏺 Publish logs if: always() uses: actions/upload-artifact@v2 @@ -107,6 +144,12 @@ jobs: with: name: 'nuget' path: 'artifacts/nuget/' + - name: 🏺 Publish Docs + if: always() + uses: actions/upload-artifact@v2 + with: + name: 'docs' + path: 'artifacts/docs/' Publish: needs: - Build diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index d0e2bc2c9..87f19af23 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -1,30 +1,32 @@ name: Close Milestone + on: release: types: - released + jobs: close_milestone: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.1 with: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.11 + uses: gittools/actions/gitversion/setup@v0.9.13 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.11 + uses: gittools/actions/gitreleasemanager/setup@v0.9.13 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.11 + uses: gittools/actions/gitversion/execute@v0.9.13 # Ensure the milestone exists - name: Create Milestone @@ -37,7 +39,7 @@ jobs: # move any issues to that milestone in the event the release is renamed - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.4 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.0 with: default-label: 'mysterious' github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }} diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml index 25aeaa680..5da81288a 100644 --- a/.github/workflows/dependabot-merge.yml +++ b/.github/workflows/dependabot-merge.yml @@ -4,34 +4,80 @@ on: pull_request_target: types: - labeled + - opened + - reopened + - closed + - synchronize jobs: comment: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest + if: | + (github.event.action == 'labeled' || github.event.action == 'opened' || github.event.action == 'reopened') steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" + - name: Dump job context env: JOB_CONTEXT: ${{ toJson(job) }} run: echo "$JOB_CONTEXT" + - name: Dump steps context env: STEPS_CONTEXT: ${{ toJson(steps) }} run: echo "$STEPS_CONTEXT" + - name: Dump runner context env: RUNNER_CONTEXT: ${{ toJson(runner) }} run: echo "$RUNNER_CONTEXT" - - uses: actions/checkout@v2.4.0 + + - name: GitHub Automerge + if: | + contains(github.event.pull_request.labels.*.name, ':shipit: merge') + || contains(github.event.pull_request.labels.*.name, 'javascript') + || contains(github.event.pull_request.labels.*.name, 'github-actions') + uses: alexwilson/enable-github-automerge-action@1.0.0 + continue-on-error: true with: - ref: master - - name: Dependabot Commenter + github-token: '${{ secrets.OMNISHARP_BOT_TOKEN }}' + merge-method: 'SQUASH' + + labeler: + runs-on: ubuntu-latest + if: | + (github.event.action == 'closed' || github.event.action == 'opened' || github.event.action == 'reopened') + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - name: Dump job context + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + + - name: Dump runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + + - name: GitHub Remove Labels if: | - (github.event.label.name == 'merge') && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]') - uses: peaceiris/actions-label-commenter@v1.10.0 + github.event.action == 'closed' + uses: actions-ecosystem/action-remove-labels@v1 with: - github_token: ${{ secrets.OMNISHARP_BOT_TOKEN }} - config_file: .github/label-commenter-dependabot.yml + labels: | + :shipit: merge + github-actions + javascript + .NET diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index c8ebd826a..4b97fa167 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -1,16 +1,20 @@ name: Create Milestone and Draft Release + on: push: branches: - master paths-ignore: - '**/*.md' + schedule: + - cron: '0 0 * * 4' + jobs: create_milestone_and_draft_release: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.1 with: fetch-depth: 0 @@ -18,18 +22,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.11 + uses: gittools/actions/gitversion/setup@v0.9.13 with: versionSpec: '5.x' - - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.11 - with: - versionSpec: '0.12.x' - - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.11 + uses: gittools/actions/gitversion/execute@v0.9.13 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 @@ -39,34 +38,19 @@ jobs: GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' continue-on-error: true - - name: Get Repo and Owner - shell: pwsh - id: repository - run: | - $parts = $ENV:GITHUB_REPOSITORY.Split('/') - echo "::set-output name=owner::$($parts[0])" - echo "::set-output name=repository::$($parts[1])" - - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.4 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.0 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Create Draft Release - shell: pwsh - run: | - dotnet gitreleasemanager create ` - -o "${{ steps.repository.outputs.owner }}" ` - -r "${{ steps.repository.outputs.repository }}" ` - --token "${{ secrets.OMNISHARP_BOT_TOKEN }}" ` - -m "v${{ steps.gitversion.outputs.majorMinorPatch }}" - - - name: Export Changelog - shell: pwsh - run: | - dotnet gitreleasemanager export ` - -o "${{ steps.repository.outputs.owner }}" ` - -r "${{ steps.repository.outputs.repository }}" ` - --token "${{ secrets.GITHUB_TOKEN }}" ` - -f CHANGELOG.md + - uses: ncipollo/release-action@v1 + with: + allowUpdates: true + generateReleaseNotes: true + draft: true + omitNameDuringUpdate: true + name: 'v${{ steps.gitversion.outputs.majorMinorPatch }}' + tag: 'v${{ steps.gitversion.outputs.majorMinorPatch }}' + token: ${{ secrets.OMNISHARP_BOT_TOKEN }} + commit: ${{ github.base_ref }} diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 000000000..586ed7dd5 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,38 @@ +name: Publish Nuget Packages + +on: + workflow_call: + # inputs: + secrets: + RSG_NUGET_API_KEY: + required: true + RSG_AZURE_DEVOPS: + required: false + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - uses: nuget/setup-nuget@v1 + with: + nuget-version: '5.x' + + - uses: actions/download-artifact@v3 + with: + name: nuget + + - name: nuget.org + # continue-on-error: true + if: startsWith(github.ref, 'refs/tags/') # this is the best approximation for a tag + env: + ApiKey: ${{ secrets.RSG_NUGET_API_KEY }} + shell: pwsh + run: | + dotnet nuget push **/*.nupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey + dotnet nuget push **/*.snupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 77fcaefb3..bc3c7ae8c 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -1,5 +1,7 @@ name: Sync Labels + on: + workflow_call: push: branches: - master @@ -14,14 +16,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.1 - name: Run Labeler if: success() uses: crazy-max/ghaction-github-labeler@v3.1.1 with: - yaml_file: .github/labels.yml - skip_delete: false - dry_run: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + yaml-file: .github/labels.yml + skip-delete: false + dry-run: false + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 7ba09e71f..49d50ba3e 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -1,4 +1,5 @@ name: Update Milestone + on: pull_request_target: types: @@ -12,10 +13,42 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.1 + with: + ref: ${{ github.sha }} + fetch-depth: 0 + + - name: Fetch all history for all tags and branches + run: git fetch --prune + + - name: Install GitVersion + if: ${{ github.event.action == 'opened' }} + uses: gittools/actions/gitversion/setup@v0.9.13 + with: + versionSpec: '5.x' + + - name: Install GitReleaseManager + if: ${{ github.event.action == 'opened' }} + uses: gittools/actions/gitreleasemanager/setup@v0.9.13 + with: + versionSpec: '0.11.x' + + - name: Use GitVersion + if: ${{ github.event.action == 'opened' }} + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.13 + + - name: Create Milestone + if: ${{ github.event.action == 'opened' }} + uses: WyriHaximus/github-action-create-milestone@v1 + with: + title: v${{ steps.gitversion.outputs.majorMinorPatch }} + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.2.4 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.0 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.husky/pre-commit b/.husky/pre-commit index d0879ca8c..3f6421029 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,5 +3,7 @@ npx lint-staged -d -r dotnet nuke --generate-configuration GitHubActions_ci --host GitHubActions +dotnet nuke --generate-configuration GitHubActions_ci-ignore --host GitHubActions git add .github/workflows/ci.yml +git add .github/workflows/ci-ignore.yml git add .nuke/build.schema.json diff --git a/Directory.Build.props b/Directory.Build.props index 0eaf54839..c824ab2bf 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,14 +14,21 @@ lsp;language server;language server protocol;language client;language server client $(MSBuildThisFileDirectory)\lsp.snk + AllEnabledByDefault + preview + true true + 1 + true + enable true true snupkg true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb $(AllowedReferenceRelatedFileExtensions);.pdb @@ -29,11 +36,11 @@ diff --git a/Directory.Build.targets b/Directory.Build.targets index 6078ba62b..4cc7c05d3 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -4,48 +4,9 @@ $(BaseIntermediateOutputPath)\GeneratedFiles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 000000000..36683010e --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,63 @@ +ο»Ώ + + + $(BaseIntermediateOutputPath)\GeneratedFiles + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Directory.Packages.supports.props b/Directory.Packages.supports.props new file mode 100644 index 000000000..665086a69 --- /dev/null +++ b/Directory.Packages.supports.props @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/LSP.sln b/LSP.sln index 7ca6d6531..68d6c34bf 100644 --- a/LSP.sln +++ b/LSP.sln @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2F323ED5-E ProjectSection(SolutionItems) = preProject test\Directory.Build.props = test\Directory.Build.props test\Directory.Build.targets = test\Directory.Build.targets + test\.editorconfig = test\.editorconfig EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{AE4D7807-6F78-428C-A0D9-914BA583A104}" @@ -25,6 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{AE4D Directory.Build.props = Directory.Build.props nuget.config = nuget.config Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonRpc", "src\JsonRpc\JsonRpc.csproj", "{9AF43FA2-EF35-435E-B59E-724877E44DDA}" diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 17f69cce5..c20468ddb 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -1,7 +1,7 @@ - net472;netcoreapp3.1 + net472;netcoreapp3.1;net6.0 Exe false diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index 482852f5b..f793325cd 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -10,17 +10,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/sample/SampleServer/TextDocumentHandler.cs b/sample/SampleServer/TextDocumentHandler.cs index 701b67278..f3b6f9c2f 100644 --- a/sample/SampleServer/TextDocumentHandler.cs +++ b/sample/SampleServer/TextDocumentHandler.cs @@ -13,6 +13,8 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Server.WorkDone; using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + #pragma warning disable CS0618 diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 000000000..dc318009a --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,2 @@ +ο»Ώ[*] +dotnet_diagnostic.CA1014.severity = none diff --git a/src/Client/Client.csproj b/src/Client/Client.csproj index 14bd92c9e..ebf3ae955 100644 --- a/src/Client/Client.csproj +++ b/src/Client/Client.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.LanguageClient OmniSharp.Extensions.LanguageServer.Client @@ -9,14 +9,15 @@ - - - - + + + + - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Dap.Client/Dap.Client.csproj b/src/Dap.Client/Dap.Client.csproj index 1fe996a04..8997ffd64 100644 --- a/src/Dap.Client/Dap.Client.csproj +++ b/src/Dap.Client/Dap.Client.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Client OmniSharp.Extensions.DebugAdapter.Client @@ -9,11 +9,12 @@ - + - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj b/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj index 77f12517f..e03805d19 100644 --- a/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj +++ b/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj @@ -1,18 +1,19 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Proposals OmniSharp.Extensions.DebugAdapter.Protocol - Proposed Debug Adapter Protocol models, classes, interfaces and helper methods, that may or may not make it into the final spec + Proposed Debug Adapter Protocol models, classes, interfaces and helper methods, that may or may not make it into the final spec - + - + diff --git a/src/Dap.Protocol/Dap.Protocol.csproj b/src/Dap.Protocol/Dap.Protocol.csproj index 45920e504..4622960c4 100644 --- a/src/Dap.Protocol/Dap.Protocol.csproj +++ b/src/Dap.Protocol/Dap.Protocol.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.DebugAdapter OmniSharp.Extensions.DebugAdapter.Protocol @@ -9,29 +9,40 @@ - + - - + + - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs b/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs index 498ccf17b..9d5e6cb04 100644 --- a/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs +++ b/src/Dap.Protocol/Feature/Requests/ThreadsFeature.cs @@ -2,6 +2,7 @@ using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; +using Thread = OmniSharp.Extensions.DebugAdapter.Protocol.Models.Thread; // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.DebugAdapter.Protocol diff --git a/src/Dap.Server/Dap.Server.csproj b/src/Dap.Server/Dap.Server.csproj index e6847acd4..c3d82e895 100644 --- a/src/Dap.Server/Dap.Server.csproj +++ b/src/Dap.Server/Dap.Server.csproj @@ -1,7 +1,7 @@ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Server OmniSharp.Extensions.DebugAdapter.Server @@ -9,11 +9,12 @@ - + - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Dap.Shared/Dap.Shared.csproj b/src/Dap.Shared/Dap.Shared.csproj index 7b833c799..cabed9b52 100644 --- a/src/Dap.Shared/Dap.Shared.csproj +++ b/src/Dap.Shared/Dap.Shared.csproj @@ -1,25 +1,28 @@ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Shared OmniSharp.Extensions.DebugAdapter.Shared - - + + - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Dap.Testing/Dap.Testing.csproj b/src/Dap.Testing/Dap.Testing.csproj index fd64128ec..dec248cdd 100644 --- a/src/Dap.Testing/Dap.Testing.csproj +++ b/src/Dap.Testing/Dap.Testing.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Testing OmniSharp.Extensions.DebugAdapter.Testing @@ -9,9 +9,9 @@ - - - - + + + + diff --git a/src/JsonRpc.Testing/JsonRpc.Testing.csproj b/src/JsonRpc.Testing/JsonRpc.Testing.csproj index 5c6ce8413..d02e92518 100644 --- a/src/JsonRpc.Testing/JsonRpc.Testing.csproj +++ b/src/JsonRpc.Testing/JsonRpc.Testing.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.JsonRpc.Testing OmniSharp.Extensions.JsonRpc.Testing @@ -13,10 +13,12 @@ - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/JsonRpc/DryIoc/DryIocAdapter.cs b/src/JsonRpc/DryIoc/DryIocAdapter.cs index 2b30999fd..ca0e269b9 100644 --- a/src/JsonRpc/DryIoc/DryIocAdapter.cs +++ b/src/JsonRpc/DryIoc/DryIocAdapter.cs @@ -1,184 +1,188 @@ -using System; -using System.Collections.Generic; +ο»Ώusing System.Runtime.CompilerServices; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.JsonRpc; -// ReSharper disable once CheckNamespace -namespace DryIoc -{ +namespace DryIoc; - /// Adapts DryIoc container to be used as MS.DI service provider, plus provides the helpers - /// to simplify work with adapted container. - internal static class DryIocAdapter +/// Adapts DryIoc container to be used as MS.DI service provider, plus provides the helpers +/// to simplify work with adapted container. +internal static class DryIocAdapter +{ + /// Adapts passed to Microsoft.DependencyInjection conventions, + /// registers DryIoc implementations of and , + /// and returns NEW container. + /// + /// Source container to adapt. + /// (optional) Specify service descriptors or use later. + /// (optional) Custom registration action, should return true to skip normal registration. + /// (optional) Use DryIoc capability. + /// + /// (Reuse.Scoped) + /// + /// // applies the MS.DI rules and registers the infrastructure helpers and service collection to the container + /// var adaptedContainer = container.WithDependencyInjectionAdapter(services); + /// + /// // the container implements IServiceProvider + /// IServiceProvider serviceProvider = adaptedContainer; + /// + ///]]> + /// + /// You still need to Dispose adapted container at the end / application shutdown. + public static IContainer WithDependencyInjectionAdapter( + this IContainer container, + IEnumerable descriptors = null, + Func registerDescriptor = null, + RegistrySharing registrySharing = RegistrySharing.Share + ) { - /// Creates the container and the `IServiceProvider` because its implemented by `IContainer` - - /// you get simply the best of both worlds. - public static IContainer Create( - IEnumerable services, - Func? registerService = null) - { - var container = new Container(Rules.MicrosoftDependencyInjectionRules); - - container.Use(r => new DryIocServiceScopeFactory(r)); - container.Populate(services, registerService); - - return container; - } + if (container.Rules != Rules.MicrosoftDependencyInjectionRules) + container = container.With( + container.Rules.WithMicrosoftDependencyInjectionRules(), + container.ScopeContext, registrySharing, container.SingletonScope + ); + + var capabilities = new DryIocServiceProviderCapabilities(container); + var singletons = container.SingletonScope; +#if NET6_0_OR_GREATER + singletons.Use(capabilities); +#endif + singletons.Use(capabilities); + singletons.UseFactory(r => new DryIocServiceScopeFactory(r)); + + if (descriptors != null) + container.Populate(descriptors, registerDescriptor); + + return container; + } - /// Adapts passed to Microsoft.DependencyInjection conventions, - /// registers DryIoc implementations of and , - /// and returns NEW container. - /// - /// Source container to adapt. - /// (optional) Specify service descriptors or use later. - /// (optional) Custom registration action, should return true to skip normal registration. - /// - /// (Reuse.Scoped) - /// - /// var adaptedContainer = container.WithDependencyInjectionAdapter(services); - /// IServiceProvider serviceProvider = adaptedContainer; // the container implements IServiceProvider now - /// - ///]]> - /// - /// You still need to Dispose adapted container at the end / application shutdown. - public static IContainer WithDependencyInjectionAdapter(this IContainer container, - IEnumerable? descriptors = null, - Func? registerDescriptor = null) - { - if (container.Rules != Rules.MicrosoftDependencyInjectionRules) - container = container.With(rules => rules.WithMicrosoftDependencyInjectionRules()); + /// Sugar to create the DryIoc container and adapter populated with services + public static IServiceProvider CreateServiceProvider(this IServiceCollection services) => + new Container(DryIoc.Rules.MicrosoftDependencyInjectionRules).WithDependencyInjectionAdapter(services); - container.Use(r => new DryIocServiceScopeFactory(r)); + /// Adds services registered in to container + public static IContainer WithCompositionRoot(this IContainer container, Type compositionRootType) + { + container.Register(compositionRootType); + container.Resolve(compositionRootType); + return container; + } - // Registers service collection - if (descriptors != null) - container.Populate(descriptors, registerDescriptor); + /// Adds services registered in to container + public static IContainer WithCompositionRoot(this IContainer container) => + container.WithCompositionRoot(typeof(TCompositionRoot)); + + /// It does not really build anything, it just gets the `IServiceProvider` from the container. + public static IServiceProvider BuildServiceProvider(this IContainer container) => + container.GetServiceProvider(); + + /// Just gets the `IServiceProvider` from the container. + public static IServiceProvider GetServiceProvider(this IResolver container) => + container; + + /// Facade to consolidate DryIoc registrations in + /// The class will be created by container on Startup + /// to enable registrations with injected or full . + /// Adapted container Service provider + /// + /// (Reuse.Singleton); + /// r.Register(Reuse.Transient); + /// r.Register(Reuse.InCurrentScope); + /// } + /// } + /// ]]> + /// + public static IServiceProvider ConfigureServiceProvider(this IContainer container) => + container.WithCompositionRoot().GetServiceProvider(); + + /// Registers service descriptors into container. May be called multiple times with different service collections. + /// The container. + /// The service descriptors. + /// (optional) Custom registration action, should return true to skip normal registration. + /// + /// { + /// if (service.ServiceType == typeof(SomeService)) { + /// r.Register(Made.Of(() => CreateCustomService()), Reuse.Singleton); + /// return true; + /// }; + /// return false; // fallback to normal registrations for the rest of the descriptors. + /// }); + /// ]]> + /// + public static IContainer Populate( + this IContainer container, IEnumerable descriptors, + Func registerDescriptor = null + ) + { + if (registerDescriptor == null) + foreach (var descriptor in descriptors) + container.RegisterDescriptor(descriptor); + else + foreach (var descriptor in descriptors) + if (!registerDescriptor(container, descriptor)) + container.RegisterDescriptor(descriptor); + return container; + } - return container; - } + /// Converts the MS.DI ServiceLifetime into the corresponding `DryIoc.IReuse` + [MethodImpl((MethodImplOptions)256)] + public static IReuse ToReuse(this ServiceLifetime lifetime) => + lifetime == ServiceLifetime.Singleton ? Reuse.Singleton : + lifetime == ServiceLifetime.Scoped ? Reuse.ScopedOrSingleton : // see, that we have Reuse.ScopedOrSingleton here instead of Reuse.Scoped + Reuse.Transient; - /// Adds services registered in to container - public static IContainer WithCompositionRoot(this IContainer container, Type compositionRootType) + /// Unpacks the service descriptor to register the service in DryIoc container + public static void RegisterDescriptor(this IContainer container, ServiceDescriptor descriptor) + { + var serviceType = descriptor.ServiceType; + var implType = descriptor.ImplementationType; + if (implType != null) { - container.Register(compositionRootType); - container.Resolve(compositionRootType); - return container; + // ensure eventing handlers are pulled in automagically. + container.RegisterMany( + new [] {descriptor.ImplementationType}, + reuse: descriptor.Lifetime.ToReuse(), + serviceTypeCondition: type => type == descriptor.ImplementationType || type == descriptor.ServiceType || typeof(IEventingHandler).IsAssignableFrom(type) || typeof(IJsonRpcHandler).IsAssignableFrom(type), + nonPublicServiceTypes: true + ); } - - /// Adds services registered in to container - public static IContainer WithCompositionRoot(this IContainer container) => - container.WithCompositionRoot(typeof(TCompositionRoot)); - - /// It does not really build anything, it just gets the `IServiceProvider` from the container. - public static IServiceProvider BuildServiceProvider(this IContainer container) => - container.GetServiceProvider(); - - /// Just gets the `IServiceProvider` from the container. - public static IServiceProvider GetServiceProvider(this IResolver container) => - container; - - /// Facade to consolidate DryIoc registrations in - /// The class will be created by container on Startup - /// to enable registrations with injected or full . - /// Adapted container Service provider - /// - /// (Reuse.Singleton); - /// r.Register(Reuse.Transient); - /// r.Register(Reuse.InCurrentScope); - /// } - /// } - /// ]]> - /// - public static IServiceProvider ConfigureServiceProvider(this IContainer container) => - container.WithCompositionRoot().GetServiceProvider(); - - /// Registers service descriptors into container. May be called multiple times with different service collections. - /// The container. - /// The service descriptors. - /// (optional) Custom registration action, should return true to skip normal registration. - /// - /// { - /// if (service.ServiceType == typeof(SomeService)) { - /// r.Register(Made.Of(() => CreateCustomService()), Reuse.Singleton); - /// return true; - /// }; - /// return false; // fallback to normal registrations for the rest of the descriptors. - /// }); - /// ]]> - /// - public static IContainer Populate(this IContainer container, IEnumerable descriptors, - Func? registerDescriptor = null) + else if (descriptor.ImplementationFactory != null) { - if (registerDescriptor == null) - foreach (var descriptor in descriptors) - container.RegisterDescriptor(descriptor); - else - foreach (var descriptor in descriptors) - if (!registerDescriptor(container, descriptor)) - container.RegisterDescriptor(descriptor); - return container; + container.Register( + DelegateFactory.Of(descriptor.ImplementationFactory.ToFactoryDelegate, descriptor.Lifetime.ToReuse()), serviceType, + null, null, isStaticallyChecked: true + ); } - - /// Uses passed descriptor to register service in container: - /// maps DI Lifetime to DryIoc Reuse, - /// and DI registration type to corresponding DryIoc Register, RegisterDelegate or RegisterInstance. - /// The container. - /// Service descriptor. - public static void RegisterDescriptor(this IContainer container, ServiceDescriptor descriptor) + else { - if (descriptor.ImplementationType != null) + // ensure eventing handlers are pulled in automagically. + if (descriptor.ImplementationInstance is not IEnumerable + && descriptor.ImplementationInstance is IEventingHandler or IJsonRpcHandler) { - var reuse = descriptor.Lifetime == ServiceLifetime.Singleton ? Reuse.Singleton - : descriptor.Lifetime == ServiceLifetime.Scoped ? Reuse.Scoped - : Reuse.Transient; - - // ensure eventing handlers are pulled in automagically. - container.RegisterMany( - new [] {descriptor.ImplementationType}, - reuse: reuse, - serviceTypeCondition: type => type == descriptor.ImplementationType || type == descriptor.ServiceType || typeof(IEventingHandler).IsAssignableFrom(type) || typeof(IJsonRpcHandler).IsAssignableFrom(type), - nonPublicServiceTypes: true - ); - } - else if (descriptor.ImplementationFactory != null) - { - var reuse = descriptor.Lifetime == ServiceLifetime.Singleton ? Reuse.Singleton - : descriptor.Lifetime == ServiceLifetime.Scoped ? Reuse.Scoped - : Reuse.Transient; - - container.RegisterDelegate(true, descriptor.ServiceType, - descriptor.ImplementationFactory, - reuse - ); + var instance = descriptor.ImplementationInstance; + container.RegisterInstanceMany(instance, nonPublicServiceTypes: true); + container.TrackDisposable(instance); } else { - // ensure eventing handlers are pulled in automagically. - if (!(descriptor.ImplementationInstance is IEnumerable) && (descriptor.ImplementationInstance is IEventingHandler || descriptor.ImplementationInstance is IJsonRpcHandler)) - { - - container.RegisterInstanceMany( - descriptor.ImplementationInstance, - nonPublicServiceTypes: true - ); - } - else - { - container.RegisterInstance(true, descriptor.ServiceType, descriptor.ImplementationInstance); - } + var instance = descriptor.ImplementationInstance; + container.Register( + InstanceFactory.Of(instance), serviceType, + null, null, isStaticallyChecked: true + ); + container.TrackDisposable(instance); } } } diff --git a/src/JsonRpc/DryIoc/DryIocServiceProviderCapabilities.cs b/src/JsonRpc/DryIoc/DryIocServiceProviderCapabilities.cs new file mode 100644 index 000000000..c291ecc91 --- /dev/null +++ b/src/JsonRpc/DryIoc/DryIocServiceProviderCapabilities.cs @@ -0,0 +1,46 @@ +ο»Ώusing Microsoft.Extensions.DependencyInjection; + +namespace DryIoc; + +/// Wrapper of DryIoc `IsRegistered` and `Resolve` throwing the exception on unresolved type capabilities. +internal sealed class DryIocServiceProviderCapabilities : +#if NET6_0_OR_GREATER + IServiceProviderIsService, +#endif + ISupportRequiredService +{ + private readonly IContainer _container; + + /// Statefully wraps the passed + public DryIocServiceProviderCapabilities(IContainer container) => _container = container; + + /// + public bool IsService(Type serviceType) + { + // I am not fully comprehend but MS.DI considers asking for the open-generic type even if it is registered to return `false` + // Probably mixing here the fact that open type cannot be instantiated without providing the concrete type argument. + // But I think it is conflating two things and making the reasoning harder. + if (serviceType.IsGenericTypeDefinition) + return false; + + if ( +#if NET6_0_OR_GREATER + serviceType == typeof(IServiceProviderIsService) || +#endif + serviceType == typeof(ISupportRequiredService) || + serviceType == typeof(IServiceScopeFactory)) + return true; + + if (_container.IsRegistered(serviceType)) + return true; + + if (serviceType.IsGenericType && + _container.IsRegistered(serviceType.GetGenericTypeDefinition())) + return true; + + return _container.IsRegistered(serviceType, factoryType: FactoryType.Wrapper); + } + + /// + public object GetRequiredService(Type serviceType) => _container.Resolve(serviceType); +} \ No newline at end of file diff --git a/src/JsonRpc/DryIoc/DryIocServiceProviderFactory.cs b/src/JsonRpc/DryIoc/DryIocServiceProviderFactory.cs index 28b752b46..fde1de962 100644 --- a/src/JsonRpc/DryIoc/DryIocServiceProviderFactory.cs +++ b/src/JsonRpc/DryIoc/DryIocServiceProviderFactory.cs @@ -1,56 +1,77 @@ -ο»Ώusing System; -using Microsoft.Extensions.DependencyInjection; -// ReSharper disable once CheckNamespace +ο»Ώusing Microsoft.Extensions.DependencyInjection; -namespace DryIoc +namespace DryIoc; + +/// +/// This DryIoc is supposed to be used with generic `IHostBuilder` like this: +/// +/// +/// await CreateHostBuilder(args).Build().RunAsync(); +/// +/// Rules WithMyRules(Rules currentRules) => currentRules; +/// +/// public static IHostBuilder CreateHostBuilder(string[] args) => +/// Host.CreateDefaultBuilder(args) +/// .UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => WithMyRules(rules)))) +/// .ConfigureWebHostDefaults(webBuilder => +/// { +/// webBuilder.UseStartup(); +/// }); +/// } +/// ]]> +/// +/// Then register your services in `Startup.ConfigureContainer`. +/// +/// DON'T try to change the container rules there - they will be lost, +/// instead pass the pre-configured container to `DryIocServiceProviderFactory` as in example above. +/// By default container will use +/// +/// DON'T forget to add `services.AddControllers().AddControllersAsServices()` in `Startup.ConfigureServices` +/// in order to access DryIoc diagnostics for controllers, property-injection, etc. +/// +/// +internal class DryIocServiceProviderFactory : IServiceProviderFactory { - /// This DryIoc is supposed to be used with `IHostBuilder` like this: - /// - /// await CreateHostBuilder(args).Build().RunAsync(); - /// - /// public static IHostBuilder CreateHostBuilder(string[] args) => - /// Host.CreateDefaultBuilder(args) - /// .UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => WithMyRules(rules)))) - /// .ConfigureWebHostDefaults(webBuilder => - /// { - /// webBuilder.UseStartup(); - /// }); - /// } - /// ]]> - /// - /// Then register your services in `Startup.ConfigureContainer`. - /// - /// DON'T try to change the container rules there - they will be lost, - /// instead pass the pre-configured container to `DryIocServiceProviderFactory` as in example above. - /// - /// DON'T forget to add `services.AddControllers().AddControllersAsServices` in `Startup.ConfigureServices` - /// in order to access DryIoc diagnostics for controllers, property-injection, etc. - /// - /// That's probably ALL YOU NEED to do. + private readonly IContainer _container; + private readonly Func _registerDescriptor; + private readonly RegistrySharing _registrySharing; + + /// + /// We won't initialize the container here because it is logically expected to be done in `CreateBuilder`, + /// so the factory constructor is just saving some options to use later. /// - internal class DryIocServiceProviderFactory : IServiceProviderFactory + public DryIocServiceProviderFactory( + IContainer container = null, + Func registerDescriptor = null + ) : + this(container, RegistrySharing.CloneAndDropCache, registerDescriptor) { - private readonly IContainer? _container; - private readonly Func? _registerDescriptor; + } - /// Some options to push to `.WithDependencyInjectionAdapter(...)` - public DryIocServiceProviderFactory( - IContainer? container = null, - Func? registerDescriptor = null) - { - _container = container; // we won't initialize the container here because it is logically expected to be done in `CreateBuilder` - _registerDescriptor = registerDescriptor; - } + /// + /// `container` is the existing container which will be cloned with the MS.DI rules and its cache will be dropped, + /// unless the `registrySharing` is set to the `RegistrySharing.Share` or to `RegistrySharing.CloneButKeepCache`. + /// `registerDescriptor` is the custom service descriptor handler. + /// + public DryIocServiceProviderFactory( + IContainer container, RegistrySharing registrySharing, + Func registerDescriptor = null + ) + { + _container = container; + _registrySharing = registrySharing; + _registerDescriptor = registerDescriptor; + } - /// - public IContainer CreateBuilder(IServiceCollection services) => - (_container ?? new Container()).WithDependencyInjectionAdapter(services, _registerDescriptor); + /// + public IContainer CreateBuilder(IServiceCollection services) => + ( _container ?? new Container(Rules.MicrosoftDependencyInjectionRules) ) + .WithDependencyInjectionAdapter(services, _registerDescriptor, _registrySharing); - /// - public IServiceProvider CreateServiceProvider(IContainer container) => - container.BuildServiceProvider(); - } -} + /// + public IServiceProvider CreateServiceProvider(IContainer container) => + container.BuildServiceProvider(); +} \ No newline at end of file diff --git a/src/JsonRpc/DryIoc/DryIocServiceScope.cs b/src/JsonRpc/DryIoc/DryIocServiceScope.cs index d1951a5c5..b0688b136 100644 --- a/src/JsonRpc/DryIoc/DryIocServiceScope.cs +++ b/src/JsonRpc/DryIoc/DryIocServiceScope.cs @@ -1,24 +1,18 @@ -ο»Ώusing System; -using Microsoft.Extensions.DependencyInjection; -// ReSharper disable once CheckNamespace +ο»Ώusing Microsoft.Extensions.DependencyInjection; -namespace DryIoc +namespace DryIoc; + +/// Bare-bones IServiceScope implementations +internal sealed class DryIocServiceScope : IServiceScope { - /// Bare-bones IServiceScope implementations - internal sealed class DryIocServiceScope : IServiceScope - { - /// - public IServiceProvider ServiceProvider => _resolverContext; + /// + public IServiceProvider ServiceProvider => _resolverContext; - private readonly IResolverContext _resolverContext; + private readonly IResolverContext _resolverContext; - /// Creating from resolver context - public DryIocServiceScope(IResolverContext resolverContext) - { - _resolverContext = resolverContext; - } + /// Creating from resolver context + public DryIocServiceScope(IResolverContext resolverContext) => _resolverContext = resolverContext; - /// Disposes the underlying resolver context - public void Dispose() => _resolverContext.Dispose(); - } -} + /// Disposes the underlying resolver context + public void Dispose() => _resolverContext.Dispose(); +} \ No newline at end of file diff --git a/src/JsonRpc/DryIoc/DryIocServiceScopeFactory.cs b/src/JsonRpc/DryIoc/DryIocServiceScopeFactory.cs index f45a9e738..742855a28 100644 --- a/src/JsonRpc/DryIoc/DryIocServiceScopeFactory.cs +++ b/src/JsonRpc/DryIoc/DryIocServiceScopeFactory.cs @@ -1,4 +1,5 @@ ο»Ώusing Microsoft.Extensions.DependencyInjection; + // ReSharper disable once CheckNamespace namespace DryIoc @@ -10,17 +11,16 @@ internal sealed class DryIocServiceScopeFactory : IServiceScopeFactory /// Stores passed scoped container to open nested scope. /// Scoped container to be used to create nested scope. - public DryIocServiceScopeFactory(IResolverContext scopedResolver) - { - _scopedResolver = scopedResolver; - } + public DryIocServiceScopeFactory(IResolverContext scopedResolver) => _scopedResolver = scopedResolver; /// Opens scope and wraps it into DI interface. /// DI wrapper of opened scope. public IServiceScope CreateScope() { var r = _scopedResolver; - var scope = r.ScopeContext == null ? new Scope(r.CurrentScope) : r.ScopeContext.SetCurrent(p => new Scope(p)); + var scope = r.ScopeContext == null + ? Scope.Of(r.OwnCurrentScope) + : r.ScopeContext.SetCurrent(p => Scope.Of(p)); return new DryIocServiceScope(r.WithCurrentScope(scope)); } } diff --git a/src/JsonRpc/JsonRpc.csproj b/src/JsonRpc/JsonRpc.csproj index b347e0f6d..29782f6dc 100644 --- a/src/JsonRpc/JsonRpc.csproj +++ b/src/JsonRpc/JsonRpc.csproj @@ -1,6 +1,6 @@ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.JsonRpc OmniSharp.Extensions.JsonRpc diff --git a/src/JsonRpc/JsonRpcServerContainer.cs b/src/JsonRpc/JsonRpcServerContainer.cs index b69a102cf..ccc645e85 100644 --- a/src/JsonRpc/JsonRpcServerContainer.cs +++ b/src/JsonRpc/JsonRpcServerContainer.cs @@ -37,7 +37,7 @@ public static IContainer Create(IServiceProvider? outerServiceProvider) rules => rules.WithUnknownServiceResolvers( request => { var value = outerServiceProvider.GetService(request.ServiceType); - return value == null ? null : (Factory) new RegisteredInstanceFactory(value, Reuse.Transient); + return value == null ? null : (Factory) InstanceFactory.Of(value, Reuse.Transient); } ) ); diff --git a/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs b/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs index e61f8059c..c24bb27d2 100644 --- a/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs +++ b/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs @@ -49,23 +49,23 @@ internal static IContainer AddJsonRpcServerCore(this IContainer container, Js ); container.Register( - made: new Made.TypedMade().Parameters - .Type(serviceKey: nameof(options.MaximumRequestTimeout)) - .Type(serviceKey: nameof(options.SupportsContentModified)) - .Name("concurrency", serviceKey: nameof(options.Concurrency)), + made: Made.Of().Parameters + .Type(serviceKey: nameof(options.MaximumRequestTimeout)) + .Type(serviceKey: nameof(options.SupportsContentModified)) + .Name("concurrency", serviceKey: nameof(options.Concurrency)), reuse: Reuse.Singleton); if (!container.IsRegistered()) { container.Register( - made: new Made.TypedMade().Parameters - .Type(serviceKey: nameof(options.InputScheduler)), + made: Made.Of().Parameters + .Type(serviceKey: nameof(options.InputScheduler)), reuse: Reuse.Singleton); } container.Register( - made: new Made.TypedMade().Parameters - .Type(serviceKey: nameof(options.Input)) + made: Made.Of().Parameters + .Type(serviceKey: nameof(options.Input)) , reuse: Reuse.Singleton ); diff --git a/src/Protocol.Proposals/Protocol.Proposals.csproj b/src/Protocol.Proposals/Protocol.Proposals.csproj index b330ead61..2e61bfaed 100644 --- a/src/Protocol.Proposals/Protocol.Proposals.csproj +++ b/src/Protocol.Proposals/Protocol.Proposals.csproj @@ -1,19 +1,20 @@ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.LanguageProtocol.Proposals OmniSharp.Extensions.LanguageServer.Protocol - Proposed Language Server Protocol models, classes, interfaces and helper methods, that may or may not make it into the final spec + Proposed Language Server Protocol models, classes, interfaces and helper methods, that may or may not make it into the final spec - - - + + + - + diff --git a/src/Protocol/Features/Document/SemanticTokensBuilder.cs b/src/Protocol/Features/Document/SemanticTokensBuilder.cs index 87c26a98b..bdd5b94a9 100644 --- a/src/Protocol/Features/Document/SemanticTokensBuilder.cs +++ b/src/Protocol/Features/Document/SemanticTokensBuilder.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol.Document diff --git a/src/Protocol/Features/Document/SemanticTokensDocument.cs b/src/Protocol/Features/Document/SemanticTokensDocument.cs index a9d7e1155..562478f51 100644 --- a/src/Protocol/Features/Document/SemanticTokensDocument.cs +++ b/src/Protocol/Features/Document/SemanticTokensDocument.cs @@ -1,7 +1,7 @@ ο»Ώusing System; using System.Collections.Immutable; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol.Document diff --git a/src/Protocol/Protocol.csproj b/src/Protocol/Protocol.csproj index bedebe4d9..28fb52bfa 100644 --- a/src/Protocol/Protocol.csproj +++ b/src/Protocol/Protocol.csproj @@ -1,6 +1,6 @@ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.LanguageProtocol OmniSharp.Extensions.LanguageServer.Protocol @@ -15,23 +15,34 @@ - + - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs b/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs index 38887e41d..ff641aa77 100644 --- a/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs +++ b/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs @@ -2,7 +2,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters { diff --git a/src/Protocol/Serialization/Converters/TextEditConverter.cs b/src/Protocol/Serialization/Converters/TextEditConverter.cs index 7777a111a..69929db95 100644 --- a/src/Protocol/Serialization/Converters/TextEditConverter.cs +++ b/src/Protocol/Serialization/Converters/TextEditConverter.cs @@ -2,7 +2,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters { diff --git a/src/Protocol/Usings.global.cs b/src/Protocol/Usings.global.cs new file mode 100644 index 000000000..1f6c6a094 --- /dev/null +++ b/src/Protocol/Usings.global.cs @@ -0,0 +1 @@ +ο»Ώglobal using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; diff --git a/src/Server/Server.csproj b/src/Server/Server.csproj index 572abd66d..d3c5c310b 100644 --- a/src/Server/Server.csproj +++ b/src/Server/Server.csproj @@ -1,6 +1,6 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.LanguageServer OmniSharp.Extensions.LanguageServer.Server @@ -8,14 +8,15 @@ - - - - + + + + - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Shared/Shared.csproj b/src/Shared/Shared.csproj index b253a26d1..b42aa76a1 100644 --- a/src/Shared/Shared.csproj +++ b/src/Shared/Shared.csproj @@ -1,23 +1,26 @@ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.LanguageServer.Shared OmniSharp.Extensions.LanguageServer.Shared Shared classes for language server protocol - + - <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1>OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1 + >OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Testing/TestContent.cs b/src/Testing/TestContent.cs index a9c52d607..a8b0635e5 100644 --- a/src/Testing/TestContent.cs +++ b/src/Testing/TestContent.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace OmniSharp.Extensions.LanguageProtocol.Testing { diff --git a/src/Testing/TestSourceHelpers.cs b/src/Testing/TestSourceHelpers.cs index 5b3e588ec..8e06cbf47 100644 --- a/src/Testing/TestSourceHelpers.cs +++ b/src/Testing/TestSourceHelpers.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace OmniSharp.Extensions.LanguageProtocol.Testing { diff --git a/src/Testing/Testing.csproj b/src/Testing/Testing.csproj index 279eb835f..4ce49a710 100644 --- a/src/Testing/Testing.csproj +++ b/src/Testing/Testing.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0 + netstandard2.1;netstandard2.0;net6.0 AnyCPU OmniSharp.Extensions.LanguageProtocol.Testing OmniSharp.Extensions.LanguageProtocol.Testing @@ -9,9 +9,9 @@ - - - - + + + + diff --git a/src/Testing/Usings.global.cs b/src/Testing/Usings.global.cs new file mode 100644 index 000000000..1f6c6a094 --- /dev/null +++ b/src/Testing/Usings.global.cs @@ -0,0 +1 @@ +ο»Ώglobal using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; diff --git a/test/.editorconfig b/test/.editorconfig index c810d8b12..f1d0802e3 100644 --- a/test/.editorconfig +++ b/test/.editorconfig @@ -1,22 +1,27 @@ -[*] -dotnet_diagnostic.CA2007.severity = none -dotnet_diagnostic.CS0618.severity = none -dotnet_diagnostic.CS0168.severity = none -dotnet_diagnostic.CS0105.severity = none -dotnet_diagnostic.CS4014.severity = none -dotnet_diagnostic.CS0162.severity = none -dotnet_diagnostic.CS8602.severity = none -dotnet_diagnostic.CS8604.severity = none -dotnet_diagnostic.CS8618.severity = none -dotnet_diagnostic.CS8619.severity = none -dotnet_diagnostic.CS8620.severity = none -dotnet_diagnostic.CS8625.severity = none -dotnet_diagnostic.CS8762.severity = none -dotnet_diagnostic.CS8767.severity = none -dotnet_diagnostic.CS1998.severity = none -dotnet_diagnostic.VSTHRD003.severity = none -dotnet_diagnostic.VSTHRD103.severity = none -dotnet_diagnostic.VSTHRD105.severity = none -dotnet_diagnostic.VSTHRD110.severity = none +ο»Ώ[*] +dotnet_diagnostic.CS0436.severity = none +dotnet_diagnostic.CA1014.severity = none +dotnet_diagnostic.CA1034.severity = none +dotnet_diagnostic.CA1040.severity = none +dotnet_diagnostic.CA1062.severity = none +dotnet_diagnostic.CA1707.severity = none +dotnet_diagnostic.CA1711.severity = none +dotnet_diagnostic.CA1715.severity = none +dotnet_diagnostic.CA1720.severity = none +dotnet_diagnostic.CA1812.severity = none +dotnet_diagnostic.CA1822.severity = none +dotnet_diagnostic.CA1848.severity = none +dotnet_diagnostic.CA2000.severity = none +dotnet_diagnostic.CA2225.severity = none +dotnet_diagnostic.CA2227.severity = none +dotnet_diagnostic.CA2254.severity = none +dotnet_diagnostic.IDE0060.severity = none +dotnet_diagnostic.RCS1163.severity = none dotnet_diagnostic.VSTHRD200.severity = none +resharper_possible_multiple_enumeration_highlighting = none +resharper_template_is_not_compile_time_constant_problem_highlighting = none +resharper_inconsistent_naming_highlighting = none +resharper_variable_hides_outer_variable_highlighting = none resharper_unused_parameter_local_highlighting = none +resharper_unused_variable_highlighting = none +resharper_suspicious_type_conversion_global_highlighting = none diff --git a/test/Client.Tests/ClientTests.cs b/test/Client.Tests/ClientTests.cs index 650968289..6c31d0426 100644 --- a/test/Client.Tests/ClientTests.cs +++ b/test/Client.Tests/ClientTests.cs @@ -11,6 +11,7 @@ using Xunit.Abstractions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace OmniSharp.Extensions.LanguageServer.Client.Tests { /// diff --git a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs index 4c22321db..1ab1e1561 100644 --- a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs +++ b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs @@ -137,7 +137,7 @@ public async Task Supports_Generating_Strongly_Typed_Registration_Options() using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + #nullable enable namespace OmniSharp.Extensions.LanguageServer.Protocol.Test @@ -183,7 +183,6 @@ public partial class CodeActionRegistrationOptions using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; #nullable enable namespace OmniSharp.Extensions.LanguageServer.Protocol.Test @@ -257,7 +256,6 @@ public async Task Supports_Generating_Strongly_Typed_Registration_Options_With_C using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; #nullable enable namespace OmniSharp.Extensions.LanguageServer.Protocol.Test @@ -322,7 +320,6 @@ public override StaticCodeActionRegistrationOptions Convert(CodeActionRegistrati using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; #nullable enable diff --git a/test/Generation.Tests/TypedCanBeResolvedTests.cs b/test/Generation.Tests/TypedCanBeResolvedTests.cs index 2544f5fd7..e3512ef7e 100644 --- a/test/Generation.Tests/TypedCanBeResolvedTests.cs +++ b/test/Generation.Tests/TypedCanBeResolvedTests.cs @@ -25,7 +25,6 @@ public async Task Supports_Generating_Strongly_Typed_ICanBeResolved_Data() using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; #nullable enable namespace OmniSharp.Extensions.LanguageServer.Protocol.Test @@ -76,7 +75,6 @@ public partial record CodeLens : IRequest, ICanBeResolved using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Immutable; @@ -266,7 +264,6 @@ public async Task Supports_Generating_Strongly_Typed_Container() using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; #nullable enable namespace OmniSharp.Extensions.LanguageServer.Protocol.Test @@ -316,7 +313,6 @@ public partial class CodeLens : IRequest, ICanBeResolved using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Immutable; diff --git a/test/Lsp.Integration.Tests/ExecuteCommandTests.cs b/test/Lsp.Integration.Tests/ExecuteCommandTests.cs index 5cf75ae98..9066bf3a4 100644 --- a/test/Lsp.Integration.Tests/ExecuteCommandTests.cs +++ b/test/Lsp.Integration.Tests/ExecuteCommandTests.cs @@ -17,7 +17,7 @@ using Serilog.Events; using Xunit; using Xunit.Abstractions; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Integration.Tests { diff --git a/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs b/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs index b57001dc8..732a46dde 100644 --- a/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs +++ b/test/Lsp.Integration.Tests/ExecuteTypedCommandTests.cs @@ -17,7 +17,7 @@ using Serilog.Events; using Xunit; using Xunit.Abstractions; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Integration.Tests { diff --git a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj index 4962ff8ef..fcb489822 100644 --- a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj +++ b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0;netcoreapp3.1 + net6.0;netcoreapp3.1;net6.0 true AnyCPU @@ -19,6 +19,12 @@ - + diff --git a/test/Lsp.Integration.Tests/RenameTests.cs b/test/Lsp.Integration.Tests/RenameTests.cs index cffef9bc7..7c4d6be93 100644 --- a/test/Lsp.Integration.Tests/RenameTests.cs +++ b/test/Lsp.Integration.Tests/RenameTests.cs @@ -16,7 +16,7 @@ using TestingUtils; using Xunit; using Xunit.Abstractions; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Integration.Tests { diff --git a/test/Lsp.Integration.Tests/Usings.global.cs b/test/Lsp.Integration.Tests/Usings.global.cs new file mode 100644 index 000000000..1f6c6a094 --- /dev/null +++ b/test/Lsp.Integration.Tests/Usings.global.cs @@ -0,0 +1 @@ +ο»Ώglobal using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; diff --git a/test/Lsp.Tests/Lsp.Tests.csproj b/test/Lsp.Tests/Lsp.Tests.csproj index 4962ff8ef..fcb489822 100644 --- a/test/Lsp.Tests/Lsp.Tests.csproj +++ b/test/Lsp.Tests/Lsp.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0;netcoreapp3.1 + net6.0;netcoreapp3.1;net6.0 true AnyCPU @@ -19,6 +19,12 @@ - + diff --git a/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs b/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs index 0b4e8c6a2..e322ee26f 100644 --- a/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs +++ b/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs @@ -22,7 +22,6 @@ using Xunit.Abstractions; using Xunit.Sdk; using Arg = NSubstitute.Arg; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; using Request = OmniSharp.Extensions.JsonRpc.Server.Request; #pragma warning disable CS0162 diff --git a/test/Lsp.Tests/Models/ApplyWorkspaceEditParamsTests.cs b/test/Lsp.Tests/Models/ApplyWorkspaceEditParamsTests.cs index ec62c4c1c..9ac2f424c 100644 --- a/test/Lsp.Tests/Models/ApplyWorkspaceEditParamsTests.cs +++ b/test/Lsp.Tests/Models/ApplyWorkspaceEditParamsTests.cs @@ -7,7 +7,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/CodeActionParamsTests.cs b/test/Lsp.Tests/Models/CodeActionParamsTests.cs index cbe63cae8..d795dc4a6 100644 --- a/test/Lsp.Tests/Models/CodeActionParamsTests.cs +++ b/test/Lsp.Tests/Models/CodeActionParamsTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/DiagnosticTests.cs b/test/Lsp.Tests/Models/DiagnosticTests.cs index 735da6d6c..5af0bf2b3 100644 --- a/test/Lsp.Tests/Models/DiagnosticTests.cs +++ b/test/Lsp.Tests/Models/DiagnosticTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/DocumentLinkTests.cs b/test/Lsp.Tests/Models/DocumentLinkTests.cs index 92d65f404..a3ddedc5a 100644 --- a/test/Lsp.Tests/Models/DocumentLinkTests.cs +++ b/test/Lsp.Tests/Models/DocumentLinkTests.cs @@ -4,7 +4,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/DocumentSymbolInformationTests.cs b/test/Lsp.Tests/Models/DocumentSymbolInformationTests.cs index c0ff3b0da..07fed7f34 100644 --- a/test/Lsp.Tests/Models/DocumentSymbolInformationTests.cs +++ b/test/Lsp.Tests/Models/DocumentSymbolInformationTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/LocationOrLocationLinksTests.cs b/test/Lsp.Tests/Models/LocationOrLocationLinksTests.cs index 5d6a68457..300d1cb4a 100644 --- a/test/Lsp.Tests/Models/LocationOrLocationLinksTests.cs +++ b/test/Lsp.Tests/Models/LocationOrLocationLinksTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/LocationTests.cs b/test/Lsp.Tests/Models/LocationTests.cs index c3d6424f6..025db8316 100644 --- a/test/Lsp.Tests/Models/LocationTests.cs +++ b/test/Lsp.Tests/Models/LocationTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/PublishDiagnosticsParamsTests.cs b/test/Lsp.Tests/Models/PublishDiagnosticsParamsTests.cs index 8a5ae567b..c5e9e6bcd 100644 --- a/test/Lsp.Tests/Models/PublishDiagnosticsParamsTests.cs +++ b/test/Lsp.Tests/Models/PublishDiagnosticsParamsTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/TextDocumentEditTests.cs b/test/Lsp.Tests/Models/TextDocumentEditTests.cs index 9ee46bca0..9489f32ee 100644 --- a/test/Lsp.Tests/Models/TextDocumentEditTests.cs +++ b/test/Lsp.Tests/Models/TextDocumentEditTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/WorkspaceEditTests.cs b/test/Lsp.Tests/Models/WorkspaceEditTests.cs index 75334924d..964dd1561 100644 --- a/test/Lsp.Tests/Models/WorkspaceEditTests.cs +++ b/test/Lsp.Tests/Models/WorkspaceEditTests.cs @@ -7,7 +7,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/Models/WorkspaceSymbolInformationTests.cs b/test/Lsp.Tests/Models/WorkspaceSymbolInformationTests.cs index 24780de5f..a5105a878 100644 --- a/test/Lsp.Tests/Models/WorkspaceSymbolInformationTests.cs +++ b/test/Lsp.Tests/Models/WorkspaceSymbolInformationTests.cs @@ -5,7 +5,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using TestingUtils; using Xunit; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + namespace Lsp.Tests.Models { diff --git a/test/Lsp.Tests/SemanticTokensDocumentTests.cs b/test/Lsp.Tests/SemanticTokensDocumentTests.cs index 0c240ac45..41752c565 100644 --- a/test/Lsp.Tests/SemanticTokensDocumentTests.cs +++ b/test/Lsp.Tests/SemanticTokensDocumentTests.cs @@ -11,7 +11,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using Xunit; using Xunit.Abstractions; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; + #pragma warning disable 618 diff --git a/test/Lsp.Tests/Usings.global.cs b/test/Lsp.Tests/Usings.global.cs new file mode 100644 index 000000000..1f6c6a094 --- /dev/null +++ b/test/Lsp.Tests/Usings.global.cs @@ -0,0 +1 @@ +ο»Ώglobal using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; diff --git a/test/TestingUtils/AutoNSubstitute/DryIocExtensions.cs b/test/TestingUtils/AutoNSubstitute/DryIocExtensions.cs index d2ca14963..975f1aee3 100644 --- a/test/TestingUtils/AutoNSubstitute/DryIocExtensions.cs +++ b/test/TestingUtils/AutoNSubstitute/DryIocExtensions.cs @@ -35,7 +35,7 @@ internal static Rules WithTestLoggerResolver(this Rules rules, Func).MakeGenericType( request.ServiceType.GetGenericArguments()[0] ); - instance = new DelegateFactory(_ => creator(request, loggerType), Reuse.Singleton); + instance = DelegateFactory.Of(_ => creator(request, loggerType), Reuse.Singleton); dictionary.TryAdd(serviceType, instance); } @@ -66,7 +66,7 @@ internal static Rules WithUndefinedTestDependenciesResolver(this Rules rules, Fu if (!dictionary.TryGetValue(serviceType, out var instance)) { - instance = new DelegateFactory(_ => creator(request), Reuse.Singleton); + instance = DelegateFactory.Of(_ => creator(request), Reuse.Singleton); dictionary.TryAdd(serviceType, instance); } diff --git a/test/TestingUtils/AutoNSubstitute/TestLogger.cs b/test/TestingUtils/AutoNSubstitute/TestLogger.cs index e974b4405..cb777ed61 100644 --- a/test/TestingUtils/AutoNSubstitute/TestLogger.cs +++ b/test/TestingUtils/AutoNSubstitute/TestLogger.cs @@ -16,7 +16,7 @@ public TestLogger(IEnumerable loggers) _loggers = loggers; } - public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) { foreach (var logger in _loggers) { diff --git a/test/TestingUtils/TestingUtils.csproj b/test/TestingUtils/TestingUtils.csproj index 60d9e1d41..5f9c8393f 100644 --- a/test/TestingUtils/TestingUtils.csproj +++ b/test/TestingUtils/TestingUtils.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.0;netstandard2.1;net6.0 false From 0b83d2fa718aa89e431fcc429cff0aadf7646369 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 03:59:59 +0000 Subject: [PATCH 027/647] Update Rocket Surgery Other --- .azure-pipelines.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index fbef5d6f1..a8652a9ce 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -30,7 +30,7 @@ resources: - repository: rsg type: github name: RocketSurgeonsGuild/AzureDevopsTemplates - ref: refs/tags/v0.13.0 + ref: refs/tags/v0.13.1 endpoint: github variables: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb85f7c67..fb97522ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,4 +156,4 @@ jobs: secrets: RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}' RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}' - uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.0 + uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.1 diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 87f19af23..1a4925471 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -39,7 +39,7 @@ jobs: # move any issues to that milestone in the event the release is renamed - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.0 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.1 with: default-label: 'mysterious' github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }} diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 4b97fa167..c595988d5 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -39,7 +39,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.0 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.1 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 49d50ba3e..f67de7db9 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -48,7 +48,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.0 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.1 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} From ac02b367166536d45d75bbc7702a69e74907648b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 03:59:53 +0000 Subject: [PATCH 028/647] Pin dependencies --- vscode-testextension/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 7b4f7f137..a045417e5 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -46,10 +46,10 @@ "postinstall": "node ./node_modules/vscode/bin/install" }, "devDependencies": { - "@types/mocha": "^8.0.0", - "@types/node": "^14.0.25", - "typescript": "^3.9.7", - "vscode": "^1.1.37" + "@types/mocha": "8.0.0", + "@types/node": "14.0.25", + "typescript": "3.9.7", + "vscode": "1.1.37" }, "dependencies": { "vscode-languageclient": "^7.0.0-next.8", From 284160ef10c9c5d67e83b205113b6a1f9e48fdbf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 04:40:08 +0000 Subject: [PATCH 029/647] Update dependency nuke.globaltool to v6.0.2 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 74333ac0c..6322dd99a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "6.0.1", + "version": "6.0.2", "commands": [ "nuke" ] From d4dbd22b353e23d9a4bb41dc3761568ebd2c2244 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 04:41:27 +0000 Subject: [PATCH 030/647] Update dependency typescript to v3.9.10 --- vscode-testextension/package-lock.json | 6 +++--- vscode-testextension/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index deefca770..a3b636974 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -309,9 +309,9 @@ } }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true }, "vscode": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index a045417e5..fb7291b4a 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -48,7 +48,7 @@ "devDependencies": { "@types/mocha": "8.0.0", "@types/node": "14.0.25", - "typescript": "3.9.7", + "typescript": "3.9.10", "vscode": "1.1.37" }, "dependencies": { From cb1ae4af61e525818df6306f0b4f65495f87e1b2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 05:05:31 +0000 Subject: [PATCH 031/647] Update github actions --- .github/workflows/ci.yml | 6 +++--- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb97522ce..fe3ad5397 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v2.4.2 with: clean: 'false' fetch-depth: '0' @@ -94,11 +94,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v1.9.0 + uses: actions/setup-dotnet@v1.9.1 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v1.9.0 + uses: actions/setup-dotnet@v1.9.1 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 1a4925471..42e5d0c0a 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.1 + uses: actions/checkout@v3.0.2 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index c595988d5..21d01ef67 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.1 + uses: actions/checkout@v3.0.2 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index bc3c7ae8c..f1710e13b 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.1 + uses: actions/checkout@v3.0.2 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index f67de7db9..118cc29c5 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.1 + uses: actions/checkout@v3.0.2 with: ref: ${{ github.sha }} fetch-depth: 0 From 5e475a6fcdbed1077e8f7fd2c6070bafd711ee51 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 05:23:05 +0000 Subject: [PATCH 032/647] Update dependency gitversion.tool to v5.10.1 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6322dd99a..0ec23d15b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "5.8.2", + "version": "5.10.1", "commands": [ "dotnet-gitversion" ] From 9673434ef1746399c83f577f04b27198bcf253c2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 05:23:01 +0000 Subject: [PATCH 033/647] Update dependency dotnet-reportgenerator-globaltool to v5.1.5 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 0ec23d15b..6e7323136 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.0.4", + "version": "5.1.5", "commands": [ "reportgenerator" ] From 966abc686c98c608bec4ae47331b4711d43d7ef9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 05:23:27 +0000 Subject: [PATCH 034/647] Update dependency jetbrains.resharper.globaltools to v2022 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6e7323136..de0812307 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2021.3.3", + "version": "2022.1.0", "commands": [ "jb" ] From b16c9f4bcb5d924fd7d5f45209c19b3abbe6a1ca Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Apr 2022 11:04:36 +0000 Subject: [PATCH 035/647] Update github actions --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe3ad5397..089c0e26f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2.4.2 + uses: actions/checkout@v3.0.2 with: clean: 'false' fetch-depth: '0' @@ -87,18 +87,18 @@ jobs: run: | git fetch --prune - name: NuGet Cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: '${{ github.workspace }}/.nuget/packages' key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}" restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v1.9.1 + uses: actions/setup-dotnet@v2.0.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v1.9.1 + uses: actions/setup-dotnet@v2.0.0 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore @@ -117,36 +117,36 @@ jobs: run: | dotnet nuke Pack --skip - name: 🐿 Publish Coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: 'actions-${{ matrix.os }}' - name: 🏺 Publish logs if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 'logs' path: 'artifacts/logs/' - name: 🏺 Publish coverage data if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 'coverage' path: 'coverage/' - name: 🏺 Publish test data if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 'test data' path: 'artifacts/test/' - name: 🏺 Publish NuGet Packages if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 'nuget' path: 'artifacts/nuget/' - name: 🏺 Publish Docs if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 'docs' path: 'artifacts/docs/' From 604f07253e1ef36ef3b1cc4487bf18285068db2b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 29 Apr 2022 16:03:05 +0000 Subject: [PATCH 036/647] Update jetbrains to v2022.1.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index de0812307..ed541ece4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.1.0", + "version": "2022.1.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 36683010e..2f8ac8765 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From ad04fed99a3f7c98f050c3761b0c6fa0e9a93f45 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 1 May 2022 20:47:29 +0000 Subject: [PATCH 037/647] Update reportgenerator to v5.1.6 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ed541ece4..c4f429a31 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.5", + "version": "5.1.6", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 2f8ac8765..e8cdd397c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 84a08858aea095f9d2d1a802224e7d9ded79e843 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 2 May 2022 17:50:11 +0000 Subject: [PATCH 038/647] Update dependency nuke.globaltool to v6.0.3 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index c4f429a31..e1a1594e1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "6.0.2", + "version": "6.0.3", "commands": [ "nuke" ] From 6ed13d4141f79aba0df03da8e4ce3204da1a7ae5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 4 May 2022 17:03:07 +0000 Subject: [PATCH 039/647] Update dependency xunit.runner.visualstudio to v2.4.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e8cdd397c..089c7783d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,7 +37,7 @@ - + From 28c482997bb7ac8535d2cfaea80a089ec732fb3c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 9 May 2022 02:52:39 +0000 Subject: [PATCH 040/647] Update dependency Rocket.Surgery.Nuke to v0.17.10 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 089c7783d..5534ea1ed 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From 9a77335ec76a69813378f313092d85cb08fbd353 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 10 May 2022 04:48:47 +0000 Subject: [PATCH 041/647] Update Rocket Surgery Other to v1.1.1 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5534ea1ed..8562ba115 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + From d72b5dc7e1cd06760874eb29fa1c1a09475da4ff Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 10 May 2022 10:10:55 +0000 Subject: [PATCH 042/647] Update actions/setup-dotnet action to v2.1.0 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 089c0e26f..40913842c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,11 +94,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v2.0.0 + uses: actions/setup-dotnet@v2.1.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v2.0.0 + uses: actions/setup-dotnet@v2.1.0 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore From ce5dadc8fcaf9ea7aefbbe90868be891727bd57e Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Fri, 20 May 2022 20:40:54 -0400 Subject: [PATCH 043/647] Updated global json to rollforward --- global.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 403171d04..4fda00640 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,6 @@ { "sdk": { - "version": "6.0.200" + "version": "6.0.200", + "rollForward": "latestMinor" } -} \ No newline at end of file +} From 8460bd033a99051a90dcdeff22275c03f44149f8 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 22 May 2022 04:34:36 -0400 Subject: [PATCH 044/647] Initial support to get 3.17 features all working --- Directory.Packages.props | 4 +- global.json | 2 +- language-server-protocol.sha.txt | 3 +- sample/SampleServer/FoldingRangeHandler.cs | 4 +- sample/SampleServer/SemanticTokensHandler.cs | 2 +- sample/SampleServer/TextDocumentHandler.cs | 10 +- src/Client/DefaultLanguageClientFacade.cs | 4 + src/Client/LanguageClient.cs | 3 + .../LanguageClientRegistrationManager.cs | 4 +- ...nguageClientServiceCollectionExtensions.cs | 3 + src/Dap.Protocol/Dap.Protocol.csproj | 23 +- .../ActionContextExtensions.cs | 9 +- .../AutoImplementParamsGenerator.cs | 4 +- .../Contexts/GeneratorData.cs | 1 + .../Contexts/RegistrationOptionAttributes.cs | 31 +- .../Contexts/RequestItem.cs | 1 + src/JsonRpc.Generators/DelegateHelpers.cs | 26 +- .../GenerateHandlerMethodsGenerator.cs | 9 +- .../GeneratorDiagnostics.cs | 5 + src/JsonRpc.Generators/Helpers.cs | 356 ++- .../RegistrationOptionsGenerator.cs | 52 +- .../Strategies/HandlerGeneratorStrategy.cs | 562 ++++- ...eneratorWithRegistrationOptionsStrategy.cs | 1 + ...eneratorWithRegistrationOptionsStrategy.cs | 114 +- ...ratorWithoutRegistrationOptionsStrategy.cs | 84 +- ...eneratorWithRegistrationOptionsStrategy.cs | 182 +- ...ratorWithoutRegistrationOptionsStrategy.cs | 8 +- .../Strategies/SendMethodRequestStrategy.cs | 16 +- .../TypedDelegatingHandlerStrategy.cs | 259 +- .../StronglyTypedGenerator.cs | 104 +- src/JsonRpc/JsonRpc.csproj | 47 +- src/JsonRpc/Server/ErrorCodes.cs | 19 +- src/JsonRpc/Server/RequestFailedException.cs | 87 + .../Server/ServerCancelledException.cs | 87 + src/Protocol/AbstractHandlers.Base.cs | 79 + src/Protocol/AbstractHandlers.Notification.cs | 53 + ...andlers.cs => AbstractHandlers.Partial.cs} | 161 +- ...bstractHandlers.PartialWithInitialValue.cs | 295 +++ src/Protocol/AbstractHandlers.Request.cs | 55 + .../Client/Capabilities/ClientCapabilities.cs | 8 + .../Capabilities/GeneralClientCapabilities.cs | 42 +- .../IGeneralClientCapabilities.cs | 38 +- .../ITextDocumentClientCapabilities.cs | 32 +- .../MarkdownClientCapabilities.cs | 12 +- .../NotebookDocumentClientCapabilities.cs | 16 + .../StaleRequestSupportClientCapabilities.cs | 26 + .../SymbolKindCapabilityOptions.cs | 24 - .../TagSupportCapabilityOptions.cs | 19 - .../TextDocumentClientCapabilities.cs | 30 +- .../WorkspaceClientCapabilities.cs | 23 +- src/Protocol/Client/ILanguageClientFacade.cs | 1 + .../Client/INotebookDocumentLanguageClient.cs | 5 + .../Client/NotebookDocumentLanguageClient.cs | 15 + .../WorkDone/WorkDoneProxyExtensions.cs | 18 + .../Document/INotebookDocumentIdentifier.cs | 50 + .../Document/NotebookDocumentAttributes.cs | 69 + .../Features/Document/CodeActionFeature.cs | 37 + .../Features/Document/CodeLensFeature.cs | 5 +- .../Features/Document/CompletionFeature.cs | 320 ++- .../Features/Document/DiagnosticsFeature.cs | 533 ++++ .../Features/Document/FoldingRangeFeature.cs | 61 +- .../Features/Document/InlayHintFeature.cs | 323 +++ .../Features/Document/InlineValueFeature.cs | 213 ++ .../Document/NotebookDocumentSyncFeature.cs | 1140 +++++++++ .../Features/Document/RenameFeature.cs | 2 +- .../Document/SemanticTokensFeature.cs | 49 +- .../Document/TextDocumentSyncFeature.cs | 466 +++- .../Features/Document/TypeHierarchyFeature.cs | 1032 ++++++++ .../Features/FileOperationsFeature.cs | 2 +- src/Protocol/Features/ProgressFeature.cs | 3 +- .../Workspace/WorkspaceSymbolsFeature.cs | 172 +- .../Generation/GenerateContainerAttribute.cs | 2 + .../GenerateRegistrationOptionsAttribute.cs | 13 +- src/Protocol/ILanguageProtocolRpcOptions.cs | 2 + src/Protocol/IRegistrationManager.cs | 2 +- ...rotocolDelegatingHandlers.CanBeResolved.cs | 72 + ...ProtocolDelegatingHandlers.Notification.cs | 120 + ...guageProtocolDelegatingHandlers.Partial.cs | 503 ++++ ...egatingHandlers.PartialWithInitialValue.cs | 542 ++++ ...guageProtocolDelegatingHandlers.Request.cs | 230 ++ .../LanguageProtocolDelegatingHandlers.cs | 838 +------ .../LanguageProtocolRpcOptionsBase.cs | 16 + src/Protocol/Models/DocumentFilter.cs | 163 -- src/Protocol/Models/DocumentSelector.cs | 48 - src/Protocol/Models/EditRange.cs | 7 + src/Protocol/Models/FileLocation.cs | 22 + .../INotebookDocumentIdentifierParams.cs | 9 + src/Protocol/Models/IPartialItem.cs | 5 + src/Protocol/Models/IPartialItems.cs | 6 + .../ITextDocumentRegistrationOptions.cs | 7 - .../Models/ITextDocumentSyncOptions.cs | 14 - src/Protocol/Models/LocationOrFileLocation.cs | 30 + .../Models/NotebookDocumentIdentifier.cs | 40 + ...onalVersionedNotebookDocumentIdentifier.cs | 17 + src/Protocol/Models/PositionEncodingKind.cs | 34 + src/Protocol/Models/RangeOrEditRange.cs | 57 + .../VersionedNotebookDocumentIdentifier.cs | 25 + .../Models/VersionedTextDocumentIdentifier.cs | 2 +- src/Protocol/NotebookDocumentNames.cs | 9 + src/Protocol/Progress/IProgressManager.cs | 25 +- src/Protocol/Progress/IProgressObserver.cs | 5 + .../PartialItemRequestProgressObservable.cs | 25 +- ...thInitialValueRequestProgressObservable.cs | 117 + .../PartialItemsRequestProgressObservable.cs | 10 +- ...thInitialValueRequestProgressObservable.cs | 139 ++ src/Protocol/Progress/ProgressManager.cs | 110 +- src/Protocol/Progress/ProgressObserver.cs | 54 +- src/Protocol/Protocol.csproj | 23 +- .../Converters/CompletionListConverter.cs | 40 - .../LocationOrFileLocationConverter.cs | 29 + src/Protocol/Serialization/Serializer.cs | 3 +- .../Capabilities/IServerCapabilities.cs | 48 + .../Server/Capabilities/ServerCapabilities.cs | 56 + src/Protocol/Server/ILanguageServerFacade.cs | 1 + .../Server/INotebookDocumentLanguageServer.cs | 5 + .../Server/NotebookDocumentLanguageServer.cs | 17 + .../Server/TextDocumentLanguageServer.cs | 1 + .../Shared/LspHandlerTypeDescriptor.cs | 14 +- src/Protocol/TextDocumentNames.cs | 7 + src/Protocol/WorkspaceNames.cs | 5 +- src/Server/DefaultLanguageServerFacade.cs | 4 + src/Server/LanguageServer.cs | 42 +- ...nguageServerServiceCollectionExtensions.cs | 2 + .../Matchers/NotebookDocumentMatcher.cs | 119 + src/Server/Matchers/TextDocumentMatcher.cs | 4 +- src/Server/Server.csproj | 3 +- test/Directory.Build.targets | 2 + .../EnumLikeStringGeneratorTests.cs | 39 +- .../GeneratedRegistrationOptionsTests.cs | 210 +- test/Generation.Tests/Generation.Tests.csproj | 8 +- .../JsonRpcGenerationTests.cs | 787 +----- test/Generation.Tests/LspFeatureTests.cs | 366 +-- test/Generation.Tests/ModuleInitializer.cs | 34 + ...ly_Implements_IEnumLikeString.verified.txt | 35 + ...ly_Typed_Registration_Options.verified.txt | 67 + ...ation_Options_With_Converters.verified.txt | 54 + ...WorkDone_Registration_Options.verified.txt | 36 + ...egistration_Options_Interface.verified.txt | 37 + ...pports_Allow_Derived_Requests.verified.txt | 59 + ...low_Derived_Requests_Nullable.verified.txt | 59 + ....Supports_Allow_Generic_Types.verified.txt | 59 + ...rts_Allows_Nullable_Responses.verified.txt | 59 + ....Supports_Custom_Method_Names.verified.txt | 31 + ...rating_Generic_Response_Types.verified.txt | 63 + ...Direction_CapabilitiesHandler.verified.txt | 32 + ...irection_DidChangeTextHandler.verified.txt | 60 + ..._Infers_Direction_ExitHandler.verified.txt | 34 + ...Direction_FoldingRangeHandler.verified.txt | 62 + ...ing_Notifications_ExitHandler.verified.txt | 33 + ....Supports_Generating_Requests.verified.txt | 61 + ...Requests_And_Infers_Direction.verified.txt | 61 + ...upports_Params_Type_As_Source.verified.txt | 67 + ...ng_Custom_Language_Extensions.verified.txt | 624 +++++ ...s_Generating_Void_Task_Return.verified.txt | 484 ++++ ...upports_Params_Type_As_Source.verified.txt | 2213 +++++++++++++++++ .../DynamicRegistrationTests.cs | 14 +- .../FluentAssertionsExtensions.cs | 2 +- test/Lsp.Integration.Tests/MonikerTests.cs | 2 +- test/Lsp.Integration.Tests/RenameTests.cs | 4 +- .../TypedCallHierarchyTests.cs | 6 +- .../TypedCodeActionTests.cs | 8 +- .../TypedCodeLensTests.cs | 8 +- .../TypedCompletionTests.cs | 42 +- .../TypedDocumentLinkTests.cs | 8 +- .../Client/ClientCapabilitiesTests.cs | 2 +- .../Client/SynchronizationCapabilityTests.cs | 4 +- .../TextDocumentClientCapabilitiesTests.cs | 2 +- .../ClientCapabilityProviderTests.cs | 18 +- test/Lsp.Tests/FluentAssertionsExtensions.cs | 2 +- test/Lsp.Tests/FoundationTests.cs | 13 +- test/Lsp.Tests/HandlerResolverTests.cs | 20 +- test/Lsp.Tests/LspRequestRouterTests.cs | 26 +- .../Matchers/TextDocumentMatcherTests.cs | 20 +- ...rTestsRequestHandlerOfTRequestTResponse.cs | 4 +- .../CodeActionRegistrationOptionsTests.cs | 6 +- .../CodeLensRegistrationOptionsTests.cs | 6 +- .../CompletionRegistrationOptionsTests.cs | 4 +- test/Lsp.Tests/Models/DocumentFilterTests.cs | 24 +- .../DocumentLinkRegistrationOptionsTests.cs | 4 +- ...nTypeFormattingRegistrationOptionsTests.cs | 4 +- .../Lsp.Tests/Models/DocumentSelectorTests.cs | 10 +- .../Lsp.Tests/Models/InitializeParamsTests.cs | 2 +- .../SignatureHelpRegistrationOptionsTests.cs | 4 +- ...tDocumentChangeRegistrationOptionsTests.cs | 4 +- ...extDocumentSaveRegistrationOptionsTests.cs | 4 +- test/Lsp.Tests/SemanticTokensDocumentTests.cs | 6 +- .../TextDocumentSyncHandlerExtensions.cs | 12 +- 187 files changed, 13682 insertions(+), 3647 deletions(-) create mode 100644 src/JsonRpc/Server/RequestFailedException.cs create mode 100644 src/JsonRpc/Server/ServerCancelledException.cs create mode 100644 src/Protocol/AbstractHandlers.Base.cs create mode 100644 src/Protocol/AbstractHandlers.Notification.cs rename src/Protocol/{AbstractHandlers.cs => AbstractHandlers.Partial.cs} (63%) create mode 100644 src/Protocol/AbstractHandlers.PartialWithInitialValue.cs create mode 100644 src/Protocol/AbstractHandlers.Request.cs create mode 100644 src/Protocol/Client/Capabilities/NotebookDocumentClientCapabilities.cs create mode 100644 src/Protocol/Client/Capabilities/StaleRequestSupportClientCapabilities.cs delete mode 100644 src/Protocol/Client/Capabilities/SymbolKindCapabilityOptions.cs delete mode 100644 src/Protocol/Client/Capabilities/TagSupportCapabilityOptions.cs create mode 100644 src/Protocol/Client/INotebookDocumentLanguageClient.cs create mode 100644 src/Protocol/Client/NotebookDocumentLanguageClient.cs create mode 100644 src/Protocol/Document/INotebookDocumentIdentifier.cs create mode 100644 src/Protocol/Document/NotebookDocumentAttributes.cs create mode 100644 src/Protocol/Features/Document/DiagnosticsFeature.cs create mode 100644 src/Protocol/Features/Document/InlayHintFeature.cs create mode 100644 src/Protocol/Features/Document/InlineValueFeature.cs create mode 100644 src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs create mode 100644 src/Protocol/Features/Document/TypeHierarchyFeature.cs create mode 100644 src/Protocol/LanguageProtocolDelegatingHandlers.CanBeResolved.cs create mode 100644 src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs create mode 100644 src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs create mode 100644 src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs create mode 100644 src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs delete mode 100644 src/Protocol/Models/DocumentFilter.cs delete mode 100644 src/Protocol/Models/DocumentSelector.cs create mode 100644 src/Protocol/Models/EditRange.cs create mode 100644 src/Protocol/Models/FileLocation.cs create mode 100644 src/Protocol/Models/INotebookDocumentIdentifierParams.cs delete mode 100644 src/Protocol/Models/ITextDocumentRegistrationOptions.cs delete mode 100644 src/Protocol/Models/ITextDocumentSyncOptions.cs create mode 100644 src/Protocol/Models/LocationOrFileLocation.cs create mode 100644 src/Protocol/Models/NotebookDocumentIdentifier.cs create mode 100644 src/Protocol/Models/OptionalVersionedNotebookDocumentIdentifier.cs create mode 100644 src/Protocol/Models/PositionEncodingKind.cs create mode 100644 src/Protocol/Models/RangeOrEditRange.cs create mode 100644 src/Protocol/Models/VersionedNotebookDocumentIdentifier.cs create mode 100644 src/Protocol/NotebookDocumentNames.cs create mode 100644 src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs create mode 100644 src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs create mode 100644 src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs create mode 100644 src/Protocol/Server/INotebookDocumentLanguageServer.cs create mode 100644 src/Protocol/Server/NotebookDocumentLanguageServer.cs create mode 100644 src/Server/Matchers/NotebookDocumentMatcher.cs create mode 100644 test/Generation.Tests/ModuleInitializer.cs create mode 100644 test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt diff --git a/Directory.Packages.props b/Directory.Packages.props index 8562ba115..14d199970 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,11 +35,13 @@ - + + + diff --git a/global.json b/global.json index 4fda00640..3e6303bfc 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.200", + "version": "6.0.300", "rollForward": "latestMinor" } } diff --git a/language-server-protocol.sha.txt b/language-server-protocol.sha.txt index 98fc9b305..9ff4a9d22 100644 --- a/language-server-protocol.sha.txt +++ b/language-server-protocol.sha.txt @@ -1,4 +1,5 @@ -- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages lastSha: bdcc0f2 -https://github.com/Microsoft/language-server-protocol/compare/bdcc0f2..gh-pages +https://github.com/Microsoft/language-server-protocol/compare/ed804013dc545b0e10bcb0a57d872c414bbc1f3c..gh-pages + diff --git a/sample/SampleServer/FoldingRangeHandler.cs b/sample/SampleServer/FoldingRangeHandler.cs index f885fe33f..54214784d 100644 --- a/sample/SampleServer/FoldingRangeHandler.cs +++ b/sample/SampleServer/FoldingRangeHandler.cs @@ -10,7 +10,7 @@ internal class FoldingRangeHandler : IFoldingRangeHandler { public FoldingRangeRegistrationOptions GetRegistrationOptions() => new FoldingRangeRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp") + DocumentSelector = TextDocumentSelector.ForLanguage("csharp") }; public Task?> Handle( @@ -30,7 +30,7 @@ CancellationToken cancellationToken ); public FoldingRangeRegistrationOptions GetRegistrationOptions(FoldingRangeCapability capability, ClientCapabilities clientCapabilities) => new FoldingRangeRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp") + DocumentSelector = TextDocumentSelector.ForLanguage("csharp") }; } } diff --git a/sample/SampleServer/SemanticTokensHandler.cs b/sample/SampleServer/SemanticTokensHandler.cs index a95635c3d..0f8c3d517 100644 --- a/sample/SampleServer/SemanticTokensHandler.cs +++ b/sample/SampleServer/SemanticTokensHandler.cs @@ -95,7 +95,7 @@ protected override SemanticTokensRegistrationOptions CreateRegistrationOptions( { return new SemanticTokensRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp"), + DocumentSelector = TextDocumentSelector.ForLanguage("csharp"), Legend = new SemanticTokensLegend { TokenModifiers = capability.TokenModifiers, diff --git a/sample/SampleServer/TextDocumentHandler.cs b/sample/SampleServer/TextDocumentHandler.cs index f3b6f9c2f..d3d7d684b 100644 --- a/sample/SampleServer/TextDocumentHandler.cs +++ b/sample/SampleServer/TextDocumentHandler.cs @@ -25,8 +25,8 @@ internal class TextDocumentHandler : TextDocumentSyncHandlerBase private readonly ILogger _logger; private readonly ILanguageServerConfiguration _configuration; - private readonly DocumentSelector _documentSelector = new DocumentSelector( - new DocumentFilter { + private readonly TextDocumentSelector _textDocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Pattern = "**/*.cs" } ); @@ -69,8 +69,8 @@ public override Task Handle(DidCloseTextDocumentParams notification, Cance public override Task Handle(DidSaveTextDocumentParams notification, CancellationToken token) => Unit.Task; - protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities) => new TextDocumentSyncRegistrationOptions() { - DocumentSelector = _documentSelector, + protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(TextSynchronizationCapability capability, ClientCapabilities clientCapabilities) => new TextDocumentSyncRegistrationOptions() { + DocumentSelector = _textDocumentSelector, Change = Change, Save = new SaveOptions() { IncludeText = true } }; @@ -129,7 +129,7 @@ CancellationToken cancellationToken } public DocumentSymbolRegistrationOptions GetRegistrationOptions(DocumentSymbolCapability capability, ClientCapabilities clientCapabilities) => new DocumentSymbolRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp") + DocumentSelector = TextDocumentSelector.ForLanguage("csharp") }; } diff --git a/src/Client/DefaultLanguageClientFacade.cs b/src/Client/DefaultLanguageClientFacade.cs index d5ae45489..cab0129d2 100644 --- a/src/Client/DefaultLanguageClientFacade.cs +++ b/src/Client/DefaultLanguageClientFacade.cs @@ -13,6 +13,7 @@ namespace OmniSharp.Extensions.LanguageServer.Client internal class DefaultLanguageClientFacade : LanguageProtocolProxy, ILanguageClientFacade, IOnLanguageClientStarted { private readonly Lazy _textDocument; + private readonly Lazy _notebookDocument; private readonly Lazy _client; private readonly Lazy _general; private readonly Lazy _window; @@ -28,6 +29,7 @@ public DefaultLanguageClientFacade( IProgressManager progressManager, ILanguageProtocolSettings languageProtocolSettings, Lazy textDocument, + Lazy notebookDocument, Lazy client, Lazy general, Lazy window, @@ -38,6 +40,7 @@ IInsanceHasStarted instanceHasStarted ) : base(requestRouter, resolverContext, progressManager, languageProtocolSettings) { _textDocument = textDocument; + _notebookDocument = notebookDocument; _client = client; _general = general; _window = window; @@ -48,6 +51,7 @@ IInsanceHasStarted instanceHasStarted } public ITextDocumentLanguageClient TextDocument => _textDocument.Value; + public INotebookDocumentLanguageClient NotebookDocument => _notebookDocument.Value; public IClientLanguageClient Client => _client.Value; public IGeneralLanguageClient General => _general.Value; public IWindowLanguageClient Window => _window.Value; diff --git a/src/Client/LanguageClient.cs b/src/Client/LanguageClient.cs index 633634784..22c7004df 100644 --- a/src/Client/LanguageClient.cs +++ b/src/Client/LanguageClient.cs @@ -177,6 +177,7 @@ internal LanguageClient( IEnumerable startedDelegates, IEnumerable startedHandlers, ITextDocumentLanguageClient textDocumentLanguageClient, + INotebookDocumentLanguageClient notebookDocumentLanguageClient, IClientLanguageClient clientLanguageClient, IGeneralLanguageClient generalLanguageClient, IWindowLanguageClient windowLanguageClient, @@ -228,6 +229,7 @@ IScheduler scheduler // We need to at least create Window here in case any handler does loggin in their constructor TextDocument = textDocumentLanguageClient; + NotebookDocument = notebookDocumentLanguageClient; Client = clientLanguageClient; General = generalLanguageClient; Window = windowLanguageClient; @@ -235,6 +237,7 @@ IScheduler scheduler } public ITextDocumentLanguageClient TextDocument { get; } + public INotebookDocumentLanguageClient NotebookDocument { get; } public IClientLanguageClient Client { get; } public IGeneralLanguageClient General { get; } public IWindowLanguageClient Window { get; } diff --git a/src/Client/LanguageClientRegistrationManager.cs b/src/Client/LanguageClientRegistrationManager.cs index b6703e4c3..19bcfc48e 100644 --- a/src/Client/LanguageClientRegistrationManager.cs +++ b/src/Client/LanguageClientRegistrationManager.cs @@ -180,14 +180,14 @@ public IObservable> Registrations public IEnumerable GetRegistrationsForMethod(string method) => _registrations.Select(z => z.Value).Where(x => x.Method == method); - public IEnumerable GetRegistrationsMatchingSelector(DocumentSelector documentSelector) => + public IEnumerable GetRegistrationsMatchingSelector(TextDocumentSelector textDocumentSelector) => _registrations .Select(z => z.Value) .Where( x => x.RegisterOptions is ITextDocumentRegistrationOptions { DocumentSelector: { } } ro && ro.DocumentSelector .Join( - documentSelector, + textDocumentSelector, z => z.HasLanguage ? z.Language : z.HasScheme ? z.Scheme : z.HasPattern ? z.Pattern : string.Empty, diff --git a/src/Client/LanguageClientServiceCollectionExtensions.cs b/src/Client/LanguageClientServiceCollectionExtensions.cs index a0e3c8b3c..cb0433cbf 100644 --- a/src/Client/LanguageClientServiceCollectionExtensions.cs +++ b/src/Client/LanguageClientServiceCollectionExtensions.cs @@ -44,6 +44,9 @@ internal static IContainer AddLanguageClientInternals(this IContainer container, container.RegisterMany( serviceTypeCondition: type => type.Name.Contains(nameof(TextDocumentLanguageClient)), reuse: Reuse.Singleton ); + container.RegisterMany( + serviceTypeCondition: type => type.Name.Contains(nameof(NotebookDocumentLanguageClient)), reuse: Reuse.Singleton + ); container.RegisterMany( serviceTypeCondition: type => type.Name.Contains(nameof(ClientLanguageClient)), reuse: Reuse.Singleton ); diff --git a/src/Dap.Protocol/Dap.Protocol.csproj b/src/Dap.Protocol/Dap.Protocol.csproj index 4622960c4..52c4b5467 100644 --- a/src/Dap.Protocol/Dap.Protocol.csproj +++ b/src/Dap.Protocol/Dap.Protocol.csproj @@ -14,35 +14,24 @@ - + - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/JsonRpc.Generators/ActionContextExtensions.cs b/src/JsonRpc.Generators/ActionContextExtensions.cs index f555d9dc4..1c6df349f 100644 --- a/src/JsonRpc.Generators/ActionContextExtensions.cs +++ b/src/JsonRpc.Generators/ActionContextExtensions.cs @@ -1,6 +1,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using OmniSharp.Extensions.JsonRpc.Generators.Contexts; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace OmniSharp.Extensions.JsonRpc.Generators { @@ -8,12 +9,12 @@ static class ActionContextExtensions { public static ParameterListSyntax GetRegistryParameterList(this ExtensionMethodContext extensionMethodContext) { - return SyntaxFactory.ParameterList( - SyntaxFactory.SeparatedList( + return ParameterList( + SeparatedList( new[] { - SyntaxFactory.Parameter(SyntaxFactory.Identifier("registry")) + Parameter(Identifier("registry")) .WithType(extensionMethodContext.Item) - .WithModifiers(SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.ThisKeyword))) + .WithModifiers(TokenList(Token(SyntaxKind.ThisKeyword))) } ) ); diff --git a/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs b/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs index c9eac05da..45b3f9f94 100644 --- a/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs +++ b/src/JsonRpc.Generators/AutoImplementParamsGenerator.cs @@ -16,7 +16,7 @@ public class AutoImplementParamsGenerator : IIncrementalGenerator public void Initialize(IncrementalGeneratorInitializationContext context) { var _attributes = "Method,RegistrationOptions"; - var _interfaces = "IPartialItemsRequest,IPartialItemRequest,IWorkDoneProgressParams,IHandlerIdentity"; + var _interfaces = "IPartialItemsRequest,IPartialItemsWithInitialValueRequest,IPartialItemRequest,IPartialItemWithInitialValueRequest,IWorkDoneProgressParams,IHandlerIdentity"; var syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( (syntaxNode, _) => @@ -102,7 +102,7 @@ private static IEnumerable AutoImplementInterfaces(Base .WithAccessorList(GetInitAccessor); } - if (syntax.BaseList?.Types.Any(z => z.Type.GetSyntaxName() is "IPartialItemsRequest" or "IPartialItemRequest") == true + if (syntax.BaseList?.Types.Any(z => z.Type.GetSyntaxName() is "IPartialItemsRequest" or "IPartialItemRequest" or "IPartialItemsWithInitialValueRequest" or "IPartialItemWithInitialValueRequest") == true && symbol.GetMembers("PartialResultToken").IsEmpty) { yield return PropertyDeclaration(NullableType(IdentifierName("ProgressToken")), Identifier("PartialResultToken")) diff --git a/src/JsonRpc.Generators/Contexts/GeneratorData.cs b/src/JsonRpc.Generators/Contexts/GeneratorData.cs index 33cffce86..f51ed9832 100644 --- a/src/JsonRpc.Generators/Contexts/GeneratorData.cs +++ b/src/JsonRpc.Generators/Contexts/GeneratorData.cs @@ -56,6 +56,7 @@ HashSet additionalUsings GetRegistrationOptions(candidateClass, symbol, lspAttributes), GetPartialItem(candidateClass, symbol, requestType), GetPartialItems(candidateClass, symbol, requestType), + symbol.AllInterfaces.Concat(requestType.Symbol.AllInterfaces).Any(z => z.Name.EndsWith("WithInitialValue", StringComparison.Ordinal)), additionalUsings, new List(), model, compilation diff --git a/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs b/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs index 28b59670c..226500e35 100644 --- a/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs +++ b/src/JsonRpc.Generators/Contexts/RegistrationOptionAttributes.cs @@ -11,11 +11,13 @@ internal record RegistrationOptionAttributes( string? Key, ExpressionSyntax[]? KeyExpression, bool SupportsWorkDoneProgress, - bool SupportsDocumentSelector, + bool SupportsTextDocumentSelector, + bool SupportsNotebookDocumentSelector, bool SupportsStaticRegistrationOptions, SyntaxSymbol? RegistrationOptionsConverter, bool ImplementsWorkDoneProgress, - bool ImplementsDocumentSelector, + bool ImplementsTextDocumentSelector, + bool ImplementsNotebookDocumentSelector, bool ImplementsStaticRegistrationOptions ) { @@ -28,24 +30,33 @@ bool ImplementsStaticRegistrationOptions // var registrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions"); var textDocumentRegistrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions"); + var notebookDocumentRegistrationOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.INotebookDocumentRegistrationOptions"); var workDoneProgressOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions"); var staticRegistrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions"); if (!( symbol.GetAttribute(registrationOptionsAttributeSymbol) is { } data )) return null; - if (!( data.ApplicationSyntaxReference?.GetSyntax() is AttributeSyntax attributeSyntax )) return null; + if (data.ApplicationSyntaxReference?.GetSyntax() is not AttributeSyntax attributeSyntax) return null; TypeSyntax? converterSyntax = null; ITypeSymbol? converter = null; - var supportsDocumentSelector = data.NamedArguments.Any(z => z is { Key: nameof(SupportsDocumentSelector), Value: { Value: true } }) + var supportsTextDocumentSelector = data.NamedArguments.Any(z => z is { Key: nameof(SupportsTextDocumentSelector), Value: { Value: true } }) || ( symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( z => SymbolEqualityComparer.Default.Equals(z, textDocumentRegistrationOptionsInterfaceSymbol) ) ) || ( textDocumentRegistrationOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( type => type.Type.GetSyntaxName()?.Contains(textDocumentRegistrationOptionsInterfaceSymbol.Name) == true ) == true ); + var supportsNotebookDocumentSelector = data.NamedArguments.Any(z => z is { Key: nameof(SupportsNotebookDocumentSelector), Value: { Value: true } }) + || ( symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( + z => SymbolEqualityComparer.Default.Equals(z, notebookDocumentRegistrationOptionsInterfaceSymbol) + ) ) + || ( notebookDocumentRegistrationOptionsInterfaceSymbol is { } && syntax.BaseList?.Types.Any( + type => type.Type.GetSyntaxName()?.Contains(notebookDocumentRegistrationOptionsInterfaceSymbol.Name) == true + ) == true ); var supportsWorkDoneProgress = data.NamedArguments.Any(z => z is { Key: nameof(SupportsWorkDoneProgress), Value: { Value: true } }) || ( symbol.AllInterfaces.Length > 0 && symbol.AllInterfaces.Any( z => SymbolEqualityComparer.Default.Equals(z, workDoneProgressOptionsInterfaceSymbol) @@ -135,7 +146,8 @@ static IEnumerable getStringExpressionSyntaxes(AttributeArgume value, valueExpressionSyntaxes, supportsWorkDoneProgress, - supportsDocumentSelector, + supportsTextDocumentSelector, + supportsNotebookDocumentSelector, supportsStaticRegistrationOptions, converterSyntax is null ? null : new SyntaxSymbol(converterSyntax, (INamedTypeSymbol)converter!), symbol @@ -156,6 +168,15 @@ static IEnumerable getStringExpressionSyntaxes(AttributeArgume .AsEnumerable() .Any(x => SymbolEqualityComparer.Default.Equals(z, x)) == true ), + symbol + .GetMembers() + .AsEnumerable() + .All( + z => notebookDocumentRegistrationOptionsInterfaceSymbol? + .GetMembers() + .AsEnumerable() + .Any(x => SymbolEqualityComparer.Default.Equals(z, x)) == true + ), symbol .GetMembers() .AsEnumerable() diff --git a/src/JsonRpc.Generators/Contexts/RequestItem.cs b/src/JsonRpc.Generators/Contexts/RequestItem.cs index 3b5103243..df9bfa5e9 100644 --- a/src/JsonRpc.Generators/Contexts/RequestItem.cs +++ b/src/JsonRpc.Generators/Contexts/RequestItem.cs @@ -17,6 +17,7 @@ record RequestItem( SyntaxSymbol? RegistrationOptions, SyntaxSymbol? PartialItem, SyntaxSymbol? PartialItems, + bool PartialHasInitialValue, HashSet AdditionalUsings, List AssemblyJsonRpcHandlersAttributeArguments, SemanticModel Model, diff --git a/src/JsonRpc.Generators/DelegateHelpers.cs b/src/JsonRpc.Generators/DelegateHelpers.cs index 677afcaab..cd82c89ff 100644 --- a/src/JsonRpc.Generators/DelegateHelpers.cs +++ b/src/JsonRpc.Generators/DelegateHelpers.cs @@ -29,25 +29,25 @@ public static Func MakeGenericFactory(Func< ); } - public static Func MakeGenericFactory( - Func factory, TypeSyntax constraint + public static Func MakeGenericFactory( + Func factory, TypeSyntax constraint ) { - return (syntax, resolveSyntax) => factory(syntax, resolveSyntax) - .WithTypeParameterList(TypeParameterList(SingletonSeparatedList(TypeParameter(Identifier("T"))))) - .WithConstraintClauses( - SingletonList( - TypeParameterConstraintClause(IdentifierName("T")) - .WithConstraints(SingletonSeparatedList(TypeConstraint(constraint))) - ) - ); + return (syntax, resolveSyntax, initialValueHandler) => factory(syntax, resolveSyntax, initialValueHandler) + .WithTypeParameterList(TypeParameterList(SingletonSeparatedList(TypeParameter(Identifier("T"))))) + .WithConstraintClauses( + SingletonList( + TypeParameterConstraintClause(IdentifierName("T")) + .WithConstraints(SingletonSeparatedList(TypeConstraint(constraint))) + ) + ); } - public static Func> MakeGenericFactory( - Func> factory, TypeSyntax constraint + public static Func> MakeGenericFactory( + Func> factory, TypeSyntax constraint ) { - return (syntax, resolveSyntax) => factory(syntax, resolveSyntax) + return (syntax, resolveSyntax, initialValueHandler) => factory(syntax, resolveSyntax, initialValueHandler) .Select( method => method .WithTypeParameterList(TypeParameterList(SingletonSeparatedList(TypeParameter(Identifier("T"))))) diff --git a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs index 51e875466..964cf139b 100644 --- a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs +++ b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs @@ -48,6 +48,13 @@ syntaxNode is TypeDeclarationSyntax tds actionItem = GeneratorData.Create( compilaiton, (TypeDeclarationSyntax)syntaxContext.Node, syntaxContext.SemanticModel, additionalUsings ); + if (actionItem is null) + { + diagnostic = Diagnostic.Create( + GeneratorDiagnostics.MustBeARequestOrNotification, syntaxContext.Node.GetLocation(), + ( (TypeDeclarationSyntax)syntaxContext.Node ).Identifier.Text + ); + } } catch (Exception e) { @@ -81,7 +88,7 @@ private void GenerateHandlerMethods( if (actionItem is null) { - context.ReportDiagnostic(diagnostic!); + if (diagnostic is { }) context.ReportDiagnostic(diagnostic); return; } diff --git a/src/JsonRpc.Generators/GeneratorDiagnostics.cs b/src/JsonRpc.Generators/GeneratorDiagnostics.cs index b93e808c5..7cdfa732c 100644 --- a/src/JsonRpc.Generators/GeneratorDiagnostics.cs +++ b/src/JsonRpc.Generators/GeneratorDiagnostics.cs @@ -41,6 +41,11 @@ internal static class GeneratorDiagnostics "Type {0} must be made readonly.", "JsonRPC", DiagnosticSeverity.Error, true ); + public static DiagnosticDescriptor MustBeARequestOrNotification { get; } = new DiagnosticDescriptor( + "JRPC1006", "Type must implement a request or notification interface", + "Type {0} must implement a request or notification interface.", "JsonRPC", DiagnosticSeverity.Error, true + ); + public static DiagnosticDescriptor MustInheritFromCanBeResolved { get; } = new DiagnosticDescriptor( "LSP1001", "The target class must implement ICanBeResolved", "The target class must implement ICanBeResolved", "LSP", DiagnosticSeverity.Error, true diff --git a/src/JsonRpc.Generators/Helpers.cs b/src/JsonRpc.Generators/Helpers.cs index f7559140d..7e81c9c22 100644 --- a/src/JsonRpc.Generators/Helpers.cs +++ b/src/JsonRpc.Generators/Helpers.cs @@ -30,8 +30,8 @@ public static bool IsRequest(TypeDeclarationSyntax symbol) => z.Type is SimpleNameSyntax and ( { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 or 2 } or { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } - or { Identifier: { Text: "IPartialItemRequest" }, Arity: 2 } - or { Identifier: { Text: "IPartialItemsRequest" }, Arity: 2 } + or { Identifier: { Text: "IPartialItemRequest" or "IPartialItemWithInitialValueRequest" }, Arity: 2 } + or { Identifier: { Text: "IPartialItemsRequest" or "IPartialItemsWithInitialValueRequest" }, Arity: 2 } or { Identifier: { Text: "IRequest" }, Arity: 1 } or { Identifier: { Text: "IJsonRpcRequest" }, Arity: 0 } ) @@ -51,15 +51,18 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT TypeSyntax? type = null!; foreach (var baseType in syntax.BaseList?.Types.AsEnumerable() ?? Array.Empty()) { - type = baseType.Type switch { - GenericNameSyntax gns => gns switch { - { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 } => ParseName("MediatR.Unit"), - { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 2 } => gns.TypeArgumentList.Arguments[1], - { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => gns.TypeArgumentList.Arguments[0], - { Identifier: { Text: "IPartialItemRequest" }, Arity: 2 } => gns.TypeArgumentList.Arguments[0], - { Identifier: { Text: "IPartialItemsRequest" }, Arity: 2 } => gns.TypeArgumentList.Arguments[0], - { Identifier: { Text: "IRequest" }, Arity: 1 } => gns.TypeArgumentList.Arguments[0], - _ => null + type = baseType.Type switch + { + GenericNameSyntax gns => gns switch + { + { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 } => ParseName("MediatR.Unit"), + { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 2 } => gns.TypeArgumentList.Arguments[1], + { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => gns.TypeArgumentList.Arguments[0], + { Identifier: { Text: "IPartialItemRequest" or "IPartialItemWithInitialValueRequest" }, Arity: 2 } => gns.TypeArgumentList.Arguments[0], + { Identifier: { Text: "IPartialItemsRequest" or "IPartialItemsWithInitialValueRequest" }, Arity: 2 } => gns.TypeArgumentList.Arguments + [0], + { Identifier: { Text: "IRequest" }, Arity: 1 } => gns.TypeArgumentList.Arguments[0], + _ => null }, SimpleNameSyntax and { Identifier: { Text: "IRequest" } } => ParseName("MediatR.Unit"), SimpleNameSyntax and { Identifier: { Text: "IJsonRpcRequest" } } => ParseName("MediatR.Unit"), @@ -89,7 +92,8 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT .OfType() .FirstOrDefault()?.Type; } - else if (syntax.BaseList?.Types.Select(z => z.Type).OfType().Any(z => z.Identifier.Text == "IRequest" || z.Identifier.Text == "IJsonRpcRequest") + else if (syntax.BaseList?.Types.Select(z => z.Type).OfType() + .Any(z => z.Identifier.Text == "IRequest" || z.Identifier.Text == "IJsonRpcRequest") == true) { type = IdentifierName(syntax.Identifier.Text); @@ -98,17 +102,23 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT { foreach (var baseType in syntax.BaseList?.Types.AsEnumerable() ?? Array.Empty()) { - type = baseType.Type switch { - GenericNameSyntax gns => gns switch { + type = baseType.Type switch + { + GenericNameSyntax gns => gns switch + { { Identifier: { Text: "IJsonRpcRequestHandler" } } => gns.TypeArgumentList.Arguments[0], { Identifier: { Text: "IJsonRpcNotificationHandler" } } => gns.TypeArgumentList.Arguments[0], { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } => gns.TypeArgumentList.Arguments[0], - { Identifier: { Text: "IRequest" }, Arity: 1 } => IdentifierName(syntax.Identifier.Text), - { Identifier: { Text: "IRequest" }, Arity: 0 } => IdentifierName(syntax.Identifier.Text), - { Identifier: { Text: "IJsonRpcRequest" } } => IdentifierName(syntax.Identifier.Text), - { Identifier: { Text: "IPartialItemRequest" }, Arity: 2 } => IdentifierName(syntax.Identifier.Text), - { Identifier: { Text: "IPartialItemsRequest" }, Arity: 2 } => IdentifierName(syntax.Identifier.Text), - _ => null, + { Identifier: { Text: "IRequest" }, Arity: 1 } => IdentifierName(syntax.Identifier.Text), + { Identifier: { Text: "IRequest" }, Arity: 0 } => IdentifierName(syntax.Identifier.Text), + { Identifier: { Text: "IJsonRpcRequest" } } => IdentifierName(syntax.Identifier.Text), + { Identifier: { Text: "IPartialItemRequest" or "IPartialItemWithInitialValueRequest" }, Arity: 2 } => IdentifierName( + syntax.Identifier.Text + ), + { Identifier: { Text: "IPartialItemsRequest" or "IPartialItemsWithInitialValueRequest" }, Arity: 2 } => IdentifierName( + syntax.Identifier.Text + ), + _ => null, }, _ => null, }; @@ -150,8 +160,10 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT TypeSyntax? type = null!; foreach (var baseType in syntax.BaseList?.Types.AsEnumerable() ?? Array.Empty()) { - type = baseType.Type switch { - GenericNameSyntax gns => gns switch { + type = baseType.Type switch + { + GenericNameSyntax gns => gns switch + { { Identifier: { Text: "ICapability" }, Arity: 1 } => gns.TypeArgumentList.Arguments[0], { Identifier: { Text: "IRegistration" }, Arity: 2 } => gns.TypeArgumentList.Arguments[1], _ => null @@ -190,9 +202,10 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT TypeSyntax? type = null!; foreach (var baseType in syntax.BaseList?.Types.AsEnumerable() ?? Array.Empty()) { - type = baseType.Type switch { - GenericNameSyntax gns and { Identifier: { Text: "IRegistration" }, Arity: >0 } => gns.TypeArgumentList.Arguments[0], - _ => null + type = baseType.Type switch + { + GenericNameSyntax gns and { Identifier: { Text: "IRegistration" }, Arity: > 0 } => gns.TypeArgumentList.Arguments[0], + _ => null }; if (type != null) break; } @@ -222,15 +235,15 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT public static SyntaxSymbol? GetPartialItems(TypeDeclarationSyntax syntax, INamedTypeSymbol symbol, SyntaxSymbol requestType) { - var handlerInterface = symbol.AllInterfaces - .FirstOrDefault(z => z.Name == "IPartialItems" && z.TypeArguments.Length == 1) - ?? requestType.Symbol.AllInterfaces.FirstOrDefault(z => z.Name == "IPartialItems" && z.TypeArguments.Length == 1); + var handlerInterface = symbol.AllInterfaces.Concat(requestType.Symbol.AllInterfaces).FirstOrDefault( + z => z is { Name: "IPartialItems", TypeArguments.Length: 1 } or { Name: "IPartialItemsWithInitialValue", TypeArguments.Length: 2 } + ); var localSymbol = handlerInterface?.TypeArguments[0] as INamedTypeSymbol; if (localSymbol == null) return null; var type = syntax.BaseList?.Types .Select(z => z.Type is GenericNameSyntax genericNameSyntax ? genericNameSyntax : null) .Where(z => z != null) - .Where(z => z!.Identifier.Text == "IPartialItemsRequest" && z.Arity == 2) + .Where(z => z is { Identifier.Text: "IPartialItemsRequest" or "IPartialItemsWithInitialValueRequest", Arity: 2 }) .Select(z => z!.TypeArgumentList.Arguments[1]) .FirstOrDefault(); @@ -239,15 +252,17 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT public static SyntaxSymbol? GetPartialItem(TypeDeclarationSyntax syntax, INamedTypeSymbol symbol, SyntaxSymbol requestType) { - var handlerInterface = symbol.AllInterfaces - .FirstOrDefault(z => z.Name == "IPartialItem" && z.TypeArguments.Length == 1) - ?? requestType.Symbol.AllInterfaces.FirstOrDefault(z => z.Name == "IPartialItem" && z.TypeArguments.Length == 1); + var handlerInterface = symbol.AllInterfaces.Concat(requestType.Symbol.AllInterfaces) + .FirstOrDefault( + z => z is { Name: "IPartialItem", TypeArguments.Length: 1 } or + { Name: "IPartialItemWithInitialValue", TypeArguments.Length: 2 } + ); var localSymbol = handlerInterface?.TypeArguments[0] as INamedTypeSymbol; if (localSymbol == null) return null; var type = syntax.BaseList?.Types .Select(z => z.Type is GenericNameSyntax genericNameSyntax ? genericNameSyntax : null) .Where(z => z != null) - .Where(z => z!.Identifier.Text == "IPartialItemRequest" && z.Arity == 2) + .Where(z => z is { Identifier.Text: "IPartialItemRequest" or "IPartialItemWithInitialValueRequest", Arity: 2 }) .Select(z => z!.TypeArgumentList.Arguments[1]) .FirstOrDefault(); return new SyntaxSymbol(type ?? ResolveTypeName(localSymbol), localSymbol); @@ -270,12 +285,16 @@ public static NameSyntax ResolveTypeName(ITypeSymbol symbol) return IdentifierName(symbol.Name); } - public static GenericNameSyntax CreatePartialAction(TypeSyntax requestType, TypeSyntax partialType, bool withCancellationToken, params TypeSyntax[] types) + public static GenericNameSyntax CreatePartialAction( + TypeSyntax requestType, TypeSyntax partialType, bool withCancellationToken, params TypeSyntax[] types + ) { - var typeArguments = new List { + var typeArguments = new List + { requestType, GenericName("IObserver").WithTypeArgumentList(TypeArgumentList(SeparatedList(new[] { partialType }))), }; + typeArguments.AddRange(types); if (withCancellationToken) { @@ -286,7 +305,9 @@ public static GenericNameSyntax CreatePartialAction(TypeSyntax requestType, Type .WithTypeArgumentList(TypeArgumentList(SeparatedList(typeArguments))); } - public static ExpressionStatementSyntax EnsureRegistrationOptionsIsSet(NameSyntax registrationOptionsName, TypeSyntax registrationOptionsType, bool hasCapability) => + public static ExpressionStatementSyntax EnsureRegistrationOptionsIsSet( + NameSyntax registrationOptionsName, TypeSyntax registrationOptionsType, bool hasCapability + ) => ExpressionStatement( AssignmentExpression( SyntaxKind.CoalesceAssignmentExpression, @@ -322,31 +343,38 @@ public static InvocationExpressionSyntax AddHandler(ExpressionSyntax syntax, par private static ArgumentListSyntax GetHandlerArgumentList() => ArgumentList( SeparatedList( - new[] { + new[] + { HandlerArgument } ) ); public static ArgumentListSyntax GetRegistrationHandlerArgumentList( - TypeSyntax registrationOptionsName, TypeSyntax registrationType, ArgumentSyntax handlerArgument, TypeSyntax? capabilityType, bool includeId + TypeSyntax registrationOptionsName, TypeSyntax registrationType, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument, TypeSyntax? capabilityType, bool includeId ) => ArgumentList( SeparatedList( - includeId - ? new[] { + (includeId + ? new[] + { Argument(IdentifierName("id")), + initialArgument!, handlerArgument, Argument(GetRegistrationOptionsAdapter(registrationOptionsName, registrationType, capabilityType)) } - : new[] { + : new[] + { + initialArgument!, handlerArgument, Argument(GetRegistrationOptionsAdapter(registrationOptionsName, registrationType, capabilityType)) - } + }) + .Where(z => z is not null) ) ); public static ArgumentSyntax HandlerArgument = Argument(IdentifierName("handler")); + public static ArgumentSyntax InitialHandlerArgument = Argument(IdentifierName("initialHandler")); public static ArgumentSyntax ResolveHandlerArgument = Argument(IdentifierName("resolveHandler")); public static ArgumentSyntax GetHandlerAdapterArgument( @@ -393,55 +421,62 @@ public static InvocationExpressionSyntax GetRegistrationOptionsAdapter( .WithArgumentList(ArgumentList(SingletonSeparatedList(Argument(registrationOptionsName)))); } - private static ArgumentListSyntax GetPartialResultArgumentList(TypeSyntax responseName, ArgumentSyntax handlerArgument) => - ArgumentList( - SeparatedList( - new[] { - handlerArgument, - Argument( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("_"), - GenericName(Identifier("GetService")) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("IProgressManager")))) - ) - ) - ), - Argument( + private static SeparatedSyntaxList GetPartialResultArgumentList( + TypeSyntax responseName, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument + ) => + SeparatedList( + new[] + { + initialArgument!, + handlerArgument, + Argument( + InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - responseName.EnsureNotNullable(), - IdentifierName("From") + IdentifierName("_"), + GenericName(Identifier("GetService")) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("IProgressManager")))) ) ) - } - ) - ); + ), + Argument( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + responseName.EnsureNotNullable(), + IdentifierName("From") + ) + ) + }.Where(z => z is not null) + )!; - private static ArgumentListSyntax GetPartialItemsArgumentList(TypeSyntax responseName, ArgumentSyntax handlerArgument) => + private static ArgumentListSyntax GetPartialItemsArgumentList( + TypeSyntax responseName, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument + ) => ArgumentList( SeparatedList( - new[] { - handlerArgument, - Argument( - InvocationExpression( + new[] + { + initialArgument!, + handlerArgument, + Argument( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("_"), + GenericName(Identifier("GetService")) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("IProgressManager")))) + ) + ) + ), + Argument( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("_"), - GenericName(Identifier("GetService")) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("IProgressManager")))) + responseName.EnsureNotNullable(), + IdentifierName("From") ) ) - ), - Argument( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - responseName.EnsureNotNullable(), - IdentifierName("From") - ) - ) - } + } + .Where(z => z is not null) ) ); @@ -456,7 +491,9 @@ public static ObjectCreationExpressionSyntax CreateHandlerArgument(NameSyntax cl public static ObjectCreationExpressionSyntax CreateHandlerArgument(string innerClassName, params TypeSyntax[] genericArguments) => ObjectCreationExpression(GenericName(innerClassName).WithTypeArgumentList(TypeArgumentList(SeparatedList(genericArguments)))); - public static ArrowExpressionClauseSyntax GetNotificationCapabilityHandlerExpression(ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax capabilityName) + public static ArrowExpressionClauseSyntax GetNotificationCapabilityHandlerExpression( + ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax capabilityName + ) { return ArrowExpressionClause( AddHandler( @@ -540,7 +577,7 @@ TypeSyntax capability public static ArrowExpressionClauseSyntax GetPartialResultCapabilityHandlerExpression( ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax itemType, TypeSyntax responseType, - TypeSyntax capabilityName + TypeSyntax capabilityName, bool requestPartialHasInitialValue ) { return ArrowExpressionClause( @@ -553,20 +590,30 @@ TypeSyntax capabilityName ), CreateHandlerArgument( IdentifierName("LanguageProtocolDelegatingHandlers"), - "PartialResultCapability", + requestPartialHasInitialValue ? "PartialResultCapabilityWithInitialValue" : "PartialResultCapability", requestName, responseType, itemType, capabilityName ) .WithArgumentList( - GetPartialResultArgumentList( - responseType, - GetHandlerAdapterArgument( - TypeArgumentList(SeparatedList(new[] { requestName, itemType })), - HandlerArgument, - capabilityName, - true + ArgumentList( + GetPartialResultArgumentList( + responseType, + GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(new[] { requestName, itemType })), + HandlerArgument, + capabilityName, + true + ), + requestPartialHasInitialValue + ? GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(new[] { requestName, responseType })), + InitialHandlerArgument, + capabilityName, + false + ) + : null ) ) ) @@ -577,7 +624,7 @@ TypeSyntax capabilityName } public static ArrowExpressionClauseSyntax GetPartialResultHandlerExpression( - ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax partialItem, TypeSyntax responseType + ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax partialItem, TypeSyntax responseType, bool requestPartialHasInitialValue ) { return ArrowExpressionClause( @@ -590,12 +637,18 @@ public static ArrowExpressionClauseSyntax GetPartialResultHandlerExpression( ), CreateHandlerArgument( IdentifierName("LanguageProtocolDelegatingHandlers"), - "PartialResult", + requestPartialHasInitialValue ? "PartialResultWithInitialValue" : "PartialResult", requestName, responseType, partialItem ) - .WithArgumentList(GetPartialResultArgumentList(responseType, HandlerArgument)) + .WithArgumentList( + ArgumentList( + GetPartialResultArgumentList( + responseType, HandlerArgument, requestPartialHasInitialValue ? InitialHandlerArgument : null + ) + ) + ) ) ) ) @@ -604,7 +657,7 @@ public static ArrowExpressionClauseSyntax GetPartialResultHandlerExpression( public static ArrowExpressionClauseSyntax GetPartialResultsCapabilityHandlerExpression( ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax responseType, - TypeSyntax itemName, TypeSyntax capabilityName + TypeSyntax itemName, TypeSyntax capabilityName, bool requestPartialHasInitialValue ) { return ArrowExpressionClause( @@ -617,20 +670,30 @@ public static ArrowExpressionClauseSyntax GetPartialResultsCapabilityHandlerExpr ), CreateHandlerArgument( IdentifierName("LanguageProtocolDelegatingHandlers"), - "PartialResultsCapability", + requestPartialHasInitialValue ? "PartialResultsCapabilityWithInitialValue" : "PartialResultsCapability", requestName, responseType, itemName, capabilityName ) .WithArgumentList( - GetPartialResultArgumentList( - responseType, - GetHandlerAdapterArgument( - TypeArgumentList(SeparatedList(new[] { requestName, itemName })), - HandlerArgument, - capabilityName, - true + ArgumentList( + GetPartialResultArgumentList( + responseType, + GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(new[] { requestName, itemName })), + HandlerArgument, + capabilityName, + true + ), + requestPartialHasInitialValue + ? GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(new[] { requestName, responseType })), + InitialHandlerArgument, + capabilityName, + false + ) + : null ) ) ) @@ -642,7 +705,7 @@ public static ArrowExpressionClauseSyntax GetPartialResultsCapabilityHandlerExpr public static ArrowExpressionClauseSyntax GetPartialResultsHandlerExpression( ExpressionSyntax nameExpression, TypeSyntax requestName, TypeSyntax itemName, - TypeSyntax responseType + TypeSyntax responseType, bool requestPartialHasInitialValue ) { return ArrowExpressionClause( @@ -655,7 +718,7 @@ TypeSyntax responseType ), CreateHandlerArgument( IdentifierName("LanguageProtocolDelegatingHandlers"), - "PartialResults", + requestPartialHasInitialValue ? "PartialResultsWithInitialValue" : "PartialResults", requestName, responseType, itemName @@ -668,7 +731,15 @@ TypeSyntax responseType HandlerArgument, null, true - ) + ), + requestPartialHasInitialValue + ? GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(new[] { requestName, responseType })), + InitialHandlerArgument, + null, + false + ) + : null ) ) ) @@ -689,7 +760,8 @@ public static ArrowExpressionClauseSyntax GetNotificationHandlerExpression(Expre .WithArgumentList( ArgumentList( SeparatedList( - new SyntaxNodeOrToken[] { + new SyntaxNodeOrToken[] + { Argument(nameExpression), Token(SyntaxKind.CommaToken), Argument( @@ -723,7 +795,8 @@ ExpressionSyntax nameExpression .WithArgumentList( ArgumentList( SeparatedList( - new[] { + new[] + { Argument(nameExpression), Argument( item.IsUnit @@ -773,7 +846,8 @@ public static ArrowExpressionClauseSyntax GetNotificationInvokeExpression() => .WithArgumentList( ArgumentList( SeparatedList( - new[] { + new[] + { Argument(IdentifierName(@"request")) } ) @@ -793,7 +867,8 @@ public static ArrowExpressionClauseSyntax GetRequestInvokeExpression() => .WithArgumentList( ArgumentList( SeparatedList( - new[] { + new[] + { Argument(IdentifierName(@"request")), Argument(IdentifierName("cancellationToken")) } @@ -806,35 +881,38 @@ public static ArrowExpressionClauseSyntax GetPartialInvokeExpression(TypeSyntax { var realResponseType = responseType is NullableTypeSyntax nts ? nts.ElementType : responseType; var factoryArgument = Argument( - SimpleLambdaExpression( - Parameter(Identifier("value")), - ObjectCreationExpression(realResponseType) - .WithArgumentList(ArgumentList(SingletonSeparatedList(Argument(IdentifierName("value"))))) + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + realResponseType.EnsureNotNullable(), + IdentifierName("From") ) ); - var arguments = new[] { + var arguments = new[] + { Argument( IdentifierName(@"request") ), factoryArgument, Argument(IdentifierName("cancellationToken")) }; - if (partialItemType is {}) + if (partialItemType is { }) { var realPartialItemType = partialItemType is NullableTypeSyntax nts2 ? nts2.ElementType : partialItemType; - arguments = new[] { + arguments = new[] + { arguments[0], arguments[1], Argument( - SimpleLambdaExpression( - Parameter(Identifier("value")), - ObjectCreationExpression(realPartialItemType) - .WithArgumentList(ArgumentList(SingletonSeparatedList(Argument(IdentifierName("value"))))) + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + realPartialItemType.EnsureNotNullable(), + IdentifierName("From") ) ), arguments[2] }; } + return ArrowExpressionClause( InvocationExpression( MemberAccessExpression( @@ -893,14 +971,17 @@ public static string SpecialCasedHandlerName(INamedTypeSymbol symbol) } public static SeparatedSyntaxList HandlerIdentityConstraint { get; } = SeparatedList( - new TypeParameterConstraintSyntax[] { + new TypeParameterConstraintSyntax[] + { ClassOrStructConstraint(SyntaxKind.ClassConstraint) .WithQuestionToken(Token(SyntaxKind.QuestionToken)), TypeConstraint(NullableType(IdentifierName("IHandlerIdentity"))), } ); - public static SyntaxList HandlerIdentityConstraintClause(bool withHandlerIdentity, IdentifierNameSyntax? openGenericType = null) + public static SyntaxList HandlerIdentityConstraintClause( + bool withHandlerIdentity, IdentifierNameSyntax? openGenericType = null + ) { if (!withHandlerIdentity) return SingletonList( @@ -946,7 +1027,8 @@ public static class CommonElements private static readonly Lazy GetSetAccessorLazy = LazyFactory.Create( () => AccessorList( List( - new[] { + new[] + { AccessorDeclaration(SyntaxKind.GetAccessorDeclaration).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), AccessorDeclaration(SyntaxKind.SetAccessorDeclaration).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) } @@ -957,7 +1039,8 @@ public static class CommonElements private static readonly Lazy GetInitAccessorLazy = LazyFactory.Create( () => AccessorList( List( - new[] { + new[] + { AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), AccessorDeclaration(SyntaxKind.InitAccessorDeclaration) @@ -972,7 +1055,8 @@ public static class CommonElements private static readonly Lazy GetAccessorLazy = LazyFactory.Create( () => AccessorList( List( - new[] { + new[] + { AccessorDeclaration(SyntaxKind.GetAccessorDeclaration).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) } ) @@ -989,7 +1073,8 @@ public static class SyntaxExtensions public static string? GetSyntaxName(this TypeSyntax typeSyntax) { - return typeSyntax switch { + return typeSyntax switch + { SimpleNameSyntax sns => sns.Identifier.Text, QualifiedNameSyntax qns => qns.Right.Identifier.Text, NullableTypeSyntax nts => nts.ElementType.GetSyntaxName() + "?", @@ -1091,19 +1176,25 @@ public static BaseMethodDeclarationSyntax MakeMethodNullable(this BaseMethodDecl if (syntax.ExpressionBody is not null) { - syntax = syntax.WithExpressionBody(syntax.ExpressionBody.WithExpression(syntax.ExpressionBody.Expression.InsideNullableSwitchExpression(identifierNameSyntax))); + syntax = syntax.WithExpressionBody( + syntax.ExpressionBody.WithExpression(syntax.ExpressionBody.Expression.InsideNullableSwitchExpression(identifierNameSyntax)) + ); } return syntax .WithParameterList( - ParameterList(SeparatedList(syntax.ParameterList.Parameters.Select(parameter => parameter.WithType(parameter.Type?.EnsureNullable())).ToArray())) + ParameterList( + SeparatedList(syntax.ParameterList.Parameters.Select(parameter => parameter.WithType(parameter.Type?.EnsureNullable())).ToArray()) + ) ) .AddAttributeLists( AttributeList( SingletonSeparatedList( Attribute( QualifiedName( - QualifiedName(QualifiedName(IdentifierName("System"), IdentifierName("Diagnostics")), IdentifierName("CodeAnalysis")), + QualifiedName( + QualifiedName(IdentifierName("System"), IdentifierName("Diagnostics")), IdentifierName("CodeAnalysis") + ), IdentifierName("NotNullIfNotNull") ) ) @@ -1130,7 +1221,9 @@ public static MethodDeclarationSyntax MakeMethodNullable(this MethodDeclarationS return ( MakeMethodNullable(syntax as BaseMethodDeclarationSyntax, identifierNameSyntax) as MethodDeclarationSyntax )!; } - public static ConversionOperatorDeclarationSyntax MakeMethodNullable(this ConversionOperatorDeclarationSyntax syntax, IdentifierNameSyntax identifierNameSyntax) + public static ConversionOperatorDeclarationSyntax MakeMethodNullable( + this ConversionOperatorDeclarationSyntax syntax, IdentifierNameSyntax identifierNameSyntax + ) { return ( MakeMethodNullable(syntax as BaseMethodDeclarationSyntax, identifierNameSyntax) as ConversionOperatorDeclarationSyntax )!; } @@ -1140,7 +1233,8 @@ public static SwitchExpressionSyntax InsideNullableSwitchExpression(this Express return SwitchExpression(name) .WithArms( SeparatedList( - new[] { + new[] + { SwitchExpressionArm( UnaryPattern(ConstantPattern(LiteralExpression(SyntaxKind.NullLiteralExpression))), creationExpression diff --git a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs index 2c36fcf4f..6a32b6efd 100644 --- a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs +++ b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs @@ -23,8 +23,11 @@ public class RegistrationOptionsGenerator : IIncrementalGenerator }; private record AttributeData( - INamedTypeSymbol RegistrationOptionsInterfaceSymbol, INamedTypeSymbol TextDocumentRegistrationOptionsInterfaceSymbol, - INamedTypeSymbol WorkDoneProgressOptionsInterfaceSymbol, INamedTypeSymbol StaticRegistrationOptionsInterfaceSymbol + INamedTypeSymbol RegistrationOptionsInterfaceSymbol, + INamedTypeSymbol TextDocumentRegistrationOptionsInterfaceSymbol, + INamedTypeSymbol NotebookDocumentRegistrationOptionsInterfaceSymbol, + INamedTypeSymbol WorkDoneProgressOptionsInterfaceSymbol, + INamedTypeSymbol StaticRegistrationOptionsInterfaceSymbol ); public void Initialize(IncrementalGeneratorInitializationContext context) @@ -39,6 +42,10 @@ public void Initialize(IncrementalGeneratorInitializationContext context) compilation.GetTypeByMetadataName( "OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions" )!; + var notebookDocumentRegistrationOptionsInterfaceSymbol = + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Models.INotebookDocumentRegistrationOptions" + )!; var workDoneProgressOptionsInterfaceSymbol = compilation.GetTypeByMetadataName( "OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions" @@ -48,8 +55,11 @@ public void Initialize(IncrementalGeneratorInitializationContext context) "OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions" )!; return new AttributeData( - registrationOptionsInterfaceSymbol, textDocumentRegistrationOptionsInterfaceSymbol, - workDoneProgressOptionsInterfaceSymbol, staticRegistrationOptionsInterfaceSymbol + registrationOptionsInterfaceSymbol, + textDocumentRegistrationOptionsInterfaceSymbol, + notebookDocumentRegistrationOptionsInterfaceSymbol, + workDoneProgressOptionsInterfaceSymbol, + staticRegistrationOptionsInterfaceSymbol ); } ); @@ -162,7 +172,7 @@ private void GenerateRegistrationOptions( staticRegistrationOptions = staticRegistrationOptions.AddAttributeLists(attributeList); } - if (data.SupportsDocumentSelector && !data.ImplementsDocumentSelector) + if (data.SupportsTextDocumentSelector && !data.ImplementsTextDocumentSelector) { if (registrationOptions.BaseList?.Types.Any( z => z.Type.ToFullString().Contains(attributes.TextDocumentRegistrationOptionsInterfaceSymbol.Name) @@ -174,7 +184,37 @@ private void GenerateRegistrationOptions( } extendedRegistrationOptions = extendedRegistrationOptions.AddMembers( - PropertyDeclaration(NullableType(IdentifierName("DocumentSelector")), Identifier("DocumentSelector")) + PropertyDeclaration(NullableType(IdentifierName("TextDocumentSelector")), Identifier("DocumentSelector")) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) + .WithAccessorList( + AccessorList( + List( + new[] + { + AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), + AccessorDeclaration(SyntaxKind.SetAccessorDeclaration) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + } + ) + ) + ) + ); + } + + if (data.SupportsNotebookDocumentSelector && !data.ImplementsNotebookDocumentSelector) + { + if (registrationOptions.BaseList?.Types.Any( + z => z.Type.ToFullString().Contains(attributes.NotebookDocumentRegistrationOptionsInterfaceSymbol.Name) + ) != true) + { + extendedRegistrationOptions = ExtendAndImplementInterface( + extendedRegistrationOptions, attributes.NotebookDocumentRegistrationOptionsInterfaceSymbol + ); + } + + extendedRegistrationOptions = extendedRegistrationOptions.AddMembers( + PropertyDeclaration(NullableType(IdentifierName("NotebookDocumentSelector")), Identifier("DocumentSelector")) .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) .WithAccessorList( AccessorList( diff --git a/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs b/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs index 08a0b1368..b96ee20c0 100644 --- a/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/HandlerGeneratorStrategy.cs @@ -260,6 +260,30 @@ public IEnumerable Apply(SourceProductionContext contex } members.Add(handlerClass); + + if (resolver is { LspAttributes: { GenerateTypedData: true } }) + { + members.Add( + GenerateTypedPartialItemHandler( + handlerClass, + request, + resolver, + request.PartialItem + ) + ); + } + + if (request is { LspAttributes: { GenerateTypedData: true } }) + { + members.Add( + GenerateTypedPartialItemHandler( + handlerClass, + request, + request, + request.PartialItem + ) + ); + } } else if (request is { PartialItems: { } partialItems }) { @@ -297,7 +321,7 @@ public IEnumerable Apply(SourceProductionContext contex if (resolver is { LspAttributes: { GenerateTypedData: true } }) { members.Add( - GenerateTypedPartialHandler( + GenerateTypedPartialItemsHandler( handlerClass, request, resolver, @@ -309,7 +333,7 @@ public IEnumerable Apply(SourceProductionContext contex if (request is { LspAttributes: { GenerateTypedData: true } }) { members.Add( - GenerateTypedPartialHandler( + GenerateTypedPartialItemsHandler( handlerClass, request, request, @@ -401,7 +425,7 @@ private static TypeSyntax GetPartialResultBaseClass(RequestItem request, SyntaxS return QualifiedName( IdentifierName("AbstractHandlers"), - GenericName($"PartialResult{( onlyCapability ? "Capability" : "" )}") + GenericName($"PartialResult{( request.PartialHasInitialValue ? "WithInitialValue" : "" )}{( onlyCapability ? "Capability" : "" )}") .WithTypeArgumentList(TypeArgumentList(SeparatedList(types))) ); } @@ -423,7 +447,7 @@ private static TypeSyntax GetPartialResultsBaseClass(RequestItem request, Syntax return QualifiedName( IdentifierName("AbstractHandlers"), - GenericName($"PartialResults{( onlyCapability ? "Capability" : "" )}") + GenericName($"PartialResults{( request.PartialHasInitialValue ? "WithInitialValue" : "" )}{( onlyCapability ? "Capability" : "" )}") .WithTypeArgumentList(TypeArgumentList(SeparatedList(types))) ); } @@ -597,11 +621,11 @@ private static IEnumerable AddConstructors(RequestItem } } - private static TypeDeclarationSyntax GenerateTypedPartialHandler( + private static TypeDeclarationSyntax GenerateTypedPartialItemHandler( TypeDeclarationSyntax classDeclarationSyntax, RequestItem item, RequestItem resolver, - SyntaxSymbol partialItems + SyntaxSymbol partialItem ) { return ClassDeclaration(classDeclarationSyntax.Identifier) @@ -673,13 +697,8 @@ SyntaxSymbol partialItems GenericName(Identifier("IObserver")) .WithTypeArgumentList( TypeArgumentList( - SingletonSeparatedList( - GenericName(Identifier("IEnumerable")) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(partialItems.Syntax))) - ) - ) - ) - ), + SingletonSeparatedList(partialItem.Syntax))) + ), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } ) @@ -712,7 +731,7 @@ SyntaxSymbol partialItems ) ) ), - partialItems.Syntax + partialItem.Syntax } ) ) @@ -729,7 +748,7 @@ SyntaxSymbol partialItems Argument( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - partialItems.Syntax, + partialItem.Syntax, IdentifierName("From") ) ) @@ -831,10 +850,6 @@ SyntaxSymbol partialItems .WithTypeArgumentList( TypeArgumentList( SingletonSeparatedList( - GenericName(Identifier("IEnumerable")) - .WithTypeArgumentList( - TypeArgumentList( - SingletonSeparatedList( GenericName(Identifier(resolver.Request.Symbol.Name)) .WithTypeArgumentList( TypeArgumentList( @@ -843,9 +858,6 @@ SyntaxSymbol partialItems ) ) ) - ) - ) - ) ) ) ) @@ -899,21 +911,14 @@ SyntaxSymbol partialItems ); } - private static TypeDeclarationSyntax GenerateTypedHandler( + + private static TypeDeclarationSyntax GenerateTypedPartialItemsHandler( TypeDeclarationSyntax classDeclarationSyntax, RequestItem item, - RequestItem resolver + RequestItem resolver, + SyntaxSymbol partialItems ) { - TypeSyntax responseType = GenericName(Identifier(item.Response.Symbol.Name)) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))); - // Special case... because the spec is awesome - if (item.Response.Symbol.Name == "CommandOrCodeActionContainer") - { - responseType = GenericName(Identifier("CodeActionContainer")) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))); - } - return ClassDeclaration(classDeclarationSyntax.Identifier) .WithModifiers(classDeclarationSyntax.Modifiers) .WithAttributeLists(classDeclarationSyntax.AttributeLists) @@ -922,45 +927,74 @@ RequestItem resolver .AddMembers( ConstructorDeclaration(classDeclarationSyntax.Identifier) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword))) - .WithParameterList(ParameterList(SingletonSeparatedList(Parameter(Identifier("id")).WithType(IdentifierName("Guid"))))) + .WithParameterList( + ParameterList( + SeparatedList( + new[] { + Parameter(Identifier("id")).WithType(IdentifierName("Guid")), + Parameter(Identifier("progressManager")).WithType(IdentifierName("IProgressManager")) + } + ) + ) + ) .WithInitializer( ConstructorInitializer( SyntaxKind.BaseConstructorInitializer, - ArgumentList(SingletonSeparatedList(Argument(IdentifierName("id")))) + ArgumentList( + SeparatedList( + new[] { + Argument(IdentifierName("id")), + Argument( + IdentifierName("progressManager") + ) + } + ) + ) ) ) .WithBody(Block()), ConstructorDeclaration(classDeclarationSyntax.Identifier) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword))) + .WithParameterList(ParameterList(SingletonSeparatedList(Parameter(Identifier("progressManager")).WithType(IdentifierName("IProgressManager"))))) .WithInitializer( ConstructorInitializer( SyntaxKind.ThisConstructorInitializer, ArgumentList( - SingletonSeparatedList( - Argument( - InvocationExpression( - MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("Guid"), IdentifierName("NewGuid")) + SeparatedList( + new[] { + Argument( + InvocationExpression( + MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("Guid"), IdentifierName("NewGuid")) + ) + ), + Argument( + IdentifierName("progressManager") ) - ) + } ) ) ) ) .WithBody(Block()), - MethodDeclaration( - GenericName(Identifier("Task")).WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(item.Response.Syntax))), - Identifier("Handle") - ) - .WithModifiers( - TokenList( - Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.SealedKeyword), Token(SyntaxKind.OverrideKeyword), Token(SyntaxKind.AsyncKeyword) - ) - ) + MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier("Handle")) + .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.SealedKeyword), Token(SyntaxKind.OverrideKeyword))) .WithParameterList( ParameterList( SeparatedList( new[] { Parameter(Identifier("request")).WithType(item.Request.Syntax), + Parameter(Identifier("results")) + .WithType( + GenericName(Identifier("IObserver")) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + GenericName(Identifier("IEnumerable")) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(partialItems.Syntax))) + ) + ) + ) + ), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } ) @@ -968,101 +1002,137 @@ RequestItem resolver ) .WithExpressionBody( ArrowExpressionClause( - AwaitExpression( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - InvocationExpression(IdentifierName("HandleParams")) - .WithArgumentList( - ArgumentList( - SeparatedList( - new[] { - Argument(IdentifierName("request")), - Argument(IdentifierName("cancellationToken")) - } + InvocationExpression(IdentifierName("Handle")) + .WithArgumentList( + ArgumentList( + SeparatedList( + new[] { + Argument(IdentifierName("request")), + Argument( + ObjectCreationExpression( + QualifiedName( + IdentifierName("LanguageProtocolDelegatingHandlers"), + GenericName( + Identifier("TypedPartialObserver") + ) + .WithTypeArgumentList( + TypeArgumentList( + SeparatedList( + new[] { + GenericName(Identifier(resolver.Response.Symbol.Name)) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + IdentifierName("T") + ) + ) + ), + partialItems.Syntax + } + ) + ) + ) + ) + ) + .WithArgumentList( + ArgumentList( + SeparatedList( + new[] { + Argument( + IdentifierName("results") + ), + Argument( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + partialItems.Syntax, + IdentifierName("From") + ) + ) + } + ) + ) ) - ) ), - IdentifierName("ConfigureAwait") - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - LiteralExpression( - SyntaxKind.FalseLiteralExpression - ) - ) - ) + Argument(IdentifierName("cancellationToken")) + } ) ) - ) + ) ) ) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), MethodDeclaration( - GenericName(Identifier("Task")).WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(resolver.Response.Syntax))), + GenericName(Identifier("Task")) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + resolver.Response.Syntax + ) + ) + ), Identifier("Handle") ) .WithModifiers( - TokenList( - Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.SealedKeyword), Token(SyntaxKind.OverrideKeyword), Token(SyntaxKind.AsyncKeyword) - ) + TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.SealedKeyword), Token(SyntaxKind.OverrideKeyword), Token(SyntaxKind.AsyncKeyword)) ) .WithParameterList( ParameterList( SeparatedList( new[] { - Parameter(Identifier("request")).WithType(resolver.Response.Syntax), + Parameter(Identifier("request")).WithType(resolver.Request.Syntax), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } ) ) ) - .WithExpressionBody( - ArrowExpressionClause( - AwaitExpression( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - InvocationExpression(IdentifierName("HandleResolve")) - .WithArgumentList( - ArgumentList( - SeparatedList( - new[] { - Argument( - IdentifierName("request") - ), - Argument( - IdentifierName("cancellationToken") + .WithBody( + Block( + LocalDeclarationStatement( + VariableDeclaration(IdentifierName("var")) + .WithVariables( + SingletonSeparatedList( + VariableDeclarator(Identifier("response")) + .WithInitializer( + EqualsValueClause( + AwaitExpression( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + InvocationExpression( + IdentifierName("HandleResolve") + ) + .WithArgumentList( + ArgumentList( + SeparatedList( + new[] { + Argument(IdentifierName("request")), + Argument( + IdentifierName("cancellationToken") + ) + } + ) + ) + ), + IdentifierName("ConfigureAwait") + ) + ) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList(Argument(LiteralExpression(SyntaxKind.FalseLiteralExpression))) + ) ) - } ) ) - ), - IdentifierName("ConfigureAwait") - ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - LiteralExpression( - SyntaxKind.FalseLiteralExpression - ) ) - ) ) ) - ) + ), + ReturnStatement(IdentifierName("response")) ) - ) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), + ), MethodDeclaration( - GenericName(Identifier("Task")) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(responseType))), - Identifier("HandleParams") + PredefinedType(Token(SyntaxKind.VoidKeyword)), + Identifier("Handle") ) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.AbstractKeyword))) .WithParameterList( @@ -1070,21 +1140,50 @@ RequestItem resolver SeparatedList( new[] { Parameter(Identifier("request")).WithType(item.Request.Syntax), + Parameter(Identifier("results")) + .WithType( + GenericName(Identifier("IObserver")) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + GenericName(Identifier("IEnumerable")) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + GenericName(Identifier(resolver.Request.Symbol.Name)) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + IdentifierName("T") + ) + ) + ) + ) + ) + ) + ) + ) + ) + ), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } ) ) ) - .WithSemicolonToken( - Token(SyntaxKind.SemicolonToken) - ), + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), MethodDeclaration( GenericName(Identifier("Task")) .WithTypeArgumentList( TypeArgumentList( SingletonSeparatedList( - GenericName(Identifier(resolver.Response.Symbol.Name)) - .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))) + GenericName(Identifier(resolver.Request.Symbol.Name)) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + IdentifierName("T") + ) + ) + ) ) ) ), @@ -1097,9 +1196,14 @@ RequestItem resolver new[] { Parameter(Identifier("request")) .WithType( - GenericName(Identifier(resolver.Response.Symbol.Name)).WithTypeArgumentList( - TypeArgumentList(SingletonSeparatedList(IdentifierName("T"))) - ) + GenericName(Identifier(resolver.Request.Symbol.Name)) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + IdentifierName("T") + ) + ) + ) ), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } @@ -1109,5 +1213,217 @@ RequestItem resolver .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) ); } + + private static TypeDeclarationSyntax GenerateTypedHandler( + TypeDeclarationSyntax classDeclarationSyntax, + RequestItem item, + RequestItem resolver + ) + { + TypeSyntax responseType = GenericName(Identifier(item.Response.Symbol.Name)) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))); + // Special case... because the spec is awesome + if (item.Response.Symbol.Name == "CommandOrCodeActionContainer") + { + responseType = GenericName(Identifier("CodeActionContainer")) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))); + } + + var typeDeclarationSyntax = ClassDeclaration(classDeclarationSyntax.Identifier) + .WithModifiers(classDeclarationSyntax.Modifiers) + .WithAttributeLists(classDeclarationSyntax.AttributeLists) + .WithHandlerIdentityConstraint(true) + .WithBaseList(BaseList(SingletonSeparatedList(SimpleBaseType(IdentifierName(classDeclarationSyntax.Identifier.Text))))) + .AddMembers( + ConstructorDeclaration(classDeclarationSyntax.Identifier) + .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword))) + .WithParameterList(ParameterList(SingletonSeparatedList(Parameter(Identifier("id")).WithType(IdentifierName("Guid"))))) + .WithInitializer( + ConstructorInitializer( + SyntaxKind.BaseConstructorInitializer, + ArgumentList(SingletonSeparatedList(Argument(IdentifierName("id")))) + ) + ) + .WithBody(Block()), + ConstructorDeclaration(classDeclarationSyntax.Identifier) + .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword))) + .WithInitializer( + ConstructorInitializer( + SyntaxKind.ThisConstructorInitializer, + ArgumentList( + SingletonSeparatedList( + Argument( + InvocationExpression( + MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("Guid"), IdentifierName("NewGuid")) + ) + ) + ) + ) + ) + ) + .WithBody(Block()), + MethodDeclaration( + GenericName(Identifier("Task")).WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(item.Response.Syntax))), + Identifier("Handle") + ) + .WithModifiers( + TokenList( + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.SealedKeyword), Token(SyntaxKind.OverrideKeyword), Token(SyntaxKind.AsyncKeyword) + ) + ) + .WithParameterList( + ParameterList( + SeparatedList( + new[] { + Parameter(Identifier("request")).WithType(item.Request.Syntax), + Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) + } + ) + ) + ) + .WithExpressionBody( + ArrowExpressionClause( + AwaitExpression( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + InvocationExpression(IdentifierName("HandleParams")) + .WithArgumentList( + ArgumentList( + SeparatedList( + new[] { + Argument(IdentifierName("request")), + Argument(IdentifierName("cancellationToken")) + } + ) + ) + ), + IdentifierName("ConfigureAwait") + ) + ) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + LiteralExpression( + SyntaxKind.FalseLiteralExpression + ) + ) + ) + ) + ) + ) + ) + ) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), + MethodDeclaration( + GenericName(Identifier("Task")).WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(resolver.Response.Syntax))), + Identifier("Handle") + ) + .WithModifiers( + TokenList( + Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.SealedKeyword), Token(SyntaxKind.OverrideKeyword), Token(SyntaxKind.AsyncKeyword) + ) + ) + .WithParameterList( + ParameterList( + SeparatedList( + new[] { + Parameter(Identifier("request")).WithType(resolver.Response.Syntax), + Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) + } + ) + ) + ) + .WithExpressionBody( + ArrowExpressionClause( + AwaitExpression( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + InvocationExpression(IdentifierName("HandleResolve")) + .WithArgumentList( + ArgumentList( + SeparatedList( + new[] { + Argument( + IdentifierName("request") + ), + Argument( + IdentifierName("cancellationToken") + ) + } + ) + ) + ), + IdentifierName("ConfigureAwait") + ) + ) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + LiteralExpression( + SyntaxKind.FalseLiteralExpression + ) + ) + ) + ) + ) + ) + ) + ) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), + MethodDeclaration( + GenericName(Identifier("Task")) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(responseType))), + Identifier("HandleParams") + ) + .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.AbstractKeyword))) + .WithParameterList( + ParameterList( + SeparatedList( + new[] { + Parameter(Identifier("request")).WithType(item.Request.Syntax), + Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) + } + ) + ) + ) + .WithSemicolonToken( + Token(SyntaxKind.SemicolonToken) + ), + MethodDeclaration( + GenericName(Identifier("Task")) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList( + GenericName(Identifier(resolver.Response.Symbol.Name)) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))) + ) + ) + ), + Identifier("HandleResolve") + ) + .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.AbstractKeyword))) + .WithParameterList( + ParameterList( + SeparatedList( + new[] { + Parameter(Identifier("request")) + .WithType( + GenericName(Identifier(resolver.Response.Symbol.Name)).WithTypeArgumentList( + TypeArgumentList(SingletonSeparatedList(IdentifierName("T"))) + ) + ), + Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) + } + ) + ) + ) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + ); + return typeDeclarationSyntax; + } } } diff --git a/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs index b4f0324bc..925d615b3 100644 --- a/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnNotificationMethodGeneratorWithRegistrationOptionsStrategy.cs @@ -138,6 +138,7 @@ private static BlockSyntax GetNotificationRegistrationHandlerExpression( capabilityName, false ), + null, capabilityName, false ) diff --git a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs index 7ad741a03..b369106b4 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithRegistrationOptionsStrategy.cs @@ -44,9 +44,9 @@ public IEnumerable Apply(SourceProductionContext contex ) ); - if (item is RequestItem { Response: { Symbol: ITypeParameterSymbol } } ri) + if (request is { Response.Symbol: ITypeParameterSymbol }) { - method = method.AddTypeParameterListParameters(TypeParameter(ri.Response.Symbol.Name)); + method = method.AddTypeParameterListParameters(TypeParameter(request.Response.Symbol.Name)); } if (request.IsUnit) @@ -65,24 +65,27 @@ public IEnumerable Apply(SourceProductionContext contex var methodFactory = MakeFactory( extensionMethodContext.GetRegistryParameterList(), registrationOptions.Syntax, - item.Capability?.Syntax + request.Capability?.Syntax, + request.PartialHasInitialValue ); var factory = methodFactory(method); yield return factory( CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax), - resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + null ); yield return factory( CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax), - resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)) + resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)), + null ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, false, IdentifierName("T")), null); - yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T")), null); + yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, false, IdentifierName("T")), null, null); + yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T")), null, null); } { @@ -90,13 +93,14 @@ public IEnumerable Apply(SourceProductionContext contex { yield return factory( CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + null ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T"), capability.Syntax), null); + yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T"), capability.Syntax), null, null); } } } @@ -120,24 +124,29 @@ public IEnumerable Apply(SourceProductionContext contex yield return factory( CreatePartialAction(request.Request.Syntax, partialItemsSyntax, false), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItemsSyntax, true), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItemsSyntax, false), null); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItemsSyntax, true), null); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItemsSyntax, false), null, + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax)); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItemsSyntax, true), null, + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax)); } if (request.Capability is { } capability) { yield return factory( CreatePartialAction(request.Request.Syntax, partialItemsSyntax, true, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); } } @@ -160,47 +169,61 @@ public IEnumerable Apply(SourceProductionContext contex yield return factory( CreatePartialAction(request.Request.Syntax, partialItem.Syntax, false), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItem.Syntax, true), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, false), null); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true), null); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, false), null, + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax)); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true), null, + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax)); } if (request.Capability is { } capability) { yield return factory( CreatePartialAction(request.Request.Syntax, partialItem.Syntax, true, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true, capability.Syntax), null); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true, capability.Syntax), null, + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax)); } } } } - private static Func> MakeFactory( - ParameterListSyntax preParameterList, TypeSyntax registrationOptions, TypeSyntax? capabilityName + private static Func> MakeFactory( + ParameterListSyntax preParameterList, TypeSyntax registrationOptions, TypeSyntax? capabilityName, bool partialHasInitialValue ) { - return method => (syntax, resolveSyntax) => GenerateMethod(method, syntax, resolveSyntax); + return method => (syntax, resolveSyntax, initialHandlerSyntax) => generateMethod(method, syntax, resolveSyntax, initialHandlerSyntax); - MethodDeclarationSyntax MethodFactory(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, ParameterSyntax registrationParameter) + MethodDeclarationSyntax methodFactory(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, TypeSyntax? initialHandlerSyntax, ParameterSyntax registrationParameter) { return method .WithParameterList( preParameterList + .AddParameters( + partialHasInitialValue && initialHandlerSyntax is {} + ? new[] { + Parameter(Identifier("initialHandler")) + .WithType(initialHandlerSyntax) + } + : Array.Empty() + ) .AddParameters(Parameter(Identifier("handler")).WithType(syntax)) .AddParameters( resolveSyntax is { } @@ -208,18 +231,18 @@ resolveSyntax is { } Parameter(Identifier("resolveHandler")) .WithType(resolveSyntax) } - : new ParameterSyntax[] { } + : Array.Empty() ) .AddParameters(registrationParameter) ); } - MethodDeclarationSyntax GenerateMethod(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax) + MethodDeclarationSyntax generateMethod(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, TypeSyntax? initialHandlerSyntax) { if (capabilityName is { }) { - return MethodFactory( - method, syntax, resolveSyntax, + return methodFactory( + method, syntax, resolveSyntax, initialHandlerSyntax, Parameter(Identifier("registrationOptions")) .WithType( GenericName(Identifier("RegistrationOptionsDelegate")).WithTypeArgumentList( @@ -229,8 +252,8 @@ MethodDeclarationSyntax GenerateMethod(MethodDeclarationSyntax method, TypeSynta ); } - return MethodFactory( - method, syntax, resolveSyntax, + return methodFactory( + method, syntax, resolveSyntax, initialHandlerSyntax, Parameter(Identifier("registrationOptions")) .WithType( GenericName(Identifier("RegistrationOptionsDelegate")) @@ -272,6 +295,7 @@ private static BlockSyntax GetRequestHandlerExpression( capabilityName, false ), + null, capabilityName, resolve is not null ) @@ -315,6 +339,7 @@ private static BlockSyntax GetVoidRequestHandlerExpression( capabilityName, false ), + null, capabilityName, resolve is not null ) @@ -354,7 +379,7 @@ private static BlockSyntax GetPartialResultsHandlerExpression( ), CreateHandlerArgument( IdentifierName("LanguageProtocolDelegatingHandlers"), - "PartialResults", + item.PartialHasInitialValue ? "PartialResultsWithInitialValue" : "PartialResults", args.ToArray() ) .WithArgumentList( @@ -368,6 +393,13 @@ private static BlockSyntax GetPartialResultsHandlerExpression( capabilityName, true ), + item.PartialHasInitialValue ? + GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList( new [] { item.Request.Syntax, item.Response.Syntax } )), + InitialHandlerArgument, + capabilityName, + false + ): null, capabilityName ) ) @@ -405,7 +437,7 @@ private static BlockSyntax GetPartialResultHandlerExpression( Parameter( Identifier("_") ), - CreateHandlerArgument(IdentifierName("LanguageProtocolDelegatingHandlers"), "PartialResult", args.ToArray()) + CreateHandlerArgument(IdentifierName("LanguageProtocolDelegatingHandlers"), item.PartialHasInitialValue ? "PartialResultWithInitialValue" : "PartialResult", args.ToArray()) .WithArgumentList( GetPartialResultArgumentList( IdentifierName("registrationOptions"), @@ -417,6 +449,13 @@ private static BlockSyntax GetPartialResultHandlerExpression( capabilityName, true ), + item.PartialHasInitialValue ? + GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(new [] { item.Request.Syntax, item.Response.Syntax })), + InitialHandlerArgument, + capabilityName, + false + ): null, capabilityName ) ) @@ -466,6 +505,7 @@ private static void InsertResolveHandler( capabilityName, false ), + null, capabilityName, true ) @@ -476,11 +516,12 @@ private static void InsertResolveHandler( } private static ArgumentListSyntax GetPartialItemsArgumentList( - TypeSyntax registrationOptionsName, TypeSyntax registrationType, TypeSyntax responseName, ArgumentSyntax handlerArgument, TypeSyntax? capabilityType + TypeSyntax registrationOptionsName, TypeSyntax registrationType, TypeSyntax responseName, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument, TypeSyntax? capabilityType ) => ArgumentList( SeparatedList( new[] { + initialArgument!, handlerArgument, Argument(GetRegistrationOptionsAdapter(registrationOptionsName, registrationType, capabilityType)), Argument( @@ -500,16 +541,17 @@ private static ArgumentListSyntax GetPartialItemsArgumentList( IdentifierName("From") ) ) - } + }.Where(z => z is not null) ) ); private static ArgumentListSyntax GetPartialResultArgumentList( - TypeSyntax registrationOptionsName, TypeSyntax registrationType, TypeSyntax responseName, ArgumentSyntax handlerArgument, TypeSyntax? capabilityType + TypeSyntax registrationOptionsName, TypeSyntax registrationType, TypeSyntax responseName, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument, TypeSyntax? capabilityType ) => ArgumentList( SeparatedList( new[] { + initialArgument!, handlerArgument, Argument(GetRegistrationOptionsAdapter(registrationOptionsName, registrationType, capabilityType)), Argument( @@ -529,7 +571,7 @@ private static ArgumentListSyntax GetPartialResultArgumentList( IdentifierName("From") ) ) - } + }.Where(z => z is not null) ) ); } diff --git a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs index 0bdcdccaa..2bfb25e58 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy.cs @@ -46,16 +46,18 @@ public IEnumerable Apply(SourceProductionContext contex method = method.AddTypeParameterListParameters(TypeParameter(ri.Response.Symbol.Name)); } - var methodFactory = MakeFactory(extensionMethodContext.GetRegistryParameterList()); + var methodFactory = MakeFactory(extensionMethodContext.GetRegistryParameterList(), request.PartialHasInitialValue); var factory = methodFactory(method); yield return factory( CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax), - resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + null ); yield return factory( CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax), - resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(static r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + null ); if (allowDerivedRequests) @@ -63,9 +65,11 @@ public IEnumerable Apply(SourceProductionContext contex var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); yield return genericFactory( - CreateAsyncFunc(request.Response.Syntax, false, IdentifierName("T")), null + CreateAsyncFunc(request.Response.Syntax, false, IdentifierName("T")), null, + null ); - yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T")), null); + yield return genericFactory(CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T")), null, + null); } { @@ -94,7 +98,8 @@ public IEnumerable Apply(SourceProductionContext contex yield return factory( CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + null ); if (allowDerivedRequests) @@ -102,7 +107,8 @@ public IEnumerable Apply(SourceProductionContext contex var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); yield return genericFactory( CreateAsyncFunc(request.Response.Syntax, true, IdentifierName("T"), capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + null ); } } @@ -117,29 +123,33 @@ public IEnumerable Apply(SourceProductionContext contex .WithIdentifier(Identifier(item.JsonRpcAttributes.PartialHandlerMethodName)) .WithExpressionBody( GetPartialResultsHandlerExpression( - GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, partialItems.Syntax, request.Response.Syntax + GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, partialItems.Syntax, request.Response.Syntax, request.PartialHasInitialValue ) ) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItemsSyntax, false), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItemsSyntax, true), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); yield return genericFactory( CreatePartialAction(IdentifierName("T"), partialItemsSyntax, false), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax) ); yield return genericFactory( CreatePartialAction(IdentifierName("T"), partialItemsSyntax, true), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); } @@ -151,13 +161,14 @@ public IEnumerable Apply(SourceProductionContext contex .WithExpressionBody( GetPartialResultsCapabilityHandlerExpression( GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, request.Response.Syntax, - partialItems.Syntax, capability.Syntax + partialItems.Syntax, capability.Syntax, request.PartialHasInitialValue ) ) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItemsSyntax, true, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) @@ -165,7 +176,8 @@ public IEnumerable Apply(SourceProductionContext contex var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); yield return genericFactory( CreatePartialAction(IdentifierName("T"), partialItemsSyntax, true, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); } } @@ -176,24 +188,28 @@ public IEnumerable Apply(SourceProductionContext contex factory = methodFactory( method.WithExpressionBody( GetPartialResultHandlerExpression( - GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, partialItem.Syntax, request.Response.Syntax + GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, partialItem.Syntax, request.Response.Syntax, request.PartialHasInitialValue ) ) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItem.Syntax, false), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, false, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, false, request.Request.Syntax) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItem.Syntax, true), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, false), null); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true), null); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, false), null, + CreateAsyncFunc(request.Response.Syntax, false, request.Response.Syntax, partialItem.Syntax)); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true), null, + CreateAsyncFunc(request.Response.Syntax, true, request.Response.Syntax, partialItem.Syntax)); } if (request.Capability is { } capability) @@ -201,35 +217,45 @@ public IEnumerable Apply(SourceProductionContext contex factory = methodFactory( method.WithExpressionBody( GetPartialResultCapabilityHandlerExpression( - GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, partialItem.Syntax, request.Response.Syntax, capability.Syntax + GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), request.Request.Syntax, partialItem.Syntax, request.Response.Syntax, capability.Syntax, request.PartialHasInitialValue ) ) ); yield return factory( CreatePartialAction(request.Request.Syntax, partialItem.Syntax, true, capability.Syntax), - resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)) + resolve.ReturnIfNotNull(r => CreateAsyncFunc(r.Response.Syntax, true, r.Request.Syntax, capability.Syntax)), + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax) ); if (allowDerivedRequests) { var genericFactory = MakeGenericFactory(factory, request.Request.Syntax); - yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true, capability.Syntax), null); + yield return genericFactory(CreatePartialAction(IdentifierName("T"), partialItem.Syntax, true, capability.Syntax), null, + CreateAsyncFunc(request.Response.Syntax, true, request.Request.Syntax)); } } } } - private static Func> MakeFactory( - ParameterListSyntax preParameterList + private static Func> MakeFactory( + ParameterListSyntax preParameterList, bool partialHasInitialValue ) { - return method => (syntax, resolveSyntax) => GenerateMethods(method, syntax, resolveSyntax); + return method => (syntax, resolveSyntax, initialHandlerSyntax) => generateMethods(method, syntax, resolveSyntax, initialHandlerSyntax); - MethodDeclarationSyntax MethodFactory(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax) + MethodDeclarationSyntax methodFactory(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, TypeSyntax? initialHandlerSyntax) { return method .WithParameterList( preParameterList + .AddParameters( + partialHasInitialValue && initialHandlerSyntax is {} + ? new[] { + Parameter(Identifier("initialHandler")) + .WithType(initialHandlerSyntax) + } + : Array.Empty() + ) .AddParameters(Parameter(Identifier("handler")).WithType(syntax)) .AddParameters( resolveSyntax is { } @@ -237,12 +263,12 @@ resolveSyntax is { } Parameter(Identifier("resolveHandler")) .WithType(resolveSyntax) } - : new ParameterSyntax[] { } + : Array.Empty() ) ); } - MethodDeclarationSyntax GenerateMethods(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax) => MethodFactory(method, syntax, resolveSyntax); + MethodDeclarationSyntax generateMethods(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, TypeSyntax? initialHandlerSyntax) => methodFactory(method, syntax, resolveSyntax, initialHandlerSyntax); } } } diff --git a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs index 303f9908d..09773d9e7 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy.cs @@ -42,6 +42,7 @@ public IEnumerable Apply(SourceProductionContext contex responseType = GenericName(Identifier("CodeActionContainer")) .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))); } + responseType = request.Response.Syntax is NullableTypeSyntax ? NullableType(responseType) : responseType; var method = MethodDeclaration(extensionMethodContext.Item, item.JsonRpcAttributes.HandlerMethodName) @@ -66,17 +67,20 @@ public IEnumerable Apply(SourceProductionContext contex var methodFactory = MakeFactory( extensionMethodContext.GetRegistryParameterList(), registrationOptions.Syntax, - item.Capability?.Syntax + item.Capability?.Syntax, + request.PartialHasInitialValue ); var factory = methodFactory(method); yield return factory( CreateAsyncFunc(responseType, false, requestType), - CreateAsyncFunc(resolveType, false, resolveType) + CreateAsyncFunc(resolveType, false, resolveType), + null ); yield return factory( CreateAsyncFunc(responseType, true, requestType), - CreateAsyncFunc(resolveType, true, resolveType) + CreateAsyncFunc(resolveType, true, resolveType), + null ); { @@ -84,7 +88,8 @@ public IEnumerable Apply(SourceProductionContext contex { yield return factory( CreateAsyncFunc(responseType, true, requestType, capability.Syntax), - CreateAsyncFunc(resolveType, true, resolveType, capability.Syntax) + CreateAsyncFunc(resolveType, true, resolveType, capability.Syntax), + null ); } } @@ -101,6 +106,7 @@ public IEnumerable Apply(SourceProductionContext contex request, requestType, resolveType, + responseType, registrationOptions.Syntax, item.Capability?.Syntax ) @@ -109,18 +115,21 @@ public IEnumerable Apply(SourceProductionContext contex yield return factory( CreatePartialAction(requestType, enumerableType, false), - CreateAsyncFunc(resolveType, false, resolveType) + CreateAsyncFunc(resolveType, false, resolveType), + CreateAsyncFunc(responseType, false, requestType) ); yield return factory( CreatePartialAction(requestType, enumerableType, true), - CreateAsyncFunc(resolveType, true, resolveType) + CreateAsyncFunc(resolveType, true, resolveType), + CreateAsyncFunc(responseType, true, requestType) ); if (request.Capability is { } capability) { yield return factory( CreatePartialAction(requestType, enumerableType, true, capability.Syntax), - CreateAsyncFunc(resolveType, true, resolveType, capability.Syntax) + CreateAsyncFunc(resolveType, true, resolveType, capability.Syntax), + CreateAsyncFunc(responseType, true, requestType) ); } } @@ -135,6 +144,7 @@ public IEnumerable Apply(SourceProductionContext contex request, requestType, resolveType, + responseType, registrationOptions.Syntax, item.Capability?.Syntax ) @@ -143,53 +153,67 @@ public IEnumerable Apply(SourceProductionContext contex yield return factory( CreatePartialAction(requestType, resolveType, false), - CreateAsyncFunc(resolveType, false, resolveType) + CreateAsyncFunc(resolveType, false, resolveType), + CreateAsyncFunc(responseType, false, requestType) ); yield return factory( CreatePartialAction(requestType, resolveType, true), - CreateAsyncFunc(resolveType, true, resolveType) + CreateAsyncFunc(resolveType, true, resolveType), + CreateAsyncFunc(responseType, true, requestType) ); if (request.Capability is { } capability) { yield return factory( CreatePartialAction(requestType, resolveType, true, capability.Syntax), - CreateAsyncFunc(resolveType, true, resolveType, capability.Syntax) + CreateAsyncFunc(resolveType, true, resolveType, capability.Syntax), + CreateAsyncFunc(responseType, true, requestType) ); } } } - private static Func> MakeFactory( - ParameterListSyntax preParameterList, TypeSyntax registrationOptions, TypeSyntax? capabilityName + private static Func> MakeFactory( + ParameterListSyntax preParameterList, TypeSyntax registrationOptions, TypeSyntax? capabilityName, bool partialHasInitialValue ) { - return method => (syntax, resolveSyntax) => GenerateMethod(method, syntax, resolveSyntax); + return method => (syntax, resolveSyntax, initialValueSyntax) => GenerateMethod(method, syntax, resolveSyntax, initialValueSyntax); - MethodDeclarationSyntax MethodFactory(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, ParameterSyntax registrationParameter) + MethodDeclarationSyntax MethodFactory( + MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, TypeSyntax? initialHandlerSyntax, ParameterSyntax registrationParameter + ) { return method - .WithParameterList( - preParameterList - .AddParameters(Parameter(Identifier("handler")).WithType(syntax)) - .AddParameters( - resolveSyntax is { } - ? new[] { - Parameter(Identifier("resolveHandler")) - .WithType(resolveSyntax) - } - : new ParameterSyntax[] { } - ) - .AddParameters(registrationParameter) - ); + .WithParameterList( + preParameterList + .AddParameters( + partialHasInitialValue && initialHandlerSyntax is {} + ? new[] { + Parameter(Identifier("initialHandler")) + .WithType(initialHandlerSyntax) + } + : Array.Empty() + ) + .AddParameters(Parameter(Identifier("handler")).WithType(syntax)) + .AddParameters( + resolveSyntax is { } + ? new[] + { + Parameter(Identifier("resolveHandler")) + .WithType(resolveSyntax) + } + : new ParameterSyntax[] { } + ) + .AddParameters(registrationParameter) + ); } - MethodDeclarationSyntax GenerateMethod(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax) + MethodDeclarationSyntax GenerateMethod(MethodDeclarationSyntax method, TypeSyntax syntax, TypeSyntax? resolveSyntax, TypeSyntax? initialHandlerSyntax) { if (capabilityName is { }) { return MethodFactory( - method, syntax, resolveSyntax, + method, syntax, resolveSyntax, initialHandlerSyntax, Parameter(Identifier("registrationOptions")) .WithType( GenericName(Identifier("RegistrationOptionsDelegate")).WithTypeArgumentList( @@ -200,7 +224,7 @@ MethodDeclarationSyntax GenerateMethod(MethodDeclarationSyntax method, TypeSynta } return MethodFactory( - method, syntax, resolveSyntax, + method, syntax, resolveSyntax, initialHandlerSyntax, Parameter(Identifier("registrationOptions")) .WithType( GenericName(Identifier("RegistrationOptionsDelegate")) @@ -229,29 +253,32 @@ private static BlockSyntax GetRequestHandlerExpression( typeArgs = typeArgs.Add(capabilityName); } - return Block(ReturnStatement( - AddHandler( - Argument( - CreateHandlerArgument($"Delegating{request.JsonRpcAttributes.HandlerName}Handler", IdentifierName("T")) - .WithArgumentList( - HandlerArgumentList( - IdentifierName("registrationOptions"), - registrationOptions, - capabilityName, - TypeArgumentList(SeparatedList(handlerAdapterArgs)), - TypeArgumentList(SeparatedList(resolveAdapterArgs)), - TypeArgumentList(SeparatedList(typeArgs.ToArray())) - ) - ) - ) - ) - )); + return Block( + ReturnStatement( + AddHandler( + Argument( + CreateHandlerArgument($"Delegating{request.JsonRpcAttributes.HandlerName}Handler", IdentifierName("T")) + .WithArgumentList( + HandlerArgumentList( + IdentifierName("registrationOptions"), + registrationOptions, + capabilityName, + TypeArgumentList(SeparatedList(handlerAdapterArgs)), + TypeArgumentList(SeparatedList(resolveAdapterArgs)), + TypeArgumentList(SeparatedList(typeArgs.ToArray())) + ) + ) + ) + ) + ) + ); } private static BlockSyntax GetPartialHandlerExpression( RequestItem request, TypeSyntax requestSyntax, TypeSyntax resolveSyntax, + TypeSyntax responseSyntax, TypeSyntax registrationOptions, TypeSyntax? capabilityName ) @@ -259,33 +286,46 @@ private static BlockSyntax GetPartialHandlerExpression( var typeArgs = ImmutableArray.Create(registrationOptions); var handlerAdapterArgs = ImmutableArray.Create(requestSyntax, resolveSyntax); var resolveAdapterArgs = ImmutableArray.Create(resolveSyntax, resolveSyntax); + var initialValueAdapterArgs = ImmutableArray.Create(requestSyntax, responseSyntax); if (capabilityName is { }) { typeArgs = typeArgs.Add(capabilityName); } - return Block(ReturnStatement( - AddHandler( - Argument( - SimpleLambdaExpression( - Parameter( - Identifier("_") - ), - CreateHandlerArgument($"Delegating{request.JsonRpcAttributes.HandlerName}PartialHandler", IdentifierName("T")) - .WithArgumentList( - PartialHandlerArgumentList( - IdentifierName("registrationOptions"), - registrationOptions, - capabilityName, - TypeArgumentList(SeparatedList(handlerAdapterArgs)), - TypeArgumentList(SeparatedList(resolveAdapterArgs)), - TypeArgumentList(SeparatedList(typeArgs.ToArray())) - ) - ) + return Block( + ReturnStatement( + AddHandler( + Argument( + SimpleLambdaExpression( + Parameter(Identifier("_")), + CreateHandlerArgument($"Delegating{request.JsonRpcAttributes.HandlerName}PartialHandler", IdentifierName("T")) + .WithArgumentList( + PartialHandlerArgumentList( + IdentifierName("registrationOptions"), + registrationOptions, + capabilityName, + TypeArgumentList(SeparatedList(handlerAdapterArgs)), + TypeArgumentList(SeparatedList(resolveAdapterArgs)), + TypeArgumentList(SeparatedList(typeArgs.ToArray())) + ).AddArguments( + request.PartialHasInitialValue + ? new[] + { + GetHandlerAdapterArgument( + TypeArgumentList(SeparatedList(initialValueAdapterArgs)), + InitialHandlerArgument, + capabilityName, + false + ) + } + : Array.Empty() + ) ) - ) - ) - )); + ) + ) + ) + ) + ); } public static ArgumentListSyntax HandlerArgumentList( @@ -298,7 +338,8 @@ TypeArgumentListSyntax registrationAdapterArgs ) => ArgumentList( SeparatedList( - new[] { + new[] + { Argument(GetRegistrationOptionsAdapter(registrationOptionsName, registrationType, capabilityName)), GetHandlerAdapterArgument( handlerAdapterArgs, @@ -326,7 +367,8 @@ TypeArgumentListSyntax registrationAdapterArgs ) => ArgumentList( SeparatedList( - new[] { + new[] + { Argument( InvocationExpression( MemberAccessExpression( diff --git a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs index a7f88defc..9b6a83b3f 100644 --- a/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy.cs @@ -118,7 +118,7 @@ public IEnumerable Apply(SourceProductionContext contex .WithIdentifier(Identifier(item.JsonRpcAttributes.PartialHandlerMethodName)) .WithExpressionBody( GetPartialResultsHandlerExpression( - GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, partialItems.Syntax, responseType + GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, partialItems.Syntax, responseType, request.PartialHasInitialValue ) ) ); @@ -140,7 +140,7 @@ public IEnumerable Apply(SourceProductionContext contex .WithExpressionBody( GetPartialResultsCapabilityHandlerExpression( GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, responseType, - resolveType, capability.Syntax + resolveType, capability.Syntax, request.PartialHasInitialValue ) ) ); @@ -157,7 +157,7 @@ public IEnumerable Apply(SourceProductionContext contex factory = methodFactory( method.WithExpressionBody( GetPartialResultHandlerExpression( - GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, observerType, responseType + GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, observerType, responseType, request.PartialHasInitialValue ) ) ); @@ -175,7 +175,7 @@ public IEnumerable Apply(SourceProductionContext contex factory = methodFactory( method.WithExpressionBody( GetPartialResultCapabilityHandlerExpression( - GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, observerType, responseType, capability.Syntax + GetJsonRpcMethodName(extensionMethodContext.TypeDeclaration), requestType, observerType, responseType, capability.Syntax, request.PartialHasInitialValue ) ) ); diff --git a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs index 7bbc19ce3..54cf6194b 100644 --- a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs @@ -16,7 +16,8 @@ public IEnumerable Apply(SourceProductionContext contex var parameterList = ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("mediator")) .WithType(extensionMethodContext.Item) .WithModifiers(TokenList(Token(SyntaxKind.ThisKeyword))), @@ -43,7 +44,8 @@ public IEnumerable Apply(SourceProductionContext contex .WithTypeArgumentList( TypeArgumentList( SeparatedList( - new[] { + new[] + { request.PartialItem.Syntax, request.Response!.Syntax } @@ -59,7 +61,9 @@ public IEnumerable Apply(SourceProductionContext contex ) ) .WithParameterList(parameterList) - .WithExpressionBody(Helpers.GetPartialInvokeExpression(request.Response.Syntax, request.PartialItem.Syntax)) + .WithExpressionBody( + Helpers.GetPartialInvokeExpression(request.Response.Syntax, request.PartialHasInitialValue ? null : request.PartialItem.Syntax) + ) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); yield break; } @@ -67,7 +71,8 @@ public IEnumerable Apply(SourceProductionContext contex if (request.PartialItems is not null) { request.AdditionalUsings.Add("OmniSharp.Extensions.LanguageServer.Protocol.Progress"); - var partialItemsSyntax = GenericName("IEnumerable").WithTypeArgumentList(TypeArgumentList(SeparatedList(new[] { request.PartialItems!.Syntax }))); + var partialItemsSyntax = + GenericName("IEnumerable").WithTypeArgumentList(TypeArgumentList(SeparatedList(new[] { request.PartialItems!.Syntax }))); yield return MethodDeclaration( GenericName( Identifier("IRequestProgressObservable") @@ -75,7 +80,8 @@ public IEnumerable Apply(SourceProductionContext contex .WithTypeArgumentList( TypeArgumentList( SeparatedList( - new[] { + new[] + { partialItemsSyntax, request.Response!.Syntax } diff --git a/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs b/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs index 21d7b9905..cca004233 100644 --- a/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/TypedDelegatingHandlerStrategy.cs @@ -71,7 +71,8 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI .WithTypeArgumentList( TypeArgumentList( SeparatedList( - new[] { + new[] + { item.RegistrationOptions.Syntax, item.Capability.Syntax } @@ -80,14 +81,17 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI ); handler = handler.AddMembers( - FieldDeclaration(VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory"))))) + FieldDeclaration( + VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory")))) + ) .WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword))), MethodDeclaration(item.RegistrationOptions.Syntax, Identifier("CreateRegistrationOptions")) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.OverrideKeyword))) .WithParameterList( ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("capability")).WithType(item.Capability.Syntax), Parameter(Identifier("clientCapabilities")).WithType(IdentifierName("ClientCapabilities")) } @@ -100,7 +104,8 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI .WithArgumentList( ArgumentList( SeparatedList( - new[] { + new[] + { Argument(IdentifierName("capability")), Argument(IdentifierName("clientCapabilities")) } @@ -119,7 +124,9 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(item.RegistrationOptions.Syntax))); handler = handler.AddMembers( - FieldDeclaration(VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory"))))) + FieldDeclaration( + VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory")))) + ) .WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword))), MethodDeclaration(item.RegistrationOptions.Syntax, Identifier("CreateRegistrationOptions")) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.OverrideKeyword))) @@ -129,7 +136,8 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI .WithArgumentList( ArgumentList( SeparatedList( - new[] { + new[] + { Argument(IdentifierName("capability")), Argument(IdentifierName("clientCapabilities")) } @@ -239,7 +247,8 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI .WithParameterList( ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("request")).WithType(requestType), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } @@ -253,12 +262,14 @@ private TypeDeclarationSyntax CreateDelegatingHandler(RequestItem item, RequestI ArgumentList( SeparatedList( item.Capability is { } - ? new[] { + ? new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("Capability")), Argument(IdentifierName("cancellationToken")) } - : new[] { + : new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("cancellationToken")) } @@ -280,7 +291,8 @@ item.Capability is { } .WithParameterList( ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("request")).WithType(resolveType), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } @@ -294,12 +306,14 @@ item.Capability is { } ArgumentList( SeparatedList( item.Capability is { } - ? new[] { + ? new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("Capability")), Argument(IdentifierName("cancellationToken")) } - : new[] { + : new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("cancellationToken")) } @@ -378,7 +392,8 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R ) ); - var constructorParams = ParameterList(SingletonSeparatedList(Parameter(Identifier("progressManager")).WithType(IdentifierName("IProgressManager")))); + var constructorParams = + ParameterList(SingletonSeparatedList(Parameter(Identifier("progressManager")).WithType(IdentifierName("IProgressManager")))); if (item.RegistrationOptions is { }) { @@ -388,7 +403,8 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R .WithTypeArgumentList( TypeArgumentList( SeparatedList( - new[] { + new[] + { item.RegistrationOptions.Syntax, item.Capability.Syntax } @@ -397,14 +413,17 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R ); handler = handler.AddMembers( - FieldDeclaration(VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory"))))) + FieldDeclaration( + VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory")))) + ) .WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword))), MethodDeclaration(item.RegistrationOptions.Syntax, Identifier("CreateRegistrationOptions")) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.OverrideKeyword))) .WithParameterList( ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("capability")).WithType(item.Capability.Syntax), Parameter(Identifier("clientCapabilities")).WithType(IdentifierName("ClientCapabilities")) } @@ -418,7 +437,8 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R ArgumentList( SeparatedList( SeparatedList( - new[] { + new[] + { Argument(IdentifierName("capability")), Argument(IdentifierName("clientCapabilities")) } @@ -438,7 +458,9 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(item.RegistrationOptions.Syntax))); handler = handler.AddMembers( - FieldDeclaration(VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory"))))) + FieldDeclaration( + VariableDeclaration(type).WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_registrationOptionsFactory")))) + ) .WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword))), MethodDeclaration(item.RegistrationOptions.Syntax, Identifier("CreateRegistrationOptions")) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.OverrideKeyword))) @@ -448,7 +470,8 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R .WithArgumentList( ArgumentList( SeparatedList( - new[] { + new[] + { Argument(IdentifierName("capability")), Argument(IdentifierName("clientCapabilities")) } @@ -490,6 +513,20 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R Parameter(Identifier("handleResolve")) .WithType(DelegateHelpers.CreateAsyncFunc(resolveType, true, resolveType, item.Capability.Syntax)) ); + if (item is { PartialHasInitialValue: true }) + { + handler = handler.AddMembers( + FieldDeclaration( + VariableDeclaration(DelegateHelpers.CreateAsyncFunc(responseType, true, requestType, item.Capability.Syntax)) + .WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_handleInitialValue")))) + ) + .WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword))) + ); + constructorParams = constructorParams.AddParameters( + Parameter(Identifier("handleInitialValue")) + .WithType(DelegateHelpers.CreateAsyncFunc(responseType, true, requestType, item.Capability.Syntax)) + ); + } } else { @@ -512,49 +549,81 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R Parameter(Identifier("handleResolve")) .WithType(DelegateHelpers.CreateAsyncFunc(resolveType, true, resolveType)) ); + if (item is { PartialHasInitialValue: true }) + { + handler = handler.AddMembers( + FieldDeclaration( + VariableDeclaration(DelegateHelpers.CreateAsyncFunc(responseType, true, requestType)) + .WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier("_handleInitialValue")))) + ) + .WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword))) + ); + constructorParams = constructorParams.AddParameters( + Parameter(Identifier("handleInitialValue")) + .WithType(DelegateHelpers.CreateAsyncFunc(responseType, true, requestType)) + ); + } } - handler = handler.AddMembers( - ConstructorDeclaration(Identifier($"Delegating{item.JsonRpcAttributes.HandlerName}PartialHandler")) - .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) - .WithParameterList(constructorParams) - .WithInitializer( - ConstructorInitializer( - SyntaxKind.BaseConstructorInitializer, - ArgumentList(SingletonSeparatedList(Argument(IdentifierName("progressManager")))) - ) - ) - .WithBody( - Block( - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - IdentifierName("_registrationOptionsFactory"), - IdentifierName("registrationOptionsFactory") - ) - ), - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - IdentifierName("_handle"), - IdentifierName("handle") - ) - ), - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - IdentifierName("_handleResolve"), - IdentifierName("handleResolve") - ) + var constructorDeclaration = ConstructorDeclaration(Identifier($"Delegating{item.JsonRpcAttributes.HandlerName}PartialHandler")) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword))) + .WithParameterList(constructorParams) + .WithInitializer( + ConstructorInitializer( + SyntaxKind.BaseConstructorInitializer, + ArgumentList(SingletonSeparatedList(Argument(IdentifierName("progressManager")))) + ) + ) + .WithBody( + Block( + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + IdentifierName("_registrationOptionsFactory"), + IdentifierName("registrationOptionsFactory") + ) + ), + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + IdentifierName("_handle"), + IdentifierName("handle") + ) + ), + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + IdentifierName("_handleResolve"), + IdentifierName("handleResolve") + ) + ) + ) + ); + + if (item is { PartialHasInitialValue: true }) + { + constructorDeclaration = constructorDeclaration.WithBody( + constructorDeclaration.Body!.AddStatements( + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + IdentifierName("_handleInitialValue"), + IdentifierName("handleInitialValue") ) ) - ), + ) + ); + } + + handler = handler.AddMembers( + constructorDeclaration, MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier("Handle")) .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.OverrideKeyword))) .WithParameterList( ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("request")).WithType(requestType), Parameter(Identifier("results")).WithType(observerType), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) @@ -569,13 +638,15 @@ private TypeDeclarationSyntax CreateDelegatingPartialHandler(RequestItem item, R ArgumentList( SeparatedList( item.Capability is { } - ? new[] { + ? new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("results")), Argument(IdentifierName("Capability")), Argument(IdentifierName("cancellationToken")) } - : new[] { + : new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("results")), Argument(IdentifierName("cancellationToken")) @@ -585,9 +656,7 @@ item.Capability is { } ) ) ) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - ); - handler = handler.AddMembers( + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), MethodDeclaration( GenericName(Identifier("Task")) .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(resolveType))), @@ -597,7 +666,8 @@ item.Capability is { } .WithParameterList( ParameterList( SeparatedList( - new[] { + new[] + { Parameter(Identifier("request")).WithType(resolveType), Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) } @@ -611,12 +681,14 @@ item.Capability is { } ArgumentList( SeparatedList( item.Capability is { } - ? new[] { + ? new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("Capability")), Argument(IdentifierName("cancellationToken")) } - : new[] { + : new[] + { Argument(IdentifierName("request")), Argument(IdentifierName("cancellationToken")) } @@ -627,6 +699,71 @@ item.Capability is { } ) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) ); + if (item is { PartialHasInitialValue: true }) + { + handler = handler.AddMembers( + MethodDeclaration( + GenericName(Identifier("Task")) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(item.Response.Syntax))), + Identifier("HandleInitialValue") + ) + .WithModifiers(TokenList(Token(SyntaxKind.ProtectedKeyword), Token(SyntaxKind.OverrideKeyword), Token(SyntaxKind.AsyncKeyword))) + .WithParameterList( + ParameterList( + SeparatedList( + new[] + { + Parameter(Identifier("request")).WithType(requestType), + Parameter(Identifier("cancellationToken")).WithType(IdentifierName("CancellationToken")) + } + ) + ) + ) + .WithExpressionBody( + ArrowExpressionClause( + AwaitExpression( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + InvocationExpression(IdentifierName("_handleInitialValue")) + .WithArgumentList( + ArgumentList( + SeparatedList( + item.Capability is { } + ? new[] + { + Argument(IdentifierName("request")), + Argument(IdentifierName("Capability")), + Argument(IdentifierName("cancellationToken")) + } + : new[] + { + Argument(IdentifierName("request")), + Argument(IdentifierName("cancellationToken")) + } + ) + ) + ), + IdentifierName("ConfigureAwait") + ) + ) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + LiteralExpression( + SyntaxKind.FalseLiteralExpression + ) + ) + ) + ) + ) + ) + ) + ) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + ); + } return handler; diff --git a/src/JsonRpc.Generators/StronglyTypedGenerator.cs b/src/JsonRpc.Generators/StronglyTypedGenerator.cs index 299cd4f25..951a8552c 100644 --- a/src/JsonRpc.Generators/StronglyTypedGenerator.cs +++ b/src/JsonRpc.Generators/StronglyTypedGenerator.cs @@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Operations; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using static OmniSharp.Extensions.JsonRpc.Generators.Helpers; @@ -28,13 +29,13 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var attributes = context.CompilationProvider .Select( (compilation, _) => new AttributeData( - compilation.GetTypeByMetadataName( - "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute" - )!, - compilation.GetTypeByMetadataName( - "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateContainerAttribute" - )! - ) + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute" + )!, + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateContainerAttribute" + )! + ) ); var createContainersSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( @@ -152,7 +153,7 @@ private static void CreateTypedClass( INamedTypeSymbol? generateTypedDataAttributeSymbol, INamedTypeSymbol? generateContainerAttributeSymbol, bool includeHandlerIdentity - ) + ) { var attribute = typeSymbol?.GetAttributes() .FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateTypedDataAttributeSymbol)); @@ -221,62 +222,67 @@ bool includeHandlerIdentity if (container is { }) { var containerName = container is { ConstructorArguments: { Length: > 0 } arguments } ? arguments[0].Value as string : null; + var typedContainer = CreateContainerClass(typedClass, containerName) .WithHandlerIdentityConstraint(includeHandlerIdentity); var typedArgumentList = TypeArgumentList(SingletonSeparatedList(IdentifierName("T"))); - typedContainer = typedContainer - .AddMembers( - ConversionOperatorDeclaration(Token(SyntaxKind.ImplicitKeyword), IdentifierName(typedContainer.Identifier)) - .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) - .WithParameterList( - ParameterList( - SingletonSeparatedList( - Parameter(Identifier("container")) - .WithType(GenericName(typedContainer.Identifier).WithTypeArgumentList(typedArgumentList)) + + if (!(container is { NamedArguments: { Length: > 0 } namedArguments } && namedArguments.FirstOrDefault(z => z.Key == "GenerateImplicitConversion") is { Value.Value: false })) + { + typedContainer = typedContainer + .AddMembers( + ConversionOperatorDeclaration(Token(SyntaxKind.ImplicitKeyword), IdentifierName(typedContainer.Identifier)) + .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) + .WithParameterList( + ParameterList( + SingletonSeparatedList( + Parameter(Identifier("container")) + .WithType(GenericName(typedContainer.Identifier).WithTypeArgumentList(typedArgumentList)) + ) ) ) - ) - .WithExpressionBody( - ArrowExpressionClause( - ObjectCreationExpression(IdentifierName(typedContainer.Identifier)) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("container"), - IdentifierName("Select") + .WithExpressionBody( + ArrowExpressionClause( + ObjectCreationExpression(IdentifierName(typedContainer.Identifier)) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("container"), + IdentifierName("Select") + ) ) - ) - .WithArgumentList( - ArgumentList( - SingletonSeparatedList( - Argument( - SimpleLambdaExpression(Parameter(Identifier("value"))) - .WithExpressionBody( - CastExpression( - IdentifierName(candidate.Identifier), - IdentifierName("value") + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + SimpleLambdaExpression(Parameter(Identifier("value"))) + .WithExpressionBody( + CastExpression( + IdentifierName(candidate.Identifier), + IdentifierName("value") + ) ) - ) + ) ) ) ) - ) + ) ) ) ) - ) + ) ) - ) - .MakeMethodNullable(IdentifierName("container")) - .WithSemicolonToken( - Token(SyntaxKind.SemicolonToken) - ) - ); + .MakeMethodNullable(IdentifierName("container")) + .WithSemicolonToken( + Token(SyntaxKind.SemicolonToken) + ) + ); + } compilationMembers.Add(typedContainer); } diff --git a/src/JsonRpc/JsonRpc.csproj b/src/JsonRpc/JsonRpc.csproj index 29782f6dc..efa5b2beb 100644 --- a/src/JsonRpc/JsonRpc.csproj +++ b/src/JsonRpc/JsonRpc.csproj @@ -17,67 +17,48 @@ - + - <_Parameter1 - >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.JsonRpc.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.JsonRpc.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageProtocol, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageProtocol, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Client, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.DebugAdapter.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/JsonRpc/Server/ErrorCodes.cs b/src/JsonRpc/Server/ErrorCodes.cs index a33a53c7f..99bfcb5a0 100644 --- a/src/JsonRpc/Server/ErrorCodes.cs +++ b/src/JsonRpc/Server/ErrorCodes.cs @@ -51,8 +51,25 @@ public static class ErrorCodes public const int RequestCancelled = -32800; /// - /// Request was cancelled. + /// Content was modified /// public const int ContentModified = -32801; + + /// + /// A request failed but it was syntactically correct, e.g the + /// method name was known and the parameters were valid. The error + /// message should contain human readable information about why + /// the request failed. + /// @since 3.17.0 + /// + public const int RequestFailed = -32803; + + /// + /// The server cancelled the request. This error code should + /// only be used for requests that explicitly support being + /// server cancellable. + /// @since 3.17.0 + /// + public const int ServerCancelled = -32802; } } diff --git a/src/JsonRpc/Server/RequestFailedException.cs b/src/JsonRpc/Server/RequestFailedException.cs new file mode 100644 index 000000000..8ea568a5f --- /dev/null +++ b/src/JsonRpc/Server/RequestFailedException.cs @@ -0,0 +1,87 @@ +ο»Ώusing System.Runtime.Serialization; + +namespace OmniSharp.Extensions.JsonRpc.Server; + +/// +/// Exception raised when request parameters are invalid according to the target method. +/// +[Serializable] +public class RequestFailedException + : TaskCanceledException, IRequestException +{ + /// + /// Create a new . + /// + /// + /// The LSP / JSON-RPC request Id (if known). + /// + public RequestFailedException(object? requestId) + : this(ErrorCodes.RequestFailed, requestId?.ToString() ?? "(unknown)", "Content not modified.", null!) + { + } + + /// + /// Create a new . + /// + /// + /// The LSP / JSON-RPC request Id (if known). + /// + /// + /// The exception that caused this exception to be raised. + /// + public RequestFailedException(object? requestId, Exception inner) + : this(ErrorCodes.RequestFailed, requestId?.ToString() ?? "(unknown)", "Content not modified.", inner) + { + } + + /// + /// Create a new . + /// + /// + /// The LSP / JSON-RPC error code. + /// + /// + /// The exception message. + /// + /// + /// The LSP / JSON-RPC request Id (if known). + /// + /// + /// The exception that caused this exception to be raised. + /// + public RequestFailedException(int errorCode, string message, string requestId, Exception inner) : base(message, inner) + { + RequestId = !string.IsNullOrWhiteSpace(requestId) ? requestId : UnknownRequestId; + ErrorCode = errorCode; + } + + /// + /// Serialisation constructor. + /// + /// + /// The serialisation data-store. + /// + /// + /// The serialisation streaming context. + /// + protected RequestFailedException(SerializationInfo info, StreamingContext context) + { + RequestId = info.GetString(nameof(RequestId)); + ErrorCode = info.GetInt32(nameof(ErrorCode)); + } + + /// + /// The LSP / JSON-RPC request Id (if known). + /// + public object RequestId { get; } + + /// + /// The LSP / JSON-RPC error code. + /// + public int ErrorCode { get; } + + /// + /// The request Id used when no valid request Id was supplied. + /// + public const string UnknownRequestId = "(unknown)"; +} diff --git a/src/JsonRpc/Server/ServerCancelledException.cs b/src/JsonRpc/Server/ServerCancelledException.cs new file mode 100644 index 000000000..8a7338928 --- /dev/null +++ b/src/JsonRpc/Server/ServerCancelledException.cs @@ -0,0 +1,87 @@ +ο»Ώusing System.Runtime.Serialization; + +namespace OmniSharp.Extensions.JsonRpc.Server; + +/// +/// Exception raised when request parameters are invalid according to the target method. +/// +[Serializable] +public class ServerCancelledException + : TaskCanceledException, IRequestException +{ + /// + /// Create a new . + /// + /// + /// The LSP / JSON-RPC request Id (if known). + /// + public ServerCancelledException(object? requestId) + : this(ErrorCodes.ServerCancelled, requestId?.ToString() ?? "(unknown)", "Content not modified.", null!) + { + } + + /// + /// Create a new . + /// + /// + /// The LSP / JSON-RPC request Id (if known). + /// + /// + /// The exception that caused this exception to be raised. + /// + public ServerCancelledException(object? requestId, Exception inner) + : this(ErrorCodes.ServerCancelled, requestId?.ToString() ?? "(unknown)", "Content not modified.", inner) + { + } + + /// + /// Create a new . + /// + /// + /// The LSP / JSON-RPC error code. + /// + /// + /// The exception message. + /// + /// + /// The LSP / JSON-RPC request Id (if known). + /// + /// + /// The exception that caused this exception to be raised. + /// + public ServerCancelledException(int errorCode, string message, string requestId, Exception inner) : base(message, inner) + { + RequestId = !string.IsNullOrWhiteSpace(requestId) ? requestId : UnknownRequestId; + ErrorCode = errorCode; + } + + /// + /// Serialisation constructor. + /// + /// + /// The serialisation data-store. + /// + /// + /// The serialisation streaming context. + /// + protected ServerCancelledException(SerializationInfo info, StreamingContext context) + { + RequestId = info.GetString(nameof(RequestId)); + ErrorCode = info.GetInt32(nameof(ErrorCode)); + } + + /// + /// The LSP / JSON-RPC request Id (if known). + /// + public object RequestId { get; } + + /// + /// The LSP / JSON-RPC error code. + /// + public int ErrorCode { get; } + + /// + /// The request Id used when no valid request Id was supplied. + /// + public const string UnknownRequestId = "(unknown)"; +} diff --git a/src/Protocol/AbstractHandlers.Base.cs b/src/Protocol/AbstractHandlers.Base.cs new file mode 100644 index 000000000..739ff577b --- /dev/null +++ b/src/Protocol/AbstractHandlers.Base.cs @@ -0,0 +1,79 @@ +ο»Ώusing System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class AbstractHandlers + { + public abstract class Base : + IRegistration, + ICapability + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + protected TRegistrationOptions RegistrationOptions { get; private set; } = default!; + protected TCapability Capability { get; private set; } = default!; + protected ClientCapabilities ClientCapabilities { get; private set; } = default!; + protected internal abstract TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities); + + TRegistrationOptions IRegistration.GetRegistrationOptions( + TCapability capability, ClientCapabilities clientCapabilities + ) + { + // ReSharper disable twice ConditionIsAlwaysTrueOrFalse + if (RegistrationOptions is not null && Capability is not null) return RegistrationOptions; + Capability = capability; + ClientCapabilities = clientCapabilities; + return RegistrationOptions = CreateRegistrationOptions(capability, clientCapabilities); + } + + void ICapability.SetCapability(TCapability capability, ClientCapabilities clientCapabilities) + { + ClientCapabilities = clientCapabilities; + Capability = capability; + } + } + + public abstract class BaseCapability : + ICapability + where TCapability : ICapability + { + protected TCapability Capability { get; private set; } = default!; + protected ClientCapabilities ClientCapabilities { get; private set; } = default!; + + void ICapability.SetCapability(TCapability capability, ClientCapabilities clientCapabilities) + { + ClientCapabilities = clientCapabilities; + Capability = capability; + } + } + + public abstract class Base : + IRegistration + where TRegistrationOptions : class, new() + { + protected TRegistrationOptions RegistrationOptions { get; private set; } = default!; + protected ClientCapabilities ClientCapabilities { get; private set; } = default!; + protected abstract TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities); + + TRegistrationOptions IRegistration.GetRegistrationOptions(ClientCapabilities clientCapabilities) + { + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + if (RegistrationOptions is not null) return RegistrationOptions; + ClientCapabilities = clientCapabilities; + return RegistrationOptions = CreateRegistrationOptions(clientCapabilities); + } + } + } +} diff --git a/src/Protocol/AbstractHandlers.Notification.cs b/src/Protocol/AbstractHandlers.Notification.cs new file mode 100644 index 000000000..89b2c4f36 --- /dev/null +++ b/src/Protocol/AbstractHandlers.Notification.cs @@ -0,0 +1,53 @@ +ο»Ώusing System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class AbstractHandlers + { + public abstract class Notification : IJsonRpcRequestHandler + where TParams : IRequest + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + + public abstract class Notification : + Base, + IJsonRpcRequestHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + + public abstract class Notification : + Base, + IJsonRpcRequestHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + + public abstract class NotificationCapability : + BaseCapability, + IJsonRpcRequestHandler + where TParams : IRequest + where TCapability : ICapability + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + } +} diff --git a/src/Protocol/AbstractHandlers.cs b/src/Protocol/AbstractHandlers.Partial.cs similarity index 63% rename from src/Protocol/AbstractHandlers.cs rename to src/Protocol/AbstractHandlers.Partial.cs index 4fa7cc9c3..132a470a3 100644 --- a/src/Protocol/AbstractHandlers.cs +++ b/src/Protocol/AbstractHandlers.Partial.cs @@ -14,101 +14,8 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol { - public static class AbstractHandlers + public static partial class AbstractHandlers { - public abstract class Base : - IRegistration, - ICapability - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - protected TRegistrationOptions RegistrationOptions { get; private set; } = default!; - protected TCapability Capability { get; private set; } = default!; - protected ClientCapabilities ClientCapabilities { get; private set; } = default!; - protected internal abstract TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities); - - TRegistrationOptions IRegistration.GetRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) - { - // ReSharper disable twice ConditionIsAlwaysTrueOrFalse - if (RegistrationOptions is not null && Capability is not null) return RegistrationOptions; - Capability = capability; - ClientCapabilities = clientCapabilities; - return RegistrationOptions = CreateRegistrationOptions(capability, clientCapabilities); - } - - void ICapability.SetCapability(TCapability capability, ClientCapabilities clientCapabilities) - { - ClientCapabilities = clientCapabilities; - Capability = capability; - } - } - - public abstract class BaseCapability : - ICapability - where TCapability : ICapability - { - protected TCapability Capability { get; private set; } = default!; - protected ClientCapabilities ClientCapabilities { get; private set; } = default!; - - void ICapability.SetCapability(TCapability capability, ClientCapabilities clientCapabilities) - { - ClientCapabilities = clientCapabilities; - Capability = capability; - } - } - - public abstract class Base : - IRegistration - where TRegistrationOptions : class, new() - { - protected TRegistrationOptions RegistrationOptions { get; private set; } = default!; - protected ClientCapabilities ClientCapabilities { get; private set; } = default!; - protected abstract TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities); - - TRegistrationOptions IRegistration.GetRegistrationOptions(ClientCapabilities clientCapabilities) - { - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (RegistrationOptions is not null) return RegistrationOptions; - ClientCapabilities = clientCapabilities; - return RegistrationOptions = CreateRegistrationOptions(clientCapabilities); - } - } - - public abstract class Request : - IJsonRpcRequestHandler - where TParams : IRequest - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - - public abstract class Request : - Base, - IJsonRpcRequestHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - - public abstract class Request : - Base, - IJsonRpcRequestHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - - public abstract class RequestCapability : - BaseCapability, - IJsonRpcRequestHandler - where TParams : IRequest - where TCapability : ICapability - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - public abstract class PartialResult : Base, IJsonRpcRequestHandler @@ -137,10 +44,10 @@ CancellationToken cancellationToken { Handle(request, observer, cancellationToken); await observer; - return _factory(default(TItem)); + return default; } - var subject = new AsyncSubject(); + using var subject = new AsyncSubject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -181,10 +88,10 @@ CancellationToken cancellationToken { Handle(request, observer, cancellationToken); await observer; - return _factory(default); + return default; } - var subject = new AsyncSubject(); + using var subject = new AsyncSubject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -225,10 +132,10 @@ CancellationToken cancellationToken { Handle(request, observer, cancellationToken); await observer; - return _factory(default); + return default; } - var subject = new AsyncSubject(); + using var subject = new AsyncSubject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -266,13 +173,14 @@ protected PartialResults(IProgressManager progressManager, Func()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( - new List(), (acc, items) => { + new List(), (acc, items) => + { acc.AddRange(items); return acc; } @@ -310,13 +218,14 @@ protected PartialResults(IProgressManager progressManager, Func()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( - new List(), (acc, items) => { + new List(), (acc, items) => + { acc.AddRange(items); return acc; } @@ -354,13 +263,14 @@ protected PartialResultsCapability(IProgressManager progressManager, Func()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( - new List(), (acc, items) => { + new List(), (acc, items) => + { acc.AddRange(items); return acc; } @@ -375,38 +285,5 @@ protected PartialResultsCapability(IProgressManager progressManager, Func> results, CancellationToken cancellationToken); } - public abstract class Notification : IJsonRpcRequestHandler - where TParams : IRequest - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - - public abstract class Notification : - Base, - IJsonRpcRequestHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - - public abstract class Notification : - Base, - IJsonRpcRequestHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } - - public abstract class NotificationCapability : - BaseCapability, - IJsonRpcRequestHandler - where TParams : IRequest - where TCapability : ICapability - { - public abstract Task Handle(TParams request, CancellationToken cancellationToken); - } } } diff --git a/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs b/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs new file mode 100644 index 000000000..1d7491b6b --- /dev/null +++ b/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs @@ -0,0 +1,295 @@ +ο»Ώusing System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class AbstractHandlers + { + public abstract class PartialResultWithInitialValue : + Base, + IJsonRpcRequestHandler + where TItem : class? + where TParams : IPartialItemWithInitialValueRequest + where TResponse : class? + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly IProgressManager _progressManager; + private readonly Func _factory; + + protected PartialResultWithInitialValue(IProgressManager progressManager, + Func factory) + { + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle( + TParams request, + CancellationToken cancellationToken + ) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await HandleInitialValue(request, cancellationToken)); + Handle(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await HandleInitialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + Handle(request, subject, cancellationToken); + return await task; + } + + protected abstract Task HandleInitialValue(TParams request, CancellationToken cancellationToken); + protected abstract void Handle(TParams request, IObserver results, CancellationToken cancellationToken); + } + + public abstract class PartialResultWithInitialValue : + Base, + IJsonRpcRequestHandler + where TItem : class? + where TParams : IPartialItemWithInitialValueRequest + where TResponse : class? + where TRegistrationOptions : class, new() + { + private readonly IProgressManager _progressManager; + private readonly Func _factory; + + protected PartialResultWithInitialValue(IProgressManager progressManager, + Func factory) + { + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle( + TParams request, + CancellationToken cancellationToken + ) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await HandleInitialValue(request, cancellationToken)); + Handle(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await HandleInitialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + Handle(request, subject, cancellationToken); + return await task; + } + + protected abstract Task HandleInitialValue(TParams request, CancellationToken cancellationToken); + protected abstract void Handle(TParams request, IObserver results, CancellationToken cancellationToken); + } + + public abstract class PartialResultWithInitialValueCapability : + BaseCapability, + IJsonRpcRequestHandler + where TItem : class? + where TParams : IPartialItemWithInitialValueRequest + where TResponse : class? + where TCapability : ICapability + { + private readonly IProgressManager _progressManager; + private readonly Func _factory; + + protected PartialResultWithInitialValueCapability(IProgressManager progressManager, + Func factory) + { + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle( + TParams request, + CancellationToken cancellationToken + ) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await HandleInitialValue(request, cancellationToken)); + Handle(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await HandleInitialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + Handle(request, subject, cancellationToken); + return await task; + } + + protected abstract Task HandleInitialValue(TParams request, CancellationToken cancellationToken); + protected abstract void Handle(TParams request, IObserver results, CancellationToken cancellationToken); + } + + public abstract class PartialResultsWithInitialValue : + Base, + IJsonRpcRequestHandler + where TParams : IPartialItemsWithInitialValueRequest + where TResponse : IEnumerable? + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + + protected PartialResultsWithInitialValue( + IProgressManager progressManager, + Func, TResponse> factory + ) + { + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await HandleInitialValue(request, cancellationToken)); + Handle(request, observer, cancellationToken); + await observer; + return default; + } + + { + using var subject = new Subject>(); + var task = subject + .Aggregate(await HandleInitialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + Handle(request, subject, cancellationToken); + return await task; + } + } + + protected abstract Task HandleInitialValue(TParams request, CancellationToken cancellationToken); + protected abstract void Handle(TParams request, IObserver> results, CancellationToken cancellationToken); + } + + public abstract class PartialResultsWithInitialValue : + Base, + IJsonRpcRequestHandler + where TParams : IPartialItemsWithInitialValueRequest + where TResponse : IEnumerable? + where TRegistrationOptions : class, new() + { + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + + protected PartialResultsWithInitialValue( + IProgressManager progressManager, Func, TResponse> factory + ) + { + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await HandleInitialValue(request, cancellationToken)); + Handle(request, observer, cancellationToken); + await observer; + return default; + } + + { + using var subject = new Subject>(); + var task = subject + .Aggregate(await HandleInitialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + Handle(request, subject, cancellationToken); + return await task; + } + } + + protected abstract Task HandleInitialValue(TParams request, CancellationToken cancellationToken); + protected abstract void Handle(TParams request, IObserver> results, CancellationToken cancellationToken); + } + + public abstract class PartialResultsWithInitialValueCapability : + BaseCapability, + IJsonRpcRequestHandler + where TParams : IPartialItemsWithInitialValueRequest + where TResponse : IEnumerable? + where TCapability : ICapability + { + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + + protected PartialResultsWithInitialValueCapability( + IProgressManager progressManager, Func, TResponse?> factory + ) + { + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await HandleInitialValue(request, cancellationToken)); + Handle(request, observer, cancellationToken); + await observer; + return default; + } + + { + using var subject = new Subject>(); + var task = subject + .Aggregate(await HandleInitialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + Handle(request, subject, cancellationToken); + return await task; + } + } + + protected abstract Task HandleInitialValue(TParams request, CancellationToken cancellationToken); + protected abstract void Handle(TParams request, IObserver> results, CancellationToken cancellationToken); + } + } +} diff --git a/src/Protocol/AbstractHandlers.Request.cs b/src/Protocol/AbstractHandlers.Request.cs new file mode 100644 index 000000000..475f6f1e8 --- /dev/null +++ b/src/Protocol/AbstractHandlers.Request.cs @@ -0,0 +1,55 @@ +ο»Ώusing System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class AbstractHandlers + { + + public abstract class Request : + IJsonRpcRequestHandler + where TParams : IRequest + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + + public abstract class Request : + Base, + IJsonRpcRequestHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + + public abstract class Request : + Base, + IJsonRpcRequestHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + + public abstract class RequestCapability : + BaseCapability, + IJsonRpcRequestHandler + where TParams : IRequest + where TCapability : ICapability + { + public abstract Task Handle(TParams request, CancellationToken cancellationToken); + } + } +} diff --git a/src/Protocol/Client/Capabilities/ClientCapabilities.cs b/src/Protocol/Client/Capabilities/ClientCapabilities.cs index 07be4f2f9..53884be40 100644 --- a/src/Protocol/Client/Capabilities/ClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/ClientCapabilities.cs @@ -18,6 +18,14 @@ public class ClientCapabilities : CapabilitiesBase, IClientCapabilities [Optional] public TextDocumentClientCapabilities? TextDocument { get; set; } + /// + /// Capabilities specific to the notebook document support. + /// + /// @since 3.17.0 + /// + [Optional] + public NotebookDocumentClientCapabilities? NotebookDocument { get; set; } + /// /// Window specific client capabilities. /// diff --git a/src/Protocol/Client/Capabilities/GeneralClientCapabilities.cs b/src/Protocol/Client/Capabilities/GeneralClientCapabilities.cs index f7f2ca959..2d1eb66aa 100644 --- a/src/Protocol/Client/Capabilities/GeneralClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/GeneralClientCapabilities.cs @@ -1,4 +1,5 @@ -ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { @@ -20,6 +21,41 @@ public class GeneralClientCapabilities : CapabilitiesBase, IGeneralClientCapabil /// /// @since 3.16.0 /// - [Optional] public MarkdownClientCapabilities? Markdown { get; set; } + [Optional] + public MarkdownClientCapabilities? Markdown { get; set; } + + /// + /// Client capability that signals how the client + /// handles stale requests (e.g. a request + /// for which the client will not process the response + /// anymore since the information is outdated). + /// + /// @since 3.17.0 + /// + [Optional] + public StaleRequestSupportClientCapabilities? StaleRequestSupport { get; set; } + + /// + /// The position encodings supported by the client. Client and server + /// have to agree on the same position encoding to ensure that offsets + /// (e.g. character position in a line) are interpreted the same on both + /// side. + /// + /// To keep the protocol backwards compatible the following applies: if + /// the value 'utf-16' is missing from the array of position encodings + /// servers can assume that the client supports UTF-16. UTF-16 is + /// therefore a mandatory encoding. + /// + /// If omitted it defaults to ['utf-16']. + /// + /// Implementation considerations: since the conversion from one encoding + /// into another requires the content of the file / line the conversion + /// is best done where the file is read which is usually on the server + /// side. + /// + /// @since 3.17.0 + /// + [Optional] + public Container? PositionEncodings { get; set; } } -} \ No newline at end of file +} diff --git a/src/Protocol/Client/Capabilities/IGeneralClientCapabilities.cs b/src/Protocol/Client/Capabilities/IGeneralClientCapabilities.cs index 06c15abfe..c036a4cad 100644 --- a/src/Protocol/Client/Capabilities/IGeneralClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/IGeneralClientCapabilities.cs @@ -1,4 +1,6 @@ -ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities +ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { public interface IGeneralClientCapabilities { @@ -15,5 +17,37 @@ public interface IGeneralClientCapabilities /// @since 3.16.0 /// MarkdownClientCapabilities? Markdown { get; set; } + + /// + /// Client capability that signals how the client + /// handles stale requests (e.g. a request + /// for which the client will not process the response + /// anymore since the information is outdated). + /// + /// @since 3.17.0 + /// + StaleRequestSupportClientCapabilities? StaleRequestSupport { get; set; } + + /// + /// The position encodings supported by the client. Client and server + /// have to agree on the same position encoding to ensure that offsets + /// (e.g. character position in a line) are interpreted the same on both + /// side. + /// + /// To keep the protocol backwards compatible the following applies: if + /// the value 'utf-16' is missing from the array of position encodings + /// servers can assume that the client supports UTF-16. UTF-16 is + /// therefore a mandatory encoding. + /// + /// If omitted it defaults to ['utf-16']. + /// + /// Implementation considerations: since the conversion from one encoding + /// into another requires the content of the file / line the conversion + /// is best done where the file is read which is usually on the server + /// side. + /// + /// @since 3.17.0 + /// + Container? PositionEncodings { get; set; } } -} \ No newline at end of file +} diff --git a/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs b/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs index 943dc8e52..fb7104c29 100644 --- a/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs @@ -2,7 +2,7 @@ { public interface ITextDocumentClientCapabilities : ICapabilitiesBase { - Supports Synchronization { get; set; } + Supports Synchronization { get; set; } /// /// Capabilities specific to the `textDocument/completion` @@ -146,5 +146,33 @@ public interface ITextDocumentClientCapabilities : ICapabilitiesBase /// @since 3.16.0 /// Supports Moniker { get; set; } + + /// + /// Capabilities specific to the various type hierarchy requests. + /// + /// @since 3.17.0 + /// + Supports TypeHierarchy { get; set; } + + /// + /// Capabilities specific to the `textDocument/inlineValue` request. + /// + /// @since 3.17.0 + /// + Supports InlineValue { get; set; } + + /// + /// Capability specific to the `textDocument/inlayHint` request. + /// + /// @since 3.17.0 + /// + Supports InlayHint { get; set; } + + /// + /// Capability specific to the diagnostic pull model. + /// + /// @since 3.17.0 + /// + Supports Diagnostic { get; set; } } -} \ No newline at end of file +} diff --git a/src/Protocol/Client/Capabilities/MarkdownClientCapabilities.cs b/src/Protocol/Client/Capabilities/MarkdownClientCapabilities.cs index 608e196e1..177d69a1a 100644 --- a/src/Protocol/Client/Capabilities/MarkdownClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/MarkdownClientCapabilities.cs @@ -1,3 +1,4 @@ +using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities @@ -12,12 +13,21 @@ public class MarkdownClientCapabilities /// /// The name of the parser. /// - public string Parser { get; set; } + public string Parser { get; set; } = null!; /// /// The version of the parser. /// [Optional] public string? Version { get; set; } + + /// + /// A list of HTML tags that the client allows / supports in + /// Markdown. + /// + /// @since 3.17.0 + /// + [Optional] + public Container? AllowedTags { get; set; } } } diff --git a/src/Protocol/Client/Capabilities/NotebookDocumentClientCapabilities.cs b/src/Protocol/Client/Capabilities/NotebookDocumentClientCapabilities.cs new file mode 100644 index 000000000..b86d035e2 --- /dev/null +++ b/src/Protocol/Client/Capabilities/NotebookDocumentClientCapabilities.cs @@ -0,0 +1,16 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; + +/// +/// Capabilities specific to the notebook document support. +/// +/// @since 3.17.0 +/// +public class NotebookDocumentClientCapabilities +{ + /// + /// Capabilities specific to notebook document synchronization + /// + /// @since 3.17.0 + /// + public Supports Synchronization { get; set; } +} diff --git a/src/Protocol/Client/Capabilities/StaleRequestSupportClientCapabilities.cs b/src/Protocol/Client/Capabilities/StaleRequestSupportClientCapabilities.cs new file mode 100644 index 000000000..64577a4d2 --- /dev/null +++ b/src/Protocol/Client/Capabilities/StaleRequestSupportClientCapabilities.cs @@ -0,0 +1,26 @@ +ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; + +/// +/// Client capability that signals how the client +/// handles stale requests (e.g. a request +/// for which the client will not process the response +/// anymore since the information is outdated). +/// +/// @since 3.17.0 +/// +public class StaleRequestSupportClientCapabilities +{ + /// + /// The client will actively cancel the request. + /// + public bool Cancel { get; set; } + + /// + /// The list of requests for which the client + /// will retry the request if it receives a + /// response with error code `ContentModified`` + /// + public Container RetryOnContentModified { get; set; } = new(); +} diff --git a/src/Protocol/Client/Capabilities/SymbolKindCapabilityOptions.cs b/src/Protocol/Client/Capabilities/SymbolKindCapabilityOptions.cs deleted file mode 100644 index 043c3781c..000000000 --- a/src/Protocol/Client/Capabilities/SymbolKindCapabilityOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities -{ - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } -} diff --git a/src/Protocol/Client/Capabilities/TagSupportCapabilityOptions.cs b/src/Protocol/Client/Capabilities/TagSupportCapabilityOptions.cs deleted file mode 100644 index f0bbaeb7d..000000000 --- a/src/Protocol/Client/Capabilities/TagSupportCapabilityOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol.Models; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities -{ - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } -} diff --git a/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs b/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs index f74b73634..c8b70d5d5 100644 --- a/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs @@ -2,7 +2,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { public class TextDocumentClientCapabilities : CapabilitiesBase, ITextDocumentClientCapabilities { - public Supports Synchronization { get; set; } + public Supports Synchronization { get; set; } /// /// Capabilities specific to the `textDocument/completion` @@ -146,5 +146,33 @@ public class TextDocumentClientCapabilities : CapabilitiesBase, ITextDocumentCli /// @since 3.16.0 /// public Supports Moniker { get; set; } + + /// + /// Capabilities specific to the various type hierarchy requests. + /// + /// @since 3.17.0 + /// + public Supports TypeHierarchy { get; set; } + + /// + /// Capabilities specific to the `textDocument/inlineValue` request. + /// + /// @since 3.17.0 + /// + public Supports InlineValue { get; set; } + + /// + /// Capability specific to the `textDocument/inlayHint` request. + /// + /// @since 3.17.0 + /// + public Supports InlayHint { get; set; } + + /// + /// Capability specific to the diagnostic pull model. + /// + /// @since 3.17.0 + /// + public Supports Diagnostic { get; set; } } } diff --git a/src/Protocol/Client/Capabilities/WorkspaceClientCapabilities.cs b/src/Protocol/Client/Capabilities/WorkspaceClientCapabilities.cs index 94dd06b5c..0f8d22833 100644 --- a/src/Protocol/Client/Capabilities/WorkspaceClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/WorkspaceClientCapabilities.cs @@ -54,6 +54,27 @@ public class WorkspaceClientCapabilities : CapabilitiesBase /// public Supports FileOperations { get; set; } + /// + /// Client workspace capabilities specific to inline values. + /// + /// @since 3.17.0 + /// + public Supports InlineValue { get; set; } + + /// + /// Client workspace capabilities specific to inlay hints. + /// + /// @since 3.17.0 + /// + public Supports InlayHint { get; set; } + + /// + /// Client workspace capabilities specific to diagnostics. + /// + /// @since 3.17.0. + /// + public Supports Diagnostics { get; set; } + /// /// The client has support for workspace folders. /// @@ -68,6 +89,4 @@ public class WorkspaceClientCapabilities : CapabilitiesBase /// public Supports Configuration { get; set; } } - - } diff --git a/src/Protocol/Client/ILanguageClientFacade.cs b/src/Protocol/Client/ILanguageClientFacade.cs index 8b29aaeee..48e6817e4 100644 --- a/src/Protocol/Client/ILanguageClientFacade.cs +++ b/src/Protocol/Client/ILanguageClientFacade.cs @@ -5,6 +5,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Client public interface ILanguageClientFacade : ILanguageClientProxy, IJsonRpcHandlerInstance { ITextDocumentLanguageClient TextDocument { get; } + INotebookDocumentLanguageClient NotebookDocument { get; } IClientLanguageClient Client { get; } IGeneralLanguageClient General { get; } IWindowLanguageClient Window { get; } diff --git a/src/Protocol/Client/INotebookDocumentLanguageClient.cs b/src/Protocol/Client/INotebookDocumentLanguageClient.cs new file mode 100644 index 000000000..f1be3c184 --- /dev/null +++ b/src/Protocol/Client/INotebookDocumentLanguageClient.cs @@ -0,0 +1,5 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Client; + +public interface INotebookDocumentLanguageClient : ILanguageClientProxy +{ +} diff --git a/src/Protocol/Client/NotebookDocumentLanguageClient.cs b/src/Protocol/Client/NotebookDocumentLanguageClient.cs new file mode 100644 index 000000000..8c2202c9c --- /dev/null +++ b/src/Protocol/Client/NotebookDocumentLanguageClient.cs @@ -0,0 +1,15 @@ +ο»Ώusing DryIoc; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client; + +internal class NotebookDocumentLanguageClient : LanguageProtocolProxy, INotebookDocumentLanguageClient +{ + public NotebookDocumentLanguageClient( + IResponseRouter requestRouter, IResolverContext resolverContext, IProgressManager progressManager, + ILanguageProtocolSettings languageProtocolSettings + ) : base(requestRouter, resolverContext, progressManager, languageProtocolSettings) + { + } +} diff --git a/src/Protocol/Client/WorkDone/WorkDoneProxyExtensions.cs b/src/Protocol/Client/WorkDone/WorkDoneProxyExtensions.cs index 53b97c59f..6312c00d9 100644 --- a/src/Protocol/Client/WorkDone/WorkDoneProxyExtensions.cs +++ b/src/Protocol/Client/WorkDone/WorkDoneProxyExtensions.cs @@ -60,6 +60,24 @@ public static TResult ObserveWorkDone( DoObserveWorkDone(proxy, @params, observer); return func(proxy, @params); } + + public static TResult ObserveWorkDone( + this INotebookDocumentLanguageClient proxy, T @params, Func func, IObserver observer + ) + where T : IWorkDoneProgressParams + { + DoObserveWorkDone(proxy, @params, observer); + return func(proxy, @params); + } + + public static TResult ObserveWorkDone( + this INotebookDocumentLanguageClient proxy, T @params, Func func, IWorkDoneProgressObserver observer + ) + where T : IWorkDoneProgressParams + { + DoObserveWorkDone(proxy, @params, observer); + return func(proxy, @params); + } public static TResult ObserveWorkDone( this IWindowLanguageClient proxy, T @params, Func func, IObserver observer diff --git a/src/Protocol/Document/INotebookDocumentIdentifier.cs b/src/Protocol/Document/INotebookDocumentIdentifier.cs new file mode 100644 index 000000000..082ce481e --- /dev/null +++ b/src/Protocol/Document/INotebookDocumentIdentifier.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reactive.Disposables; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document +{ + public interface INotebookDocumentIdentifier + { + /// + /// Returns the attributes for the document at the given URI. This can return null. + /// + /// + /// + NotebookDocumentAttributes GetNotebookDocumentAttributes(DocumentUri uri); + } + + public abstract class NotebookDocumentIdentifierBase : INotebookDocumentIdentifier + { + public NotebookDocumentAttributes GetNotebookDocumentAttributes(DocumentUri uri) + { + var (languageId, schema) = GetAttributes(uri); + return new NotebookDocumentAttributes(uri, languageId, schema); + } + + protected abstract (string notebookType, string schema) GetAttributes(DocumentUri uri); + } + + public class NotebookDocumentIdentifiers : IEnumerable + { + private readonly HashSet _NotebookDocumentIdentifiers = new HashSet(); + public IEnumerator GetEnumerator() => _NotebookDocumentIdentifiers.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public IDisposable Add(params INotebookDocumentIdentifier[] identifiers) + { + foreach (var item in identifiers) + _NotebookDocumentIdentifiers.Add(item); + return Disposable.Create( + () => { + foreach (var NotebookDocumentIdentifier in identifiers) + { + _NotebookDocumentIdentifiers.Remove(NotebookDocumentIdentifier); + } + } + ); + } + } +} diff --git a/src/Protocol/Document/NotebookDocumentAttributes.cs b/src/Protocol/Document/NotebookDocumentAttributes.cs new file mode 100644 index 000000000..b7f39c32c --- /dev/null +++ b/src/Protocol/Document/NotebookDocumentAttributes.cs @@ -0,0 +1,69 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Document; + +public class NotebookDocumentAttributes : IEquatable +{ + public NotebookDocumentAttributes(DocumentUri uri, string notebookType) + { + Uri = uri; + NotebookType = notebookType; + } + + public NotebookDocumentAttributes(DocumentUri uri) + { + Uri = uri; + } + + public NotebookDocumentAttributes(string language) + { + Language = language; + } + + public NotebookDocumentAttributes(string language, DocumentUri uri) + { + Language = language; + Uri = uri; + } + + public NotebookDocumentAttributes(DocumentUri uri, string scheme, string notebookType) + { + Uri = uri; + Scheme = scheme; + NotebookType = notebookType; + } + + public DocumentUri Uri { get; } + public string? Scheme { get; } + public string? NotebookType { get; } + public string? Language { get; } + + public bool Equals(NotebookDocumentAttributes? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Uri.Equals(other.Uri) && Scheme == other.Scheme && NotebookType == other.NotebookType; + } + + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((NotebookDocumentAttributes) obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = Uri.GetHashCode(); + hashCode = ( hashCode * 397 ) ^ ( Scheme != null ? Scheme.GetHashCode() : 0 ); + hashCode = ( hashCode * 397 ) ^ ( NotebookType != null ? NotebookType.GetHashCode() : 0 ); + hashCode = ( hashCode * 397 ) ^ ( Language != null ? Language.GetHashCode() : 0 ); + return hashCode; + } + } + + public static bool operator ==(NotebookDocumentAttributes? left, NotebookDocumentAttributes? right) => Equals(left, right); + + public static bool operator !=(NotebookDocumentAttributes? left, NotebookDocumentAttributes? right) => !Equals(left, right); +} diff --git a/src/Protocol/Features/Document/CodeActionFeature.cs b/src/Protocol/Features/Document/CodeActionFeature.cs index 19bf652b9..516bf42cb 100644 --- a/src/Protocol/Features/Document/CodeActionFeature.cs +++ b/src/Protocol/Features/Document/CodeActionFeature.cs @@ -72,6 +72,14 @@ public record CodeActionContext /// [Optional] public Container? Only { get; init; } + + /// + /// The reason why code actions were requested. + /// + /// @since 3.17.0 + /// + [Optional] + public CodeActionTriggerKind? TriggerKind { get; init; } } [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] @@ -414,6 +422,35 @@ public readonly partial struct CodeActionKind /// Base kind for an organize imports source action: `source.organizeImports` /// public static CodeActionKind SourceOrganizeImports { get; } = new CodeActionKind("source.organizeImports"); + + /// + /// Base kind for a 'fix all' source action: `source.fixAll`. + /// + /// 'Fix all' actions automatically fix errors that have a clear fix that + /// do not require user input. They should not suppress errors or perform + /// unsafe fixes such as generating new types or classes. + /// + /// @since 3.17.0 + /// + public static CodeActionKind SourceFixAll { get; } = new CodeActionKind("source.fixAll"); + } + + + [JsonConverter(typeof(NumberEnumConverter))] + public enum CodeActionTriggerKind + { + /// + /// Code actions were explicitly requested by the user or by an extension. + /// + Invoked = 1, + + /// + /// Code actions were requested automatically. + /// + /// This typically happens when current selection in a file changes, but can + /// also be triggered when file content changes. + /// + Automatic = 2 } } diff --git a/src/Protocol/Features/Document/CodeLensFeature.cs b/src/Protocol/Features/Document/CodeLensFeature.cs index 66d7ea1d5..8e2434f5d 100644 --- a/src/Protocol/Features/Document/CodeLensFeature.cs +++ b/src/Protocol/Features/Document/CodeLensFeature.cs @@ -108,10 +108,7 @@ public override StaticOptions Convert(CodeLensRegistrationOptions source) } } } - } - - namespace Models - { + [Parallel] [Method(WorkspaceNames.CodeLensRefresh, Direction.ServerToClient)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] diff --git a/src/Protocol/Features/Document/CompletionFeature.cs b/src/Protocol/Features/Document/CompletionFeature.cs index 0f13e8824..4e0e49de7 100644 --- a/src/Protocol/Features/Document/CompletionFeature.cs +++ b/src/Protocol/Features/Document/CompletionFeature.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Reflection; using MediatR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -28,7 +29,7 @@ namespace Models GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) ] [RegistrationOptions(typeof(CompletionRegistrationOptions)), Capability(typeof(CompletionCapability)), Resolver(typeof(CompletionItem))] - public partial record CompletionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest + public partial record CompletionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsWithInitialValueRequest { /// /// The completion context. This is only available it the client specifies to send @@ -45,7 +46,7 @@ public partial record CompletionParams : TextDocumentPositionParams, IWorkDonePr GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "CompletionResolve"), GenerateHandlerMethods, GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)), - GenerateContainer("CompletionList"), + GenerateContainer("CompletionList", GenerateImplicitConversion = false), GenerateTypedData ] [Capability(typeof(CompletionCapability))] @@ -58,6 +59,14 @@ public partial record CompletionItem : ICanBeResolved, IRequest, /// public string Label { get; init; } + /// + /// Additional details for the label + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public CompletionItemLabelDetails? LabelDetails { get; init; } + /// /// The kind of this completion item. Based of the kind /// an icon is chosen by the editor. @@ -168,6 +177,21 @@ public partial record CompletionItem : ICanBeResolved, IRequest, [Optional] public TextEditOrInsertReplaceEdit? TextEdit { get; init; } + /// + /// The edit text used if the completion item is part of a CompletionList and + /// CompletionList defines an item default for the text edit range. + /// + /// Clients will only honor this property if they opt into completion list + /// item defaults using the capability `completionList.itemDefaults`. + /// + /// If not provided and a list's default range is provided the label + /// property is used as a text. + /// + /// @since 3.17.0 + /// + [Optional] + public string? TextEditText { get; init; } + /// /// An optional array of additional text edits that are applied when /// selecting this completion. Edits must not overlap with the main edit @@ -288,6 +312,15 @@ public partial class CompletionRegistrationOptions : IWorkDoneProgressOptions, I [Optional] public Container? AllCommitCharacters { get; set; } + /// + /// The server supports the following `CompletionItem` specific + /// capabilities. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public CompletionRegistrationCompletionItemOptions? CompletionItem { get; set; } + class CompletionRegistrationOptionsConverter : RegistrationOptionsConverterBase { private readonly IHandlersManager _handlersManager; @@ -299,16 +332,31 @@ public CompletionRegistrationOptionsConverter(IHandlersManager handlersManager) public override StaticOptions Convert(CompletionRegistrationOptions source) { - return new() { + return new() + { ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(ICompletionResolveHandler)), AllCommitCharacters = source.AllCommitCharacters, TriggerCharacters = source.TriggerCharacters, WorkDoneProgress = source.WorkDoneProgress, + CompletionItem = source.CompletionItem }; } } } + public class CompletionRegistrationCompletionItemOptions + { + /// + /// The server has support for completion item label + /// details (see also `CompletionItemLabelDetails`) when receiving + /// a completion item in a resolve call. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public bool? LabelDetailsSupport { get; set; } + } + public record CompletionContext { /// @@ -353,7 +401,7 @@ public enum CompletionTriggerKind /// Represents a collection of [completion items](#CompletionItem) to be presented /// in the editor. /// - [JsonConverter(typeof(CompletionListConverter))] + [JsonConverter(typeof(Converter))] public partial class CompletionList { public CompletionList(bool isIncomplete) : this(Enumerable.Empty(), isIncomplete) @@ -377,13 +425,99 @@ public CompletionList(IEnumerable items, bool isIncomplete) : ba /// public IEnumerable Items => this; + /// + /// In many cases the items of an actual completion result share the same + /// value for properties like `commitCharacters` or the range of a text + /// edit. A completion list can therefore define item defaults which will + /// be used if a completion item itself doesn't specify the value. + /// + /// If a completion list specifies a default value and a completion item + /// also specifies a corresponding value the one from the item is used. + /// + /// Servers are only allowed to return default values if the client + /// signals support for this via the `completionList.itemDefaults` + /// capability. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public CompletionListItemDefaults? ItemDefaults { get; set; } + public static CompletionList? From(CompletionList? list) where T : class?, IHandlerIdentity? - => list switch { - not null => new(list.Items.Select(CompletionItem.From)!, list.IsIncomplete), + => list switch + { + not null => new(list.Items.Select(CompletionItem.From)!, list.IsIncomplete) + { + ItemDefaults = list.ItemDefaults + }, _ => null }; + + public static CompletionList From(CompletionList? source, IEnumerable? result) + => new ((source?.Items ?? Array.Empty()).Concat(result ?? Array.Empty())) + { + ItemDefaults = source?.ItemDefaults + }; + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, CompletionList? value, JsonSerializer serializer) + { + if (!value.IsIncomplete && value.ItemDefaults is null) + { + serializer.Serialize(writer, value.Items.ToArray()); + return; + } + + writer.WriteStartObject(); + writer.WritePropertyName("isIncomplete"); + writer.WriteValue(value.IsIncomplete); + + writer.WritePropertyName("items"); + writer.WriteStartArray(); + foreach (var item in value.Items) + { + serializer.Serialize(writer, item); + } + writer.WriteEndArray(); + + if (value.ItemDefaults is { }) + { + writer.WritePropertyName("itemDefaults"); + serializer.Serialize(writer, value.ItemDefaults); + } + + writer.WriteEndObject(); + } + + public override CompletionList? ReadJson( + JsonReader reader, Type objectType, CompletionList? existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + if (reader.TokenType == JsonToken.StartArray) + { + var array = JArray.Load(reader).ToObject>(serializer); + return new CompletionList(array); + } + + if (reader.TokenType == JsonToken.Null) + { + return null; + } + + var result = JObject.Load(reader); + var items = result["items"].ToObject>(serializer); + return new CompletionList(items, result["isIncomplete"]?.Value() ?? false) + { + ItemDefaults = result["itemDefaults"]?.ToObject() + }; + } + + public override bool CanRead => true; + } } + [JsonConverter(typeof(TypedCompletionListConverter))] public partial class CompletionList { public CompletionList(bool isIncomplete) : this(isIncomplete, Enumerable.Empty>()) @@ -412,12 +546,133 @@ public CompletionList(bool isIncomplete, params CompletionItem[] items) : bas /// public IEnumerable> Items => this; + /// + /// In many cases the items of an actual completion result share the same + /// value for properties like `commitCharacters` or the range of a text + /// edit. A completion list can therefore define item defaults which will + /// be used if a completion item itself doesn't specify the value. + /// + /// If a completion list specifies a default value and a completion item + /// also specifies a corresponding value the one from the item is used. + /// + /// Servers are only allowed to return default values if the client + /// signals support for this via the `completionList.itemDefaults` + /// capability. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public CompletionListItemDefaults? ItemDefaults { get; set; } + public static CompletionList? Create(CompletionList? list) - => list switch { + => list switch + { not null => - new(list.IsIncomplete, list.Items.Select(CompletionItem.From)!), + new(list.IsIncomplete, list.Items.Select(CompletionItem.From)!) + { + ItemDefaults = list.ItemDefaults + }, _ => null }; + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("container")] + public static implicit operator CompletionList? (CompletionList? container) => container switch + { + not null => new CompletionList(container.Select(value => (CompletionItem)value), container.IsIncomplete) + { + ItemDefaults = container.ItemDefaults + }, + _ => null + }; + + } + + internal class TypedCompletionListConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + serializer.Serialize(writer, (CompletionList?)value); + } + + public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) + { + var completionList = serializer.Deserialize(reader); + return objectType.GetMethod(nameof(CompletionList.Create), BindingFlags.Static | BindingFlags.Public)! + .Invoke(null, new object[] { completionList })!; + } + + public override bool CanConvert(Type objectType) + { + return objectType.IsGenericType && objectType.GetGenericTypeDefinition() == typeof(CompletionList<>); + } + + public override bool CanRead => true; + } + + public record CompletionListItemDefaults + { + /// + /// A default commit character set. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public Container? CommitCharacters { get; init; } + + /// + /// A default edit range + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public RangeOrEditRange? EditRange { get; init; } + + /// + /// A default insert text format + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public InsertTextFormat? InsertTextFormat { get; init; } + + /// + /// A default insert text mode + /// + /// @since 3.17.0 - proposed state + /// + public InsertTextMode? InsertTextMode { get; init; } + + /// + /// A default data value. + /// + /// @since 3.17.0 + /// + [Optional] + public JToken? Data { get; init; } + } + + /// + /// Additional details for a completion item label. + /// + /// @since 3.17.0 - proposed state + /// + public record CompletionItemLabelDetails + { + /// + /// An optional string which is rendered less prominently directly after + /// {@link CompletionItem.label label}, without any spacing. Should be + /// used for function signatures or type annotations. + /// + [Optional] + public string? Detail { get; init; } + + /// + /// An optional string which is rendered less prominently after + /// {@link CompletionItemLabelDetails.detail}. Should be used for fully qualified + /// names or file path. + /// + [Optional] + public string? Description { get; init; } } } @@ -444,6 +699,46 @@ public partial class CompletionCapability : DynamicCapability /// [Optional] public bool ContextSupport { get; set; } + + /// + /// The client's default when the completion item doesn't provide a + /// `insertTextMode` property. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public InsertTextMode? InsertTextMode { get; set; } + + /// + /// The client supports the following `CompletionList` specific + /// capabilities. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public CompletionListCapabilityOptions? CompletionList { get; set; } + } + + /// + /// The client supports the following `CompletionList` specific + /// capabilities. + /// + /// @since 3.17.0 - proposed state + /// + public class CompletionListCapabilityOptions + { + /// + /// The client supports the the following itemDefaults on + /// a completion list. + /// + /// The value lists the supported property names of the + /// `CompletionList.itemDefaults` object. If omitted + /// no properties are supported. + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public Container? ItemDefaults { get; set; } } public class CompletionItemCapabilityOptions @@ -532,6 +827,15 @@ public class CompletionItemCapabilityOptions /// [Optional] public CompletionItemInsertTextModeSupportCapabilityOptions? InsertTextModeSupport { get; set; } + + /// + /// The client has support for completion item label + /// details (see also `CompletionItemLabelDetails`). + /// + /// @since 3.17.0 - proposed state + /// + [Optional] + public bool LabelDetailsSupport { get; set; } } public class CompletionItemInsertTextModeSupportCapabilityOptions diff --git a/src/Protocol/Features/Document/DiagnosticsFeature.cs b/src/Protocol/Features/Document/DiagnosticsFeature.cs new file mode 100644 index 000000000..0c1bf067f --- /dev/null +++ b/src/Protocol/Features/Document/DiagnosticsFeature.cs @@ -0,0 +1,533 @@ +ο»Ώusing System.Collections.Immutable; +using MediatR; +using Newtonsoft.Json; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + [Parallel] + [Method(TextDocumentNames.Diagnostics, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DiagnosticsRegistrationOptions))] + [Capability(typeof(DiagnosticClientCapabilities))] + public partial record DocumentDiagnosticParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, + IPartialItemWithInitialValueRequest + { + /// + /// The text document. + /// + public TextDocumentIdentifier TextDocument { get; init; } = null!; + + /// + /// The additional identifier provided during registration. + /// + [Optional] + public string? Identifier { get; init; } + + /// + /// The result id of a previous response if provided. + /// + [Optional] + public string? PreviousResultId { get; init; } + } + + [Parallel] + [Method(WorkspaceNames.Diagnostics, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(DiagnosticsRegistrationOptions))] + [Capability(typeof(DiagnosticWorkspaceClientCapabilities))] + public partial record WorkspaceDiagnosticParams : IWorkDoneProgressParams, + IPartialItemWithInitialValueRequest + { + /// + /// The additional identifier provided during registration. + /// + [Optional] + public string? Identifier { get; init; } + + /// + /// The result id of a previous response if provided. + /// + public Container PreviousResultIds { get; init; } + } + + + [Parallel] + [Method(WorkspaceNames.DiagnosticRefresh, Direction.ServerToClient)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] + [Capability(typeof(CodeLensWorkspaceClientCapabilities))] + public partial record DiagnosticRefreshParams : IRequest; + + public interface IDiagnosticReport + { + /// + /// A full document diagnostic report. + /// + DocumentDiagnosticReportKind Kind { get; } + } + + /// + /// The result of a document diagnostic pull request. A report can + /// either be a full report containing all diagnostics for the + /// requested document or a unchanged report indicating that nothing + /// has changed in terms of diagnostics in comparison to the last + /// pull request. + /// + /// @since 3.17.0 + /// + [JsonConverter(typeof(Converter))] + public abstract partial record RelatedDocumentDiagnosticReport(DocumentDiagnosticReportKind Kind) : DocumentDiagnosticReportPartialResult, + IDiagnosticReport + { + /// + /// The report kind + /// + public DocumentDiagnosticReportKind Kind { get; } = Kind; + + public static RelatedDocumentDiagnosticReport From(RelatedDocumentDiagnosticReport original, DocumentDiagnosticReportPartialResult? result) + { + var docs = original.RelatedDocuments?.ToBuilder() ?? ImmutableDictionary.Empty.ToBuilder(); + foreach (var item in result?.RelatedDocuments ?? ImmutableDictionary.Empty) + { + if (docs.ContainsKey(item.Key)) + { + docs[item.Key] = item.Value; + } + else + { + docs.Add(item); + } + } + + return original with { RelatedDocuments = docs.ToImmutable() }; + } + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, RelatedDocumentDiagnosticReport value, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + public override RelatedDocumentDiagnosticReport ReadJson( + JsonReader reader, Type objectType, RelatedDocumentDiagnosticReport existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + throw new NotImplementedException(); + } + } + } + + [JsonConverter(typeof(Converter))] + public abstract partial record DocumentDiagnosticReport(DocumentDiagnosticReportKind Kind) : IDiagnosticReport + { + /// + /// The report kind + /// + public DocumentDiagnosticReportKind Kind { get; } = Kind; + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, DocumentDiagnosticReport value, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + public override DocumentDiagnosticReport ReadJson( + JsonReader reader, Type objectType, DocumentDiagnosticReport existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + throw new NotImplementedException(); + } + } + } + + /// + /// The document diagnostic report kinds. + /// + /// @since 3.17.0 + /// + [StringEnum] + public readonly partial struct DocumentDiagnosticReportKind + { + /// + /// A diagnostic report with a full + /// set of problems. + /// + public static DocumentDiagnosticReportKind Full { get; } = new("full"); + + /// + /// A report indicating that the last + /// returned report is still accurate. + /// + public static DocumentDiagnosticReportKind Unchanged { get; } = new("unchanged"); + } + + /// + /// A diagnostic report with a full set of problems. + /// + /// @since 3.17.0 + /// + public interface IFullDocumentDiagnosticReport : IDiagnosticReport + { + /// + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + /// + string? ResultId { get; init; } + + /// + /// The actual items. + /// + Container Items { get; init; } + } + + /// + /// A diagnostic report with a full set of problems. + /// + /// @since 3.17.0 + /// + public partial record FullDocumentDiagnosticReport() : DocumentDiagnosticReport(DocumentDiagnosticReportKind.Full), IFullDocumentDiagnosticReport + { + /// + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + /// + [Optional] + public string? ResultId { get; init; } + + /// + /// The actual items. + /// + public Container Items { get; init; } + } + + /// + /// A diagnostic report indicating that the last returned + /// report is still accurate. + /// + /// @since 3.17.0 + /// + public interface IUnchangedDocumentDiagnosticReport : IDiagnosticReport + { + /// + /// A result id which will be sent on the next + /// diagnostic request for the same document. + /// + string ResultId { get; init; } + } + + /// + /// A diagnostic report indicating that the last returned + /// report is still accurate. + /// + /// @since 3.17.0 + /// + public partial record UnchangedDocumentDiagnosticReport() : DocumentDiagnosticReport(DocumentDiagnosticReportKind.Unchanged), + IUnchangedDocumentDiagnosticReport + { + /// + /// A result id which will be sent on the next + /// diagnostic request for the same document. + /// + public string ResultId { get; init; } + } + + /// + /// A full diagnostic report with a set of related documents. + /// + /// @since 3.17.0 + /// + public partial record RelatedFullDocumentDiagnosticReport() : RelatedDocumentDiagnosticReport(DocumentDiagnosticReportKind.Full), + IFullDocumentDiagnosticReport + { + /// + /// The actual items. + /// + public Container Items { get; init; } + + /// + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + /// + public string? ResultId { get; init; } + } + + /// + /// An unchanged diagnostic report with a set of related documents. + /// + /// @since 3.17.0 + /// + public partial record RelatedUnchangedDocumentDiagnosticReport() : RelatedDocumentDiagnosticReport(DocumentDiagnosticReportKind.Unchanged), + IUnchangedDocumentDiagnosticReport + { + /// + /// A result id which will be sent on the next + /// diagnostic request for the same document. + /// + public string ResultId { get; init; } + } + + /// + /// A partial result for a document diagnostic report. + /// + /// @since 3.17.0 + /// + public partial record DocumentDiagnosticReportPartialResult + { + /// + /// Diagnostics of related documents. This information is useful + /// in programming languages where code in a file A can generate + /// diagnostics in a file B which A depends on. An example of + /// such a language is C/C++ where marco definitions in a file + /// a.cpp and result in errors in a header file b.hpp. + /// + /// @since 3.17.0 + /// + public ImmutableDictionary? RelatedDocuments { get; init; } + + public static DocumentDiagnosticReportPartialResult? From(DocumentDiagnosticReport? result) + { + if (result is null) + { + return null; + } + + return null; + } + } + + /// + /// Cancellation data returned from a diagnostic request. + /// + /// @since 3.17.0 + /// + public partial record DiagnosticServerCancellationData + { + public bool RetriggerRequest { get; init; } + } + + /// + /// A previous result id in a workspace pull request. + /// + /// @since 3.17.0 + /// + public partial record PreviousResultId + { + /// + /// The URI for which the client knowns a + /// result id. + /// + public DocumentUri Uri { get; init; } + + /// + /// The value of the previous result id. + /// + public string Value { get; init; } + } + + /// + /// A workspace diagnostic report. + /// + /// @since 3.17.0 + /// + public partial record WorkspaceDiagnosticReport : WorkspaceDiagnosticReportPartialResult + { + internal WorkspaceDiagnosticReport() + { + } + + internal WorkspaceDiagnosticReport(WorkspaceDiagnosticReportPartialResult partialResult) + { + Items = partialResult.Items; + } + + public static WorkspaceDiagnosticReport From(WorkspaceDiagnosticReport original, WorkspaceDiagnosticReportPartialResult? result) + { + return new WorkspaceDiagnosticReport() + { + Items = new Container( + original.Items.Concat(result?.Items ?? Array.Empty()) + ) + }; + } + } + + + [JsonConverter(typeof(Converter))] + public abstract partial record WorkspaceDocumentDiagnosticReport(DocumentDiagnosticReportKind Kind) : IDiagnosticReport + { + /// + /// The report kind + /// + public DocumentDiagnosticReportKind Kind { get; } = Kind; + + /// + /// The URI for which diagnostic information is reported. + /// + public DocumentUri Uri { get; init; } + + /// + /// The version number for which the diagnostics are reported. + /// If the document is not marked as open `null` can be provided. + /// + public int? Version { get; init; } + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, WorkspaceDocumentDiagnosticReport value, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + public override WorkspaceDocumentDiagnosticReport ReadJson( + JsonReader reader, Type objectType, WorkspaceDocumentDiagnosticReport existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + throw new NotImplementedException(); + } + } + } + + /// + /// A full document diagnostic report for a workspace diagnostic result. + /// + /// @since 3.17.0 + /// + public partial record WorkspaceFullDocumentDiagnosticReport() : WorkspaceDocumentDiagnosticReport(DocumentDiagnosticReportKind.Full), + IFullDocumentDiagnosticReport + { + /// + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + /// + public string? ResultId { get; init; } + + /// + /// The actual items. + /// + public Container Items { get; init; } + } + + /// + /// An unchanged document diagnostic report for a workspace diagnostic result. + /// + /// @since 3.17.0 + /// + public partial record WorkspaceUnchangedDocumentDiagnosticReport() : WorkspaceDocumentDiagnosticReport(DocumentDiagnosticReportKind.Unchanged), + IUnchangedDocumentDiagnosticReport + { + /// + /// A result id which will be sent on the next + /// diagnostic request for the same document. + /// + public string ResultId { get; init; } + }; + + /// + /// A partial result for a workspace diagnostic report. + /// + /// @since 3.17.0 + /// + public partial record WorkspaceDiagnosticReportPartialResult + { + public Container Items { get; init; } + + internal WorkspaceDiagnosticReportPartialResult() + { + } + + internal WorkspaceDiagnosticReportPartialResult(WorkspaceDiagnosticReport partialResult) + { + Items = partialResult.Items; + } + } + + + [GenerateRegistrationOptions(nameof(ServerCapabilities.DiagnosticProvider))] + [RegistrationName(TextDocumentNames.Diagnostics)] + public partial class DiagnosticsRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + /// + /// An optional identifier under which the diagnostics are + /// managed by the client. + /// + [Optional] + public string? Identifier { get; set; } + + /// + /// Whether the language has inter file dependencies meaning that + /// editing code in one file can result in a different diagnostic + /// set in another file. Inter file dependencies are common for + /// most programming languages and typically uncommon for linters. + /// + public bool InterFileDependencies { get; set; } + + /// + /// The server provides support for workspace diagnostics as well. + /// + public bool WorkspaceDiagnostics { get; set; } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.Diagnostic))] + public partial class DiagnosticClientCapabilities : DynamicCapability + { + /// + /// Whether the clients supports related documents for document diagnostic + /// pulls. + /// + [Optional] + public bool RelatedDocumentSupport { get; set; } + } + + /// + /// Capabilities specific to the code lens requests scoped to the + /// workspace. + /// + /// @since 3.16.0. + /// + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Diagnostics))] + public class DiagnosticWorkspaceClientCapabilities : ICapability + { + /// + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// pulled diagnostics currently shown. It should be used with absolute care + /// and is useful for situation where a server for example detects a project + /// wide change that requires such a calculation. + /// + [Optional] + public bool RefreshSupport { get; set; } + } + } + + namespace Document + { + } +} diff --git a/src/Protocol/Features/Document/FoldingRangeFeature.cs b/src/Protocol/Features/Document/FoldingRangeFeature.cs index 344114a6c..cafe80829 100644 --- a/src/Protocol/Features/Document/FoldingRangeFeature.cs +++ b/src/Protocol/Features/Document/FoldingRangeFeature.cs @@ -7,6 +7,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; @@ -79,6 +80,16 @@ public partial record FoldingRange [Optional] public FoldingRangeKind? Kind { get; init; } + /// + /// The text that the client should show when the specified range is + /// collapsed. If not defined or not supported by the client, a default + /// will be chosen by the client. + /// + /// @since 3.17.0 - proposed + /// + [Optional] + public string? CollapsedText { get; init; } + private string DebuggerDisplay => $"[start: (line: {StartLine}{( StartCharacter.HasValue ? $", char: {StartCharacter}" : string.Empty )}), end: (line: {EndLine}, char: {( EndCharacter.HasValue ? $", char: {EndCharacter}" : string.Empty )})]"; @@ -92,23 +103,23 @@ public override string ToString() /// /// Enum of known range kinds /// - [JsonConverter(typeof(StringEnumConverter))] - public enum FoldingRangeKind + [StringEnum] + public readonly partial struct FoldingRangeKind { /// /// Folding range for a comment /// - [EnumMember(Value = "comment")] Comment, + public static FoldingRangeKind Comment { get; } = new FoldingRangeKind("comment"); /// /// Folding range for a imports or includes /// - [EnumMember(Value = "imports")] Imports, + public static FoldingRangeKind Imports { get; } = new FoldingRangeKind("imports"); /// /// Folding range for a region (e.g. `#region`) /// - [EnumMember(Value = "region")] Region + public static FoldingRangeKind Region { get; } = new FoldingRangeKind("region"); } [GenerateRegistrationOptions(nameof(ServerCapabilities.FoldingRangeProvider))] @@ -137,7 +148,47 @@ public partial class FoldingRangeCapability : DynamicCapability /// If set, the client signals that it only supports folding complete lines. If set, client will /// ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange. /// + [Optional] public bool LineFoldingOnly { get; set; } + + /// + /// Specific options for the folding range kind. + /// + /// @since 3.17.0 + /// + [Optional] + public FoldingRangeCapabilityFoldingRangeKind? FoldingRangeKind { get; set; } + + /// + /// Specific options for the folding range. + /// @since 3.17.0 + /// + [Optional] + public FoldingRangeCapabilityFoldingRange? FoldingRange { get; set; } + } + + public partial class FoldingRangeCapabilityFoldingRangeKind + { + /// + /// The folding range kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + public partial class FoldingRangeCapabilityFoldingRange + { + /// + /// If set, the client signals that it supports setting collapsedText on + /// folding ranges to display custom labels instead of the default text. + /// + /// @since 3.17.0 + /// + [Optional] + public bool CollapsedText { get; set; } } } diff --git a/src/Protocol/Features/Document/InlayHintFeature.cs b/src/Protocol/Features/Document/InlayHintFeature.cs new file mode 100644 index 000000000..aa2ca1c8f --- /dev/null +++ b/src/Protocol/Features/Document/InlayHintFeature.cs @@ -0,0 +1,323 @@ +ο»Ώusing System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + [Parallel] + [Method(TextDocumentNames.InlayHint, Direction.ClientToServer)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "InlayHints"), + GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(InlayHintRegistrationOptions)), Capability(typeof(InlayHintWorkspaceClientCapabilities))] + public partial record InlayHintParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, + IRequest?> + { + /// + /// The text document. + /// + public TextDocumentIdentifier TextDocument { get; init; } + + /// + /// The visible document range for which inlay hints should be computed. + /// + public Range Range { get; init; } + } + + /// + /// Inlay hint information. + /// + /// @since 3.17.0 + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(TextDocumentNames.InlayHintResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "InlayHintResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateTypedData] + [Capability(typeof(InlayHintWorkspaceClientCapabilities))] + public partial record InlayHint : ICanBeResolved, IRequest + { + /// + /// The position of this hint. + /// + public Position Position { get; init; } + + /// + /// The label of this hint. A human readable string or an array of + /// InlayHintLabelPart label parts. + /// + /// *Note* that neither the string nor the label part can be empty. + /// + public StringOrInlayHintLabelParts Label { get; init; } + + /// + /// The kind of this hint. Can be omitted in which case the client + /// should fall back to a reasonable default. + /// + public InlayHintKind? Kind { get; init; } + + /// + /// Optional text edits that are performed when accepting this inlay hint. + /// + /// *Note* that edits are expected to change the document so that the inlay + /// hint (or its nearest variant) is now part of the document and the inlay + /// hint itself is now obsolete. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Container? TextEdits { get; init; } + + /// + /// The tooltip text when you hover over this item. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public StringOrMarkupContent? Tooltip { get; init; } + + /// + /// Render padding before the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + /// + [Optional] + public bool? PaddingLeft { get; init; } + + /// + /// Render padding after the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + /// + [Optional] + public bool? PaddingRight { get; init; } + + /// + /// A data entry field that is preserved on a document link between a + /// DocumentLinkRequest and a DocumentLinkResolveRequest. + /// + [Optional] + public JToken? Data { get; init; } + + private string DebuggerDisplay => ToString(); + } + + /// + /// An inlay hint label part allows for interactive and composite labels + /// of inlay hints. + /// + /// @since 3.17.0 + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record InlayHintLabelPart + { + /// + /// The value of this label part. + /// + public string Value { get; init; } + + /// + /// The tooltip text when you hover over this label part. Depending on + /// the client capability `inlayHint.resolveSupport` clients might resolve + /// this property late using the resolve request. + /// + [Optional] + public StringOrMarkupContent? Tooltip { get; init; } + + /// + /// An optional source code location that represents this + /// label part. + /// + /// The editor will use this location for the hover and for code navigation + /// features: This part will become a clickable link that resolves to the + /// definition of the symbol at the given location (not necessarily the + /// location itself), it shows the hover that shows at the given location, + /// and it shows a context menu with further code navigation commands. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Location? Location { get; init; } + + /// + /// An optional command for this label part. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Command? Command { get; init; } + + private string DebuggerDisplay => ToString(); + } + + [JsonConverter(typeof(Converter))] + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public record StringOrInlayHintLabelParts + { + public StringOrInlayHintLabelParts(string value) => String = value; + + public StringOrInlayHintLabelParts(IEnumerable inlayHintLabelParts) => InlayHintLabelParts = new(inlayHintLabelParts); + + public string? String { get; } + public bool HasString => InlayHintLabelParts is null; + public Container? InlayHintLabelParts { get; } + public bool HasInlayHintLabelParts => InlayHintLabelParts is { }; + + public static implicit operator StringOrInlayHintLabelParts?(string? value) => value is null ? null : new StringOrInlayHintLabelParts(value); + + public static implicit operator StringOrInlayHintLabelParts?(MarkupContent? markupContent) => + markupContent is null ? null : new StringOrInlayHintLabelParts(markupContent); + + private string DebuggerDisplay => + $"{( HasString ? String : HasInlayHintLabelParts ? string.Join(", ", InlayHintLabelParts!.Select(z => z.ToString())) : string.Empty )}"; + + /// + public override string ToString() => DebuggerDisplay; + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, StringOrInlayHintLabelParts value, JsonSerializer serializer) + { + if (value.HasString) + { + writer.WriteValue(value.String); + } + else + { + serializer.Serialize(writer, value.InlayHintLabelParts ?? Array.Empty()); + } + } + + public override StringOrInlayHintLabelParts ReadJson( + JsonReader reader, Type objectType, StringOrInlayHintLabelParts existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + if (reader.TokenType == JsonToken.StartArray) + { + var result = JArray.Load(reader); + return new StringOrInlayHintLabelParts(result.ToObject>()); + } + + if (reader.TokenType == JsonToken.String) + { + return new StringOrInlayHintLabelParts(( reader.Value as string )!); + } + + return ""; + } + + public override bool CanRead => true; + } + } + + /// + /// Inlay hint kinds. + /// + /// @since 3.17.0 + /// + /// + [JsonConverter(typeof(NumberEnumConverter))] + public enum InlayHintKind + { + /// + /// An inlay hint that for a type annotation. + /// + Type = 1, + + /// + /// An inlay hint that is for a parameter. + /// + Parameter = 2 + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.InlayHintProvider))] + [RegistrationOptionsConverter(typeof(InlayHintRegistrationOptionsConverter))] + [RegistrationName(TextDocumentNames.InlayHint)] + public partial class InlayHintRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class InlayHintRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public InlayHintRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(InlayHintRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IInlayHintResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.InlayHint))] + public partial class InlayHintWorkspaceClientCapabilities : DynamicCapability + { + /// + /// Indicates which properties a client can resolve lazily on a inlay + /// hint. + /// + [Optional] + public InlayHintCapabilityResolveSupport? ResolveSupport { get; set; } + } + + /// + /// Indicates which properties a client can resolve lazily on a inlay + /// hint. + /// + public class InlayHintCapabilityResolveSupport + { + /// + /// The properties that a client can resolve lazily. + /// + public Container Properties { get; set; } + } + } + + namespace Document + { + } +} diff --git a/src/Protocol/Features/Document/InlineValueFeature.cs b/src/Protocol/Features/Document/InlineValueFeature.cs new file mode 100644 index 000000000..5440fd3a9 --- /dev/null +++ b/src/Protocol/Features/Document/InlineValueFeature.cs @@ -0,0 +1,213 @@ +ο»Ώusing System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + [Parallel] + [Method(TextDocumentNames.InlineValue, Direction.ClientToServer)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "InlineValues"), + GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(InlineValueRegistrationOptions)), Capability(typeof(InlineValueWorkspaceClientCapabilities))] + public partial record InlineValueParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, + IRequest?> + { + /// + /// The text document. + /// + public TextDocumentIdentifier TextDocument { get; init; } + + /// + /// The document range for which inline values should be computed. + /// + public Range Range { get; init; } + + /// + /// Additional information about the context in which inline values were + /// requested. + /// + public InlineValueContext Context { get; init; } + } + + /// + /// @since 3.17.0 + /// + public partial record InlineValueContext + { + /// + /// The stack frame (as a DAP Id) where the execution has stopped. + /// + public int FrameId { get; set; } + + /// + /// The document range where execution has stopped. + /// Typically the end position of the range denotes the line where the + /// inline values are shown. + /// + public Range StoppedLocation { get; set; } + } + + [Parallel] + [Method(WorkspaceNames.InlineValueRefresh, Direction.ServerToClient)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] + [Capability(typeof(CodeLensWorkspaceClientCapabilities))] + public partial record InlineValueRefreshParams : IRequest; + + [JsonConverter(typeof(Converter))] + public abstract partial record InlineValueBase + { + /// + /// The document range for which the inline value applies. + /// + public Range Range { get; init; } + + internal class Converter : JsonConverter + { + public override bool CanWrite => false; + + public override void WriteJson(JsonWriter writer, InlineValueBase value, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + public override InlineValueBase ReadJson( + JsonReader reader, Type objectType, InlineValueBase existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + var result = JObject.Load(reader); + if (result["text"] is { Type: JTokenType.String }) + { + return result.ToObject(); + } + + if (result["variableName"] is { Type: JTokenType.String }) + { + return result.ToObject(); + } + + if (result["expression"] is { Type: JTokenType.String }) + { + return result.ToObject(); + } + + return null!; + } + } + } + + /// + /// Provide inline value as text. + /// + /// @since 3.17.0 + /// + [JsonConverter(typeof(Converter))] + public partial record InlineValueText : InlineValueBase + { + /// + /// The text of the inline value. + /// + public string Text { get; init; } + } + + /// + /// Provide inline value through a variable lookup. + /// + /// If only a range is specified, the variable name will be extracted from + /// the underlying document. + /// + /// An optional variable name can be used to override the extracted name. + /// + /// @since 3.17.0 + /// + [JsonConverter(typeof(Converter))] + public partial record InlineValueVariableLookup : InlineValueBase + { + /// + /// If specified the name of the variable to look up. + /// + [Optional] + public string? VariableName { get; init; } + + /// + /// How to perform the lookup. + /// + public bool CaseSensitiveLookup { get; init; } + } + + /// + /// Provide an inline value through an expression evaluation. + /// + /// If only a range is specified, the expression will be extracted from the + /// underlying document. + /// + /// An optional expression can be used to override the extracted expression. + /// + /// @since 3.17.0 + /// + [JsonConverter(typeof(Converter))] + public partial record InlineValueEvaluatableExpression : InlineValueBase + { + /// + /// If specified the expression overrides the extracted expression. + /// + public string? Expression { get; init; } + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.InlineValueProvider))] + [RegistrationName(TextDocumentNames.InlineValue)] + public partial class InlineValueRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + } + } + + namespace Server.Capabilities + { + } + + namespace Client.Capabilities + { + /// + /// Client workspace capabilities specific to inline values. + /// + /// @since 3.17.0 + /// + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.InlineValue))] + public partial class InlineValueWorkspaceClientCapabilities : ICapability + { + /// + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// inline values currently shown. It should be used with absolute care and + /// is useful for situation where a server for example detect a project wide + /// change that requires such a calculation. + /// + [Optional] + public bool RefreshSupport { get; set; } + } + } + + namespace Document + { + } +} diff --git a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs new file mode 100644 index 000000000..04e784371 --- /dev/null +++ b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs @@ -0,0 +1,1140 @@ +ο»Ώusing System; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using Minimatch; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The params sent in a open notebook document notification. + /// + /// @since 3.17.0 + /// + [Serial] + [Method(NotebookDocumentNames.DidOpen, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] + [Capability(typeof(NotebookDocumentSyncClientCapabilities))] + public partial class DidOpenNotebookDocumentParams : IRequest + { + /// + /// The notebook document that got opened. + /// + public NotebookDocument NotebookDocument { get; set; } + + /// + /// The text documents that represent the content + /// of a notebook cell. + /// + public Container CellTextDocuments { get; set; } + } + + /// + /// The params sent in a change notebook document notification. + /// + /// @since 3.17.0 + /// + [Serial] + [Method(NotebookDocumentNames.DidChange, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] + [Capability(typeof(NotebookDocumentSyncClientCapabilities))] + public partial record DidChangeNotebookDocumentParams : IRequest + { + /// + /// The notebook document that did change. The version number points + /// to the version after all provided changes have been applied. + /// + public VersionedNotebookDocumentIdentifier NotebookDocument { get; set; } + + /// + /// The actual changes to the notebook document. + /// + /// The change describes single state change to the notebook document. + /// So it moves a notebook document, its cells and its cell text document + /// contents from state S to S'. + /// + /// To mirror the content of a notebook using change events use the + /// following approach: + /// - start with the same initial content + /// - apply the 'notebookDocument/didChange' notifications in the order + /// you receive them. + /// + public NotebookDocumentChangeEvent Change { get; set; } + } + + [Serial] + [Method(NotebookDocumentNames.DidSave, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] + [Capability(typeof(NotebookDocumentSyncClientCapabilities))] + public partial class DidSaveNotebookDocumentParams : INotebookDocumentIdentifierParams, IRequest + { + /// + /// The notebook document that got saved. + /// + public NotebookDocumentIdentifier NotebookDocument { get; set; } + } + + [Parallel] + [Method(NotebookDocumentNames.DidClose, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] + [Capability(typeof(NotebookDocumentSyncClientCapabilities))] + public partial class DidCloseNotebookDocumentParams : INotebookDocumentIdentifierParams, IRequest + { + /// + /// The notebook document that got closed. + /// + public NotebookDocumentIdentifier NotebookDocument { get; set; } + + /// + /// The text documents that represent the content + /// of a notebook cell that got closed. + /// + public Container CellTextDocuments { get; set; } + } + + /// + /// A change event for a notebook document. + /// + /// @since 3.17.0 + /// + public partial record NotebookDocumentChangeEvent + { + /// + /// The changed meta data if any. + /// + public JObject? Metadata { get; init; } + + /// + /// Changes to cells + /// + public NotebookDocumentChangeEventCells Cells { get; init; } + } + + /// + /// Changes to cells + /// + public partial record NotebookDocumentChangeEventCells + { + /// + /// Changes to the cell structure to add or + /// remove cells. + /// + public NotebookDocumentChangeEventCellsStructure? Structure { get; init; } + + /// + /// Changes to notebook cells properties like its + /// kind, execution summary or metadata. + /// + public Container? Data { get; set; } + + /// + /// Changes to the text content of notebook cells. + /// + public NotebookDocumentChangeEventCellsTextContent TextContent { get; init; } + } + + /// + /// Changes to the cell structure to add or + /// remove cells. + /// + public partial record NotebookDocumentChangeEventCellsStructure + { + /// + /// The change to the cell array. + /// + public NotebookCellArrayChange Array { get; set; } + + /// + /// Additional opened cell text documents. + /// + public Container? DidOpen { get; set; } + + /// + /// Additional closed cell text documents. + /// + public Container? DidClose { get; set; } + } + + /// + /// A change describing how to move a `NotebookCell` + /// array from state S to S'. + /// + /// @since 3.17.0 + /// + public partial record NotebookCellArrayChange + { + /// + /// The start oftest of the cell that changed. + /// + public uint Start { get; set; } + + /// + /// The deleted cells + /// + public uint DeleteCount { get; set; } + + /// + /// The new cells, if any + /// + public Container? Cells { get; set; } + } + + /// + /// Changes to the text content of notebook cells. + /// + public partial record NotebookDocumentChangeEventCellsTextContent + { + public VersionedTextDocumentIdentifier Document { get; set; } + public Container Changes { get; set; } + } + + /// + /// An event describing a change to a text document. If range and rangeLength are omitted + /// the new text is considered to be the full content of the document. + /// + public record NotebookDocumentContentChangeEvent + { + /// + /// The range of the document that changed. + /// + [Optional] + public Range? Range { get; init; } + + /// + /// The length of the range that got replaced. + /// + /// + /// in the LSP spec + /// + [Optional] + public int RangeLength { get; init; } + + /// + /// The new text of the document. + /// + public string Text { get; init; } = null!; + } + + /// + /// A notebook document. + /// + /// @since 3.17.0 + /// + public partial record NotebookDocument + { + /// + /// The notebook document's uri. + /// + public DocumentUri Uri { get; set; } + + /// + /// The type of the notebook. + /// + public string NotebookType { get; set; } + + /// + /// The version number of this document (it will increase after each + /// change, including undo/redo). + /// + public int Version { get; set; } + + /// + /// Additional metadata stored with the notebook + /// document. + /// + public JObject? Metadata { get; set; } + + /// + /// The cells of a notebook. + /// + public Container Cells { get; set; } + } + + + /// + /// A notebook cell. + /// + /// A cell's document URI must be unique across ALL notebook + /// cells and can therefore be used to uniquely identify a + /// notebook cell or the cell's text document. + /// + /// @since 3.17.0 + /// + public partial record NotebookCell + { + /// + /// The cell's kind + /// + public NotebookCellKind Kind { get; set; } + + /// + /// The URI of the cell's text document + /// content. + /// + public DocumentUri Document { get; set; } + + /// + /// Additional metadata stored with the cell. + /// + public JObject? Metadata { get; set; } + + /// + /// Additional execution summary information + /// if supported by the client. + /// + public ExecutionSummary? ExecutionSummary { get; set; } + } + + + public partial record ExecutionSummary + { + /// + /// A strict monotonically increasing value + /// indicating the execution order of a cell + /// inside a notebook. + /// + public uint ExecutionOrder { get; set; } + + /// + /// Whether the execution was successful or + /// not if known by the client. + /// + public bool? Success { get; set; } + } + + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public class NotebookDocumentFilter : IEquatable + { + public static NotebookDocumentFilter ForPattern(string wildcard) => new NotebookDocumentFilter { Pattern = wildcard }; + + public static NotebookDocumentFilter ForNotebookType(string notebookType) => new NotebookDocumentFilter { NotebookType = notebookType }; + + public static NotebookDocumentFilter ForScheme(string scheme) => new NotebookDocumentFilter { Scheme = scheme }; + + /// + /// A language id, like `typescript`. + /// + [Optional] + public string? NotebookType { get; init; } + + /// + /// does the document filter contains a language + /// + [JsonIgnore] + public bool HasNotebookType => NotebookType != null; + + /// + /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + /// + [Optional] + public string? Scheme { get; init; } + + /// + /// does the document filter contains a scheme + /// + [JsonIgnore] + public bool HasScheme => Scheme != null; + + /// + /// A glob pattern, like `*.{ts,js}`. + /// + [Optional] + public string? Pattern + { + get => _pattern; + init + { + _pattern = value; + _minimatcher = new Minimatcher(value!, new Options { MatchBase = true }); + } + } + + /// + /// does the document filter contains a paattern + /// + [JsonIgnore] + public bool HasPattern => Pattern != null; + + private string? _pattern; + private Minimatcher? _minimatcher; + + public static explicit operator string(NotebookDocumentFilter notebookDocumentFilter) + { + var items = new List(); + if (notebookDocumentFilter.HasNotebookType) + { + items.Add(notebookDocumentFilter.NotebookType!); + } + + if (notebookDocumentFilter.HasScheme) + { + items.Add(notebookDocumentFilter.Scheme!); + } + + if (notebookDocumentFilter.HasPattern) + { + items.Add(notebookDocumentFilter.Pattern!); + } + + return $"[{string.Join(", ", items)}]"; + } + + public bool IsMatch(NotebookDocumentAttributes attributes) + { + if (HasNotebookType && HasPattern && HasScheme) + { + return NotebookType == attributes.NotebookType && Scheme == attributes.Scheme && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + if (HasNotebookType && HasPattern) + { + return NotebookType == attributes.NotebookType && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + if (HasNotebookType && HasScheme) + { + return NotebookType == attributes.NotebookType && Scheme == attributes.Scheme; + } + + if (HasPattern && HasScheme) + { + return Scheme == attributes.Scheme && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + if (HasNotebookType) + { + return NotebookType == attributes.NotebookType; + } + + if (HasScheme) + { + return Scheme == attributes.Scheme; + } + + if (HasPattern) + { + return _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + return false; + } + + public bool Equals(NotebookDocumentFilter? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return _pattern == other._pattern && NotebookType == other.NotebookType && Scheme == other.Scheme; + } + + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((NotebookDocumentFilter)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = _pattern != null ? _pattern.GetHashCode() : 0; + hashCode = ( hashCode * 397 ) ^ ( NotebookType != null ? NotebookType.GetHashCode() : 0 ); + hashCode = ( hashCode * 397 ) ^ ( Scheme != null ? Scheme.GetHashCode() : 0 ); + return hashCode; + } + } + + public static bool operator ==(NotebookDocumentFilter left, NotebookDocumentFilter right) => Equals(left, right); + + public static bool operator !=(NotebookDocumentFilter left, NotebookDocumentFilter right) => !Equals(left, right); + + private string DebuggerDisplay => (string)this; + + /// + public override string ToString() => DebuggerDisplay; + } + + public record NotebookSelectorCell + { + public string Language { get; init; } + } + + + /// + /// The notebooks to be synced + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public class NotebookSelector : IEquatable + { + /// + /// The notebook to be synced If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + /// + public NotebookDocumentFilter? NotebookDocument { get; init; } + + public bool HasNotebookDocument => NotebookDocument is not null; + + /// + /// The cells of the matching notebook to be synced. + /// + public Container? Cells { get; init; } + + public bool HasCells => Cells is not null; + + + public bool IsMatch(NotebookDocumentAttributes attributes) + { + return NotebookDocument?.IsMatch(attributes) == true + || ( attributes.Language is not null && Cells?.Any(z => z.Language == attributes.Language) == true ); + } + + private string DebuggerDisplay => (string)this; + + /// + public override string ToString() => DebuggerDisplay; + + public static explicit operator string(NotebookSelector notebookDocumentFilter) + { + var items = new List(); + if (notebookDocumentFilter.HasNotebookDocument) + { + items.Add((string)notebookDocumentFilter.NotebookDocument!); + } + + if (notebookDocumentFilter.HasCells) + { + items.Add(string.Join(", ", notebookDocumentFilter.Cells!.Select(z => z.Language!))); + } + + return $"[{string.Join(", ", items)}]"; + } + + public bool Equals(NotebookSelector? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Equals(NotebookDocument, other.NotebookDocument) && Equals(Cells, other.Cells); + } + + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((NotebookSelector)obj); + } + + public override int GetHashCode() + { + unchecked + { + return ( ( NotebookDocument != null ? NotebookDocument.GetHashCode() : 0 ) * 397 ) ^ ( Cells != null ? Cells.GetHashCode() : 0 ); + } + } + + public static bool operator ==(NotebookSelector? left, NotebookSelector? right) + { + return Equals(left, right); + } + + public static bool operator !=(NotebookSelector? left, NotebookSelector? right) + { + return !Equals(left, right); + } + } + + /// + /// A collection of document filters used to identify valid documents + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public class NotebookDocumentSelector : ContainerBase + { + public NotebookDocumentSelector() : this(Enumerable.Empty()) + { + } + + public NotebookDocumentSelector(IEnumerable items) : base(items) + { + } + + public NotebookDocumentSelector(params NotebookDocumentFilter[] items) : base(items) + { + } + + public static implicit operator NotebookDocumentSelector(NotebookDocumentFilter[] items) => new NotebookDocumentSelector(items); + + public static implicit operator NotebookDocumentSelector(Collection items) => new NotebookDocumentSelector(items); + + public static implicit operator NotebookDocumentSelector(List items) => new NotebookDocumentSelector(items); + + public static implicit operator string(NotebookDocumentSelector? documentSelector) => + documentSelector is not null ? string.Join(", ", documentSelector.Select(x => (string)x)) : string.Empty; + + public bool IsMatch(NotebookDocumentAttributes attributes) => this.Any(z => z.IsMatch(attributes)); + + public override string ToString() => this; + + public static NotebookDocumentSelector ForPattern(params string[] wildcards) => + new NotebookDocumentSelector(wildcards.Select(NotebookDocumentFilter.ForPattern)); + + public static NotebookDocumentSelector ForNotebookType(params string[] notebookTypes) => + new NotebookDocumentSelector(notebookTypes.Select(NotebookDocumentFilter.ForNotebookType)); + + public static NotebookDocumentSelector ForScheme(params string[] schemes) => + new NotebookDocumentSelector(schemes.Select(NotebookDocumentFilter.ForScheme)); + + private string DebuggerDisplay => this; + } + + + /// + /// A notebook cell kind. + /// + /// @since 3.17.0 + /// + [JsonConverter(typeof(NumberEnumConverter))] + public enum NotebookCellKind + { + /// + /// A markup-cell is formatted source that is used for display. + /// + Markup = 1, + + /// + /// A code-cell is source code. + /// + Code = 2 + } + + public interface INotebookDocumentRegistrationOptions : IRegistrationOptions + { + /// + /// The notebooks to be synced + /// + NotebookSelector NotebookSelector { get; set; } + } + + /// + /// Options specific to a notebook plus its cells + /// to be synced to the server. + /// + /// If a selector provider a notebook document + /// filter but no cell selector all cells of a + /// matching notebook document will be synced. + /// + /// If a selector provides no notebook document + /// filter but only a cell selector all notebook + /// document that contain at least one matching + /// cell will be synced. + /// + /// @since 3.17.0 + /// + [GenerateRegistrationOptions(nameof(ServerCapabilities.NotebookDocumentSync))] + [RegistrationOptionsConverter(typeof(Converter))] + public partial class NotebookDocumentSyncOptions : INotebookDocumentRegistrationOptions + { + /// + /// The notebooks to be synced + /// + public NotebookSelector NotebookSelector { get; set; } + + /// + /// Whether save notification should be forwarded to + /// + /// the server. Will only be honored if mode === `notebook`. + /// + public bool? Save { get; set; } + + private class Converter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public Converter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(NotebookDocumentSyncOptions source) + { + return new() + { + NotebookSelector = source.NotebookSelector, + Save = source.Save, + }; + } + } + } + } + + namespace Client.Capabilities + { + /// + /// Notebook specific client capabilities. + /// + /// @since 3.17.0 + /// + public partial class NotebookDocumentSyncClientCapabilities : DynamicCapability + { + /// + /// The client supports sending execution summary data per cell. + /// + public bool? ExecutionSummarySupport { get; set; } + } + } + + namespace Document + { + public interface INotebookDocumentSyncHandler : IDidChangeNotebookDocumentHandler, IDidOpenNotebookDocumentHandler, + IDidCloseNotebookDocumentHandler, IDidSaveNotebookDocumentHandler, INotebookDocumentIdentifier + { + } + + public abstract class NotebookDocumentSyncHandlerBase : INotebookDocumentSyncHandler + { + public abstract NotebookDocumentAttributes GetNotebookDocumentAttributes(DocumentUri uri); + public abstract Task Handle(DidOpenNotebookDocumentParams request, CancellationToken cancellationToken); + public abstract Task Handle(DidChangeNotebookDocumentParams request, CancellationToken cancellationToken); + public abstract Task Handle(DidSaveNotebookDocumentParams request, CancellationToken cancellationToken); + public abstract Task Handle(DidCloseNotebookDocumentParams request, CancellationToken cancellationToken); + + protected NotebookDocumentSyncOptions RegistrationOptions { get; private set; } + + protected ClientCapabilities ClientCapabilities { get; private set; } + + protected NotebookDocumentSyncClientCapabilities Capability { get; private set; } = default!; + + protected abstract NotebookDocumentSyncOptions CreateRegistrationOptions( + NotebookDocumentSyncClientCapabilities capability, ClientCapabilities clientCapabilities + ); + + private NotebookDocumentSyncOptions AssignRegistrationOptions( + NotebookDocumentSyncClientCapabilities capability, ClientCapabilities clientCapabilities + ) + { + Capability = capability; + if (RegistrationOptions is { }) return RegistrationOptions; + ClientCapabilities = clientCapabilities; + return RegistrationOptions = CreateRegistrationOptions(capability, clientCapabilities); + } + + NotebookDocumentSyncOptions IRegistration.GetRegistrationOptions( + NotebookDocumentSyncClientCapabilities capability, ClientCapabilities clientCapabilities + ) + { + return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); + } + } + + + public static class NotebookDocumentSyncExtensions + { + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + onOpenHandler, + onCloseHandler, + onChangeHandler, + onSaveHandler, + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + RegistrationOptionsDelegate? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + public static ILanguageServerRegistry OnNotebookDocumentSync( + this ILanguageServerRegistry registry, + Func getNotebookDocumentAttributes, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + NotebookDocumentSyncOptions? registrationOptions + ) + { + return registry.AddHandlers( + new DelegatingHandler( + getNotebookDocumentAttributes, + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) + ) + ); + } + + private class DelegatingHandler : NotebookDocumentSyncHandlerBase + { + private readonly Func _onOpenHandler; + private readonly Func _onCloseHandler; + private readonly Func _onChangeHandler; + private readonly Func _onSaveHandler; + + private readonly RegistrationOptionsDelegate + _registrationOptionsFactory; + + private readonly Func _getNotebookDocumentAttributes; + + public DelegatingHandler( + Func getNotebookDocumentAttributes, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _onOpenHandler = onOpenHandler; + _onSaveHandler = onSaveHandler; + _registrationOptionsFactory = registrationOptionsFactory; + _onChangeHandler = onChangeHandler; + _onCloseHandler = onCloseHandler; + _getNotebookDocumentAttributes = getNotebookDocumentAttributes; + } + + public override async Task Handle(DidOpenNotebookDocumentParams request, CancellationToken cancellationToken) + { + await _onOpenHandler.Invoke(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + public override async Task Handle(DidChangeNotebookDocumentParams request, CancellationToken cancellationToken) + { + await _onChangeHandler.Invoke(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + public override async Task Handle(DidSaveNotebookDocumentParams request, CancellationToken cancellationToken) + { + await _onSaveHandler.Invoke(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + public override async Task Handle(DidCloseNotebookDocumentParams request, CancellationToken cancellationToken) + { + await _onCloseHandler.Invoke(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + protected override NotebookDocumentSyncOptions CreateRegistrationOptions( + NotebookDocumentSyncClientCapabilities capability, ClientCapabilities clientCapabilities + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } + + public override NotebookDocumentAttributes GetNotebookDocumentAttributes(DocumentUri uri) + { + return _getNotebookDocumentAttributes.Invoke(uri); + } + } + } + } +} diff --git a/src/Protocol/Features/Document/RenameFeature.cs b/src/Protocol/Features/Document/RenameFeature.cs index 48ae01358..65555fa95 100644 --- a/src/Protocol/Features/Document/RenameFeature.cs +++ b/src/Protocol/Features/Document/RenameFeature.cs @@ -48,7 +48,7 @@ public partial record RenameParams : ITextDocumentIdentifierParams, IRequest; + public partial record PrepareRenameParams : TextDocumentPositionParams, IWorkDoneProgressParams, IRequest; [JsonConverter(typeof(RangeOrPlaceholderRangeConverter))] public record RangeOrPlaceholderRange diff --git a/src/Protocol/Features/Document/SemanticTokensFeature.cs b/src/Protocol/Features/Document/SemanticTokensFeature.cs index 7185fdfca..cd9d56358 100644 --- a/src/Protocol/Features/Document/SemanticTokensFeature.cs +++ b/src/Protocol/Features/Document/SemanticTokensFeature.cs @@ -177,6 +177,8 @@ internal SemanticTokensPartialResult(SemanticTokens? result) { Data = result?.Data ?? ImmutableArray.Empty; } + + public static SemanticTokensPartialResult From(SemanticTokens? result) => new SemanticTokensPartialResult(result); } @@ -418,6 +420,8 @@ public static implicit operator SemanticTokensFullOrDelta(SemanticTokensFullOrDe { return new SemanticTokensFullOrDelta(semanticTokensDeltaPartialResult); } + + public static SemanticTokensFullOrDeltaPartialResult From(SemanticTokensFullOrDelta? result) => new SemanticTokensFullOrDeltaPartialResult(result); } /// @@ -604,6 +608,11 @@ public readonly partial struct SemanticTokenType public static SemanticTokenType Modifier { get; } = new SemanticTokenType("modifier"); public static SemanticTokenType Event { get; } = new SemanticTokenType("event"); public static SemanticTokenType EnumMember { get; } = new SemanticTokenType("enumMember"); + + /// + /// @since 3.17.0 + /// + public static SemanticTokenType Decorator { get; } = new SemanticTokenType("decorator"); } [RegistrationName(TextDocumentNames.SemanticTokensRegistration)] @@ -708,6 +717,32 @@ public partial class SemanticTokensCapability : DynamicCapability /// [Optional] public bool MultilineTokenSupport { get; set; } + + /// + /// Whether the client allows the server to actively cancel a + /// semantic token request, e.g. supports returning + /// ErrorCodes.ServerCancelled. If a server does the client + /// needs to retrigger the request. + /// + /// @since 3.17.0 + /// + [Optional] + public bool ServerCancelSupport { get; set; } + + /// + /// Whether the client uses semantic tokens to augment existing + /// syntax tokens. If set to `true` client side created syntax + /// tokens and semantic tokens are both used for colorization. If + /// set to `false` the client only uses the returned semantic tokens + /// for colorization. + /// + /// If the value is `undefined` then the client behavior is not + /// specified. + /// + /// @since 3.17.0 + /// + [Optional] + public bool AugmentsSyntaxTokens { get; set; } } public partial class SemanticTokensCapabilityRequests @@ -931,7 +966,7 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration { return mediator.ProgressManager.MonitorUntil( @params, - (partial, result) => new SemanticTokens + (result, partial) => new SemanticTokens { Data = partial.Data, ResultId = result?.ResultId @@ -946,9 +981,9 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration ) { return mediator.ProgressManager.MonitorUntil( - @params, (partial, result) => + @params, (result, partial) => { - if (partial.IsDelta) + if (partial?.IsDelta == true) { return new SemanticTokensFullOrDelta( new SemanticTokensDelta @@ -959,7 +994,7 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration ); } - if (partial.IsFull) + if (partial?.IsFull == true) { return new SemanticTokensFullOrDelta( new SemanticTokens @@ -971,7 +1006,7 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration } return new SemanticTokensFullOrDelta(new SemanticTokens()); - }, cancellationToken + }, SemanticTokensFullOrDeltaPartialResult.From, cancellationToken ); } @@ -982,12 +1017,12 @@ protected internal override SemanticTokensRegistrationOptions CreateRegistration { return mediator.ProgressManager.MonitorUntil( @params, - (partial, result) => new SemanticTokens + (result, partial) => new SemanticTokens { Data = partial.Data, ResultId = result?.ResultId }, - tokens => new SemanticTokensPartialResult(tokens)!, + SemanticTokensPartialResult.From, cancellationToken ); } diff --git a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs index 615df16a0..54ab31a88 100644 --- a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs @@ -1,8 +1,12 @@ using System; +using System.Collections.ObjectModel; +using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; using MediatR; +using Minimatch; +using Newtonsoft.Json; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Client; @@ -25,7 +29,7 @@ namespace Models [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentChangeRegistrationOptions))] - [Capability(typeof(SynchronizationCapability))] + [Capability(typeof(TextSynchronizationCapability))] public partial record DidChangeTextDocumentParams : IRequest { /// @@ -103,7 +107,7 @@ public record TextDocumentEdit [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentOpenRegistrationOptions))] - [Capability(typeof(SynchronizationCapability))] + [Capability(typeof(TextSynchronizationCapability))] public partial class DidOpenTextDocumentParams : IRequest { /// @@ -123,7 +127,7 @@ public partial class TextDocumentOpenRegistrationOptions : ITextDocumentRegistra [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentCloseRegistrationOptions))] - [Capability(typeof(SynchronizationCapability))] + [Capability(typeof(TextSynchronizationCapability))] public partial class DidCloseTextDocumentParams : ITextDocumentIdentifierParams, IRequest { /// @@ -143,7 +147,7 @@ public partial class TextDocumentCloseRegistrationOptions : ITextDocumentRegistr [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentSaveRegistrationOptions))] - [Capability(typeof(SynchronizationCapability))] + [Capability(typeof(TextSynchronizationCapability))] public partial class DidSaveTextDocumentParams : ITextDocumentIdentifierParams, IRequest { /// @@ -169,6 +173,214 @@ public partial class TextDocumentSaveRegistrationOptions : ITextDocumentRegistra public bool IncludeText { get; set; } } + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public class TextDocumentFilter : IEquatable + { + public static TextDocumentFilter ForPattern(string wildcard) => new TextDocumentFilter { Pattern = wildcard }; + + public static TextDocumentFilter ForLanguage(string language) => new TextDocumentFilter { Language = language }; + + public static TextDocumentFilter ForScheme(string scheme) => new TextDocumentFilter { Scheme = scheme }; + + /// + /// A language id, like `typescript`. + /// + [Optional] + public string? Language { get; init; } + + /// + /// does the document filter contains a language + /// + [JsonIgnore] + public bool HasLanguage => Language != null; + + /// + /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + /// + [Optional] + public string? Scheme { get; init; } + + /// + /// does the document filter contains a scheme + /// + [JsonIgnore] + public bool HasScheme => Scheme != null; + + /// + /// A glob pattern, like `*.{ts,js}`. + /// + [Optional] + public string? Pattern + { + get => _pattern; + init + { + _pattern = value; + _minimatcher = new Minimatcher(value!, new Options { MatchBase = true }); + } + } + + /// + /// does the document filter contains a paattern + /// + [JsonIgnore] + public bool HasPattern => Pattern != null; + + private string? _pattern; + private Minimatcher? _minimatcher; + + public static explicit operator string(TextDocumentFilter textDocumentFilter) + { + var items = new List(); + if (textDocumentFilter.HasLanguage) + { + items.Add(textDocumentFilter.Language!); + } + + if (textDocumentFilter.HasScheme) + { + items.Add(textDocumentFilter.Scheme!); + } + + if (textDocumentFilter.HasPattern) + { + items.Add(textDocumentFilter.Pattern!); + } + + return $"[{string.Join(", ", items)}]"; + } + + public bool IsMatch(TextDocumentAttributes attributes) + { + if (HasLanguage && HasPattern && HasScheme) + { + return Language == attributes.LanguageId && Scheme == attributes.Scheme && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + if (HasLanguage && HasPattern) + { + return Language == attributes.LanguageId && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + if (HasLanguage && HasScheme) + { + return Language == attributes.LanguageId && Scheme == attributes.Scheme; + } + + if (HasPattern && HasScheme) + { + return Scheme == attributes.Scheme && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + if (HasLanguage) + { + return Language == attributes.LanguageId; + } + + if (HasScheme) + { + return Scheme == attributes.Scheme; + } + + if (HasPattern) + { + return _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; + } + + return false; + } + + public bool Equals(TextDocumentFilter? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return _pattern == other._pattern && Language == other.Language && Scheme == other.Scheme; + } + + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((TextDocumentFilter)obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = _pattern != null ? _pattern.GetHashCode() : 0; + hashCode = ( hashCode * 397 ) ^ ( Language != null ? Language.GetHashCode() : 0 ); + hashCode = ( hashCode * 397 ) ^ ( Scheme != null ? Scheme.GetHashCode() : 0 ); + return hashCode; + } + } + + public static bool operator ==(TextDocumentFilter left, TextDocumentFilter right) => Equals(left, right); + + public static bool operator !=(TextDocumentFilter left, TextDocumentFilter right) => !Equals(left, right); + + private string DebuggerDisplay => (string)this; + + /// + public override string ToString() => DebuggerDisplay; + } + + + /// + /// A collection of document filters used to identify valid documents + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public class TextDocumentSelector : ContainerBase + { + public TextDocumentSelector() : this(Enumerable.Empty()) + { + } + + public TextDocumentSelector(IEnumerable items) : base(items) + { + } + + public TextDocumentSelector(params TextDocumentFilter[] items) : base(items) + { + } + + public static implicit operator TextDocumentSelector(TextDocumentFilter[] items) => new TextDocumentSelector(items); + + public static implicit operator TextDocumentSelector(Collection items) => new TextDocumentSelector(items); + + public static implicit operator TextDocumentSelector(List items) => new TextDocumentSelector(items); + + public static implicit operator string(TextDocumentSelector? documentSelector) => + documentSelector is not null ? string.Join(", ", documentSelector.Select(x => (string) x)) : string.Empty; + + public bool IsMatch(TextDocumentAttributes attributes) => this.Any(z => z.IsMatch(attributes)); + + public override string ToString() => this; + + public static TextDocumentSelector ForPattern(params string[] wildcards) => new TextDocumentSelector(wildcards.Select(TextDocumentFilter.ForPattern)); + + public static TextDocumentSelector ForLanguage(params string[] languages) => new TextDocumentSelector(languages.Select(TextDocumentFilter.ForLanguage)); + + public static TextDocumentSelector ForScheme(params string[] schemes) => new TextDocumentSelector(schemes.Select(TextDocumentFilter.ForScheme)); + + private string DebuggerDisplay => this; + } + + public interface ITextDocumentSyncOptions + { + [Optional] bool OpenClose { get; set; } + [Optional] TextDocumentSyncKind Change { get; set; } + [Optional] bool WillSave { get; set; } + [Optional] bool WillSaveWaitUntil { get; set; } + [Optional] BooleanOr Save { get; set; } + } + + public interface ITextDocumentRegistrationOptions : IRegistrationOptions + { + TextDocumentSelector? DocumentSelector { get; set; } + } + [GenerateRegistrationOptions(nameof(ServerCapabilities.TextDocumentSync))] [RegistrationOptionsConverter(typeof(Converter))] public partial class TextDocumentSyncRegistrationOptions : ITextDocumentRegistrationOptions @@ -284,7 +496,7 @@ public static implicit operator TextDocumentCloseRegistrationOptions(TextDocumen [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumenWillSaveRegistrationOptions))] - [Capability(typeof(SynchronizationCapability))] + [Capability(typeof(TextSynchronizationCapability))] public partial class WillSaveTextDocumentParams : IRequest { /// @@ -312,7 +524,7 @@ public partial class TextDocumenWillSaveRegistrationOptions : ITextDocumentRegis [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentWillSaveWaitUntilRegistrationOptions))] - [Capability(typeof(SynchronizationCapability))] + [Capability(typeof(TextSynchronizationCapability))] public partial class WillSaveWaitUntilTextDocumentParams : IRequest { /// @@ -335,7 +547,7 @@ public partial class TextDocumentWillSaveWaitUntilRegistrationOptions : ITextDoc namespace Client.Capabilities { [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.Synchronization))] - public class SynchronizationCapability : DynamicCapability + public class TextSynchronizationCapability : DynamicCapability { /// @@ -379,13 +591,15 @@ public abstract class TextDocumentSyncHandlerBase : ITextDocumentSyncHandler protected ClientCapabilities ClientCapabilities { get; private set; } - protected SynchronizationCapability Capability { get; private set; } = default!; + protected TextSynchronizationCapability Capability { get; private set; } = default!; protected abstract TextDocumentSyncRegistrationOptions CreateRegistrationOptions( - SynchronizationCapability capability, ClientCapabilities clientCapabilities + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities ); - private TextDocumentSyncRegistrationOptions AssignRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities) + private TextDocumentSyncRegistrationOptions AssignRegistrationOptions( + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities + ) { Capability = capability; if (RegistrationOptions is { }) return RegistrationOptions; @@ -393,29 +607,29 @@ private TextDocumentSyncRegistrationOptions AssignRegistrationOptions(Synchroniz return RegistrationOptions = CreateRegistrationOptions(capability, clientCapabilities); } - TextDocumentChangeRegistrationOptions IRegistration.GetRegistrationOptions( - SynchronizationCapability capability, ClientCapabilities clientCapabilities + TextDocumentChangeRegistrationOptions IRegistration.GetRegistrationOptions( + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities ) { return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); } - TextDocumentOpenRegistrationOptions IRegistration.GetRegistrationOptions( - SynchronizationCapability capability, ClientCapabilities clientCapabilities + TextDocumentOpenRegistrationOptions IRegistration.GetRegistrationOptions( + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities ) { return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); } - TextDocumentCloseRegistrationOptions IRegistration.GetRegistrationOptions( - SynchronizationCapability capability, ClientCapabilities clientCapabilities + TextDocumentCloseRegistrationOptions IRegistration.GetRegistrationOptions( + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities ) { return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); } - TextDocumentSaveRegistrationOptions IRegistration.GetRegistrationOptions( - SynchronizationCapability capability, ClientCapabilities clientCapabilities + TextDocumentSaveRegistrationOptions IRegistration.GetRegistrationOptions( + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities ) { return RegistrationOptions ?? AssignRegistrationOptions(capability, clientCapabilities); @@ -428,11 +642,11 @@ public static class TextDocumentSyncExtensions public static ILanguageServerRegistry OnTextDocumentSync( this ILanguageServerRegistry registry, Func getTextDocumentAttributes, - Func onOpenHandler, - Func onCloseHandler, - Func onChangeHandler, - Func onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( @@ -442,7 +656,7 @@ public static ILanguageServerRegistry OnTextDocumentSync( onCloseHandler, onChangeHandler, onSaveHandler, - RegistrationAdapter.Adapt(registrationOptions) + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -450,21 +664,21 @@ public static ILanguageServerRegistry OnTextDocumentSync( public static ILanguageServerRegistry OnTextDocumentSync( this ILanguageServerRegistry registry, Func getTextDocumentAttributes, - Func onOpenHandler, - Func onCloseHandler, - Func onChangeHandler, - Func onSaveHandler, + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, TextDocumentSyncRegistrationOptions? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -472,21 +686,21 @@ public static ILanguageServerRegistry OnTextDocumentSync( public static ILanguageServerRegistry OnTextDocumentSync( this ILanguageServerRegistry registry, Func getTextDocumentAttributes, - Action onOpenHandler, - Action onCloseHandler, - Action onChangeHandler, - Action onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -494,21 +708,21 @@ public static ILanguageServerRegistry OnTextDocumentSync( public static ILanguageServerRegistry OnTextDocumentSync( this ILanguageServerRegistry registry, Func getTextDocumentAttributes, - Action onOpenHandler, - Action onCloseHandler, - Action onChangeHandler, - Action onSaveHandler, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, TextDocumentSyncRegistrationOptions? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -517,21 +731,21 @@ public static ILanguageServerRegistry OnTextDocumentSync( this ILanguageServerRegistry registry, TextDocumentSyncKind kind, Func getTextDocumentAttributes, - Action onOpenHandler, - Action onCloseHandler, - Action onChangeHandler, - Action onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -540,21 +754,21 @@ public static ILanguageServerRegistry OnTextDocumentSync( this ILanguageServerRegistry registry, TextDocumentSyncKind kind, Func getTextDocumentAttributes, - Action onOpenHandler, - Action onCloseHandler, - Action onChangeHandler, - Action onSaveHandler, + Action onOpenHandler, + Action onCloseHandler, + Action onChangeHandler, + Action onSaveHandler, TextDocumentSyncRegistrationOptions? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -567,17 +781,17 @@ public static ILanguageServerRegistry OnTextDocumentSync( Func onCloseHandler, Func onChangeHandler, Func onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -596,11 +810,11 @@ public static ILanguageServerRegistry OnTextDocumentSync( return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -613,17 +827,17 @@ public static ILanguageServerRegistry OnTextDocumentSync( Action onCloseHandler, Action onChangeHandler, Action onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -642,11 +856,11 @@ public static ILanguageServerRegistry OnTextDocumentSync( return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -659,17 +873,17 @@ public static ILanguageServerRegistry OnTextDocumentSync( Func onCloseHandler, Func onChangeHandler, Func onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -688,11 +902,11 @@ public static ILanguageServerRegistry OnTextDocumentSync( return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -705,17 +919,17 @@ public static ILanguageServerRegistry OnTextDocumentSync( Action onCloseHandler, Action onChangeHandler, Action onSaveHandler, - RegistrationOptionsDelegate? registrationOptions + RegistrationOptionsDelegate? registrationOptions ) { return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } @@ -734,31 +948,31 @@ public static ILanguageServerRegistry OnTextDocumentSync( return registry.AddHandlers( new DelegatingHandler( getTextDocumentAttributes, - HandlerAdapter.Adapt(onOpenHandler), - HandlerAdapter.Adapt(onCloseHandler), - HandlerAdapter.Adapt(onChangeHandler), - HandlerAdapter.Adapt(onSaveHandler), - RegistrationAdapter.Adapt(registrationOptions) + HandlerAdapter.Adapt(onOpenHandler), + HandlerAdapter.Adapt(onCloseHandler), + HandlerAdapter.Adapt(onChangeHandler), + HandlerAdapter.Adapt(onSaveHandler), + RegistrationAdapter.Adapt(registrationOptions) ) ); } private class DelegatingHandler : TextDocumentSyncHandlerBase { - private readonly Func _onOpenHandler; - private readonly Func _onCloseHandler; - private readonly Func _onChangeHandler; - private readonly Func _onSaveHandler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Func _onOpenHandler; + private readonly Func _onCloseHandler; + private readonly Func _onChangeHandler; + private readonly Func _onSaveHandler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; private readonly Func _getTextDocumentAttributes; public DelegatingHandler( Func getTextDocumentAttributes, - Func onOpenHandler, - Func onCloseHandler, - Func onChangeHandler, - Func onSaveHandler, - RegistrationOptionsDelegate registrationOptionsFactory + Func onOpenHandler, + Func onCloseHandler, + Func onChangeHandler, + Func onSaveHandler, + RegistrationOptionsDelegate registrationOptionsFactory ) { _onOpenHandler = onOpenHandler; @@ -794,7 +1008,7 @@ public override async Task Handle(DidCloseTextDocumentParams request, Canc } protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions( - SynchronizationCapability capability, ClientCapabilities clientCapabilities + TextSynchronizationCapability capability, ClientCapabilities clientCapabilities ) { return _registrationOptionsFactory(capability, clientCapabilities); diff --git a/src/Protocol/Features/Document/TypeHierarchyFeature.cs b/src/Protocol/Features/Document/TypeHierarchyFeature.cs new file mode 100644 index 000000000..8ca5918a4 --- /dev/null +++ b/src/Protocol/Features/Document/TypeHierarchyFeature.cs @@ -0,0 +1,1032 @@ +ο»Ώusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reactive; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameter of a `textDocument/prepareTypeHierarchy` request. + /// + /// @since 3.16.0 + /// + [Parallel] + [Method(TextDocumentNames.PrepareTypeHierarchy, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(TypeHierarchyRegistrationOptions))] + [Capability(typeof(TypeHierarchyCapability))] + public partial record TypeHierarchyPrepareParams : TextDocumentPositionParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchyItem>; + + /// + /// Represents programming constructs like functions or constructors in the context + /// of call hierarchy. + /// + /// @since 3.16.0 + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateTypedData] + public partial record TypeHierarchyItem : ICanBeResolved + { + /// + /// The name of this item. + /// + public string Name { get; init; } = null!; + + /// + /// The kind of this item. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this item. + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// More detail for this item, e.g. the signature of a function. + /// + [Optional] + public string? Detail { get; init; } + + /// + /// The resource identifier of this item. + /// + public DocumentUri Uri { get; init; } = null!; + + /// + /// The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code. + /// + public Range Range { get; init; } = null!; + + /// + /// The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. + /// Must be contained by the [`range`](#TypeHierarchyItem.range). + /// + public Range SelectionRange { get; init; } = null!; + + /// + /// A data entry field that is preserved between a call hierarchy prepare and + /// supertypes calls or subtypes calls requests. + /// + [Optional] + public JToken? Data { get; init; } + + private string DebuggerDisplay => + $"[{Kind.ToString()}] " + + $"{Name} " + + $"@ {Uri} " + + $"{Range}"; + + /// + public override string ToString() + { + return DebuggerDisplay; + } + } + + public abstract record TypeHierarchyBaseCallParams : ICanBeResolved + { + public TypeHierarchyItem Item { get; init; } = null!; + + JToken? ICanBeResolved.Data + { + get => Item.GetRawData(); + init => Item.SetRawData(value); + } + } + + public abstract record TypeHierarchyBaseCallParams : ICanBeResolved + where T : class?, IHandlerIdentity? + { + public TypeHierarchyItem Item { get; init; } = null!; + + JToken? ICanBeResolved.Data + { + get => Item.GetRawData(); + init => Item.SetRawData(value); + } + } + + /// + /// The parameter of a `TypeHierarchy/supertypesCalls` request. + /// + /// @since 3.16.0 + /// + [Parallel] + [Method(TextDocumentNames.TypeHierarchySupertypes, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "TypeHierarchySupertypes")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(TypeHierarchyCapability))] + public partial record TypeHierarchySupertypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchySupertypesCall>, + IDoesNotParticipateInRegistration; + + /// + /// The parameter of a `TypeHierarchy/supertypesCalls` request. + /// + /// @since 3.16.0 + /// + [Method(TextDocumentNames.TypeHierarchySupertypes, Direction.ClientToServer)] + public partial record TypeHierarchySupertypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchySupertypesCall>, + IDoesNotParticipateInRegistration + where T : class?, IHandlerIdentity?; + + /// + /// Represents an supertypes call, e.g. a caller of a method or constructor. + /// + /// @since 3.16.0 + /// + public partial record TypeHierarchySupertypesCall + { + /// + /// The item that makes the call. + /// + public TypeHierarchyItem From { get; init; } = null!; + + /// + /// The range at which at which the calls appears. This is relative to the caller + /// denoted by [`this.from`](#TypeHierarchySupertypesCall.from). + /// + public Container FromRanges { get; init; } = null!; + } + + /// + /// The parameter of a `TypeHierarchy/subtypesCalls` request. + /// + /// @since 3.16.0 + /// + [Parallel] + [Method(TextDocumentNames.TypeHierarchySubtypes, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "TypeHierarchySubtypes")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(TypeHierarchyCapability))] + public partial record TypeHierarchySubtypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchySubtypesCall>, + IDoesNotParticipateInRegistration + + { + public static TypeHierarchySubtypesCallsParams Create(TypeHierarchySubtypesCallsParams item) + where T : class?, IHandlerIdentity? + { + return new TypeHierarchySubtypesCallsParams + { + Item = item.Item, + PartialResultToken = item.PartialResultToken, + WorkDoneToken = item.PartialResultToken + }; + } + } + + /// + /// The parameter of a `TypeHierarchy/subtypesCalls` request. + /// + /// @since 3.16.0 + /// + [Method(TextDocumentNames.TypeHierarchySubtypes, Direction.ClientToServer)] + public partial record TypeHierarchySubtypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchySubtypesCall>, + IDoesNotParticipateInRegistration + where T : class?, IHandlerIdentity? + { + public static TypeHierarchySubtypesCallsParams Create(TypeHierarchySubtypesCallsParams item) + { + return new TypeHierarchySubtypesCallsParams + { + Item = item.Item, + PartialResultToken = item.PartialResultToken, + WorkDoneToken = item.PartialResultToken + }; + } + + public static implicit operator TypeHierarchySubtypesCallsParams(TypeHierarchySubtypesCallsParams item) + { + return Create(item); + } + + public static implicit operator TypeHierarchySubtypesCallsParams(TypeHierarchySubtypesCallsParams item) + { + return TypeHierarchySubtypesCallsParams.Create(item); + } + } + + /// + /// Represents an subtypes call, e.g. calling a getter from a method or a method from a constructor etc. + /// + /// @since 3.16.0 + /// + public partial record TypeHierarchySubtypesCall + { + /// + /// The item that is called. + /// + public TypeHierarchyItem To { get; init; } = null!; + + /// + /// The range at which this item is called. This is the range relative to the caller, e.g the item + /// passed to [`provideTypeHierarchySubtypesCalls`](#TypeHierarchyItemProvider.provideTypeHierarchySubtypesCalls) + /// and not [`this.to`](#TypeHierarchySubtypesCall.to). + /// + public Container FromRanges { get; init; } = null!; + } + + /// + /// Call hierarchy options used during static or dynamic registration. + /// + /// @since 3.16.0 + /// + [GenerateRegistrationOptions(nameof(ServerCapabilities.TypeHierarchyProvider))] + [RegistrationName(TextDocumentNames.PrepareTypeHierarchy)] + public partial class TypeHierarchyRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions + { + } + } + + namespace Client.Capabilities + { + /// + /// Capabilities specific to the `textDocument/TypeHierarchy`. + /// + /// @since 3.16.0 + /// + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.TypeHierarchy))] + public partial class TypeHierarchyCapability : DynamicCapability + { + } + } + + namespace Document + { + public abstract class TypeHierarchyHandlerBase : AbstractHandlers.Base, + ITypeHierarchyPrepareHandler, + ITypeHierarchySupertypesHandler, + ITypeHierarchySubtypesHandler + { + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + protected TypeHierarchyHandlerBase(Guid id) + { + _id = id; + } + + protected TypeHierarchyHandlerBase() : this(Guid.NewGuid()) + { + } + + public abstract Task?> Handle(TypeHierarchyPrepareParams request, CancellationToken cancellationToken); + public abstract Task?> Handle(TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken); + public abstract Task?> Handle(TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken); + } + + public abstract class PartialTypeHierarchyHandlerBase : AbstractHandlers.PartialResults?, + TypeHierarchyItem, + TypeHierarchyRegistrationOptions, TypeHierarchyCapability>, + ITypeHierarchyPrepareHandler, ITypeHierarchySupertypesHandler, ITypeHierarchySubtypesHandler + { + private readonly ITypeHierarchySupertypesHandler _supertypes; + private readonly ITypeHierarchySubtypesHandler _subtypes; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + protected PartialTypeHierarchyHandlerBase(Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + _id = id; + _supertypes = new PartialSupertypes(id, progressManager, this); + _subtypes = new PartialSubtypes(id, progressManager, this); + } + + protected PartialTypeHierarchyHandlerBase(IProgressManager progressManager) : this(Guid.NewGuid(), progressManager) + { + } + + public Task?> Handle(TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken) + { + return _supertypes.Handle(request, cancellationToken); + } + + public Task?> Handle(TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken) + { + return _subtypes.Handle(request, cancellationToken); + } + + protected abstract void Handle( + TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ); + + protected abstract void Handle( + TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ); + + private class PartialSupertypes : AbstractHandlers.PartialResults< + TypeHierarchySupertypesCallsParams, + Container?, + TypeHierarchySupertypesCall, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >, ITypeHierarchySupertypesHandler + { + private readonly PartialTypeHierarchyHandlerBase _self; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialSupertypes(Guid id, IProgressManager progressManager, PartialTypeHierarchyHandlerBase self) : + base(progressManager, Container.From) + { + _id = id; + _self = self; + } + + protected override void Handle( + TypeHierarchySupertypesCallsParams request, + IObserver> results, + CancellationToken cancellationToken + ) + { + _self.Handle(request, results, cancellationToken); + } + + protected internal override TypeHierarchyRegistrationOptions CreateRegistrationOptions( + TypeHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return ( (IRegistration)_self ).GetRegistrationOptions( + capability, clientCapabilities + ); + } + } + + private class PartialSubtypes : AbstractHandlers.PartialResults?, + TypeHierarchySubtypesCall, TypeHierarchyRegistrationOptions + , TypeHierarchyCapability>, ITypeHierarchySubtypesHandler + { + private readonly PartialTypeHierarchyHandlerBase _self; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialSubtypes(Guid id, IProgressManager progressManager, PartialTypeHierarchyHandlerBase self) : + base(progressManager, Container.From) + + { + _id = id; + _self = self; + } + + protected override void Handle( + TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ) + { + _self.Handle(request, results, cancellationToken); + } + + protected internal override TypeHierarchyRegistrationOptions CreateRegistrationOptions( + TypeHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return ( (IRegistration)_self ).GetRegistrationOptions( + capability, clientCapabilities + ); + } + } + } + + public abstract class TypeHierarchyHandlerBase : TypeHierarchyHandlerBase where T : class?, IHandlerIdentity? + { + protected TypeHierarchyHandlerBase(Guid id) : base(id) + { + } + + protected TypeHierarchyHandlerBase() : this(Guid.NewGuid()) + { + } + + public sealed override async Task?> Handle(TypeHierarchyPrepareParams request, CancellationToken cancellationToken) + { + var response = await HandlePrepare(request, cancellationToken).ConfigureAwait(false); + return Container.From(response?.Select(TypeHierarchyItem.From)!); + } + + public sealed override Task?> Handle( + TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken + ) + { + return HandleSupertypesCalls( + new TypeHierarchySupertypesCallsParams + { + Item = request.Item, + PartialResultToken = request.PartialResultToken, + WorkDoneToken = request.WorkDoneToken + }, + cancellationToken + ); + } + + public sealed override Task?> Handle( + TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken + ) + { + return HandleSubtypesCalls( + new TypeHierarchySubtypesCallsParams + { + Item = request.Item, + PartialResultToken = request.PartialResultToken, + WorkDoneToken = request.WorkDoneToken + }, + cancellationToken + ); + } + + protected abstract Task>?> HandlePrepare(TypeHierarchyPrepareParams request, CancellationToken cancellationToken); + + protected abstract Task?> HandleSupertypesCalls( + TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken + ); + + protected abstract Task?> HandleSubtypesCalls( + TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken + ); + } + + public abstract class PartialTypeHierarchyHandlerBase : PartialTypeHierarchyHandlerBase where T : class?, IHandlerIdentity? + { + protected PartialTypeHierarchyHandlerBase(IProgressManager progressManager) : base(progressManager) + { + } + + protected sealed override void Handle( + TypeHierarchyPrepareParams request, IObserver> results, CancellationToken cancellationToken + ) + { + Handle( + request, + Observer.Create>>( + x => results.OnNext(x.Select(z => (TypeHierarchyItem)z)), + results.OnError, + results.OnCompleted + ), cancellationToken + ); + } + + protected abstract void Handle( + TypeHierarchyPrepareParams request, IObserver>> results, CancellationToken cancellationToken + ); + + protected sealed override void Handle( + TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ) + { + Handle( + new TypeHierarchySupertypesCallsParams + { + Item = request.Item, + PartialResultToken = request.PartialResultToken, + WorkDoneToken = request.WorkDoneToken + }, + results, + cancellationToken + ); + } + + protected abstract void Handle( + TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ); + + protected sealed override void Handle( + TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ) + { + Handle( + new TypeHierarchySubtypesCallsParams + { + Item = request.Item, + PartialResultToken = request.PartialResultToken, + WorkDoneToken = request.WorkDoneToken + }, + results, + cancellationToken + ); + } + + protected abstract void Handle( + TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ); + } + + public static partial class TypeHierarchyExtensions + { + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Func?>> handler, + Func?>> supertypesHandler, + Func?>> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) + { + var id = Guid.NewGuid(); + return registry + .AddHandler( + TextDocumentNames.PrepareTypeHierarchy, + new LanguageProtocolDelegatingHandlers.Request< + TypeHierarchyPrepareParams, + Container?, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + HandlerAdapter.Adapt(handler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySupertypes, + new LanguageProtocolDelegatingHandlers.Request< + TypeHierarchySupertypesCallsParams, + Container?, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + HandlerAdapter.Adapt(supertypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySubtypes, + new LanguageProtocolDelegatingHandlers.Request< + TypeHierarchySubtypesCallsParams, + Container?, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + HandlerAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ) + ; + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Func>?>> handler, + Func, TypeHierarchyCapability, CancellationToken, Task?>> + supertypesHandler, + Func, TypeHierarchyCapability, CancellationToken, Task?>> + subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + new DelegatingTypeHierarchyHandler( + HandlerAdapter.Adapt(handler), + HandlerAdapter.Adapt(supertypesHandler), + HandlerAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Func?>> handler, + Func?>> supertypesHandler, + Func?>> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) + { + var id = Guid.NewGuid(); + return registry + .AddHandler( + TextDocumentNames.PrepareTypeHierarchy, + new LanguageProtocolDelegatingHandlers.Request< + TypeHierarchyPrepareParams, + Container?, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + HandlerAdapter.Adapt(handler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySupertypes, + new LanguageProtocolDelegatingHandlers.Request< + TypeHierarchySupertypesCallsParams, + Container?, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + HandlerAdapter.Adapt(supertypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySubtypes, + new LanguageProtocolDelegatingHandlers.Request?, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + HandlerAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ) + ; + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Func>?>> handler, + Func, TypeHierarchyCapability, Task?>> supertypesHandler, + Func, TypeHierarchyCapability, Task?>> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + new DelegatingTypeHierarchyHandler( + HandlerAdapter.Adapt(handler), + HandlerAdapter.Adapt(supertypesHandler), + HandlerAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Func>?>> handler, + Func, CancellationToken, Task?>> supertypesHandler, + Func, CancellationToken, Task?>> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + new DelegatingTypeHierarchyHandler( + HandlerAdapter.Adapt(handler), + HandlerAdapter.Adapt(supertypesHandler), + HandlerAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Func>?>> handler, + Func, Task?>> supertypesHandler, + Func, Task?>> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + new DelegatingTypeHierarchyHandler( + HandlerAdapter.Adapt(handler), + HandlerAdapter.Adapt(supertypesHandler), + HandlerAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Action>, TypeHierarchyCapability, CancellationToken> handler, + Action>, TypeHierarchyCapability, CancellationToken> + supertypesHandler, + Action>, TypeHierarchyCapability, CancellationToken> + subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) + { + var id = Guid.NewGuid(); + return registry.AddHandler( + TextDocumentNames.PrepareTypeHierarchy, + _ => new LanguageProtocolDelegatingHandlers.PartialResults< + TypeHierarchyPrepareParams, + Container?, TypeHierarchyItem, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + PartialAdapter.Adapt(handler), + RegistrationAdapter.Adapt(registrationOptionsFactory), + _.GetRequiredService(), + Container.From + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySupertypes, + _ => new LanguageProtocolDelegatingHandlers.PartialResults< + TypeHierarchySupertypesCallsParams, + Container?, TypeHierarchySupertypesCall, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + PartialAdapter.Adapt(supertypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory), + _.GetRequiredService(), + Container.From + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySubtypes, + _ => new LanguageProtocolDelegatingHandlers.PartialResults< + TypeHierarchySubtypesCallsParams, + Container?, TypeHierarchySubtypesCall, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + PartialAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory), + _.GetRequiredService(), + Container.From + ) + ) + ; + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Action>>, TypeHierarchyCapability, CancellationToken> handler, + Action, IObserver>, TypeHierarchyCapability, CancellationToken> + supertypesHandler, + Action, IObserver>, TypeHierarchyCapability, CancellationToken> + subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + _ => + new DelegatingPartialTypeHierarchyHandler( + _.GetRequiredService(), + PartialAdapter.Adapt(handler), + PartialAdapter.Adapt(supertypesHandler), + PartialAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Action>, TypeHierarchyCapability> handler, + Action>, TypeHierarchyCapability> supertypesHandler, + Action>, TypeHierarchyCapability> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) + { + var id = Guid.NewGuid(); + return + registry.AddHandler( + TextDocumentNames.PrepareTypeHierarchy, + _ => new LanguageProtocolDelegatingHandlers.PartialResults< + TypeHierarchyPrepareParams, + Container?, TypeHierarchyItem, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + PartialAdapter.Adapt(handler), + RegistrationAdapter.Adapt(registrationOptionsFactory), + _.GetRequiredService(), + Container.From + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySupertypes, + _ => new LanguageProtocolDelegatingHandlers.PartialResults< + TypeHierarchySupertypesCallsParams, + Container?, TypeHierarchySupertypesCall, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + PartialAdapter.Adapt(supertypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory), + _.GetRequiredService(), + Container.From + ) + ) + .AddHandler( + TextDocumentNames.TypeHierarchySubtypes, + _ => new LanguageProtocolDelegatingHandlers.PartialResults< + TypeHierarchySubtypesCallsParams, + Container?, TypeHierarchySubtypesCall, + TypeHierarchyRegistrationOptions, + TypeHierarchyCapability + >( + id, + PartialAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory), + _.GetRequiredService(), + Container.From + ) + ) + ; + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Action>>, TypeHierarchyCapability> handler, + Action, IObserver>, TypeHierarchyCapability> supertypesHandler, + Action, IObserver>, TypeHierarchyCapability> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + _ => new DelegatingPartialTypeHierarchyHandler( + _.GetRequiredService(), + PartialAdapter.Adapt(handler), + PartialAdapter.Adapt(supertypesHandler), + PartialAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Action>>, CancellationToken> handler, + Action, IObserver>, CancellationToken> supertypesHandler, + Action, IObserver>, CancellationToken> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + _ => new DelegatingPartialTypeHierarchyHandler( + _.GetRequiredService(), + PartialAdapter.Adapt(handler), + PartialAdapter.Adapt(supertypesHandler), + PartialAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + public static ILanguageServerRegistry OnTypeHierarchy( + this ILanguageServerRegistry registry, + Action>>> handler, + Action, IObserver>> supertypesHandler, + Action, IObserver>> subtypesHandler, + RegistrationOptionsDelegate? registrationOptionsFactory + ) where T : class?, IHandlerIdentity? + { + return registry.AddHandler( + _ => new DelegatingPartialTypeHierarchyHandler( + _.GetRequiredService(), + PartialAdapter.Adapt(handler), + PartialAdapter.Adapt(supertypesHandler), + PartialAdapter.Adapt(subtypesHandler), + RegistrationAdapter.Adapt(registrationOptionsFactory) + ) + ); + } + + private class DelegatingTypeHierarchyHandler : TypeHierarchyHandlerBase where T : class?, IHandlerIdentity? + { + private readonly Func>?>> + _handlePrepare; + + private readonly Func, TypeHierarchyCapability, CancellationToken, + Task?>> + _handleSupertypesCalls; + + private readonly Func, TypeHierarchyCapability, CancellationToken, + Task?>> + _handleSubtypesCalls; + + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + + public DelegatingTypeHierarchyHandler( + Func>?>> handlePrepare, + Func, TypeHierarchyCapability, CancellationToken, Task?>> + handleSupertypesCalls, + Func, TypeHierarchyCapability, CancellationToken, Task?>> + handleSubtypesCalls, + RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _handlePrepare = handlePrepare; + _handleSupertypesCalls = handleSupertypesCalls; + _handleSubtypesCalls = handleSubtypesCalls; + _registrationOptionsFactory = registrationOptionsFactory; + } + + protected override Task>?> HandlePrepare(TypeHierarchyPrepareParams request, CancellationToken cancellationToken) + { + return _handlePrepare(request, Capability, cancellationToken); + } + + protected override Task?> HandleSupertypesCalls( + TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken + ) + { + return _handleSupertypesCalls(request, Capability, cancellationToken); + } + + protected override Task?> HandleSubtypesCalls( + TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken + ) + { + return _handleSubtypesCalls(request, Capability, cancellationToken); + } + + protected internal override TypeHierarchyRegistrationOptions CreateRegistrationOptions( + TypeHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } + } + + private class DelegatingPartialTypeHierarchyHandler : PartialTypeHierarchyHandlerBase where T : class?, IHandlerIdentity? + { + private readonly Action>>, TypeHierarchyCapability, CancellationToken> + _handleParams; + + private readonly Action, IObserver>, TypeHierarchyCapability, + CancellationToken> + _handleSupertypes; + + private readonly Action, IObserver>, TypeHierarchyCapability, + CancellationToken> + _handleSubtypes; + + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + + public DelegatingPartialTypeHierarchyHandler( + IProgressManager progressManager, + Action>>, TypeHierarchyCapability, CancellationToken> handleParams, + Action, IObserver>, TypeHierarchyCapability, CancellationToken> + handleSupertypes, + Action, IObserver>, TypeHierarchyCapability, CancellationToken> + handleSubtypes, + RegistrationOptionsDelegate registrationOptionsFactory + ) : base(progressManager) + { + _handleParams = handleParams; + _handleSupertypes = handleSupertypes; + _handleSubtypes = handleSubtypes; + _registrationOptionsFactory = registrationOptionsFactory; + } + + protected override void Handle( + TypeHierarchyPrepareParams request, IObserver>> results, CancellationToken cancellationToken + ) + { + _handleParams(request, results, Capability, cancellationToken); + } + + protected override void Handle( + TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ) + { + _handleSupertypes(request, results, Capability, cancellationToken); + } + + protected override void Handle( + TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + ) + { + _handleSubtypes(request, results, Capability, cancellationToken); + } + + protected internal override TypeHierarchyRegistrationOptions CreateRegistrationOptions( + TypeHierarchyCapability capability, ClientCapabilities clientCapabilities + ) + { + return _registrationOptionsFactory(capability, clientCapabilities); + } + } + } + } +} diff --git a/src/Protocol/Features/FileOperationsFeature.cs b/src/Protocol/Features/FileOperationsFeature.cs index b9d1b6829..158e0a40e 100644 --- a/src/Protocol/Features/FileOperationsFeature.cs +++ b/src/Protocol/Features/FileOperationsFeature.cs @@ -329,7 +329,7 @@ public record FileOperationFilter namespace Server.Capabilities { - public class FileOperationsWorkspaceServerCapabilities : DynamicCapability + public class FileOperationsWorkspaceServerCapabilities { /// /// The client has support for sending didCreateFiles notifications. diff --git a/src/Protocol/Features/ProgressFeature.cs b/src/Protocol/Features/ProgressFeature.cs index 9e971f13a..e6484714c 100644 --- a/src/Protocol/Features/ProgressFeature.cs +++ b/src/Protocol/Features/ProgressFeature.cs @@ -130,12 +130,13 @@ public static IRequestProgressObservable RequestProgress @params, Func factory, + Func reverseFactory, CancellationToken cancellationToken = default ) { @params.SetPartialResultToken(new ProgressToken(Guid.NewGuid().ToString())); - return requestRouter.ProgressManager.MonitorUntil(@params, factory, cancellationToken); + return requestRouter.ProgressManager.MonitorUntil(@params, factory, reverseFactory, cancellationToken); } public static IRequestProgressObservable, TResponse> RequestProgress( diff --git a/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs b/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs index 1c34a435d..7778d79dc 100644 --- a/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs +++ b/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs @@ -1,11 +1,14 @@ using System.Diagnostics; +using MediatR; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Client; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; // ReSharper disable once CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol @@ -17,9 +20,26 @@ namespace Models /// [Parallel] [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams { /// /// A non-empty query string @@ -71,14 +91,95 @@ public partial record SymbolInformation public override string ToString() => DebuggerDisplay; } + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions { } + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } } + namespace Client.Capabilities { [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability// + public partial class WorkspaceSymbolCapability : DynamicCapability // { /// /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. @@ -87,7 +188,7 @@ public partial class WorkspaceSymbolCapability : DynamicCapability// public SymbolKindCapabilityOptions? SymbolKind { get; set; } /// - /// The client supports tags on `SymbolInformation`.Tags are supported on + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. /// Clients supporting tags have to handle unknown tags gracefully. /// @@ -95,6 +196,67 @@ public partial class WorkspaceSymbolCapability : DynamicCapability// /// [Optional] public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); } } } diff --git a/src/Protocol/Generation/GenerateContainerAttribute.cs b/src/Protocol/Generation/GenerateContainerAttribute.cs index 582e7a175..96d9636c4 100644 --- a/src/Protocol/Generation/GenerateContainerAttribute.cs +++ b/src/Protocol/Generation/GenerateContainerAttribute.cs @@ -18,5 +18,7 @@ public GenerateContainerAttribute(string? className = null) { } + + public bool GenerateImplicitConversion { get; set; } } } diff --git a/src/Protocol/Generation/GenerateRegistrationOptionsAttribute.cs b/src/Protocol/Generation/GenerateRegistrationOptionsAttribute.cs index d24f59ae6..4bbced7e0 100644 --- a/src/Protocol/Generation/GenerateRegistrationOptionsAttribute.cs +++ b/src/Protocol/Generation/GenerateRegistrationOptionsAttribute.cs @@ -13,13 +13,20 @@ public class GenerateRegistrationOptionsAttribute : Attribute { public bool SupportsWorkDoneProgress { get; init; } public bool SupportsStaticRegistrationOptions { get; init; } - public bool SupportsDocumentSelector { get; init; } + public bool SupportsTextDocumentSelector { get; init; } + public bool SupportsNotebookDocumentSelector { get; init; } public Type? Converter { get; init; } public bool SupportsTextDocument { - get => SupportsDocumentSelector; - init => SupportsDocumentSelector = value; + get => SupportsTextDocumentSelector; + init => SupportsTextDocumentSelector = value; + } + + public bool SupportsNotebookDocument + { + get => SupportsNotebookDocumentSelector; + init => SupportsNotebookDocumentSelector = value; } public GenerateRegistrationOptionsAttribute(string? key = null, params string?[] keys) diff --git a/src/Protocol/ILanguageProtocolRpcOptions.cs b/src/Protocol/ILanguageProtocolRpcOptions.cs index 209e258c8..c02f21326 100644 --- a/src/Protocol/ILanguageProtocolRpcOptions.cs +++ b/src/Protocol/ILanguageProtocolRpcOptions.cs @@ -8,5 +8,7 @@ public interface ILanguageProtocolRpcOptions : IJsonRpcHandlerRegistry, IJ { T AddTextDocumentIdentifier(params ITextDocumentIdentifier[] handlers); T AddTextDocumentIdentifier() where TTextDocumentIdentifier : ITextDocumentIdentifier; + T AddNotebookDocumentIdentifier(params INotebookDocumentIdentifier[] handlers); + T AddNotebookDocumentIdentifier() where TNotebookDocumentIdentifier : INotebookDocumentIdentifier; } } diff --git a/src/Protocol/IRegistrationManager.cs b/src/Protocol/IRegistrationManager.cs index 000802dfc..2e721b31a 100644 --- a/src/Protocol/IRegistrationManager.cs +++ b/src/Protocol/IRegistrationManager.cs @@ -10,7 +10,7 @@ public interface IRegistrationManager IObservable> Registrations { get; } IEnumerable CurrentRegistrations { get; } IEnumerable GetRegistrationsForMethod(string method); - IEnumerable GetRegistrationsMatchingSelector(DocumentSelector documentSelector); + IEnumerable GetRegistrationsMatchingSelector(TextDocumentSelector textDocumentSelector); void RegisterCapabilities(ServerCapabilities serverCapabilities); } } diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.CanBeResolved.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.CanBeResolved.cs new file mode 100644 index 000000000..c73acd41e --- /dev/null +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.CanBeResolved.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class LanguageProtocolDelegatingHandlers + { + public sealed class CanBeResolved : + AbstractHandlers.Base, + ICanBeResolvedHandler, + ICanBeIdentifiedHandler + where TItem : ICanBeResolved, IRequest + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Func> _resolveHandler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public CanBeResolved( + Guid id, Func> resolveHandler, + RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _resolveHandler = resolveHandler; + _registrationOptionsFactory = registrationOptionsFactory; + _id = id; + } + + Task IRequestHandler.Handle(TItem request, CancellationToken cancellationToken) => _resolveHandler(request, Capability, cancellationToken); + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class CanBeResolved : + AbstractHandlers.Base, + ICanBeResolvedHandler, + ICanBeIdentifiedHandler + where TItem : ICanBeResolved, IRequest + where TRegistrationOptions : class, new() + { + private readonly Func> _resolveHandler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public CanBeResolved(Guid id, Func> resolveHandler, RegistrationOptionsDelegate registrationOptionsFactory) + { + _id = id; + _resolveHandler = resolveHandler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + Task IRequestHandler.Handle(TItem request, CancellationToken cancellationToken) => _resolveHandler(request, cancellationToken); + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); + } + } +} diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs new file mode 100644 index 000000000..ca1b7a124 --- /dev/null +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class LanguageProtocolDelegatingHandlers + { + public sealed class Notification : + AbstractHandlers.Base, + IJsonRpcNotificationHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Func _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public Notification( + Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + public Notification( + Func handler, RegistrationOptionsDelegate registrationOptionsFactory + ) : + this(Guid.Empty, handler, registrationOptionsFactory) + { + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + await _handler(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class Notification : + AbstractHandlers.Base, + IJsonRpcNotificationHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + { + private readonly Func _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public Notification(Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + public Notification(Func handler, RegistrationOptionsDelegate registrationOptionsFactory) : + this(Guid.Empty, handler, registrationOptionsFactory) + { + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + await _handler(request, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); + } + + public sealed class NotificationCapability : + AbstractHandlers.BaseCapability, + IJsonRpcNotificationHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TCapability : ICapability + { + private readonly Func _handler; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public NotificationCapability(Guid id, Func handler) + { + _id = id; + _handler = handler; + } + + public NotificationCapability(Func handler) : + this(Guid.Empty, handler) + { + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + await _handler(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + } + } +} diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs new file mode 100644 index 000000000..4ed018d85 --- /dev/null +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs @@ -0,0 +1,503 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + public static partial class LanguageProtocolDelegatingHandlers + { + public sealed class PartialResult : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemRequest + where TItem : class? + where TResponse : class? + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Func _factory; + private readonly Action, TCapability, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResult( + Guid id, Action, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, + Func factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + } + + public PartialResult( + Action, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, + Func factory + ) : + this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) + { + } + + async Task IRequestHandler.Handle( + TParams request, + CancellationToken cancellationToken + ) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + _handler(request, observer, Capability, cancellationToken); + await observer; + return _factory(default); + } + + var subject = new AsyncSubject(); + var task = subject + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, subject, Capability, cancellationToken); + return await task; + } + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class PartialResult : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemRequest + where TItem : class? + where TResponse : class? + where TRegistrationOptions : class, new() + { + private readonly Action, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Func _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResult( + Action, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func factory + ) : + this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) + { + } + + public PartialResult( + Guid id, Action, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + _handler(request, observer, cancellationToken); + await observer; + return _factory(default); + } + + var subject = new AsyncSubject(); + var task = subject + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, subject, cancellationToken); + return await task; + } + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); + } + + public sealed class PartialResultCapability : + AbstractHandlers.BaseCapability, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemRequest + where TItem : class? + where TResponse : class? + where TCapability : ICapability + { + private readonly Action, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultCapability( + Action, CancellationToken> handler, IProgressManager progressManager, Func factory + ) : + this(Guid.Empty, handler, progressManager, factory) + { + } + + public PartialResultCapability( + Guid id, Action, CancellationToken> handler, IProgressManager progressManager, Func factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + _handler(request, Capability, observer, cancellationToken); + await observer; + return _factory(default); + } + + var subject = new AsyncSubject(); + var task = subject + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, Capability, subject, cancellationToken); + return await task; + } + } + + public sealed class PartialResult : + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemRequest + where TItem : class? + where TResponse : class? + { + private readonly Action, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResult(Action, CancellationToken> handler, IProgressManager progressManager, Func factory) : + this(Guid.Empty, handler, progressManager, factory) + { + } + + public PartialResult(Guid id, Action, CancellationToken> handler, IProgressManager progressManager, Func factory) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + _handler(request, observer, cancellationToken); + await observer; + return _factory(default); + } + + var subject = new AsyncSubject(); + var task = subject + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, subject, cancellationToken); + return await task; + } + } + + public sealed class PartialResults : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsRequest + where TItem : class? + where TResponse : IEnumerable? + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Action>, TCapability, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse?> _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResults( + Action>, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, + Func, TResponse?> factory + ) : + this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) + { + } + + public PartialResults( + Guid id, Action>, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, Func, TResponse?> factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + _handler(request, observer, Capability, cancellationToken); + await observer; + return _factory(Enumerable.Empty()); + } + + var subject = new Subject>(); + var task = subject + .Aggregate( + new List(), (acc, items) => { + acc.AddRange(items); + return acc; + } + ) + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, Capability, cancellationToken); + return await task; + } + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class PartialResults : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsRequest + where TItem : class? + where TResponse : IEnumerable? + where TRegistrationOptions : class, new() + { + private readonly Action>, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse?> _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResults( + Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func, TResponse?> factory + ) : + this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) + { + } + + public PartialResults( + Guid id, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func, TResponse?> factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + _handler(request, observer, cancellationToken); + await observer; + return _factory(Enumerable.Empty()); + } + + var subject = new Subject>(); + var task = subject + .Aggregate( + new List(), (acc, items) => { + acc.AddRange(items); + return acc; + } + ) + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, cancellationToken); + return await task; + } + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); + } + + public sealed class PartialResultsCapability : + AbstractHandlers.BaseCapability, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsRequest + where TItem : class? + where TResponse : IEnumerable? + where TCapability : ICapability + { + private readonly Action>, TCapability, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse?> _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultsCapability( + Action>, TCapability, CancellationToken> handler, IProgressManager progressManager, + Func, TResponse?> factory + ) : + this(Guid.Empty, handler, progressManager, factory) + { + } + + public PartialResultsCapability( + Guid id, Action>, TCapability, CancellationToken> handler, IProgressManager progressManager, + Func, TResponse?> factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + _handler(request, observer, Capability, cancellationToken); + await observer; + return _factory(Enumerable.Empty()); + } + + var subject = new Subject>(); + var task = subject + .Aggregate( + new List(), (acc, items) => { + acc.AddRange(items); + return acc; + } + ) + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, Capability, cancellationToken); + return await task; + } + } + + public sealed class PartialResults : + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsRequest + where TItem : class? + where TResponse : IEnumerable? + { + private readonly Action>, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse?> _factory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResults( + Action>, CancellationToken> handler, IProgressManager progressManager, Func, TResponse?> factory + ) : + this(Guid.Empty, handler, progressManager, factory) + { + _handler = handler; + _progressManager = progressManager; + _factory = factory; + } + + public PartialResults( + Guid id, Action>, CancellationToken> handler, IProgressManager progressManager, Func, TResponse?> factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + _handler(request, observer, cancellationToken); + await observer; + return _factory(Enumerable.Empty()); + } + + var subject = new Subject>(); + var task = subject + .Aggregate( + new List(), (acc, items) => { + acc.AddRange(items); + return acc; + } + ) + .Select(_factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, cancellationToken); + return await task; + } + } + } +} diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs new file mode 100644 index 000000000..67925b9b3 --- /dev/null +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs @@ -0,0 +1,542 @@ +ο»Ώusing System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol; + +public static partial class LanguageProtocolDelegatingHandlers +{ + public sealed class PartialResultWithInitialValue : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemWithInitialValueRequest + where TItem : class? + where TResponse : class? + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Func _factory; + private readonly Func> _initialValue; + private readonly Action, TCapability, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultWithInitialValue( + Guid id, + Func> initialValue, + Action, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, + Func factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + public PartialResultWithInitialValue( + Func> initialValue, + Action, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, + Func factory + ) : + this(Guid.Empty, initialValue, handler, registrationOptionsFactory, progressManager, factory) + { + } + + async Task IRequestHandler.Handle( + TParams request, + CancellationToken cancellationToken + ) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await _initialValue(request, Capability, cancellationToken)); + _handler(request, observer, Capability, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await _initialValue(request, Capability, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, subject, Capability, cancellationToken); + return await task; + } + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class PartialResultWithInitialValue : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemWithInitialValueRequest + where TItem : class? + where TResponse : class? + where TRegistrationOptions : class, new() + { + private readonly Action, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Func _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultWithInitialValue( + Action, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func factory, + Func> initialValue + ) : + this(Guid.Empty, initialValue, handler, registrationOptionsFactory, progressManager, factory) + { + } + + public PartialResultWithInitialValue( + Guid id, + Func> initialValue, + Action, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await _initialValue(request, cancellationToken)); + _handler(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await _initialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, subject, cancellationToken); + return await task; + } + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(clientCapabilities); + } + + public sealed class PartialResultWithInitialValueCapability : + AbstractHandlers.BaseCapability, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemWithInitialValueRequest + where TItem : class? + where TResponse : class? + where TCapability : ICapability + { + private readonly Action, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultWithInitialValueCapability( + Func> initialValue, + Action, CancellationToken> handler, + IProgressManager progressManager, + Func factory + ) : + this(Guid.Empty, initialValue, handler, progressManager, factory) + { + } + + public PartialResultWithInitialValueCapability( + Guid id, + Func> initialValue, + Action, CancellationToken> handler, + IProgressManager progressManager, + Func factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await _initialValue(request, Capability, cancellationToken)); + _handler(request, Capability, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await _initialValue(request, Capability, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, Capability, subject, cancellationToken); + return await task; + } + } + + public sealed class PartialResultWithInitialValue : + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemWithInitialValueRequest + where TItem : class? + where TResponse : class? + { + private readonly Action, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultWithInitialValue( + Func> initialValue, + Action, CancellationToken> handler, + IProgressManager progressManager, + Func factory + ) : + this(Guid.Empty, initialValue, handler, progressManager, factory) + { + } + + public PartialResultWithInitialValue( + Guid id, + Func> initialValue, + Action, CancellationToken> handler, + IProgressManager progressManager, + Func factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver.Noop) + { + observer.OnNext(await _initialValue(request, cancellationToken)); + _handler(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new AsyncSubject(); + var task = subject + .Aggregate(await _initialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + // in the event nothing is emitted... + subject.OnNext(default!); + _handler(request, subject, cancellationToken); + return await task; + } + } + + public sealed class PartialResultsWithInitialValue : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsWithInitialValueRequest + where TItem : class? + where TResponse : IEnumerable? + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Action>, TCapability, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultsWithInitialValue( + Func> initialValue, + Action>, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, + Func, TResponse> factory + ) : + this(Guid.Empty, initialValue, handler, registrationOptionsFactory, progressManager, factory) + { + } + + public PartialResultsWithInitialValue( + Guid id, + Func> initialValue, + Action>, TCapability, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, Func, TResponse> factory + + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + observer.OnNext(await _initialValue(request, Capability, cancellationToken)); + _handler(request, observer, Capability, cancellationToken); + await observer; + return default; + } + + using var subject = new Subject>(); + var task = subject + .Aggregate(await _initialValue(request, Capability, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, Capability, cancellationToken); + return await task; + } + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class PartialResultsWithInitialValue : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsWithInitialValueRequest + where TItem : class? + where TResponse : IEnumerable? + where TRegistrationOptions : class, new() + { + private readonly Action>, CancellationToken> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultsWithInitialValue( + Func> initialValue, + Action>, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func, TResponse> factory + + ) : + this(Guid.Empty, initialValue, handler, registrationOptionsFactory, progressManager, factory) + { + } + + public PartialResultsWithInitialValue( + Guid id, + Func> initialValue, + Action>, CancellationToken> handler, + RegistrationOptionsDelegate registrationOptionsFactory, + IProgressManager progressManager, + Func, TResponse> factory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + observer.OnNext(await _initialValue(request, cancellationToken)); + _handler(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new Subject>(); + var task = subject + .Aggregate(await _initialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, cancellationToken); + return await task; + } + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(clientCapabilities); + } + + public sealed class PartialResultsWithInitialValueCapability : + AbstractHandlers.BaseCapability, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsWithInitialValueRequest + where TItem : class? + where TResponse : IEnumerable? + where TCapability : ICapability + { + private readonly Action>, TCapability, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultsWithInitialValueCapability( + Func> initialValue, + Action>, TCapability, CancellationToken> handler, IProgressManager progressManager, + Func, TResponse> factory + ) : + this(Guid.Empty, initialValue, handler, progressManager, factory) + { + } + + public PartialResultsWithInitialValueCapability( + Guid id, + Func> initialValue, + Action>, TCapability, CancellationToken> handler, IProgressManager progressManager, + Func, TResponse> factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + observer.OnNext(await _initialValue(request, Capability, cancellationToken)); + _handler(request, observer, Capability, cancellationToken); + await observer; + return default; + } + + using var subject = new Subject>(); + var task = subject + .Aggregate(await _initialValue(request, Capability, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, Capability, cancellationToken); + return await task; + } + } + + public sealed class PartialResultsWithInitialValue : + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IPartialItemsWithInitialValueRequest + where TItem : class? + where TResponse : IEnumerable? + { + private readonly Action>, CancellationToken> _handler; + private readonly IProgressManager _progressManager; + private readonly Func, TResponse> _factory; + private readonly Func> _initialValue; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public PartialResultsWithInitialValue( + Func> initialValue, + Action>, CancellationToken> handler, IProgressManager progressManager, + Func, TResponse> factory + + ) : + this(Guid.Empty, initialValue, handler, progressManager, factory) + { + _handler = handler; + _progressManager = progressManager; + _factory = factory; + } + + public PartialResultsWithInitialValue( + Guid id, + Func> initialValue, + Action>, CancellationToken> handler, IProgressManager progressManager, + Func, TResponse> factory + ) + { + _id = id; + _handler = handler; + _progressManager = progressManager; + _factory = factory; + _initialValue = initialValue; + } + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + var observer = _progressManager.For(request, cancellationToken); + if (observer != ProgressObserver>.Noop) + { + observer.OnNext(await _initialValue(request, cancellationToken)); + _handler(request, observer, cancellationToken); + await observer; + return default; + } + + using var subject = new Subject>(); + var task = subject + .Aggregate(await _initialValue(request, cancellationToken), _factory) + .ToTask(cancellationToken, _progressManager.Scheduler) + .ConfigureAwait(false); + _handler(request, subject, cancellationToken); + return await task; + } + } +} diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs new file mode 100644 index 000000000..b269ffe4f --- /dev/null +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol; + +public static partial class LanguageProtocolDelegatingHandlers +{ + public sealed class Request : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Func> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public Request( + Guid id, Func> handler, + RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + public Request( + Func> handler, + RegistrationOptionsDelegate registrationOptionsFactory + ) : + this(Guid.Empty, handler, registrationOptionsFactory) + { + } + + Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) => + _handler(request, Capability, cancellationToken); + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class Request : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + where TCapability : ICapability + { + private readonly Func _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public Request( + Guid id, Func handler, + RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + public Request( + Func handler, + RegistrationOptionsDelegate registrationOptionsFactory + ) : + this(Guid.Empty, handler, registrationOptionsFactory) + { + } + + + async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) + { + await _handler(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(capability, clientCapabilities); + } + + public sealed class RequestRegistration : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + { + private readonly Func> _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public RequestRegistration( + Func> handler, RegistrationOptionsDelegate registrationOptionsFactory + ) : + this(Guid.Empty, handler, registrationOptionsFactory) + { + } + + public RequestRegistration( + Guid id, Func> handler, RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) => + _handler(request, cancellationToken); + + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(clientCapabilities); + } + + public sealed class RequestRegistration : + AbstractHandlers.Base, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TRegistrationOptions : class, new() + { + private readonly Func _handler; + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public RequestRegistration( + Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory + ) + { + _id = id; + _handler = handler; + _registrationOptionsFactory = registrationOptionsFactory; + } + + public RequestRegistration( + Func handler, RegistrationOptionsDelegate registrationOptionsFactory + ) : + this(Guid.Empty, handler, registrationOptionsFactory) + { + } + + async Task IRequestHandler. + Handle(TParams request, CancellationToken cancellationToken) + { + await _handler(request, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + + protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => + _registrationOptionsFactory(clientCapabilities); + } + + public sealed class RequestCapability : + AbstractHandlers.BaseCapability, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TCapability : ICapability + { + private readonly Func> _handler; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public RequestCapability(Func> handler) : + this(Guid.Empty, handler) + { + } + + public RequestCapability(Guid id, Func> handler) + { + _id = id; + _handler = handler; + } + + Task IRequestHandler. + Handle(TParams request, CancellationToken cancellationToken) => + _handler(request, Capability, cancellationToken); + } + + public sealed class RequestCapability : + AbstractHandlers.BaseCapability, + IJsonRpcRequestHandler, + ICanBeIdentifiedHandler + where TParams : IRequest + where TCapability : ICapability + { + private readonly Func _handler; + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + + public RequestCapability(Func handler) : + this(Guid.Empty, handler) + { + } + + public RequestCapability(Guid id, Func handler) + { + _id = id; + _handler = handler; + } + + async Task IRequestHandler. + Handle(TParams request, CancellationToken cancellationToken) + { + await _handler(request, Capability, cancellationToken).ConfigureAwait(false); + return Unit.Value; + } + } +} diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.cs index 1b6386b75..899531ca3 100644 --- a/src/Protocol/LanguageProtocolDelegatingHandlers.cs +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.cs @@ -14,844 +14,8 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol { - public static class LanguageProtocolDelegatingHandlers + public static partial class LanguageProtocolDelegatingHandlers { - public sealed class Request : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - private readonly Func> _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public Request( - Guid id, Func> handler, - RegistrationOptionsDelegate registrationOptionsFactory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - public Request( - Func> handler, RegistrationOptionsDelegate registrationOptionsFactory - ) : - this(Guid.Empty, handler, registrationOptionsFactory) - { - } - - Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) => - _handler(request, Capability, cancellationToken); - - protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); - } - - public sealed class CanBeResolved : - AbstractHandlers.Base, - ICanBeResolvedHandler, - ICanBeIdentifiedHandler - where TItem : ICanBeResolved, IRequest - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - private readonly Func> _resolveHandler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public CanBeResolved( - Guid id, Func> resolveHandler, - RegistrationOptionsDelegate registrationOptionsFactory - ) - { - _resolveHandler = resolveHandler; - _registrationOptionsFactory = registrationOptionsFactory; - _id = id; - } - - Task IRequestHandler.Handle(TItem request, CancellationToken cancellationToken) => _resolveHandler(request, Capability, cancellationToken); - - protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); - } - - public sealed class CanBeResolved : - AbstractHandlers.Base, - ICanBeResolvedHandler, - ICanBeIdentifiedHandler - where TItem : ICanBeResolved, IRequest - where TRegistrationOptions : class, new() - { - private readonly Func> _resolveHandler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public CanBeResolved(Guid id, Func> resolveHandler, RegistrationOptionsDelegate registrationOptionsFactory) - { - _id = id; - _resolveHandler = resolveHandler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - Task IRequestHandler.Handle(TItem request, CancellationToken cancellationToken) => _resolveHandler(request, cancellationToken); - - protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); - } - - public sealed class Request : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - private readonly Func _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public Request( - Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - public Request(Func handler, RegistrationOptionsDelegate registrationOptionsFactory) : - this(Guid.Empty, handler, registrationOptionsFactory) - { - } - - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - await _handler(request, Capability, cancellationToken).ConfigureAwait(false); - return Unit.Value; - } - - protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); - } - - public sealed class RequestRegistration : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - { - private readonly Func> _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public RequestRegistration(Func> handler, RegistrationOptionsDelegate registrationOptionsFactory) : - this(Guid.Empty, handler, registrationOptionsFactory) - { - } - - public RequestRegistration( - Guid id, Func> handler, RegistrationOptionsDelegate registrationOptionsFactory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) => _handler(request, cancellationToken); - - - protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); - } - - public sealed class RequestRegistration : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - { - private readonly Func _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public RequestRegistration(Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - public RequestRegistration(Func handler, RegistrationOptionsDelegate registrationOptionsFactory) : - this(Guid.Empty, handler, registrationOptionsFactory) - { - } - - async Task IRequestHandler. - Handle(TParams request, CancellationToken cancellationToken) - { - await _handler(request, cancellationToken).ConfigureAwait(false); - return Unit.Value; - } - - protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); - } - - public sealed class RequestCapability : - AbstractHandlers.BaseCapability, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TCapability : ICapability - { - private readonly Func> _handler; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public RequestCapability(Func> handler) : - this(Guid.Empty, handler) - { - } - - public RequestCapability(Guid id, Func> handler) - { - _id = id; - _handler = handler; - } - - Task IRequestHandler. - Handle(TParams request, CancellationToken cancellationToken) => - _handler(request, Capability, cancellationToken); - } - - public sealed class RequestCapability : - AbstractHandlers.BaseCapability, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TCapability : ICapability - { - private readonly Func _handler; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public RequestCapability(Func handler) : - this(Guid.Empty, handler) - { - } - - public RequestCapability(Guid id, Func handler) - { - _id = id; - _handler = handler; - } - - async Task IRequestHandler. - Handle(TParams request, CancellationToken cancellationToken) - { - await _handler(request, Capability, cancellationToken).ConfigureAwait(false); - return Unit.Value; - } - } - - public sealed class PartialResult : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemRequest - where TItem : class? - where TResponse : class? - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - private readonly Func _factory; - private readonly Action, TCapability, CancellationToken> _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly IProgressManager _progressManager; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResult( - Guid id, Action, TCapability, CancellationToken> handler, - RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, - Func factory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - _progressManager = progressManager; - _factory = factory; - } - - public PartialResult( - Action, TCapability, CancellationToken> handler, - RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, - Func factory - ) : - this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) - { - } - - async Task IRequestHandler.Handle( - TParams request, - CancellationToken cancellationToken - ) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver.Noop) - { - _handler(request, observer, Capability, cancellationToken); - await observer; - return _factory(default); - } - - var subject = new AsyncSubject(); - var task = subject - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - // in the event nothing is emitted... - subject.OnNext(default!); - _handler(request, subject, Capability, cancellationToken); - return await task; - } - - protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); - } - - public sealed class PartialResult : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemRequest - where TItem : class? - where TResponse : class? - where TRegistrationOptions : class, new() - { - private readonly Action, CancellationToken> _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly IProgressManager _progressManager; - private readonly Func _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResult( - Action, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, - IProgressManager progressManager, - Func factory - ) : - this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) - { - } - - public PartialResult( - Guid id, Action, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, - IProgressManager progressManager, - Func factory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver.Noop) - { - _handler(request, observer, cancellationToken); - await observer; - return _factory(default); - } - - var subject = new AsyncSubject(); - var task = subject - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - // in the event nothing is emitted... - subject.OnNext(default!); - _handler(request, subject, cancellationToken); - return await task; - } - - protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); - } - - public sealed class PartialResultCapability : - AbstractHandlers.BaseCapability, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemRequest - where TItem : class? - where TResponse : class? - where TCapability : ICapability - { - private readonly Action, CancellationToken> _handler; - private readonly IProgressManager _progressManager; - private readonly Func _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResultCapability( - Action, CancellationToken> handler, IProgressManager progressManager, Func factory - ) : - this(Guid.Empty, handler, progressManager, factory) - { - } - - public PartialResultCapability( - Guid id, Action, CancellationToken> handler, IProgressManager progressManager, Func factory - ) - { - _id = id; - _handler = handler; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver.Noop) - { - _handler(request, Capability, observer, cancellationToken); - await observer; - return _factory(default); - } - - var subject = new AsyncSubject(); - var task = subject - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - // in the event nothing is emitted... - subject.OnNext(default!); - _handler(request, Capability, subject, cancellationToken); - return await task; - } - } - - public sealed class PartialResult : - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemRequest - where TItem : class? - where TResponse : class? - { - private readonly Action, CancellationToken> _handler; - private readonly IProgressManager _progressManager; - private readonly Func _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResult(Action, CancellationToken> handler, IProgressManager progressManager, Func factory) : - this(Guid.Empty, handler, progressManager, factory) - { - } - - public PartialResult(Guid id, Action, CancellationToken> handler, IProgressManager progressManager, Func factory) - { - _id = id; - _handler = handler; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver.Noop) - { - _handler(request, observer, cancellationToken); - await observer; - return _factory(default); - } - - var subject = new AsyncSubject(); - var task = subject - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - // in the event nothing is emitted... - subject.OnNext(default!); - _handler(request, subject, cancellationToken); - return await task; - } - } - - public sealed class PartialResults : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemsRequest - where TItem : class? - where TResponse : IEnumerable? - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - private readonly Action>, TCapability, CancellationToken> _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly IProgressManager _progressManager; - private readonly Func, TResponse?> _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResults( - Action>, TCapability, CancellationToken> handler, - RegistrationOptionsDelegate registrationOptionsFactory, IProgressManager progressManager, - Func, TResponse?> factory - ) : - this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) - { - } - - public PartialResults( - Guid id, Action>, TCapability, CancellationToken> handler, - RegistrationOptionsDelegate registrationOptionsFactory, - IProgressManager progressManager, Func, TResponse?> factory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver>.Noop) - { - _handler(request, observer, Capability, cancellationToken); - await observer; - return _factory(Enumerable.Empty()); - } - - var subject = new Subject>(); - var task = subject - .Aggregate( - new List(), (acc, items) => { - acc.AddRange(items); - return acc; - } - ) - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - _handler(request, subject, Capability, cancellationToken); - return await task; - } - - protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); - } - - public sealed class PartialResults : - AbstractHandlers.Base, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemsRequest - where TItem : class? - where TResponse : IEnumerable? - where TRegistrationOptions : class, new() - { - private readonly Action>, CancellationToken> _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly IProgressManager _progressManager; - private readonly Func, TResponse?> _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResults( - Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, - IProgressManager progressManager, - Func, TResponse?> factory - ) : - this(Guid.Empty, handler, registrationOptionsFactory, progressManager, factory) - { - } - - public PartialResults( - Guid id, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptionsFactory, - IProgressManager progressManager, - Func, TResponse?> factory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver>.Noop) - { - _handler(request, observer, cancellationToken); - await observer; - return _factory(Enumerable.Empty()); - } - - var subject = new Subject>(); - var task = subject - .Aggregate( - new List(), (acc, items) => { - acc.AddRange(items); - return acc; - } - ) - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - _handler(request, subject, cancellationToken); - return await task; - } - - protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); - } - - public sealed class PartialResultsCapability : - AbstractHandlers.BaseCapability, - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemsRequest - where TItem : class? - where TResponse : IEnumerable? - where TCapability : ICapability - { - private readonly Action>, TCapability, CancellationToken> _handler; - private readonly IProgressManager _progressManager; - private readonly Func, TResponse?> _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResultsCapability( - Action>, TCapability, CancellationToken> handler, IProgressManager progressManager, - Func, TResponse?> factory - ) : - this(Guid.Empty, handler, progressManager, factory) - { - } - - public PartialResultsCapability( - Guid id, Action>, TCapability, CancellationToken> handler, IProgressManager progressManager, - Func, TResponse?> factory - ) - { - _id = id; - _handler = handler; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver>.Noop) - { - _handler(request, observer, Capability, cancellationToken); - await observer; - return _factory(Enumerable.Empty()); - } - - var subject = new Subject>(); - var task = subject - .Aggregate( - new List(), (acc, items) => { - acc.AddRange(items); - return acc; - } - ) - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - _handler(request, subject, Capability, cancellationToken); - return await task; - } - } - - public sealed class PartialResults : - IJsonRpcRequestHandler, - ICanBeIdentifiedHandler - where TParams : IPartialItemsRequest - where TItem : class? - where TResponse : IEnumerable? - { - private readonly Action>, CancellationToken> _handler; - private readonly IProgressManager _progressManager; - private readonly Func, TResponse?> _factory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public PartialResults( - Action>, CancellationToken> handler, IProgressManager progressManager, Func, TResponse?> factory - ) : - this(Guid.Empty, handler, progressManager, factory) - { - _handler = handler; - _progressManager = progressManager; - _factory = factory; - } - - public PartialResults( - Guid id, Action>, CancellationToken> handler, IProgressManager progressManager, Func, TResponse?> factory - ) - { - _id = id; - _handler = handler; - _progressManager = progressManager; - _factory = factory; - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - var observer = _progressManager.For(request, cancellationToken); - if (observer != ProgressObserver>.Noop) - { - _handler(request, observer, cancellationToken); - await observer; - return _factory(Enumerable.Empty()); - } - - var subject = new Subject>(); - var task = subject - .Aggregate( - new List(), (acc, items) => { - acc.AddRange(items); - return acc; - } - ) - .Select(_factory) - .ToTask(cancellationToken, _progressManager.Scheduler) - .ConfigureAwait(false); - _handler(request, subject, cancellationToken); - return await task; - } - } - - public sealed class Notification : - AbstractHandlers.Base, - IJsonRpcNotificationHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - where TCapability : ICapability - { - private readonly Func _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public Notification( - Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory - ) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - public Notification( - Func handler, RegistrationOptionsDelegate registrationOptionsFactory - ) : - this(Guid.Empty, handler, registrationOptionsFactory) - { - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - await _handler(request, Capability, cancellationToken).ConfigureAwait(false); - return Unit.Value; - } - - protected internal override TRegistrationOptions CreateRegistrationOptions(TCapability capability, ClientCapabilities clientCapabilities) => - _registrationOptionsFactory(capability, clientCapabilities); - } - - public sealed class Notification : - AbstractHandlers.Base, - IJsonRpcNotificationHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TRegistrationOptions : class, new() - { - private readonly Func _handler; - private readonly RegistrationOptionsDelegate _registrationOptionsFactory; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public Notification(Guid id, Func handler, RegistrationOptionsDelegate registrationOptionsFactory) - { - _id = id; - _handler = handler; - _registrationOptionsFactory = registrationOptionsFactory; - } - - public Notification(Func handler, RegistrationOptionsDelegate registrationOptionsFactory) : - this(Guid.Empty, handler, registrationOptionsFactory) - { - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - await _handler(request, cancellationToken).ConfigureAwait(false); - return Unit.Value; - } - - protected override TRegistrationOptions CreateRegistrationOptions(ClientCapabilities clientCapabilities) => _registrationOptionsFactory(clientCapabilities); - } - - public sealed class NotificationCapability : - AbstractHandlers.BaseCapability, - IJsonRpcNotificationHandler, - ICanBeIdentifiedHandler - where TParams : IRequest - where TCapability : ICapability - { - private readonly Func _handler; - private readonly Guid _id; - Guid ICanBeIdentifiedHandler.Id => _id; - - public NotificationCapability(Guid id, Func handler) - { - _id = id; - _handler = handler; - } - - public NotificationCapability(Func handler) : - this(Guid.Empty, handler) - { - } - - async Task IRequestHandler.Handle(TParams request, CancellationToken cancellationToken) - { - await _handler(request, Capability, cancellationToken).ConfigureAwait(false); - return Unit.Value; - } - } - public sealed class TypedPartialObserver : IObserver> { private readonly IObserver> _results; diff --git a/src/Protocol/LanguageProtocolRpcOptionsBase.cs b/src/Protocol/LanguageProtocolRpcOptionsBase.cs index 6f5339b15..8fbd76e04 100644 --- a/src/Protocol/LanguageProtocolRpcOptionsBase.cs +++ b/src/Protocol/LanguageProtocolRpcOptionsBase.cs @@ -32,6 +32,22 @@ public T AddTextDocumentIdentifier() where TI : ITextDocumentIdentifier return (T)(object)this; } + public T AddNotebookDocumentIdentifier(params INotebookDocumentIdentifier[] handlers) + { + foreach (var item in handlers) + { + Services.AddSingleton(typeof(INotebookDocumentIdentifier), item); + } + + return (T)(object)this; + } + + public T AddNotebookDocumentIdentifier() where TI : INotebookDocumentIdentifier + { + Services.AddSingleton(typeof(INotebookDocumentIdentifier), typeof(TI)); + return (T)(object)this; + } + public LspSerializer Serializer { get; set; } = new LspSerializer(ClientVersion.Lsp3); public ConfigurationBuilder ConfigurationBuilder { get; set; } = new ConfigurationBuilder(); internal bool AddDefaultLoggingProvider { get; set; } diff --git a/src/Protocol/Models/DocumentFilter.cs b/src/Protocol/Models/DocumentFilter.cs deleted file mode 100644 index e9f6628d4..000000000 --- a/src/Protocol/Models/DocumentFilter.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using Minimatch; -using Newtonsoft.Json; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -// ReSharper disable NonReadonlyMemberInGetHashCode - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public class DocumentFilter : IEquatable - { - public static DocumentFilter ForPattern(string wildcard) => new DocumentFilter { Pattern = wildcard }; - - public static DocumentFilter ForLanguage(string language) => new DocumentFilter { Language = language }; - - public static DocumentFilter ForScheme(string scheme) => new DocumentFilter { Scheme = scheme }; - - /// - /// A language id, like `typescript`. - /// - [Optional] - public string? Language { get; set; } - - /// - /// does the document filter contains a language - /// - [JsonIgnore] - public bool HasLanguage => Language != null; - - /// - /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. - /// - [Optional] - public string? Scheme { get; set; } - - /// - /// does the document filter contains a scheme - /// - [JsonIgnore] - public bool HasScheme => Scheme != null; - - /// - /// A glob pattern, like `*.{ts,js}`. - /// - [Optional] - public string? Pattern - { - get => _pattern; - set { - _pattern = value; - _minimatcher = new Minimatcher(value!, new Options { MatchBase = true }); - } - } - - /// - /// does the document filter contains a paattern - /// - [JsonIgnore] - public bool HasPattern => Pattern != null; - - private string? _pattern; - private Minimatcher? _minimatcher; - - public static explicit operator string(DocumentFilter documentFilter) - { - var items = new List(); - if (documentFilter.HasLanguage) - { - items.Add(documentFilter.Language!); - } - - if (documentFilter.HasScheme) - { - items.Add(documentFilter.Scheme!); - } - - if (documentFilter.HasPattern) - { - items.Add(documentFilter.Pattern!); - } - - return $"[{string.Join(", ", items)}]"; - } - - public bool IsMatch(TextDocumentAttributes attributes) - { - if (HasLanguage && HasPattern && HasScheme) - { - return Language == attributes.LanguageId && Scheme == attributes.Scheme && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; - } - - if (HasLanguage && HasPattern) - { - return Language == attributes.LanguageId && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; - } - - if (HasLanguage && HasScheme) - { - return Language == attributes.LanguageId && Scheme == attributes.Scheme; - } - - if (HasPattern && HasScheme) - { - return Scheme == attributes.Scheme && _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; - } - - if (HasLanguage) - { - return Language == attributes.LanguageId; - } - - if (HasScheme) - { - return Scheme == attributes.Scheme; - } - - if (HasPattern) - { - return _minimatcher?.IsMatch(attributes.Uri.ToString()) == true; - } - - return false; - } - - public bool Equals(DocumentFilter? other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return _pattern == other._pattern && Language == other.Language && Scheme == other.Scheme; - } - - public override bool Equals(object? obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; - return Equals((DocumentFilter) obj); - } - - public override int GetHashCode() - { - unchecked - { - var hashCode = _pattern != null ? _pattern.GetHashCode() : 0; - hashCode = ( hashCode * 397 ) ^ ( Language != null ? Language.GetHashCode() : 0 ); - hashCode = ( hashCode * 397 ) ^ ( Scheme != null ? Scheme.GetHashCode() : 0 ); - return hashCode; - } - } - - public static bool operator ==(DocumentFilter left, DocumentFilter right) => Equals(left, right); - - public static bool operator !=(DocumentFilter left, DocumentFilter right) => !Equals(left, right); - - private string DebuggerDisplay => (string) this; - - /// - public override string ToString() => DebuggerDisplay; - } -} diff --git a/src/Protocol/Models/DocumentSelector.cs b/src/Protocol/Models/DocumentSelector.cs deleted file mode 100644 index 761c54739..000000000 --- a/src/Protocol/Models/DocumentSelector.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Diagnostics; -using System.Linq; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - /// - /// A collection of document filters used to identify valid documents - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public class DocumentSelector : ContainerBase - { - public DocumentSelector() : this(Enumerable.Empty()) - { - } - - public DocumentSelector(IEnumerable items) : base(items) - { - } - - public DocumentSelector(params DocumentFilter[] items) : base(items) - { - } - - public static implicit operator DocumentSelector(DocumentFilter[] items) => new DocumentSelector(items); - - public static implicit operator DocumentSelector(Collection items) => new DocumentSelector(items); - - public static implicit operator DocumentSelector(List items) => new DocumentSelector(items); - - public static implicit operator string(DocumentSelector? documentSelector) => - documentSelector is not null ? string.Join(", ", documentSelector.Select(x => (string) x)) : string.Empty; - - public bool IsMatch(TextDocumentAttributes attributes) => this.Any(z => z.IsMatch(attributes)); - - public override string ToString() => this; - - public static DocumentSelector ForPattern(params string[] wildcards) => new DocumentSelector(wildcards.Select(DocumentFilter.ForPattern)); - - public static DocumentSelector ForLanguage(params string[] languages) => new DocumentSelector(languages.Select(DocumentFilter.ForLanguage)); - - public static DocumentSelector ForScheme(params string[] schemes) => new DocumentSelector(schemes.Select(DocumentFilter.ForScheme)); - - private string DebuggerDisplay => this; - } -} diff --git a/src/Protocol/Models/EditRange.cs b/src/Protocol/Models/EditRange.cs new file mode 100644 index 000000000..bff1dbc99 --- /dev/null +++ b/src/Protocol/Models/EditRange.cs @@ -0,0 +1,7 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +public partial record EditRange +{ + public Range Insert { get; init; } + public Range Replace { get; init; } +} \ No newline at end of file diff --git a/src/Protocol/Models/FileLocation.cs b/src/Protocol/Models/FileLocation.cs new file mode 100644 index 000000000..e62aa39b5 --- /dev/null +++ b/src/Protocol/Models/FileLocation.cs @@ -0,0 +1,22 @@ +ο»Ώusing System.Diagnostics; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] +[GenerateContainer] +public record FileLocation +{ + /// + /// The uri of the document + /// + public DocumentUri Uri { get; init; } = null!; + + private string DebuggerDisplay => $"{{{Uri}}}"; + + /// + public override string ToString() + { + return DebuggerDisplay; + } +} \ No newline at end of file diff --git a/src/Protocol/Models/INotebookDocumentIdentifierParams.cs b/src/Protocol/Models/INotebookDocumentIdentifierParams.cs new file mode 100644 index 000000000..3d54eb520 --- /dev/null +++ b/src/Protocol/Models/INotebookDocumentIdentifierParams.cs @@ -0,0 +1,9 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +public interface INotebookDocumentIdentifierParams +{ + /// + /// The notebook document that got closed. + /// + public NotebookDocumentIdentifier NotebookDocument {get; set;} +} diff --git a/src/Protocol/Models/IPartialItem.cs b/src/Protocol/Models/IPartialItem.cs index ff494139f..3ddfddae5 100644 --- a/src/Protocol/Models/IPartialItem.cs +++ b/src/Protocol/Models/IPartialItem.cs @@ -3,8 +3,13 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models { public interface IPartialItem : IPartialResultParams { } + public interface IPartialItemWithInitialValue : IPartialResultParams { } public interface IPartialItemRequest : IRequest, IPartialItem { } + + public interface IPartialItemWithInitialValueRequest : IRequest, IPartialItemWithInitialValue + { + } } diff --git a/src/Protocol/Models/IPartialItems.cs b/src/Protocol/Models/IPartialItems.cs index 2a1f036f0..cf1ff18d9 100644 --- a/src/Protocol/Models/IPartialItems.cs +++ b/src/Protocol/Models/IPartialItems.cs @@ -4,9 +4,15 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models { public interface IPartialItems : IPartialResultParams { } + public interface IPartialItemsWithInitialValue : IPartialResultParams { } public interface IPartialItemsRequest : IRequest, IPartialItems where TResponse : IEnumerable? { } + + public interface IPartialItemsWithInitialValueRequest : IRequest, IPartialItemsWithInitialValue + where TResponse : IEnumerable? + { + } } diff --git a/src/Protocol/Models/ITextDocumentRegistrationOptions.cs b/src/Protocol/Models/ITextDocumentRegistrationOptions.cs deleted file mode 100644 index 574fe8c34..000000000 --- a/src/Protocol/Models/ITextDocumentRegistrationOptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - public interface ITextDocumentRegistrationOptions : IRegistrationOptions - { - DocumentSelector? DocumentSelector { get; set; } - } -} diff --git a/src/Protocol/Models/ITextDocumentSyncOptions.cs b/src/Protocol/Models/ITextDocumentSyncOptions.cs deleted file mode 100644 index 66e8cbfbe..000000000 --- a/src/Protocol/Models/ITextDocumentSyncOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - public interface ITextDocumentSyncOptions - { - [Optional] bool OpenClose { get; set; } - [Optional] TextDocumentSyncKind Change { get; set; } - [Optional] bool WillSave { get; set; } - [Optional] bool WillSaveWaitUntil { get; set; } - [Optional] BooleanOr Save { get; set; } - } -} diff --git a/src/Protocol/Models/LocationOrFileLocation.cs b/src/Protocol/Models/LocationOrFileLocation.cs new file mode 100644 index 000000000..790bd7787 --- /dev/null +++ b/src/Protocol/Models/LocationOrFileLocation.cs @@ -0,0 +1,30 @@ +ο»Ώusing Newtonsoft.Json; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +[JsonConverter(typeof(LocationOrFileLocationConverter))] +public record LocationOrFileLocation +{ + public LocationOrFileLocation(Location location) + { + Location = location; + FileLocation = null; + } + + public LocationOrFileLocation(FileLocation locationLink) + { + Location = null; + FileLocation = locationLink; + } + + public bool IsLocation => Location is not null; + public Location? Location { get; } + + public bool IsFileLocation => FileLocation != null; + public FileLocation? FileLocation { get; } + + public static implicit operator LocationOrFileLocation(Location location) => new LocationOrFileLocation(location); + + public static implicit operator LocationOrFileLocation(FileLocation locationLink) => new LocationOrFileLocation(locationLink); +} \ No newline at end of file diff --git a/src/Protocol/Models/NotebookDocumentIdentifier.cs b/src/Protocol/Models/NotebookDocumentIdentifier.cs new file mode 100644 index 000000000..045455abb --- /dev/null +++ b/src/Protocol/Models/NotebookDocumentIdentifier.cs @@ -0,0 +1,40 @@ +ο»Ώusing System.Diagnostics; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] +public record NotebookDocumentIdentifier +{ + public NotebookDocumentIdentifier() + { + } + + public NotebookDocumentIdentifier(DocumentUri uri) + { + Uri = uri; + } + + /// + /// The text document's URI. + /// + public DocumentUri Uri { get; init; } = null!; + + public static implicit operator NotebookDocumentIdentifier(DocumentUri uri) + { + return new NotebookDocumentIdentifier { Uri = uri }; + } + + public static implicit operator NotebookDocumentIdentifier(string uri) + { + return new NotebookDocumentIdentifier { Uri = uri }; + } + + // ReSharper disable once ConstantConditionalAccessQualifier + private string DebuggerDisplay => Uri?.ToString() ?? string.Empty; + + /// + public override string ToString() + { + return DebuggerDisplay; + } +} diff --git a/src/Protocol/Models/OptionalVersionedNotebookDocumentIdentifier.cs b/src/Protocol/Models/OptionalVersionedNotebookDocumentIdentifier.cs new file mode 100644 index 000000000..116ca48f0 --- /dev/null +++ b/src/Protocol/Models/OptionalVersionedNotebookDocumentIdentifier.cs @@ -0,0 +1,17 @@ +ο»Ώusing System.Diagnostics; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] +public record OptionalVersionedNotebookDocumentIdentifier : NotebookDocumentIdentifier +{ + /// + /// The version number of this document. + /// + public int? Version { get; init; } + + private string DebuggerDisplay => $"{Uri}@({Version})"; + + /// + public override string ToString() => DebuggerDisplay; +} diff --git a/src/Protocol/Models/PositionEncodingKind.cs b/src/Protocol/Models/PositionEncodingKind.cs new file mode 100644 index 000000000..8e2495a02 --- /dev/null +++ b/src/Protocol/Models/PositionEncodingKind.cs @@ -0,0 +1,34 @@ +ο»Ώusing OmniSharp.Extensions.JsonRpc.Generation; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +/// +/// A set of predefined position encoding kinds. +/// +/// @since 3.17.0 +/// +[StringEnum] +public readonly partial struct PositionEncodingKind +{ + /// + /// Character offsets count UTF-8 code units. + /// + public static PositionEncodingKind UTF8 = new("utf-8"); + + /// + /// Character offsets count UTF-16 code units. + /// + /// This is the default and must always be supported + /// by servers + /// + public static PositionEncodingKind UTF16 = new("utf-16"); + + /// + /// Character offsets count UTF-32 code units. + /// + /// Implementation note: these are the same as Unicode code points, + /// so this `PositionEncodingKind` may also be used for an + /// encoding-agnostic representation of character offsets. + /// + public static PositionEncodingKind UTF32 = new("utf-32"); +} diff --git a/src/Protocol/Models/RangeOrEditRange.cs b/src/Protocol/Models/RangeOrEditRange.cs new file mode 100644 index 000000000..3f8dbcb5c --- /dev/null +++ b/src/Protocol/Models/RangeOrEditRange.cs @@ -0,0 +1,57 @@ +ο»Ώusing Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +[JsonConverter(typeof(Converter))] +public partial record RangeOrEditRange +{ + public RangeOrEditRange(Range range) + { + Range = range; + EditRange = null; + } + + public RangeOrEditRange(EditRange editRange) + { + Range = null; + EditRange = editRange; + } + + public bool IsRange => Range is not null; + public Range? Range { get; set; } + + public bool IsEditRange => EditRange != null; + public EditRange? EditRange { get; } + + public static implicit operator RangeOrEditRange(Range range) => new RangeOrEditRange(range); + + public static implicit operator RangeOrEditRange(EditRange editRange) => new RangeOrEditRange(editRange); + + + public class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, RangeOrEditRange value, JsonSerializer serializer) + { + if (value.IsRange) + serializer.Serialize(writer, value.Range); + if (value.IsEditRange) + serializer.Serialize(writer, value.EditRange); + } + + public override RangeOrEditRange ReadJson( + JsonReader reader, Type objectType, RangeOrEditRange existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + var obj = JObject.Load(reader); + if (obj.ContainsKey("insert")) + { + return new RangeOrEditRange(obj.ToObject()); + } + + return new RangeOrEditRange(obj.ToObject()); + } + + public override bool CanRead => true; + } +} diff --git a/src/Protocol/Models/VersionedNotebookDocumentIdentifier.cs b/src/Protocol/Models/VersionedNotebookDocumentIdentifier.cs new file mode 100644 index 000000000..b5fa46ffc --- /dev/null +++ b/src/Protocol/Models/VersionedNotebookDocumentIdentifier.cs @@ -0,0 +1,25 @@ +ο»Ώusing System.Diagnostics; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; + +/// +/// A versioned notebook document identifier. +/// +/// @since 3.17.0 +/// +[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] +public partial record VersionedNotebookDocumentIdentifier { + /// + /// The version number of this notebook document. + /// + public int Version {get; set;} + /// + /// The notebook document's uri. + /// + public DocumentUri Uri {get; set;} + + private string DebuggerDisplay => $"{Uri}@({Version})"; + + /// + public override string ToString() => DebuggerDisplay; +} diff --git a/src/Protocol/Models/VersionedTextDocumentIdentifier.cs b/src/Protocol/Models/VersionedTextDocumentIdentifier.cs index c3d0ef719..3e31e07c0 100644 --- a/src/Protocol/Models/VersionedTextDocumentIdentifier.cs +++ b/src/Protocol/Models/VersionedTextDocumentIdentifier.cs @@ -3,7 +3,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models { [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public record VersionedTextDocumentIdentifier : TextDocumentIdentifier + public partial record VersionedTextDocumentIdentifier : TextDocumentIdentifier { /// /// The version number of this document. diff --git a/src/Protocol/NotebookDocumentNames.cs b/src/Protocol/NotebookDocumentNames.cs new file mode 100644 index 000000000..e90844615 --- /dev/null +++ b/src/Protocol/NotebookDocumentNames.cs @@ -0,0 +1,9 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol; + +public static class NotebookDocumentNames +{ + public const string DidChange = "notebookDocument/didChange"; + public const string DidClose = "notebookDocument/didClose"; + public const string DidOpen = "notebookDocument/didOpen"; + public const string DidSave = "notebookDocument/didSave"; +} diff --git a/src/Protocol/Progress/IProgressManager.cs b/src/Protocol/Progress/IProgressManager.cs index f46219cc3..1981927b6 100644 --- a/src/Protocol/Progress/IProgressManager.cs +++ b/src/Protocol/Progress/IProgressManager.cs @@ -21,24 +21,16 @@ CancellationToken cancellationToken IRequestProgressObservable MonitorUntil( IPartialItemRequest request, - Func factory, + Func factory, Func reverseFactory, CancellationToken cancellationToken ); - [Obsolete("Method may not work correctly when subscribing to the result, use overload with the reverse factory parameter")] IRequestProgressObservable MonitorUntil( - IPartialItemRequest request, - Func factory, + IPartialItemWithInitialValueRequest request, + Func factory, CancellationToken cancellationToken - ); - - [Obsolete("Method may not work correctly when subscribing to the result, use overload with the reverse factory parameter")] - IRequestProgressObservable MonitorUntil( - IPartialItemRequest request, - Func factory, - CancellationToken cancellationToken - ); + ) where TResult : TItem; IRequestProgressObservable, TResponse> MonitorUntil( IPartialItemsRequest request, @@ -50,12 +42,21 @@ IRequestProgressObservable MonitorUntil( IPartialItemsRequest, TItem> request, CancellationToken cancellationToken ); + + IRequestProgressObservable, TResponse> MonitorUntil( + IPartialItemsWithInitialValueRequest request, + Func, TResponse> factory, + CancellationToken cancellationToken + ) where TResponse : IEnumerable?; IProgressObserver For(ProgressToken token, CancellationToken cancellationToken); IProgressObserver For(IPartialItemRequest request, CancellationToken cancellationToken); + IProgressObserverWithInitialValue For(IPartialItemWithInitialValueRequest request, CancellationToken cancellationToken); IProgressObserver> For(IPartialItemsRequest request, CancellationToken cancellationToken) where TResponse : IEnumerable?; + IProgressObserverWithInitialValue> For(IPartialItemsWithInitialValueRequest request, CancellationToken cancellationToken) + where TInitial : IEnumerable?; IScheduler Scheduler { get; } } } diff --git a/src/Protocol/Progress/IProgressObserver.cs b/src/Protocol/Progress/IProgressObserver.cs index 24616e9d4..cc492961b 100644 --- a/src/Protocol/Progress/IProgressObserver.cs +++ b/src/Protocol/Progress/IProgressObserver.cs @@ -5,6 +5,11 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress { + public interface IProgressObserverWithInitialValue : IProgressObserver, IObserver + { + void OnNext(TInitial initial); + TaskAwaiter GetAwaiter(); + } public interface IProgressObserver : IProgressObserver, IObserver { TaskAwaiter GetAwaiter(); diff --git a/src/Protocol/Progress/PartialItemRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemRequestProgressObservable.cs index 5e921134d..2be977be1 100644 --- a/src/Protocol/Progress/PartialItemRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemRequestProgressObservable.cs @@ -25,7 +25,7 @@ public PartialItemRequestProgressObservable( ISerializer serializer, ProgressToken token, IObservable requestResult, - Func factory, + Func factory, Func reverseFactory, CancellationToken cancellationToken, Action onCompleteAction @@ -37,20 +37,17 @@ Action onCompleteAction _task = Observable.Create( observer => new CompositeDisposable { - _dataSubject - .ForkJoin( - requestResult - .Do( - _ => - { - if (_receivedPartialData) return; - _dataSubject.OnNext(reverseFactory(_)); - }, - _dataSubject.OnError, - _dataSubject.OnCompleted - ), - factory + requestResult + .Do( + _ => + { + if (_receivedPartialData) return; + _dataSubject.OnNext(reverseFactory(_)); + }, + _dataSubject.OnError, + _dataSubject.OnCompleted ) + .ForkJoin(_dataSubject, factory) .Subscribe(observer), Disposable.Create(onCompleteAction) } diff --git a/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs new file mode 100644 index 000000000..55b1e99a3 --- /dev/null +++ b/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs @@ -0,0 +1,117 @@ +ο»Ώusing System.Reactive.Concurrency; +using System.Reactive.Disposables; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Runtime.CompilerServices; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +internal class PartialItemWithInitialValueRequestProgressObservable : IRequestProgressObservable, IObserver + where TResult : TItem +{ + private readonly ISerializer _serializer; + private readonly ReplaySubject _dataSubject; + private readonly CompositeDisposable _disposable; + private readonly Task _task; + private bool _receivedInitialValue; + + public PartialItemWithInitialValueRequestProgressObservable( + ISerializer serializer, + ProgressToken token, + IObservable requestResult, + Func factory, + CancellationToken cancellationToken, + Action onCompleteAction + ) + { + _serializer = serializer; + _dataSubject = new ReplaySubject(1, Scheduler.Immediate); + _disposable = new CompositeDisposable { _dataSubject }; + _task = Observable.Create( + observer => new CompositeDisposable + { + requestResult + .Do( + _ => + { + if (_receivedInitialValue) return; + _dataSubject.OnNext(_); + }, + _dataSubject.OnError, + _dataSubject.OnCompleted + ) + .ForkJoin(_dataSubject, factory) + .Subscribe(observer), + Disposable.Create(onCompleteAction) + } + ) + .ToTask(cancellationToken); + + ProgressToken = token; + } + + public ProgressToken ProgressToken { get; } + public Type ParamsType { get; } = typeof(TItem); + + void IObserver.OnCompleted() + { + OnCompleted(); + } + + void IObserver.OnError(Exception error) + { + OnError(error); + } + + private void OnCompleted() + { + if (_dataSubject.IsDisposed) return; + _dataSubject.OnCompleted(); + } + + private void OnError(Exception error) + { + if (_dataSubject.IsDisposed) return; + _dataSubject.OnError(error); + } + + public void OnNext(JToken value) + { + if (_dataSubject.IsDisposed) return; + if (!_receivedInitialValue) + { + _receivedInitialValue = true; + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)!); + } + else + { + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)); + } + } + + public void Dispose() + { + if (_disposable.IsDisposed) return; + _disposable.Dispose(); + } + + public IDisposable Subscribe(IObserver observer) + { + return _dataSubject.Subscribe(observer); + } + +#pragma warning disable VSTHRD003 + public Task AsTask() + { + return _task; + } +#pragma warning restore VSTHRD003 + public TaskAwaiter GetAwaiter() + { + return _task.GetAwaiter(); + } +} diff --git a/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs index 3ca17fe7d..fbef42084 100644 --- a/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs @@ -54,11 +54,17 @@ Action onCompleteAction .ForkJoin( requestResult .Do( - result => _dataSubject.OnNext(result ?? Enumerable.Empty()), + result => + { + if (result is not null) + { + _dataSubject.OnNext(result); + } + }, _dataSubject.OnError, _dataSubject.OnCompleted ), - (items, result) => items?.Count() > result?.Count() ? items : result + (items, result) => (items?.Count() ?? 0) > (result?.Count() ?? 0) ? items : result ) .Subscribe(observer), Disposable.Create(onCompleteAction) diff --git a/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs new file mode 100644 index 000000000..a84e6df78 --- /dev/null +++ b/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs @@ -0,0 +1,139 @@ +ο»Ώusing System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Concurrency; +using System.Reactive.Disposables; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress +{ + internal class PartialItemsWithInitialValueRequestProgressObservable : IRequestProgressObservable, TResult>, + IObserver, + IDisposable + where TResult : IEnumerable? + { + private readonly ISerializer _serializer; + private readonly ReplaySubject> _dataSubject; + private readonly CompositeDisposable _disposable; + private readonly Task _task; + private bool _receivedInitialValue; + + public PartialItemsWithInitialValueRequestProgressObservable( + ISerializer serializer, + ProgressToken token, + IObservable requestResult, + Func?, TResult> factory, + CancellationToken cancellationToken, + Action onCompleteAction + ) + { + _serializer = serializer; + _dataSubject = new ReplaySubject>(int.MaxValue, Scheduler.Immediate); + _disposable = new CompositeDisposable { _dataSubject }; + _task = Observable.Create( + observer => new CompositeDisposable + { + _dataSubject + .Aggregate( + default(TResult), (acc, items) => + { + if (acc is null && items is TResult r) return r; + return factory(acc, items); + } + ) + .ForkJoin( + requestResult + .Do( + result => + { + if (result is not null) + { + _dataSubject.OnNext(result); + } + }, + _dataSubject.OnError, + _dataSubject.OnCompleted + ), + (items, result) => (items?.Count() ?? 0) > (result?.Count() ?? 0) ? items : result + ) + .Subscribe(observer), + Disposable.Create(onCompleteAction) + } + ) + .ToTask(cancellationToken); + + ProgressToken = token; + } + + public ProgressToken ProgressToken { get; } + public Type ParamsType { get; } = typeof(TItem); + + void IObserver.OnCompleted() + { + OnCompleted(); + } + + void IObserver.OnError(Exception error) + { + OnError(error); + } + + private void OnCompleted() + { + if (_dataSubject.IsDisposed) return; + _dataSubject.OnCompleted(); + } + + private void OnError(Exception error) + { + if (_dataSubject.IsDisposed) return; + _dataSubject.OnError(error); + } + + public void OnNext(JToken value) + { + if (_dataSubject.IsDisposed) return; + if (!_receivedInitialValue) + { + _receivedInitialValue = true; + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)!); + } + else + { + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)); + } + } + + public void Dispose() + { + if (_disposable.IsDisposed) return; + _disposable.Dispose(); + } + +// public IDisposable Subscribe(IObserver> observer) => _disposable.IsDisposed ? Disposable.Empty : _dataSubject.Subscribe(observer); + public IDisposable Subscribe(IObserver> observer) + { + return _dataSubject.Subscribe(observer); + } + +#pragma warning disable VSTHRD003 + public Task AsTask() + { + return _task; + } +#pragma warning restore VSTHRD003 + public TaskAwaiter GetAwaiter() + { + return _task.GetAwaiter(); + } + } +} diff --git a/src/Protocol/Progress/ProgressManager.cs b/src/Protocol/Progress/ProgressManager.cs index c57fb182a..ae3fe8592 100644 --- a/src/Protocol/Progress/ProgressManager.cs +++ b/src/Protocol/Progress/ProgressManager.cs @@ -79,7 +79,7 @@ CancellationToken cancellationToken _serializer, request.PartialResultToken!, MakeRequest(request), - (x, _) => factory(x), + (_, x) => factory(x), _ => default!, cancellationToken, () => _activeObservables.TryRemove(request.PartialResultToken!, out _) @@ -90,62 +90,63 @@ CancellationToken cancellationToken public IRequestProgressObservable MonitorUntil( IPartialItemRequest request, - Func factory, + Func factory, + Func reverseFactory, CancellationToken cancellationToken ) { request.SetPartialResultToken(); - if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable observable) + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) + && o is IRequestProgressObservable observable) { return observable; } observable = new PartialItemRequestProgressObservable( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), - factory, - _ => default!, + (_, x) => factory(x), + reverseFactory, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _) + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } public IRequestProgressObservable MonitorUntil( IPartialItemRequest request, - Func factory, + Func factory, Func reverseFactory, CancellationToken cancellationToken ) { request.SetPartialResultToken(); - if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) - && o is IRequestProgressObservable observable) + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable observable) { return observable; } observable = new PartialItemRequestProgressObservable( _serializer, - request.PartialResultToken!, + request.PartialResultToken, MakeRequest(request), - (x, _) => factory(x), + factory, reverseFactory, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken!, out _) + () => _activeObservables.TryRemove(request.PartialResultToken, out _) ); - _activeObservables.TryAdd(request.PartialResultToken!, observable); + _activeObservables.TryAdd(request.PartialResultToken, observable); return observable; } public IRequestProgressObservable MonitorUntil( - IPartialItemRequest request, - Func factory, - Func reverseFactory, + IPartialItemWithInitialValueRequest request, + Func factory, CancellationToken cancellationToken ) + where TResult : TItem { request.SetPartialResultToken(); if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable observable) @@ -153,12 +154,11 @@ CancellationToken cancellationToken return observable; } - observable = new PartialItemRequestProgressObservable( + observable = new PartialItemWithInitialValueRequestProgressObservable( _serializer, request.PartialResultToken, MakeRequest(request), factory, - reverseFactory, cancellationToken, () => _activeObservables.TryRemove(request.PartialResultToken, out _) ); @@ -172,7 +172,8 @@ CancellationToken cancellationToken ) { request.SetPartialResultToken(); - if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable, IEnumerable> observable) + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) + && o is IRequestProgressObservable, IEnumerable> observable) { return observable; } @@ -196,7 +197,8 @@ public IRequestProgressObservable, TResponse> MonitorUntil? { request.SetPartialResultToken(); - if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable, TResponse> observable) + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) + && o is IRequestProgressObservable, TResponse> observable) { return observable; } @@ -233,6 +235,31 @@ public IRequestProgressObservable MonitorUntil(IPartialItemsReques return observable; } + + public IRequestProgressObservable, TResponse> MonitorUntil( + IPartialItemsWithInitialValueRequest request, + Func, TResponse> factory, CancellationToken cancellationToken + ) + where TResponse : IEnumerable? + { + request.SetPartialResultToken(); + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) + && o is IRequestProgressObservable, TResponse> observable) + { + return observable; + } + + observable = new PartialItemsWithInitialValueRequestProgressObservable( + _serializer, + request.PartialResultToken, + MakeRequest(request), + factory, cancellationToken, + () => _activeObservables.TryRemove(request.PartialResultToken, out _) + ); + _activeObservables.TryAdd(request.PartialResultToken, observable); + return observable; + } + public IProgressObserver For(ProgressToken token, CancellationToken cancellationToken) { if (_activeObservers.TryGetValue(token, out var o) && o is IProgressObserver observer) @@ -260,6 +287,23 @@ public IProgressObserver For(IPartialItemRequest For( + IPartialItemWithInitialValueRequest request, CancellationToken cancellationToken + ) + { + if (request.PartialResultToken == null) return ProgressObserver.Noop; + if (_activeObservers.TryGetValue(request.PartialResultToken, out var o) && o is IProgressObserverWithInitialValue observer) + { + return observer; + } + + observer = new ProgressObserver( + request.PartialResultToken, _router, _serializer, cancellationToken, () => _activeObservers.TryRemove(request.PartialResultToken, out _) + ); + _activeObservers.TryAdd(request.PartialResultToken, observer); + return observer; + } + public IProgressObserver> For(IPartialItemsRequest request, CancellationToken cancellationToken) where TResponse : IEnumerable? { @@ -276,11 +320,31 @@ public IProgressObserver> For(IPartialItems return observer; } + public IProgressObserverWithInitialValue> For( + IPartialItemsWithInitialValueRequest request, CancellationToken cancellationToken + ) + where TInitial : IEnumerable? + { + if (request.PartialResultToken == null) return ProgressObserver>.Noop; + if (_activeObservers.TryGetValue(request.PartialResultToken, out var o) + && o is IProgressObserverWithInitialValue> observer) + { + return observer; + } + + observer = new ProgressObserver>( + request.PartialResultToken, _router, _serializer, cancellationToken, () => _activeObservers.TryRemove(request.PartialResultToken, out _) + ); + _activeObservers.TryAdd(request.PartialResultToken, observer); + return observer; + } + private IObservable MakeRequest(IRequest request) => // Has problems with wanting custom exceptions around cancellation. // Observable.FromAsync(ct => _router.SendRequest(request, ct)) Observable.Create( - async (observer, ct) => { + async (observer, ct) => + { try { observer.OnNext(await _router.SendRequest(request, ct).ConfigureAwait(false)); diff --git a/src/Protocol/Progress/ProgressObserver.cs b/src/Protocol/Progress/ProgressObserver.cs index 95d6e069e..5c01ff449 100644 --- a/src/Protocol/Progress/ProgressObserver.cs +++ b/src/Protocol/Progress/ProgressObserver.cs @@ -9,13 +9,40 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress { + internal class ProgressObserver : ProgressObserver, IProgressObserverWithInitialValue + { + private bool _isInitialized; + + public static ProgressObserver Noop { get; } = + new ProgressObserver(new ProgressToken(nameof(Noop)), null, null, CancellationToken.None, () => { }); + + public ProgressObserver( + ProgressToken token, IResponseRouter? responseRouter, ISerializer? serializer, CancellationToken cancellationToken, Action disposal + ) : base(token, responseRouter, serializer, cancellationToken, disposal) + { + } + + public void OnNext(TInitial initial) + { + if (_isInitialized || isComplete || responseRouter == null) return; + responseRouter.SendNotification( + new ProgressParams + { + Token = ProgressToken, + Value = JToken.FromObject(initial, serializer?.JsonSerializer) + } + ); + _isInitialized = true; + } + } + internal class ProgressObserver : IProgressObserver { - private readonly IResponseRouter? _responseRouter; - private readonly ISerializer? _serializer; + protected readonly IResponseRouter? responseRouter; + protected readonly ISerializer? serializer; private readonly Action _disposal; private readonly TaskCompletionSource _completionSource; - private bool _isComplete; + protected bool isComplete; public static ProgressObserver Noop { get; } = new ProgressObserver(new ProgressToken(nameof(Noop)), null, null, CancellationToken.None, () => { }); @@ -28,8 +55,8 @@ public ProgressObserver( Action disposal ) { - _responseRouter = responseRouter; - _serializer = serializer; + this.responseRouter = responseRouter; + this.serializer = serializer; _disposal = disposal; ProgressToken = token; CancellationToken = cancellationToken; @@ -43,25 +70,26 @@ Action disposal public void OnCompleted() { - if (_isComplete) return; + if (isComplete) return; _completionSource.TrySetResult(Unit.Default); - _isComplete = true; + isComplete = true; } void IObserver.OnError(Exception error) { - if (_isComplete) return; + if (isComplete) return; _completionSource.TrySetException(error); - _isComplete = true; + isComplete = true; } public void OnNext(T value) { - if (_isComplete || _responseRouter == null) return; - _responseRouter.SendNotification( - new ProgressParams { + if (isComplete || responseRouter == null) return; + responseRouter.SendNotification( + new ProgressParams + { Token = ProgressToken, - Value = JToken.FromObject(value, _serializer?.JsonSerializer) + Value = JToken.FromObject(value, serializer?.JsonSerializer) } ); } diff --git a/src/Protocol/Protocol.csproj b/src/Protocol/Protocol.csproj index 28fb52bfa..df8c95b85 100644 --- a/src/Protocol/Protocol.csproj +++ b/src/Protocol/Protocol.csproj @@ -15,34 +15,23 @@ - + - <_Parameter1 - >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Proposals, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageServer.Shared, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f - <_Parameter1 - >OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageClient, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/src/Protocol/Serialization/Converters/CompletionListConverter.cs b/src/Protocol/Serialization/Converters/CompletionListConverter.cs index 701d9f473..352d98acc 100644 --- a/src/Protocol/Serialization/Converters/CompletionListConverter.cs +++ b/src/Protocol/Serialization/Converters/CompletionListConverter.cs @@ -7,44 +7,4 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters { - internal class CompletionListConverter : JsonConverter - { - public override void WriteJson(JsonWriter writer, CompletionList value, JsonSerializer serializer) - { - if (!value.IsIncomplete) - { - serializer.Serialize(writer, value.Items.ToArray()); - return; - } - - writer.WriteStartObject(); - writer.WritePropertyName("isIncomplete"); - writer.WriteValue(value.IsIncomplete); - - writer.WritePropertyName("items"); - writer.WriteStartArray(); - foreach (var item in value.Items) - { - serializer.Serialize(writer, item); - } - - writer.WriteEndArray(); - writer.WriteEndObject(); - } - - public override CompletionList ReadJson(JsonReader reader, Type objectType, CompletionList existingValue, bool hasExistingValue, JsonSerializer serializer) - { - if (reader.TokenType == JsonToken.StartArray) - { - var array = JArray.Load(reader).ToObject>(serializer); - return new CompletionList(array); - } - - var result = JObject.Load(reader); - var items = result["items"].ToObject>(serializer); - return new CompletionList(items, result["isIncomplete"].Value()); - } - - public override bool CanRead => true; - } } diff --git a/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs b/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs new file mode 100644 index 000000000..01112e26a --- /dev/null +++ b/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs @@ -0,0 +1,29 @@ +ο»Ώusing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; + +public class LocationOrFileLocationConverter : JsonConverter +{ + public override void WriteJson(JsonWriter writer, LocationOrFileLocation value, JsonSerializer serializer) + { + if (value.IsLocation) + serializer.Serialize(writer, value.Location); + if (value.IsFileLocation) + serializer.Serialize(writer, value.FileLocation); + } + + public override LocationOrFileLocation ReadJson(JsonReader reader, Type objectType, LocationOrFileLocation existingValue, bool hasExistingValue, JsonSerializer serializer) + { + var obj = JObject.Load(reader); + if (obj.ContainsKey("range")) + { + return new LocationOrFileLocation(obj.ToObject()); + } + + return new LocationOrFileLocation(obj.ToObject()); + } + + public override bool CanRead => true; +} diff --git a/src/Protocol/Serialization/Serializer.cs b/src/Protocol/Serialization/Serializer.cs index 96c55b41a..441e2ae63 100644 --- a/src/Protocol/Serialization/Serializer.cs +++ b/src/Protocol/Serialization/Serializer.cs @@ -105,7 +105,7 @@ protected override JsonSerializerSettings CreateSerializerSettings() protected override void AddOrReplaceConverters(ICollection converters) { ReplaceConverter(converters, new SupportsConverter()); - ReplaceConverter(converters, new CompletionListConverter()); + ReplaceConverter(converters, new CompletionList.Converter()); ReplaceConverter(converters, new DiagnosticCodeConverter()); ReplaceConverter(converters, new NullableDiagnosticCodeConverter()); ReplaceConverter(converters, new LocationOrLocationLinksConverter()); @@ -123,6 +123,7 @@ protected override void AddOrReplaceConverters(ICollection conver ReplaceConverter(converters, new SemanticTokensFullOrDeltaPartialResultConverter()); ReplaceConverter(converters, new SymbolInformationOrDocumentSymbolConverter()); ReplaceConverter(converters, new LocationOrLocationLinkConverter()); + ReplaceConverter(converters, new StringOrInlayHintLabelParts.Converter()); ReplaceConverter(converters, new WorkspaceEditDocumentChangeConverter()); ReplaceConverter(converters, new ParameterInformationLabelConverter()); ReplaceConverter(converters, new ValueTupleContractResolver()); diff --git a/src/Protocol/Server/Capabilities/IServerCapabilities.cs b/src/Protocol/Server/Capabilities/IServerCapabilities.cs index b441b237c..d410f321c 100644 --- a/src/Protocol/Server/Capabilities/IServerCapabilities.cs +++ b/src/Protocol/Server/Capabilities/IServerCapabilities.cs @@ -13,12 +13,32 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities /// public interface IServerCapabilities : ICapabilitiesBase { + /// + /// The position encoding the server picked from the encodings offered + /// by the client via the client capability `general.positionEncodings`. + /// + /// If the client didn't provide any position encodings the only valid + /// value that a server can return is 'utf-16'. + /// + /// If omitted it defaults to 'utf-16'. + /// + /// @since 3.17.0 + /// + PositionEncodingKind? PositionEncoding { get; set; } + /// /// Defines how text documents are synced. Is either a detailed structure defining each notification or /// for backwards compatibility the TextDocumentSyncKind number. /// TextDocumentSync? TextDocumentSync { get; set; } +// /// +// /// Defines how notebook documents are synced. +// /// +// /// @since 3.17.0 +// /// +// NotebookDocumentSyncOptions.StaticOptions NotebookDocumentSync { get; set; } + /// /// The server provides hover support. /// @@ -167,5 +187,33 @@ public interface IServerCapabilities : ICapabilitiesBase /// Since 3.14.0 /// BooleanOr? DeclarationProvider { get; set; } + + /// + /// The server provides type hierarchy support. + /// + /// @since 3.17.0 + /// + BooleanOr? TypeHierarchyProvider { get; set; } + + /// + /// The server provides inline values. + /// + /// @since 3.17.0 + /// + BooleanOr? InlineValueProvider { get; set; } + + /// + /// The server provides inlay hints. + /// + /// @since 3.17.0 + /// + BooleanOr? InlayHintProvider { get; set; } + + /// + /// The server has support for pull model diagnostics. + /// + /// @since 3.17.0 + /// + DiagnosticsRegistrationOptions.StaticOptions? DiagnosticProvider { get; set; } } } diff --git a/src/Protocol/Server/Capabilities/ServerCapabilities.cs b/src/Protocol/Server/Capabilities/ServerCapabilities.cs index 578440393..6d2c3e9ce 100644 --- a/src/Protocol/Server/Capabilities/ServerCapabilities.cs +++ b/src/Protocol/Server/Capabilities/ServerCapabilities.cs @@ -14,6 +14,19 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities /// public class ServerCapabilities : CapabilitiesBase, IServerCapabilities { + /// + /// The position encoding the server picked from the encodings offered + /// by the client via the client capability `general.positionEncodings`. + /// + /// If the client didn't provide any position encodings the only valid + /// value that a server can return is 'utf-16'. + /// + /// If omitted it defaults to 'utf-16'. + /// + /// @since 3.17.0 + /// + public PositionEncodingKind? PositionEncoding { get; set; } + /// /// Defines how text documents are synced. Is either a detailed structure defining each notification or /// for backwards compatibility the TextDocumentSyncKind number. @@ -21,6 +34,14 @@ public class ServerCapabilities : CapabilitiesBase, IServerCapabilities [Optional] public TextDocumentSync? TextDocumentSync { get; set; } + /// + /// Defines how notebook documents are synced. + /// + /// @since 3.17.0 + /// + [Optional] + public NotebookDocumentSyncOptions? NotebookDocumentSync { get; set; } + /// /// The server provides hover support. /// @@ -170,6 +191,7 @@ public class ServerCapabilities : CapabilitiesBase, IServerCapabilities /// /// Since 3.10.0 /// + [Optional] public BooleanOr? FoldingRangeProvider { get; set; } /// @@ -177,6 +199,7 @@ public class ServerCapabilities : CapabilitiesBase, IServerCapabilities /// /// Since 3.15.0 /// + [Optional] public BooleanOr? SelectionRangeProvider { get; set; } /// @@ -192,8 +215,41 @@ public class ServerCapabilities : CapabilitiesBase, IServerCapabilities /// /// Since 3.14.0 /// + [Optional] public BooleanOr? DeclarationProvider { get; set; } + /// + /// The server provides type hierarchy support. + /// + /// @since 3.17.0 + /// + [Optional] + public BooleanOr? TypeHierarchyProvider { get; set; } + + /// + /// The server provides inline values. + /// + /// @since 3.17.0 + /// + [Optional] + public BooleanOr? InlineValueProvider { get; set; } + + /// + /// The server provides inlay hints. + /// + /// @since 3.17.0 + /// + [Optional] + public BooleanOr? InlayHintProvider { get; set; } + + /// + /// The server has support for pull model diagnostics. + /// + /// @since 3.17.0 + /// + [Optional] + public DiagnosticsRegistrationOptions.StaticOptions? DiagnosticProvider { get; set; } + /// /// Workspace specific server capabilities /// diff --git a/src/Protocol/Server/ILanguageServerFacade.cs b/src/Protocol/Server/ILanguageServerFacade.cs index 15019d677..21f919ea1 100644 --- a/src/Protocol/Server/ILanguageServerFacade.cs +++ b/src/Protocol/Server/ILanguageServerFacade.cs @@ -5,6 +5,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Server public interface ILanguageServerFacade : ILanguageServerProxy, IJsonRpcHandlerInstance { ITextDocumentLanguageServer TextDocument { get; } + INotebookDocumentLanguageServer NotebookDocument { get; } IClientLanguageServer Client { get; } IGeneralLanguageServer General { get; } IWindowLanguageServer Window { get; } diff --git a/src/Protocol/Server/INotebookDocumentLanguageServer.cs b/src/Protocol/Server/INotebookDocumentLanguageServer.cs new file mode 100644 index 000000000..4b0d37231 --- /dev/null +++ b/src/Protocol/Server/INotebookDocumentLanguageServer.cs @@ -0,0 +1,5 @@ +ο»Ώnamespace OmniSharp.Extensions.LanguageServer.Protocol.Server; + +public interface INotebookDocumentLanguageServer : ILanguageServerProxy +{ +} diff --git a/src/Protocol/Server/NotebookDocumentLanguageServer.cs b/src/Protocol/Server/NotebookDocumentLanguageServer.cs new file mode 100644 index 000000000..88c9001dd --- /dev/null +++ b/src/Protocol/Server/NotebookDocumentLanguageServer.cs @@ -0,0 +1,17 @@ + +using DryIoc; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Server +{ + internal class NotebookDocumentLanguageServer : LanguageProtocolProxy, INotebookDocumentLanguageServer + { + public NotebookDocumentLanguageServer( + IResponseRouter requestRouter, IResolverContext resolverContext, IProgressManager progressManager, + ILanguageProtocolSettings languageProtocolSettings + ) : base(requestRouter, resolverContext, progressManager, languageProtocolSettings) + { + } + } +} diff --git a/src/Protocol/Server/TextDocumentLanguageServer.cs b/src/Protocol/Server/TextDocumentLanguageServer.cs index 2c04ce3fd..699d33cd9 100644 --- a/src/Protocol/Server/TextDocumentLanguageServer.cs +++ b/src/Protocol/Server/TextDocumentLanguageServer.cs @@ -1,3 +1,4 @@ + using DryIoc; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.LanguageServer.Protocol.Progress; diff --git a/src/Protocol/Shared/LspHandlerTypeDescriptor.cs b/src/Protocol/Shared/LspHandlerTypeDescriptor.cs index 2e5ba1123..f3120d281 100644 --- a/src/Protocol/Shared/LspHandlerTypeDescriptor.cs +++ b/src/Protocol/Shared/LspHandlerTypeDescriptor.cs @@ -15,12 +15,18 @@ public LspHandlerTypeDescriptor(Type handlerType) : base(handlerType) { if (HasParamsType) { - PartialItemsType = ParamsType!.GetInterfaces() - .FirstOrDefault(z => z.IsGenericType && typeof(IPartialItems<>).IsAssignableFrom(z.GetGenericTypeDefinition())) + PartialItemsType = (ParamsType!.GetInterfaces() + .FirstOrDefault(z => z.IsGenericType && typeof(IPartialItems<>).IsAssignableFrom(z.GetGenericTypeDefinition())) + ?? + ParamsType!.GetInterfaces() + .FirstOrDefault(z => z.IsGenericType && typeof(IPartialItemsWithInitialValue<,>).IsAssignableFrom(z.GetGenericTypeDefinition())) + ) ?.GetGenericArguments()[0]; - PartialItemType = ParamsType.GetInterfaces() - .FirstOrDefault(z => z.IsGenericType && typeof(IPartialItem<>).IsAssignableFrom(z.GetGenericTypeDefinition())) + PartialItemType = (ParamsType.GetInterfaces() + .FirstOrDefault(z => z.IsGenericType && typeof(IPartialItem<>).IsAssignableFrom(z.GetGenericTypeDefinition()))?? + ParamsType.GetInterfaces() + .FirstOrDefault(z => z.IsGenericType && typeof(IPartialItemWithInitialValue<,>).IsAssignableFrom(z.GetGenericTypeDefinition()))) ?.GetGenericArguments()[0]; } diff --git a/src/Protocol/TextDocumentNames.cs b/src/Protocol/TextDocumentNames.cs index a447bf7e3..2e99158eb 100644 --- a/src/Protocol/TextDocumentNames.cs +++ b/src/Protocol/TextDocumentNames.cs @@ -44,5 +44,12 @@ public static class TextDocumentNames public const string SemanticTokensRange = "textDocument/semanticTokens/range"; public const string Moniker = "textDocument/moniker"; public const string LinkedEditingRange = "textDocument/linkedEditingRange"; + public const string InlayHint = "textDocument/inlayHint"; + public const string InlayHintResolve = "inlayHint/resolve"; + public const string InlineValue = "textDocument/inlineValue"; + public const string Diagnostics = "textDocument/diagnostic"; + public const string PrepareTypeHierarchy = "textDocument/prepareTypeHierarchy"; + public const string TypeHierarchySupertypes = "typeHierarchy/supertypes"; + public const string TypeHierarchySubtypes = "typeHierarchy/subtypes"; } } diff --git a/src/Protocol/WorkspaceNames.cs b/src/Protocol/WorkspaceNames.cs index 90f5f6b31..598adb7bf 100644 --- a/src/Protocol/WorkspaceNames.cs +++ b/src/Protocol/WorkspaceNames.cs @@ -9,6 +9,7 @@ public static class WorkspaceNames public const string DidChangeWorkspaceFolders = "workspace/didChangeWorkspaceFolders"; public const string ExecuteCommand = "workspace/executeCommand"; public const string WorkspaceSymbol = "workspace/symbol"; + public const string WorkspaceSymbolResolve = "workspaceSymbol/resolve"; public const string WorkspaceFolders = "workspace/workspaceFolders"; public const string SemanticTokensRefresh = "workspace/semanticTokens/refresh"; public const string CodeLensRefresh = "workspace/codeLens/refresh"; @@ -18,6 +19,8 @@ public static class WorkspaceNames public const string DidRenameFiles = "workspace/didRenameFiles"; public const string WillDeleteFiles = "workspace/willDeleteFiles"; public const string DidDeleteFiles = "workspace/didDeleteFiles"; - + public const string InlineValueRefresh = "workspace/inlineValue/refresh"; + public const string DiagnosticRefresh = "workspace/diagnostic/refresh"; + public const string Diagnostics = "workspace/diagnostic"; } } diff --git a/src/Server/DefaultLanguageServerFacade.cs b/src/Server/DefaultLanguageServerFacade.cs index 3331596f3..a55433f06 100644 --- a/src/Server/DefaultLanguageServerFacade.cs +++ b/src/Server/DefaultLanguageServerFacade.cs @@ -16,6 +16,7 @@ namespace OmniSharp.Extensions.LanguageServer.Server internal class DefaultLanguageServerFacade : LanguageProtocolProxy, ILanguageServerFacade, IOnLanguageServerStarted { private readonly Lazy _textDocument; + private readonly Lazy _notebookDocument; private readonly Lazy _client; private readonly Lazy _general; private readonly Lazy _window; @@ -33,6 +34,7 @@ public DefaultLanguageServerFacade( IProgressManager progressManager, ILanguageProtocolSettings languageProtocolSettings, Lazy textDocument, + Lazy notebookDocument, Lazy client, Lazy general, Lazy window, @@ -45,6 +47,7 @@ IInsanceHasStarted instancesHasStarted ) : base(requestRouter, resolverContext, progressManager, languageProtocolSettings) { _textDocument = textDocument; + _notebookDocument = notebookDocument; _client = client; _general = general; _window = window; @@ -58,6 +61,7 @@ IInsanceHasStarted instancesHasStarted } public ITextDocumentLanguageServer TextDocument => _textDocument.Value; + public INotebookDocumentLanguageServer NotebookDocument => _notebookDocument.Value; public IClientLanguageServer Client => _client.Value; public IGeneralLanguageServer General => _general.Value; public IWindowLanguageServer Window => _window.Value; diff --git a/src/Server/LanguageServer.cs b/src/Server/LanguageServer.cs index ef81d70d8..987229e84 100644 --- a/src/Server/LanguageServer.cs +++ b/src/Server/LanguageServer.cs @@ -12,6 +12,7 @@ using DryIoc; using MediatR; using Microsoft.Extensions.Options; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.LanguageServer.Protocol; @@ -180,6 +181,7 @@ internal LanguageServer( IEnumerable startedHandlers, IServerWorkDoneManager serverWorkDoneManager, ITextDocumentLanguageServer textDocumentLanguageServer, + INotebookDocumentLanguageServer notebookDocumentLanguageServer, IClientLanguageServer clientLanguageServer, IGeneralLanguageServer generalLanguageServer, IWindowLanguageServer windowLanguageServer, @@ -214,6 +216,7 @@ IScheduler scheduler // We need to at least create Window here in case any handler does logging in their constructor TextDocument = textDocumentLanguageServer; + NotebookDocument = notebookDocumentLanguageServer; Client = clientLanguageServer; General = generalLanguageServer; Window = windowLanguageServer; @@ -231,19 +234,27 @@ IScheduler scheduler _capabilityTypes = options.Value.UseAssemblyAttributeScanning ? options.Value.Assemblies .SelectMany(z => z.GetCustomAttributes()) - .ToLookup(z => z.CapabilityKey, z => z.CapabilityType) + .ToLookup( + z => char.ToLowerInvariant(z.CapabilityKey[0]) + z.CapabilityKey.Substring(1), z => z.CapabilityType, + StringComparer.OrdinalIgnoreCase + ) : options.Value.Assemblies .SelectMany(z => z.ExportedTypes) .Where(z => z.IsClass && !z.IsAbstract) .Where(z => typeof(ICapability).IsAssignableFrom(z)) .Where(z => z.GetCustomAttributes().Any()) - .ToLookup(z => string.Join(".", z.GetCustomAttribute().Keys)); + .ToLookup( + z => string.Join( + ".", z.GetCustomAttribute().Keys.Select(z => char.ToLowerInvariant(z[0]) + z.Substring(1)) + ), StringComparer.OrdinalIgnoreCase + ); _disposable.Add(_collection.Add(this)); } public ITextDocumentLanguageServer TextDocument { get; } + public INotebookDocumentLanguageServer NotebookDocument { get; } public IClientLanguageServer Client { get; } public IGeneralLanguageServer General { get; } public IWindowLanguageServer Window { get; } @@ -318,7 +329,10 @@ async Task IRequestHandler("{}"); + notebookDocumentCapabilities = + ClientSettings.Capabilities.NotebookDocument ??= _serializer.DeserializeObject("{}"); workspaceCapabilities = ClientSettings.Capabilities.Workspace ??= _serializer.DeserializeObject("{}"); windowCapabilities = ClientSettings.Capabilities.Window ??= _serializer.DeserializeObject("{}"); generalCapabilities = ClientSettings.Capabilities.General ??= _serializer.DeserializeObject("{}"); @@ -448,7 +474,11 @@ out GeneralClientCapabilities generalCapabilities } private InitializeResult ReadServerCapabilities( - ClientCapabilities clientCapabilities, WindowClientCapabilities windowCapabilities, TextDocumentClientCapabilities textDocumentCapabilities + ClientCapabilities clientCapabilities, + WindowClientCapabilities windowCapabilities, + WorkspaceClientCapabilities workspaceCapabilities, + TextDocumentClientCapabilities textDocumentCapabilities, + NotebookDocumentClientCapabilities notebookDocumentCapabilities ) { // little hack to ensure that we get the proposed capabilities if proposals are turned on @@ -457,7 +487,7 @@ private InitializeResult ReadServerCapabilities( var serverCapabilitiesObject = new JObject(); foreach (var converter in _registrationOptionsConverters) { - var keys = ( converter.Key ?? Array.Empty() ).Select(key => char.ToLower(key[0]) + key.Substring(1)).ToArray(); + var keys = ( converter.Key ?? Array.Empty() ).Select(key => char.ToLowerInvariant(key[0]) + key.Substring(1)).ToArray(); var value = serverCapabilitiesObject; foreach (var key in keys.Take(keys.Length - 1)) { diff --git a/src/Server/LanguageServerServiceCollectionExtensions.cs b/src/Server/LanguageServerServiceCollectionExtensions.cs index 1f15b71bf..c45cde01a 100644 --- a/src/Server/LanguageServerServiceCollectionExtensions.cs +++ b/src/Server/LanguageServerServiceCollectionExtensions.cs @@ -43,6 +43,7 @@ internal static IContainer AddLanguageServerInternals(this IContainer container, } container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(TextDocumentLanguageServer)), reuse: Reuse.Singleton); + container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(NotebookDocumentLanguageServer)), reuse: Reuse.Singleton); container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(ClientLanguageServer)), reuse: Reuse.Singleton); container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(GeneralLanguageServer)), reuse: Reuse.Singleton); container.RegisterMany(serviceTypeCondition: type => type.Name.Contains(nameof(WindowLanguageServer)), reuse: Reuse.Singleton); @@ -105,6 +106,7 @@ internal static IContainer AddLanguageServerInternals(this IContainer container, ); container.RegisterMany(Reuse.Singleton); + container.RegisterMany(Reuse.Singleton); container.RegisterMany(Reuse.Singleton); container.RegisterMany(Reuse.Singleton); container.RegisterMany(new[] { typeof(ResolveCommandPipeline<,>) }); diff --git a/src/Server/Matchers/NotebookDocumentMatcher.cs b/src/Server/Matchers/NotebookDocumentMatcher.cs new file mode 100644 index 000000000..62235e9c3 --- /dev/null +++ b/src/Server/Matchers/NotebookDocumentMatcher.cs @@ -0,0 +1,119 @@ +using System.Collections.Generic; +using System.Linq; +using Microsoft.Extensions.Logging; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Shared; +using OmniSharp.Extensions.LanguageServer.Shared; + +namespace OmniSharp.Extensions.LanguageServer.Server.Matchers +{ + internal class NotebookDocumentMatcher : IHandlerMatcher + { + private readonly ILogger _logger; + private readonly NotebookDocumentIdentifiers _notebookDocumentIdentifiers; + + public NotebookDocumentMatcher(ILogger logger, NotebookDocumentIdentifiers notebookDocumentIdentifiers) + { + _logger = logger; + _notebookDocumentIdentifiers = notebookDocumentIdentifiers; + } + + public IEnumerable FindHandler(object parameters, IEnumerable descriptors) + { + switch (parameters) + { + case INotebookDocumentIdentifierParams notebookDocumentIdentifierParams: + { + // ReSharper disable once ConstantConditionalAccessQualifier + if (notebookDocumentIdentifierParams.NotebookDocument?.Uri is null) break; + var attributes = GetNotebookDocumentAttributes(notebookDocumentIdentifierParams.NotebookDocument.Uri); + + _logger.LogTrace("Found attributes {Count}, {Attributes}", attributes.Count, attributes.Select(x => $"{x.NotebookType}:{x.Scheme}:{x.Uri}")); + + return GetHandler(descriptors, attributes); + } + case DidOpenNotebookDocumentParams openNotebookDocumentParams: + { + // ReSharper disable once ConstantConditionalAccessQualifier + if (openNotebookDocumentParams.NotebookDocument?.Uri is null) break; + var attributes = new List() + { + new ( + openNotebookDocumentParams.NotebookDocument.Uri, openNotebookDocumentParams.NotebookDocument.NotebookType + ) + }; + attributes.AddRange( + openNotebookDocumentParams.CellTextDocuments + .Select(z => new NotebookDocumentAttributes(z.LanguageId, z.Uri)) + .Distinct() + ); + + _logger.LogTrace("Found attributes {Count}, {Attributes}", attributes.Count, attributes.Select(x => $"{x.NotebookType}:{x.Scheme}:{x.Uri}")); + + return GetHandler(descriptors, attributes); + } + case DidChangeNotebookDocumentParams didChangeDocumentParams: + { + // ReSharper disable once ConstantConditionalAccessQualifier + if (didChangeDocumentParams.NotebookDocument?.Uri is null) break; + // TODO: Do something with document version here? + var attributes = GetNotebookDocumentAttributes(didChangeDocumentParams.NotebookDocument.Uri); + + attributes.AddRange( + didChangeDocumentParams.Change.Cells.Structure?.Array.Cells? + .Select(z => new NotebookDocumentAttributes(z.Document)) + .Distinct() ?? Array.Empty() + ); + attributes.AddRange( + didChangeDocumentParams.Change.Cells.Data? + .Select(z => new NotebookDocumentAttributes(z.Document)) + .Distinct() ?? Array.Empty() + ); + + _logger.LogTrace("Found attributes {Count}, {Attributes}", attributes.Count, attributes.Select(x => $"{x.NotebookType}:{x.Scheme}:{x.Uri}")); + + return GetHandler(descriptors, attributes); + } + } + + return Enumerable.Empty(); + } + + private List GetNotebookDocumentAttributes(DocumentUri uri) => + _notebookDocumentIdentifiers + .Select(x => x.GetNotebookDocumentAttributes(uri)) + .Where(x => x is not null) + .ToList(); + + private IEnumerable GetHandler(IEnumerable descriptors, IEnumerable attributes) => + attributes.SelectMany(z => GetHandler(descriptors, z)).Distinct(); + + private IEnumerable GetHandler(IEnumerable descriptors, NotebookDocumentAttributes attributes) + { + var lspHandlerDescriptors = descriptors as ILspHandlerDescriptor[] ?? descriptors.ToArray(); + var method = lspHandlerDescriptors.FirstOrDefault()?.Method; + _logger.LogTrace("Looking for handler for descriptors {Method}", method); + foreach (var descriptor in lspHandlerDescriptors) + { + _logger.LogTrace("Checking handler {Method}:{Handler}", method, descriptor.ImplementationType.FullName); + var registrationOptions = descriptor.RegistrationOptions as INotebookDocumentRegistrationOptions; + + _logger.LogTrace("Registration options {OptionsName}", registrationOptions?.GetType().FullName); + _logger.LogTrace("Document Selector {NotebookDocumentSelector}", registrationOptions?.NotebookSelector?.ToString() ?? string.Empty); + if (registrationOptions?.NotebookSelector is null || registrationOptions.NotebookSelector.IsMatch(attributes)) + { + _logger.LogTrace( + "Handler Selected: {Handler} {Id} via {NotebookDocumentSelector} (targeting {HandlerInterface})", + descriptor.ImplementationType.FullName, + descriptor.Handler is ICanBeIdentifiedHandler h ? h.Id.ToString() : string.Empty, + registrationOptions?.NotebookSelector?.ToString(), + descriptor.HandlerType.FullName + ); + yield return descriptor; + } + } + } + } +} diff --git a/src/Server/Matchers/TextDocumentMatcher.cs b/src/Server/Matchers/TextDocumentMatcher.cs index 758d716e4..a90aeb9c9 100644 --- a/src/Server/Matchers/TextDocumentMatcher.cs +++ b/src/Server/Matchers/TextDocumentMatcher.cs @@ -80,11 +80,11 @@ private IEnumerable GetHandler(IEnumerable - <_Parameter1 - >OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f + <_Parameter1>OmniSharp.Extensions.LanguageProtocol.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 2e1c2229c..2ac321523 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -16,6 +16,8 @@ + + <_Parameter1>Client.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f diff --git a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs index 320a396fc..4ba031458 100644 --- a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs +++ b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs @@ -4,6 +4,7 @@ namespace Generation.Tests { + [UsesVerify] public class EnumLikeStringGeneratorTests { [Fact] @@ -20,43 +21,7 @@ public readonly partial struct ThreadEventReason } } "; - var expected = @" -#nullable enable -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using Newtonsoft.Json; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Serialization.Converters; - -namespace Test -{ - [JsonConverter(typeof(EnumLikeStringConverter))] - [DebuggerDisplay(""{_value}"")] - public readonly partial struct ThreadEventReason : IEquatable, IEquatable, IEnumLikeString - { - private static readonly Lazy> _defaults = new Lazy>(() => - { - return new ThreadEventReason[]{Started, Exited}; - }); - public static IEnumerable Defaults => _defaults.Value; - private readonly string _value; - public ThreadEventReason(string type) => _value = type; - public static implicit operator ThreadEventReason(string kind) => new ThreadEventReason(kind); - public static implicit operator string (ThreadEventReason kind) => kind._value; - public override string ToString() => _value; - public bool Equals(ThreadEventReason other) => _value == other._value; - public bool Equals(string other) => _value == other; - public override bool Equals(object obj) => obj is string s && Equals(s) || obj is ThreadEventReason other && Equals(other); - public override int GetHashCode() => _value.GetHashCode(); - public static bool operator ==(ThreadEventReason left, ThreadEventReason right) => left.Equals(right); - public static bool operator !=(ThreadEventReason left, ThreadEventReason right) => !left.Equals(right); - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(GenerationHelpers.Generate(source)); } } } diff --git a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs index 1ab1e1561..4a1d3026c 100644 --- a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs +++ b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs @@ -4,6 +4,7 @@ namespace Generation.Tests { + [UsesVerify] public class GeneratedRegistrationOptionsTests { [Fact] @@ -20,44 +21,7 @@ namespace Test public partial class WorkspaceSymbolRegistrationOptions { } } "; - var expected = @" -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; - -#nullable enable -namespace Test -{ - [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverterAttribute(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - - class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - public WorkspaceSymbolRegistrationOptionsConverter() - { - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new StaticOptions{WorkDoneProgress = source.WorkDoneProgress}; - } - } - - [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(await GenerationHelpers.Generate(source)); } [Fact] @@ -76,45 +40,7 @@ public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptio } "; - var expected = @" -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; - -#nullable enable -namespace Test -{ - [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverterAttribute(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - - class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - public WorkspaceSymbolRegistrationOptionsConverter() - { - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new StaticOptions{WorkDoneProgress = source.WorkDoneProgress}; - } - } - - [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - public partial class StaticOptions : IWorkDoneProgressOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(await GenerationHelpers.Generate(source)); } [Fact] @@ -142,7 +68,7 @@ public async Task Supports_Generating_Strongly_Typed_Registration_Options() #nullable enable namespace OmniSharp.Extensions.LanguageServer.Protocol.Test { - [GenerateRegistrationOptions(nameof(ServerCapabilities.CodeActionProvider), SupportsDocumentSelector = true, SupportsWorkDoneProgress = true] + [GenerateRegistrationOptions(nameof(ServerCapabilities.CodeActionProvider), SupportsTextDocumentSelector = true, SupportsWorkDoneProgress = true] public partial class CodeActionRegistrationOptions { /// @@ -165,76 +91,7 @@ public partial class CodeActionRegistrationOptions } } #nullable restore"; - - var expected = @" -using System; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using MediatR; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ - [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] - [RegistrationOptionsConverterAttribute(typeof(CodeActionRegistrationOptionsConverter))] - public partial class CodeActionRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions - { - public DocumentSelector? DocumentSelector { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - - class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - public CodeActionRegistrationOptionsConverter() - { - } - - public override StaticOptions Convert(CodeActionRegistrationOptions source) - { - return new StaticOptions{CodeActionKinds = source.CodeActionKinds, ResolveProvider = source.ResolveProvider, WorkDoneProgress = source.WorkDoneProgress}; - } - } - - [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] - public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions - { - /// - /// CodeActionKinds that this server may return. - /// - /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server - /// may list out every specific kind they provide. - /// - [Optional] - public Container? CodeActionKinds { get; set; } = new Container(); - /// - /// The server provides support to resolve additional - /// information for a code action. - /// - /// @since 3.16.0 - /// - [Optional] - public bool ResolveProvider { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(await GenerationHelpers.Generate(source)); } [Fact] @@ -304,62 +161,7 @@ public override StaticCodeActionRegistrationOptions Convert(CodeActionRegistrati } #nullable restore"; - var expected = @" -using System; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using MediatR; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ - [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] - public partial class CodeActionRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions - { - public DocumentSelector? DocumentSelector { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - - [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] - public partial class StaticOptions : IWorkDoneProgressOptions - { - /// - /// CodeActionKinds that this server may return. - /// - /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server - /// may list out every specific kind they provide. - /// - [Optional] - public Container? CodeActionKinds { get; set; } = new Container(); - /// - /// The server provides support to resolve additional - /// information for a code action. - /// - /// @since 3.16.0 - /// - [Optional] - public bool ResolveProvider { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(await GenerationHelpers.Generate(source)); } } } diff --git a/test/Generation.Tests/Generation.Tests.csproj b/test/Generation.Tests/Generation.Tests.csproj index 8f8f18ef0..4af9af6e5 100644 --- a/test/Generation.Tests/Generation.Tests.csproj +++ b/test/Generation.Tests/Generation.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net6.0 + net6.0 true AnyCPU @@ -12,5 +12,11 @@ + + + + + JsonRpcGenerationTests + diff --git a/test/Generation.Tests/JsonRpcGenerationTests.cs b/test/Generation.Tests/JsonRpcGenerationTests.cs index 496e8eed2..129651727 100644 --- a/test/Generation.Tests/JsonRpcGenerationTests.cs +++ b/test/Generation.Tests/JsonRpcGenerationTests.cs @@ -7,6 +7,7 @@ namespace Generation.Tests { + [UsesVerify] public class JsonRpcGenerationTests { [Fact] @@ -33,42 +34,7 @@ public interface IExitHandler : IJsonRpcNotificationHandler } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Test; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class ExitExtensions - { - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static void SendExit(this ILanguageClient mediator, ExitParams request) => mediator.SendNotification(request); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -112,71 +78,7 @@ public partial record ExecuteCommandParams : IRequest, IWorkDoneProgressPa } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Test; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ - [Serial, Method(WorkspaceNames.ExecuteCommand, Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IExecuteCommandHandler : IJsonRpcRequestHandler, T>, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class ExecuteCommandHandlerBase : AbstractHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>, IExecuteCommandHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class ExecuteCommandExtensions1 - { - public static ILanguageServerRegistry OnExecuteCommand(this ILanguageServerRegistry registry, Func, Task> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.ExecuteCommand, new LanguageProtocolDelegatingHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>(HandlerAdapter.Adapt, T>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnExecuteCommand(this ILanguageServerRegistry registry, Func, CancellationToken, Task> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.ExecuteCommand, new LanguageProtocolDelegatingHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>(HandlerAdapter.Adapt, T>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnExecuteCommand(this ILanguageServerRegistry registry, Func, ExecuteCommandCapability, CancellationToken, Task> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.ExecuteCommand, new LanguageProtocolDelegatingHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>(HandlerAdapter.Adapt, T>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static Task ExecuteCommand(this IWorkspaceLanguageClient mediator, ExecuteCommandParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - public static Task ExecuteCommand(this ILanguageClient mediator, ExecuteCommandParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -225,40 +127,7 @@ namespace OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test public interface ICapabilitiesHandler : IJsonRpcNotificationHandler { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Client; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.DebugAdapter.Protocol.Server; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class CapabilitiesExtensions - { - public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Action handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); - public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Func handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); - public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Action handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); - public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Func handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); - public static void SendCapabilities(this IDebugAdapterServer mediator, CapabilitiesEvent request) => mediator.SendNotification(request); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } @@ -286,41 +155,7 @@ public interface IExitHandler : IJsonRpcNotificationHandler } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Test; - -namespace Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class ExitExtensions - { - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); - public static void SendExit(this ILanguageClient mediator, ExitParams request) => mediator.SendNotification(request); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -344,73 +179,11 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Test { [Serial, Method(TextDocumentNames.DidChange, Direction.ClientToServer), GenerateHandlerMethods, GenerateRequestMethods] public interface IDidChangeTextDocumentHandler : IJsonRpcNotificationHandler, - IRegistration + IRegistration { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Test; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class DidChangeTextDocumentExtensions - { - public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static void DidChangeTextDocument(this ILanguageClient mediator, DidChangeTextDocumentParams request) => mediator.SendNotification(request); - } -#nullable restore -} -"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -440,71 +213,7 @@ public interface IFoldingRangeHandler : IJsonRpcRequestHandler>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.FoldingRange, new LanguageProtocolDelegatingHandlers.Request, FoldingRangeRegistrationOptions, FoldingRangeCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnFoldingRange(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.FoldingRange, new LanguageProtocolDelegatingHandlers.Request, FoldingRangeRegistrationOptions, FoldingRangeCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnFoldingRange(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.FoldingRange, new LanguageProtocolDelegatingHandlers.Request, FoldingRangeRegistrationOptions, FoldingRangeCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveFoldingRange(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.FoldingRange, _ => new LanguageProtocolDelegatingHandlers.PartialResults, FoldingRange, FoldingRangeRegistrationOptions, FoldingRangeCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveFoldingRange(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.FoldingRange, _ => new LanguageProtocolDelegatingHandlers.PartialResults, FoldingRange, FoldingRangeRegistrationOptions, FoldingRangeCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveFoldingRange(this ILanguageServerRegistry registry, Action>, FoldingRangeCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.FoldingRange, _ => new LanguageProtocolDelegatingHandlers.PartialResults, FoldingRange, FoldingRangeRegistrationOptions, FoldingRangeCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static IRequestProgressObservable, Container> RequestFoldingRange(this ITextDocumentLanguageClient mediator, FoldingRangeRequestParam request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new Container(value), cancellationToken); - public static IRequestProgressObservable, Container> RequestFoldingRange(this ILanguageClient mediator, FoldingRangeRequestParam request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new Container(value), cancellationToken); - } -#nullable restore -} -"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -530,69 +239,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Test public interface IDefinitionHandler : IJsonRpcRequestHandler, IRegistration { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Test; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute, Obsolete(""This is obsolete"")] - public static partial class DefinitionExtensions - { - public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); - } - - public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); - } - - public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, DefinitionCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); - } - - public static IRequestProgressObservable, LocationOrLocationLinks> RequestDefinition(this ILanguageClient mediator, DefinitionParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new LocationOrLocationLinks(value), cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(GenerationHelpers.Generate(source)); } @@ -619,69 +266,7 @@ namespace Test public interface IDefinitionHandler : IJsonRpcRequestHandler, IRegistration { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Test; - -namespace Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class DefinitionExtensions - { - public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); - } - - public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); - } - - public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, DefinitionCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); - } - - public static IRequestProgressObservable, LocationOrLocationLinks> RequestDefinition(this ITextDocumentLanguageClient mediator, DefinitionParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new LocationOrLocationLinks(value), cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(GenerationHelpers.Generate(source)); } [Fact] @@ -712,39 +297,7 @@ namespace Test [Serial, Method(GeneralNames.Initialize, Direction.ClientToServer), GenerateHandlerMethods(typeof(ILanguageServerRegistry), MethodName = ""OnLanguageProtocolInitialize""), GenerateRequestMethods(typeof(ITextDocumentLanguageClient), MethodName = ""RequestLanguageProtocolInitialize"")] public interface ILanguageProtocolInitializeHandler : IJsonRpcRequestHandler {} }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Test; - -namespace Test -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class LanguageProtocolInitializeExtensions - { - public static ILanguageServerRegistry OnLanguageProtocolInitialize(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(GeneralNames.Initialize, RequestHandler.For(handler)); - public static ILanguageServerRegistry OnLanguageProtocolInitialize(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(GeneralNames.Initialize, RequestHandler.For(handler)); - public static Task RequestLanguageProtocolInitialize(this ITextDocumentLanguageClient mediator, InitializeParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -766,67 +319,7 @@ public class AttachResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class AttachRequestArguments: IRequest { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; -using OmniSharp.Extensions.DebugAdapter.Protocol.Client; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.DebugAdapter.Protocol.Server; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ - [Method(""attach"", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IAttachRequestHandler : IJsonRpcRequestHandler where T : AttachRequestArguments - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class AttachRequestHandlerBase : AbstractHandlers.Request, IAttachRequestHandler where T : AttachRequestArguments - { - } - - public partial interface IAttachRequestHandler : IAttachRequestHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class AttachRequestHandlerBase : AttachRequestHandlerBase, IAttachRequestHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class AttachRequestExtensions - { - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : AttachRequestArguments => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : AttachRequestArguments => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static Task AttachRequest(this IDebugAdapterClient mediator, AttachRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -848,67 +341,7 @@ public class LaunchResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class LaunchRequestArguments: IRequest { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; -using OmniSharp.Extensions.DebugAdapter.Protocol.Client; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.DebugAdapter.Protocol.Server; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ - [Method(""launch"", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface ILaunchRequestHandler : IJsonRpcRequestHandler where T : LaunchRequestArguments - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class LaunchRequestHandlerBase : AbstractHandlers.Request, ILaunchRequestHandler where T : LaunchRequestArguments - { - } - - public partial interface ILaunchRequestHandler : ILaunchRequestHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class LaunchRequestHandlerBase : LaunchRequestHandlerBase, ILaunchRequestHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class LaunchRequestExtensions - { - public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""launch"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""launch"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : LaunchRequestArguments => registry.AddHandler(""launch"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : LaunchRequestArguments => registry.AddHandler(""launch"", RequestHandler.For(handler)); - public static Task LaunchRequest(this IDebugAdapterClient mediator, LaunchRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -930,67 +363,7 @@ public class AttachResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class AttachRequestArguments: IRequest { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; -using OmniSharp.Extensions.DebugAdapter.Protocol.Client; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.DebugAdapter.Protocol.Server; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ - [Method(""attach"", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IAttachRequestHandler : IJsonRpcRequestHandler where T : AttachRequestArguments - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class AttachRequestHandlerBase : AbstractHandlers.Request, IAttachRequestHandler where T : AttachRequestArguments - { - } - - public partial interface IAttachRequestHandler : IAttachRequestHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class AttachRequestHandlerBase : AttachRequestHandlerBase, IAttachRequestHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class AttachRequestExtensions - { - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : AttachRequestArguments => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : AttachRequestArguments => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static Task AttachRequest(this IDebugAdapterClient mediator, AttachRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -1012,67 +385,7 @@ public class AttachResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class AttachRequestArguments: IRequest { } }"; - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; -using OmniSharp.Extensions.DebugAdapter.Protocol.Client; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.DebugAdapter.Protocol.Server; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ - [Method(""attach"", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IAttachRequestHandler : IJsonRpcRequestHandler where T : AttachRequestArguments - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class AttachRequestHandlerBase : AbstractHandlers.Request, IAttachRequestHandler where T : AttachRequestArguments - { - } - - public partial interface IAttachRequestHandler : IAttachRequestHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class AttachRequestHandlerBase : AttachRequestHandlerBase, IAttachRequestHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class AttachRequestExtensions - { - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : AttachRequestArguments => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) - where T : AttachRequestArguments => registry.AddHandler(""attach"", RequestHandler.For(handler)); - public static Task AttachRequest(this IDebugAdapterClient mediator, AttachRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } [Fact] @@ -1104,75 +417,7 @@ public partial class RenameParams : ITextDocumentIdentifierParams, IRequest, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class RenameHandlerBase : AbstractHandlers.Request, IRenameHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Bogus.Handlers -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class RenameExtensions - { - public static ILanguageServerRegistry OnRename(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Rename, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnRename(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Rename, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnRename(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(TextDocumentNames.Rename, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static Task RequestRename(this ITextDocumentLanguageClient mediator, RenameParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - public static Task RequestRename(this ILanguageClient mediator, RenameParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -}"; - await AssertGeneratedAsExpected(source, expected); + await Verify(Generate(source)); } } } diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index da2ff3dec..1d087b085 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -4,6 +4,7 @@ namespace Generation.Tests { + [UsesVerify] public class LspFeatureTests { // [Fact(Skip = "for testing"] @@ -11,97 +12,17 @@ public class LspFeatureTests public async Task Supports_Params_Type_As_Source() { var source = FeatureFixture.ReadSource("Workspace.WorkspaceSymbolsFeature.cs"); - var expected = @" -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ - [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IWorkspaceSymbolsHandler : IJsonRpcRequestHandler?>, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class WorkspaceSymbolsHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class WorkspaceSymbolsPartialHandlerBase : AbstractHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler - { - protected WorkspaceSymbolsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) - { - } - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class WorkspaceSymbolsExtensions - { - public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ITextDocumentLanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new Container(value), cancellationToken); - public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ILanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new Container(value), cancellationToken); - } -#nullable restore -}"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify( + new + { + RegistrationOptionsGenerator = await GenerationHelpers.GenerateAsync(source), + StronglyTypedGenerator = await GenerationHelpers.GenerateAsync(source), + GenerateHandlerMethodsGenerator = await GenerationHelpers.GenerateAsync(source), + AutoImplementParamsGenerator = await GenerationHelpers.GenerateAsync(source), + AssemblyCapabilityKeyAttributeGenerator = await GenerationHelpers.GenerateAsync(source), + AssemblyJsonRpcHandlersAttributeGenerator = await GenerationHelpers.GenerateAsync(source), + EnumLikeStringGenerator = await GenerationHelpers.GenerateAsync(source), + }); } [Fact] @@ -161,197 +82,17 @@ public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions } #nullable restore"; - var expectedOptions = @" -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [RegistrationOptionsKey(""unitTestDiscovery"")] - [RegistrationOptionsConverterAttribute(typeof(UnitTestRegistrationOptionsConverter))] - public partial class UnitTestRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - - class UnitTestRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - public UnitTestRegistrationOptionsConverter() - { - } - - public override StaticOptions Convert(UnitTestRegistrationOptions source) - { - return new StaticOptions{SupportsDebugging = source.SupportsDebugging, WorkDoneProgress = source.WorkDoneProgress}; - } - } - - [RegistrationOptionsKey(""unitTestDiscovery"")] - public partial class StaticOptions : IWorkDoneProgressOptions - { - [Optional] - public bool SupportsDebugging { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore"; - var expectedStrongTypes = @" -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method(""tests/run"", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method(""tests/discover"", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey(""workspace"", ""unitTests"")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions(""unitTestDiscovery"")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore -"; - var expectedHandlers = @" -using Lsp.Tests.Integration.Fixtures; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method(""tests/discover"", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IDiscoverUnitTestsHandler : IJsonRpcRequestHandler>, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class DiscoverUnitTestsHandlerBase : AbstractHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class DiscoverUnitTestsPartialHandlerBase : AbstractHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler - { - protected DiscoverUnitTestsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) - { - } - } -} -#nullable restore - -namespace Lsp.Tests.Integration.Fixtures -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class DiscoverUnitTestsExtensions - { - public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(""tests/discover"", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(""tests/discover"", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(""tests/discover"", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(""tests/discover"", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(""tests/discover"", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, UnitTestCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(""tests/discover"", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static IRequestProgressObservable, Container> RequestDiscoverUnitTests(this ILanguageClient mediator, DiscoverUnitTestsParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, value => new Container(value), cancellationToken); - } -#nullable restore -}"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expectedOptions); - await GenerationHelpers.AssertGeneratedAsExpected(source, expectedStrongTypes); - await GenerationHelpers.AssertGeneratedAsExpected(source, expectedHandlers); + await Verify( + new + { + RegistrationOptionsGenerator = await GenerationHelpers.GenerateAsync(source), + StronglyTypedGenerator = await GenerationHelpers.GenerateAsync(source), + GenerateHandlerMethodsGenerator = await GenerationHelpers.GenerateAsync(source), + AutoImplementParamsGenerator = await GenerationHelpers.GenerateAsync(source), + AssemblyCapabilityKeyAttributeGenerator = await GenerationHelpers.GenerateAsync(source), + AssemblyJsonRpcHandlersAttributeGenerator = await GenerationHelpers.GenerateAsync(source), + EnumLikeStringGenerator = await GenerationHelpers.GenerateAsync(source), + }); } [Fact] @@ -401,56 +142,17 @@ public partial class Registration } #nullable restore"; - var expectedHandlers = @" -using Lsp.Tests.Integration.Fixtures; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Client -{ - [Parallel, Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IRegisterCapabilityHandler : IJsonRpcRequestHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class RegisterCapabilityHandlerBase : AbstractHandlers.Request, IRegisterCapabilityHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Client -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class RegisterCapabilityExtensions - { - public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); - public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); - } -#nullable restore -}"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expectedHandlers); + await Verify( + new + { + RegistrationOptionsGenerator = await GenerationHelpers.GenerateAsync(source), + StronglyTypedGenerator = await GenerationHelpers.GenerateAsync(source), + GenerateHandlerMethodsGenerator = await GenerationHelpers.GenerateAsync(source), + AutoImplementParamsGenerator = await GenerationHelpers.GenerateAsync(source), + AssemblyCapabilityKeyAttributeGenerator = await GenerationHelpers.GenerateAsync(source), + AssemblyJsonRpcHandlersAttributeGenerator = await GenerationHelpers.GenerateAsync(source), + EnumLikeStringGenerator = await GenerationHelpers.GenerateAsync(source), + }); } } } diff --git a/test/Generation.Tests/ModuleInitializer.cs b/test/Generation.Tests/ModuleInitializer.cs new file mode 100644 index 000000000..67d97e1a7 --- /dev/null +++ b/test/Generation.Tests/ModuleInitializer.cs @@ -0,0 +1,34 @@ +ο»Ώusing System.Runtime.CompilerServices; +using DiffEngine; +using Microsoft.CodeAnalysis; + +public static class ModuleInitializer +{ + [ModuleInitializer] + public static void Init() + { + VerifySourceGenerators.Enable(); + VerifierSettings.AddExtraSettings( + settings => { settings.Converters.Add(new SyntaxTreeConverter()); } + ); + DiffRunner.Disabled = true; + VerifierSettings.DerivePathInfo( + static (sourceFile, directory, type, method) => + { + static string GetTypeName(Type type) => type.IsNested ? $"{type.ReflectedType!.Name}.{type.Name}" : type.Name; + var typeName = GetTypeName(type); + return new(Path.Combine(Path.GetDirectoryName(sourceFile)!, "snapshots"), typeName, method.Name); + } + ); + } + + class SyntaxTreeConverter : + WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, SyntaxTree value) => + writer.WriteValue( + $@"//HintName: {value.FilePath.Replace("\\", "/", StringComparison.OrdinalIgnoreCase)} +{value.GetText()}" + ); + } +} diff --git a/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt new file mode 100644 index 000000000..d5586f89e --- /dev/null +++ b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt @@ -0,0 +1,35 @@ +ο»Ώ#nullable enable +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using Newtonsoft.Json; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Serialization.Converters; + +namespace Test +{ + [JsonConverter(typeof(EnumLikeStringConverter))] + [DebuggerDisplay("{_value}")] + public readonly partial struct ThreadEventReason : IEquatable, IEquatable, IEnumLikeString + { + private static readonly Lazy> _defaults = new Lazy>(() => + { + return new ThreadEventReason[]{Started, Exited}; + }); + public static IEnumerable Defaults => _defaults.Value; + private readonly string _value; + public ThreadEventReason(string type) => _value = type; + public static implicit operator ThreadEventReason(string kind) => new ThreadEventReason(kind); + public static implicit operator string (ThreadEventReason kind) => kind._value; + public override string ToString() => _value; + public bool Equals(ThreadEventReason other) => _value == other._value; + public bool Equals(string other) => _value == other; + public override bool Equals(object obj) => obj is string s && Equals(s) || obj is ThreadEventReason other && Equals(other); + public override int GetHashCode() => _value.GetHashCode(); + public static bool operator ==(ThreadEventReason left, ThreadEventReason right) => left.Equals(right); + public static bool operator !=(ThreadEventReason left, ThreadEventReason right) => !left.Equals(right); + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt new file mode 100644 index 000000000..6f0f0e782 --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt @@ -0,0 +1,67 @@ +ο»Ώusing System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] + [RegistrationOptionsConverterAttribute(typeof(CodeActionRegistrationOptionsConverter))] + public partial class CodeActionRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions + { + public TextDocumentSelector? DocumentSelector { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + + class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + public CodeActionRegistrationOptionsConverter() + { + } + + public override StaticOptions Convert(CodeActionRegistrationOptions source) + { + return new StaticOptions{CodeActionKinds = source.CodeActionKinds, ResolveProvider = source.ResolveProvider, WorkDoneProgress = source.WorkDoneProgress}; + } + } + + [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] + public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions + { + /// + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + /// + [Optional] + public Container? CodeActionKinds { get; set; } = new Container(); + /// + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + /// + [Optional] + public bool ResolveProvider { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt new file mode 100644 index 000000000..28928dfda --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt @@ -0,0 +1,54 @@ +ο»Ώusing System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] + public partial class CodeActionRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + public TextDocumentSelector? DocumentSelector { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + + [RegistrationOptionsKey(nameof(ServerCapabilities.CodeActionProvider))] + public partial class StaticOptions : IWorkDoneProgressOptions + { + /// + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + /// + [Optional] + public Container? CodeActionKinds { get; set; } = new Container(); + /// + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + /// + [Optional] + public bool ResolveProvider { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt new file mode 100644 index 000000000..01837585c --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt @@ -0,0 +1,36 @@ +ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +#nullable enable +namespace Test +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverterAttribute(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions, OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + + class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + public WorkspaceSymbolRegistrationOptionsConverter() + { + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new StaticOptions{WorkDoneProgress = source.WorkDoneProgress}; + } + } + + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt new file mode 100644 index 000000000..72a814123 --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt @@ -0,0 +1,37 @@ +ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +#nullable enable +namespace Test +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverterAttribute(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + + class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + public WorkspaceSymbolRegistrationOptionsConverter() + { + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new StaticOptions{WorkDoneProgress = source.WorkDoneProgress}; + } + } + + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + public partial class StaticOptions : IWorkDoneProgressOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt new file mode 100644 index 000000000..c8d6fe2aa --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt @@ -0,0 +1,59 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; +using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.DebugAdapter.Protocol.Server; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ + [Method("attach", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IAttachRequestHandler : IJsonRpcRequestHandler where T : AttachRequestArguments + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class AttachRequestHandlerBase : AbstractHandlers.Request, IAttachRequestHandler where T : AttachRequestArguments + { + } + + public partial interface IAttachRequestHandler : IAttachRequestHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class AttachRequestHandlerBase : AttachRequestHandlerBase, IAttachRequestHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class AttachRequestExtensions + { + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : AttachRequestArguments => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : AttachRequestArguments => registry.AddHandler("attach", RequestHandler.For(handler)); + public static Task AttachRequest(this IDebugAdapterClient mediator, AttachRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt new file mode 100644 index 000000000..6f976f45a --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt @@ -0,0 +1,59 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; +using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.DebugAdapter.Protocol.Server; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ + [Method("launch", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface ILaunchRequestHandler : IJsonRpcRequestHandler where T : LaunchRequestArguments + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class LaunchRequestHandlerBase : AbstractHandlers.Request, ILaunchRequestHandler where T : LaunchRequestArguments + { + } + + public partial interface ILaunchRequestHandler : ILaunchRequestHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class LaunchRequestHandlerBase : LaunchRequestHandlerBase, ILaunchRequestHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class LaunchRequestExtensions + { + public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("launch", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("launch", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : LaunchRequestArguments => registry.AddHandler("launch", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnLaunchRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : LaunchRequestArguments => registry.AddHandler("launch", RequestHandler.For(handler)); + public static Task LaunchRequest(this IDebugAdapterClient mediator, LaunchRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt new file mode 100644 index 000000000..c8d6fe2aa --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt @@ -0,0 +1,59 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; +using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.DebugAdapter.Protocol.Server; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ + [Method("attach", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IAttachRequestHandler : IJsonRpcRequestHandler where T : AttachRequestArguments + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class AttachRequestHandlerBase : AbstractHandlers.Request, IAttachRequestHandler where T : AttachRequestArguments + { + } + + public partial interface IAttachRequestHandler : IAttachRequestHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class AttachRequestHandlerBase : AttachRequestHandlerBase, IAttachRequestHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class AttachRequestExtensions + { + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : AttachRequestArguments => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : AttachRequestArguments => registry.AddHandler("attach", RequestHandler.For(handler)); + public static Task AttachRequest(this IDebugAdapterClient mediator, AttachRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt new file mode 100644 index 000000000..bb407fc31 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt @@ -0,0 +1,59 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; +using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.DebugAdapter.Protocol.Server; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ + [Method("attach", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IAttachRequestHandler : IJsonRpcRequestHandler where T : AttachRequestArguments + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class AttachRequestHandlerBase : AbstractHandlers.Request, IAttachRequestHandler where T : AttachRequestArguments + { + } + + public partial interface IAttachRequestHandler : IAttachRequestHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class AttachRequestHandlerBase : AttachRequestHandlerBase, IAttachRequestHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Bogus +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class AttachRequestExtensions + { + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : AttachRequestArguments => registry.AddHandler("attach", RequestHandler.For(handler)); + public static IDebugAdapterServerRegistry OnAttachRequest(this IDebugAdapterServerRegistry registry, Func> handler) + where T : AttachRequestArguments => registry.AddHandler("attach", RequestHandler.For(handler)); + public static Task AttachRequest(this IDebugAdapterClient mediator, AttachRequestArguments request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt new file mode 100644 index 000000000..7338bcc42 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt @@ -0,0 +1,31 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Test; + +namespace Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class LanguageProtocolInitializeExtensions + { + public static ILanguageServerRegistry OnLanguageProtocolInitialize(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(GeneralNames.Initialize, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnLanguageProtocolInitialize(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(GeneralNames.Initialize, RequestHandler.For(handler)); + public static Task RequestLanguageProtocolInitialize(this ITextDocumentLanguageClient mediator, InitializeParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt new file mode 100644 index 000000000..2e3c4907c --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt @@ -0,0 +1,63 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Serial, Method(WorkspaceNames.ExecuteCommand, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IExecuteCommandHandler : IJsonRpcRequestHandler, T>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class ExecuteCommandHandlerBase : AbstractHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>, IExecuteCommandHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class ExecuteCommandExtensions1 + { + public static ILanguageServerRegistry OnExecuteCommand(this ILanguageServerRegistry registry, Func, Task> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.ExecuteCommand, new LanguageProtocolDelegatingHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>(HandlerAdapter.Adapt, T>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnExecuteCommand(this ILanguageServerRegistry registry, Func, CancellationToken, Task> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.ExecuteCommand, new LanguageProtocolDelegatingHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>(HandlerAdapter.Adapt, T>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnExecuteCommand(this ILanguageServerRegistry registry, Func, ExecuteCommandCapability, CancellationToken, Task> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.ExecuteCommand, new LanguageProtocolDelegatingHandlers.Request, T, ExecuteCommandRegistrationOptions, ExecuteCommandCapability>(HandlerAdapter.Adapt, T>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static Task ExecuteCommand(this IWorkspaceLanguageClient mediator, ExecuteCommandParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task ExecuteCommand(this ILanguageClient mediator, ExecuteCommandParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt new file mode 100644 index 000000000..c332f2f34 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt @@ -0,0 +1,32 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Client; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.DebugAdapter.Protocol.Server; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class CapabilitiesExtensions + { + public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Action handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); + public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Func handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); + public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Action handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); + public static IDebugAdapterClientRegistry OnCapabilities(this IDebugAdapterClientRegistry registry, Func handler) => registry.AddHandler(EventNames.Capabilities, NotificationHandler.For(handler)); + public static void SendCapabilities(this IDebugAdapterServer mediator, CapabilitiesEvent request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt new file mode 100644 index 000000000..c6a4389c7 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt @@ -0,0 +1,60 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class DidChangeTextDocumentExtensions + { + public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDidChangeTextDocument(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.DidChange, new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static void DidChangeTextDocument(this ILanguageClient mediator, DidChangeTextDocumentParams request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt new file mode 100644 index 000000000..3010363c9 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt @@ -0,0 +1,34 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class ExitExtensions + { + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static void SendExit(this ILanguageClient mediator, ExitParams request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt new file mode 100644 index 000000000..8b22ac216 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt @@ -0,0 +1,62 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class FoldingRangeExtensions + { + public static ILanguageServerRegistry OnFoldingRange(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.FoldingRange, new LanguageProtocolDelegatingHandlers.Request, FoldingRangeRegistrationOptions, FoldingRangeCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnFoldingRange(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.FoldingRange, new LanguageProtocolDelegatingHandlers.Request, FoldingRangeRegistrationOptions, FoldingRangeCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnFoldingRange(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.FoldingRange, new LanguageProtocolDelegatingHandlers.Request, FoldingRangeRegistrationOptions, FoldingRangeCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveFoldingRange(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.FoldingRange, _ => new LanguageProtocolDelegatingHandlers.PartialResults, FoldingRange, FoldingRangeRegistrationOptions, FoldingRangeCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveFoldingRange(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.FoldingRange, _ => new LanguageProtocolDelegatingHandlers.PartialResults, FoldingRange, FoldingRangeRegistrationOptions, FoldingRangeCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveFoldingRange(this ILanguageServerRegistry registry, Action>, FoldingRangeCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.FoldingRange, _ => new LanguageProtocolDelegatingHandlers.PartialResults, FoldingRange, FoldingRangeRegistrationOptions, FoldingRangeCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container> RequestFoldingRange(this ITextDocumentLanguageClient mediator, FoldingRangeRequestParam request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + public static IRequestProgressObservable, Container> RequestFoldingRange(this ILanguageClient mediator, FoldingRangeRequestParam request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt new file mode 100644 index 000000000..78415af70 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt @@ -0,0 +1,33 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Test; + +namespace Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class ExitExtensions + { + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Action handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static ILanguageServerRegistry OnExit(this ILanguageServerRegistry registry, Func handler) => registry.AddHandler(GeneralNames.Exit, NotificationHandler.For(handler)); + public static void SendExit(this ILanguageClient mediator, ExitParams request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt new file mode 100644 index 000000000..ef6fe9dde --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt @@ -0,0 +1,61 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Test; + +namespace Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class DefinitionExtensions + { + public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); + } + + public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); + } + + public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, DefinitionCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); + } + + public static IRequestProgressObservable, LocationOrLocationLinks> RequestDefinition(this ITextDocumentLanguageClient mediator, DefinitionParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, LocationOrLocationLinks.From, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt new file mode 100644 index 000000000..676c48fd3 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt @@ -0,0 +1,61 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute, Obsolete("This is obsolete")] + public static partial class DefinitionExtensions + { + public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDefinition(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); + } + + public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); + } + + public static ILanguageServerRegistry ObserveDefinition(this ILanguageServerRegistry registry, Action>, DefinitionCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Definition, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), LocationOrLocationLinks.From)); + } + + public static IRequestProgressObservable, LocationOrLocationLinks> RequestDefinition(this ILanguageClient mediator, DefinitionParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, LocationOrLocationLinks.From, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt new file mode 100644 index 000000000..eb10b6688 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt @@ -0,0 +1,67 @@ +ο»Ώusing MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Bogus; +using OmniSharp.Extensions.LanguageServer.Protocol.Bogus.Handlers; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using RenameCapability = OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.RenameCapability; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using ITextDocumentIdentifierParams = OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentIdentifierParams; +using RenameRegistrationOptions = OmniSharp.Extensions.LanguageServer.Protocol.Models.RenameRegistrationOptions; +using WorkspaceEdit = OmniSharp.Extensions.LanguageServer.Protocol.Models.WorkspaceEdit; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Bogus.Handlers +{ + [Parallel, Method(TextDocumentNames.Rename, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IRenameHandler : IJsonRpcRequestHandler, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class RenameHandlerBase : AbstractHandlers.Request, IRenameHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Bogus.Handlers +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class RenameExtensions + { + public static ILanguageServerRegistry OnRename(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Rename, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnRename(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Rename, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnRename(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.Rename, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static Task RequestRename(this ITextDocumentLanguageClient mediator, RenameParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task RequestRename(this ILanguageClient mediator, RenameParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt new file mode 100644 index 000000000..30be59b44 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt @@ -0,0 +1,624 @@ +ο»Ώ{ + RegistrationOptionsGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.RegistrationOptionsGenerator/UnitTestRegistrationOptions.cs +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [RegistrationOptionsKey("unitTestDiscovery")] + [RegistrationOptionsConverterAttribute(typeof(UnitTestRegistrationOptionsConverter))] + public partial class UnitTestRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + + class UnitTestRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + public UnitTestRegistrationOptionsConverter() + { + } + + public override StaticOptions Convert(UnitTestRegistrationOptions source) + { + return new StaticOptions{SupportsDebugging = source.SupportsDebugging, WorkDoneProgress = source.WorkDoneProgress}; + } + } + + [RegistrationOptionsKey("unitTestDiscovery")] + public partial class StaticOptions : IWorkDoneProgressOptions + { + [Optional] + public bool SupportsDebugging { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore + + ], + StronglyTypedGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + ], + GenerateHandlerMethodsGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/UnitTest.cs +using Lsp.Tests.Integration.Fixtures; +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IUnitTestHandler : IJsonRpcNotificationHandler, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class UnitTestHandlerBase : AbstractHandlers.Notification, IUnitTestHandler + { + } +} +#nullable restore + +namespace Lsp.Tests.Integration.Fixtures +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class UnitTestExtensions + { + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static void SendUnitTest(this ILanguageClient mediator, UnitTest request) => mediator.SendNotification(request); + } +#nullable restore +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/DiscoverUnitTestsParams.cs +using Lsp.Tests.Integration.Fixtures; +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IDiscoverUnitTestsHandler : IJsonRpcRequestHandler>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class DiscoverUnitTestsHandlerBase : AbstractHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class DiscoverUnitTestsPartialHandlerBase : AbstractHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler + { + protected DiscoverUnitTestsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + } + } +} +#nullable restore + +namespace Lsp.Tests.Integration.Fixtures +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class DiscoverUnitTestsExtensions + { + public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, UnitTestCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container> RequestDiscoverUnitTests(this ILanguageClient mediator, DiscoverUnitTestsParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} + ], + AutoImplementParamsGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + ], + AssemblyCapabilityKeyAttributeGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AssemblyCapabilityKeyAttributeGenerator/AssemblyCapabilityKeys.cs +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +[assembly: AssemblyCapabilityKey(typeof(Lsp.Tests.Integration.Fixtures.UnitTestCapability), "workspace", "unitTests")] + ], + AssemblyJsonRpcHandlersAttributeGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + ], + EnumLikeStringGenerator: [ +//HintName: Test0.cs + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class UnitTest : IRequest + { + public string Name { get; set; } = null!; + } + + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [ + GenerateHandler, + GenerateHandlerMethods(typeof(ILanguageServerRegistry)), + GenerateRequestMethods(typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] + public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams + { + public ProgressToken? PartialResultToken { get; set; } = null!; + public ProgressToken? WorkDoneToken { get; set; } = null!; + } + + [CapabilityKey("workspace", "unitTests")] + public partial class UnitTestCapability : DynamicCapability + { + public string Property { get; set; } = null!; + } + + [GenerateRegistrationOptions("unitTestDiscovery")] + public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions + { + [Optional] public bool SupportsDebugging { get; set; } + } +} +#nullable restore + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt new file mode 100644 index 000000000..3b3df7fc7 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt @@ -0,0 +1,484 @@ +ο»Ώ{ + RegistrationOptionsGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + ], + StronglyTypedGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.StronglyTypedGenerator/RegistrationContainer.cs +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial class RegistrationContainer : ContainerBase + { + public RegistrationContainer() : this(Enumerable.Empty()) + { + } + + public RegistrationContainer(IEnumerable items) : base(items) + { + } + + public RegistrationContainer(params Registration[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(IEnumerable? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (Registration[] items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(params Registration[] items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (Collection? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(Collection? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (List? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(List? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (in ImmutableArray? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(in ImmutableArray? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (ImmutableList? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(ImmutableList? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + } +} +#nullable restore + + ], + GenerateHandlerMethodsGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/RegistrationParams.cs +using Lsp.Tests.Integration.Fixtures; +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client +{ + [Parallel, Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IRegisterCapabilityHandler : IJsonRpcRequestHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class RegisterCapabilityHandlerBase : AbstractHandlers.Request, IRegisterCapabilityHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class RegisterCapabilityExtensions + { + public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); + public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); + } +#nullable restore +} + ], + AutoImplementParamsGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + ], + AssemblyCapabilityKeyAttributeGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + ], + AssemblyJsonRpcHandlersAttributeGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + ], + EnumLikeStringGenerator: [ +//HintName: Test0.cs + +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ + +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel] + [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [ + GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), + GenerateHandlerMethods(typeof(ILanguageClientRegistry), + GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) + ] + public class RegistrationParams : IJsonRpcRequest + { + public RegistrationContainer Registrations { get; set; } = null!; + } + + /// + /// General parameters to to regsiter for a capability. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public partial class Registration + { + } +} +#nullable restore + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt new file mode 100644 index 000000000..e652fd4a5 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt @@ -0,0 +1,2213 @@ +ο»Ώ{ + RegistrationOptionsGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.RegistrationOptionsGenerator/WorkspaceSymbolRegistrationOptions.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using OmniSharp.Extensions.LanguageServer.Protocol; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + public partial class StaticOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore + + ], + StronglyTypedGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + ], + GenerateHandlerMethodsGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/SymbolInformationParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface ISymbolInformationHandler : IJsonRpcRequestHandler?>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SymbolInformationHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, ISymbolInformationHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SymbolInformationPartialHandlerBase : AbstractHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, ISymbolInformationHandler + { + protected SymbolInformationPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + } + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class SymbolInformationExtensions + { + public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container?> RequestSymbolInformation(this ITextDocumentLanguageClient mediator, SymbolInformationParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + public static IRequestProgressObservable, Container?> RequestSymbolInformation(this ILanguageClient mediator, SymbolInformationParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/WorkspaceSymbolParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IWorkspaceSymbolsHandler : IJsonRpcRequestHandler?>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class WorkspaceSymbolsHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class WorkspaceSymbolsPartialHandlerBase : AbstractHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler + { + protected WorkspaceSymbolsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + } + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class WorkspaceSymbolsExtensions + { + public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ITextDocumentLanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ILanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/WorkspaceSymbol.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Parallel, Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IWorkspaceSymbolResolveHandler : IJsonRpcRequestHandler, ICapability + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class WorkspaceSymbolResolveHandlerBase : AbstractHandlers.RequestCapability, IWorkspaceSymbolResolveHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class WorkspaceSymbolResolveExtensions + { + public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, new LanguageProtocolDelegatingHandlers.RequestCapability(HandlerAdapter.Adapt(handler))); + public static Task ResolveWorkspaceSymbol(this IWorkspaceLanguageClient mediator, WorkspaceSymbol request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task ResolveWorkspaceSymbol(this ILanguageClient mediator, WorkspaceSymbol request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} + ], + AutoImplementParamsGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AutoImplementParamsGenerator/Test0_SymbolInformationParams.cs +#nullable enable +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + public partial record SymbolInformationParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + + [Optional] + public ProgressToken? PartialResultToken { get; init; } + } +} +#nullable restore + + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AutoImplementParamsGenerator/Test0_WorkspaceSymbolParams.cs +#nullable enable +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + public partial record WorkspaceSymbolParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + + [Optional] + public ProgressToken? PartialResultToken { get; init; } + } +} +#nullable restore + + ], + AssemblyCapabilityKeyAttributeGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + +//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AssemblyCapabilityKeyAttributeGenerator/AssemblyCapabilityKeys.cs +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System.Diagnostics; + +[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + ], + AssemblyJsonRpcHandlersAttributeGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + ], + EnumLikeStringGenerator: [ +//HintName: Test0.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol +{ + namespace Models + { + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + /// + /// The parameters of a Workspace Symbol Request. + /// + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams + { + /// + /// A non-empty query string + /// + public string Query { get; init; } + } + + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public partial record SymbolInformation + { + /// + /// The name of this symbol. + /// + public string Name { get; init; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; init; } + + /// + /// Tags for this completion item. + /// + /// @since 3.16.0 + /// + [Optional] + public Container? Tags { get; init; } + + /// + /// Indicates if this item is deprecated. + /// + [Optional] + public bool Deprecated { get; init; } + + /// + /// The location of this symbol. + /// + public Location Location { get; init; } + + /// + /// The name of the symbol containing this symbol. + /// + [Optional] + public string? ContainerName { get; init; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + /// + /// A special workspace symbol that supports locations without a range + /// + /// @since 3.17.0 - proposed state + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] + [Capability(typeof(WorkspaceSymbolCapability))] + public partial record WorkspaceSymbol : IRequest + { + /// + /// The name of this symbol. + /// + public string Name { get; set; } + + /// + /// The kind of this symbol. + /// + public SymbolKind Kind { get; set; } + + /// + /// Tags for this completion item. + /// + [Optional] + public Container? Tags { get; set; } + + /// + /// The location of this symbol. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + /// + [Optional] + public string? ContainerName { get; set; } + + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] + [RegistrationName(WorkspaceNames.WorkspaceSymbol)] + public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + public partial class WorkspaceSymbolCapability : DynamicCapability // + { + /// + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + /// + [Optional] + public SymbolKindCapabilityOptions? SymbolKind { get; set; } + + /// + /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + [Optional] + public Supports TagSupport { get; set; } + + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + [Optional] + public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } + } + + /// + /// The client supports tags on `SymbolInformation`.Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + /// + public class TagSupportCapabilityOptions + { + /// + /// The tags supported by the client. + /// + public Container ValueSet { get; set; } = null!; + } + + /// + /// Specific capabilities for the `SymbolKind`. + /// + public class SymbolKindCapabilityOptions + { + /// + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + /// + [Optional] + public Container? ValueSet { get; set; } + } + + /// + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 - proposedState + /// + public partial class ResolveSupportCapabilityOptions + { + /// + /// The properties that a client can resolve lazily. Usually + /// `location.range` + /// + public Container Properties { get; set; } = new(); + } + } +} + ] +} \ No newline at end of file diff --git a/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs b/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs index f7787981d..c4352d021 100644 --- a/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs +++ b/test/Lsp.Integration.Tests/DynamicRegistrationTests.cs @@ -59,7 +59,7 @@ public async Task Should_Register_Dynamically_While_Server_Is_Running() (@params, token) => Task.FromResult(new CompletionList()), (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("vb") + DocumentSelector = TextDocumentSelector.ForLanguage("vb") } ) ); @@ -109,7 +109,7 @@ public async Task Should_Unregister_Dynamically_While_Server_Is_Running() (@params, token) => Task.FromResult(new CompletionList()), (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("vb") + DocumentSelector = TextDocumentSelector.ForLanguage("vb") } ) ); @@ -163,18 +163,18 @@ await TestHelper.DelayUntil( client.RegistrationManager.CurrentRegistrations.Should().ContainSingle(x => x.Method == TextDocumentNames.SemanticTokensRegistration); } - private bool SelectorMatches(Registration registration, Func documentFilter) + private bool SelectorMatches(Registration registration, Func documentFilter) { return SelectorMatches(registration.RegisterOptions!, documentFilter); } - private bool SelectorMatches(object options, Func documentFilter) + private bool SelectorMatches(object options, Func documentFilter) { if (options is Registration registration) return SelectorMatches(registration.RegisterOptions!, documentFilter); if (options is ITextDocumentRegistrationOptions tdro) return tdro.DocumentSelector?.Any(documentFilter) == true; - if (options is DocumentSelector selector) + if (options is TextDocumentSelector selector) return selector.Any(documentFilter); return false; } @@ -206,7 +206,7 @@ public async Task Should_Gather_Static_Registrations() Legend = new SemanticTokensLegend(), Full = new SemanticTokensCapabilityRequestFull { Delta = true }, Range = new SemanticTokensCapabilityRequestRange(), - DocumentSelector = DocumentSelector.ForLanguage("csharp") + DocumentSelector = TextDocumentSelector.ForLanguage("csharp") }; // Our server only statically registers when it detects a server that does not support dynamic capabilities @@ -364,7 +364,7 @@ public void Configure(LanguageServerOptions options) (@params, token) => Task.FromResult(new CompletionList()), (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp"), + DocumentSelector = TextDocumentSelector.ForLanguage("csharp"), ResolveProvider = true, TriggerCharacters = new Container("a", "b"), AllCommitCharacters = new Container("1", "2"), diff --git a/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs b/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs index bba67f668..cbb682d93 100644 --- a/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs +++ b/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs @@ -14,7 +14,7 @@ public static EquivalencyAssertionOptions ConfigureForSupports(this Equiva return options .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) .ComparingByMembers>() - .ComparingByMembers>() + .ComparingByMembers>() .ComparingByMembers>() .ComparingByMembers>() .ComparingByMembers>() diff --git a/test/Lsp.Integration.Tests/MonikerTests.cs b/test/Lsp.Integration.Tests/MonikerTests.cs index cfaee34c7..a72c6ef04 100644 --- a/test/Lsp.Integration.Tests/MonikerTests.cs +++ b/test/Lsp.Integration.Tests/MonikerTests.cs @@ -55,7 +55,7 @@ private void ServerOptionsAction(LanguageServerOptions obj) obj.OnMoniker( _request, (_, _) => new MonikerRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp"), + DocumentSelector = TextDocumentSelector.ForLanguage("csharp"), } ); } diff --git a/test/Lsp.Integration.Tests/RenameTests.cs b/test/Lsp.Integration.Tests/RenameTests.cs index 7c4d6be93..d6128fc5e 100644 --- a/test/Lsp.Integration.Tests/RenameTests.cs +++ b/test/Lsp.Integration.Tests/RenameTests.cs @@ -228,13 +228,13 @@ private void ServerOptionsAction(LanguageServerOptions obj) obj.OnPrepareRename( _prepareRename, (_, _) => new RenameRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp") + DocumentSelector = TextDocumentSelector.ForLanguage("csharp") } ); obj.OnRename( _rename, (_, _) => new RenameRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("csharp"), + DocumentSelector = TextDocumentSelector.ForLanguage("csharp"), PrepareProvider = true, } ); diff --git a/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs b/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs index 3da1c2560..1209b0bf9 100644 --- a/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs +++ b/test/Lsp.Integration.Tests/TypedCallHierarchyTests.cs @@ -63,7 +63,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() outgoingHandlerA, (_, _) => new() { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -85,7 +85,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() outgoingHandlerB, (_, _) => new() { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); } @@ -144,7 +144,7 @@ public async Task Should_Resolve_With_Data_Capability() outgoingHandler, (_, _) => new() { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); } diff --git a/test/Lsp.Integration.Tests/TypedCodeActionTests.cs b/test/Lsp.Integration.Tests/TypedCodeActionTests.cs index d155a5a4b..d626e33eb 100644 --- a/test/Lsp.Integration.Tests/TypedCodeActionTests.cs +++ b/test/Lsp.Integration.Tests/TypedCodeActionTests.cs @@ -66,7 +66,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-a" } }); }, (_, _) => new CodeActionRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -95,7 +95,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-b" } }); }, (_, _) => new CodeActionRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -120,7 +120,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-c" } }); }, (_, _) => new CodeActionRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -145,7 +145,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() action => { return Task.FromResult(action with { Command = action.Command with { Name = "resolved-d" } }); }, (_, _) => new CodeActionRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("vb") + DocumentSelector = TextDocumentSelector.ForLanguage("vb") } ); } diff --git a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs index 0737fd0fa..8b5f5c41d 100644 --- a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs +++ b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs @@ -64,7 +64,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-a" } }); }, (_, _) => new CodeLensRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -91,7 +91,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-b" } }); }, (_, _) => new CodeLensRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -114,7 +114,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-c" } }); }, (_, _) => new CodeLensRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -137,7 +137,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-d" } }); }, (_, _) => new CodeLensRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("vb") + DocumentSelector = TextDocumentSelector.ForLanguage("vb") } ); } diff --git a/test/Lsp.Integration.Tests/TypedCompletionTests.cs b/test/Lsp.Integration.Tests/TypedCompletionTests.cs index 61cc6faaa..95120baeb 100644 --- a/test/Lsp.Integration.Tests/TypedCompletionTests.cs +++ b/test/Lsp.Integration.Tests/TypedCompletionTests.cs @@ -64,7 +64,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-a" } }); }, (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -91,7 +91,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-b" } }); }, (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -114,7 +114,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-c" } }); }, (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -137,7 +137,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() completionItem => { return Task.FromResult(completionItem with { Command = completionItem.Command with { Name = "resolved-d" } }); }, (_, _) => new CompletionRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("vb") + DocumentSelector = TextDocumentSelector.ForLanguage("vb") } ); } @@ -222,9 +222,24 @@ public async Task Should_Resolve_With_Partial_Data_Capability() options => { }, options => { options.ObserveCompletion( + (completionParams, token) => Task.FromResult( + new CompletionList() + { + ItemDefaults = new CompletionListItemDefaults() + { + InsertTextMode = InsertTextMode.AsIs, + EditRange = new Range() + { + End = new Position(0, 1) + }, + CommitCharacters = new Container("a", "b", "c"), + Data = JObject.FromObject(new { Test = 1 }) + } + } + ), (completionParams, observer, capability, token) => { - var a = new CompletionList( + var a = new Container>( new CompletionItem { Command = new Command @@ -260,6 +275,8 @@ public async Task Should_Resolve_With_Partial_Data_Capability() ); var completionList = await client.RequestCompletion(new CompletionParams()); + completionList.ItemDefaults.Should().NotBeNull(); + completionList.ItemDefaults.CommitCharacters.Should().ContainInOrder("a", "b", "c"); var item = completionList.First(); item = await client.ResolveCompletion(item); @@ -324,9 +341,10 @@ public async Task Should_Resolve_With_Partial_Data_CancellationToken() options => { }, options => { options.ObserveCompletion( + (completionParams, token) => Task.FromResult(new CompletionList()), (completionParams, observer, token) => { - var a = new CompletionList( + var a = new Container>( new CompletionItem { Command = new Command @@ -425,9 +443,10 @@ public async Task Should_Resolve_With_Partial_Data() options => { }, options => { options.ObserveCompletion( + (completionParams) => Task.FromResult(new CompletionList()), (completionParams, observer) => { - var a = new CompletionList( + var a = new Container>( new CompletionItem { Command = new Command @@ -512,9 +531,10 @@ public async Task Should_Resolve_Partial_Capability() options => { }, options => { options.ObserveCompletion( + (completionParams, token) => Task.FromResult(new CompletionList()), (completionParams, observer, capability, token) => { - var a = new CompletionList( + var a = new Container( new CompletionItem { Command = new Command @@ -583,9 +603,10 @@ public async Task Should_Resolve_Partial_CancellationToken() options => { }, options => { options.ObserveCompletion( + (completionParams, token) => Task.FromResult(new CompletionList()), (completionParams, observer, token) => { - var a = new CompletionList( + var a = new Container( new CompletionItem { Command = new Command @@ -654,9 +675,10 @@ public async Task Should_Resolve_Partial() options => { }, options => { options.ObserveCompletion( + (completionParams) => Task.FromResult(new CompletionList()), (completionParams, observer) => { - var a = new CompletionList( + var a = new Container( new CompletionItem { Command = new Command diff --git a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs index 2ea362015..c0fcc0037 100644 --- a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs +++ b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs @@ -59,7 +59,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-a" }); }, (_, _) => new DocumentLinkRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -82,7 +82,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-b" }); }, (_, _) => new DocumentLinkRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -101,7 +101,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-c" }); }, (_, _) => new DocumentLinkRegistrationOptions { - DocumentSelector = DocumentSelector.ForPattern("**/*.cs") + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") } ); @@ -120,7 +120,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() documentLink => { return Task.FromResult(documentLink with { Tooltip = "resolved-d" }); }, (_, _) => new DocumentLinkRegistrationOptions { - DocumentSelector = DocumentSelector.ForLanguage("vb") + DocumentSelector = TextDocumentSelector.ForLanguage("vb") } ); } diff --git a/test/Lsp.Tests/Capabilities/Client/ClientCapabilitiesTests.cs b/test/Lsp.Tests/Capabilities/Client/ClientCapabilitiesTests.cs index 3741dc966..0d01e9426 100644 --- a/test/Lsp.Tests/Capabilities/Client/ClientCapabilitiesTests.cs +++ b/test/Lsp.Tests/Capabilities/Client/ClientCapabilitiesTests.cs @@ -55,7 +55,7 @@ public void SimpleTest(string expected) DynamicRegistration = true, LinkSupport = true }, - Synchronization = new SynchronizationCapability { + Synchronization = new TextSynchronizationCapability { DynamicRegistration = true, WillSave = true, DidSave = true, diff --git a/test/Lsp.Tests/Capabilities/Client/SynchronizationCapabilityTests.cs b/test/Lsp.Tests/Capabilities/Client/SynchronizationCapabilityTests.cs index df9269189..0b21cabe3 100644 --- a/test/Lsp.Tests/Capabilities/Client/SynchronizationCapabilityTests.cs +++ b/test/Lsp.Tests/Capabilities/Client/SynchronizationCapabilityTests.cs @@ -12,7 +12,7 @@ public class SynchronizationCapabilityTests [JsonFixture] public void SimpleTest(string expected) { - var model = new SynchronizationCapability { + var model = new TextSynchronizationCapability { WillSave = false, WillSaveWaitUntil = false, DidSave = false, @@ -22,7 +22,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } } diff --git a/test/Lsp.Tests/Capabilities/Client/TextDocumentClientCapabilitiesTests.cs b/test/Lsp.Tests/Capabilities/Client/TextDocumentClientCapabilitiesTests.cs index faa8c4286..d4c3b623b 100644 --- a/test/Lsp.Tests/Capabilities/Client/TextDocumentClientCapabilitiesTests.cs +++ b/test/Lsp.Tests/Capabilities/Client/TextDocumentClientCapabilitiesTests.cs @@ -38,7 +38,7 @@ public void SimpleTest(string expected) SnippetSupport = true } }, - Synchronization = new SynchronizationCapability { + Synchronization = new TextSynchronizationCapability { DynamicRegistration = true, WillSave = true, DidSave = true, diff --git a/test/Lsp.Tests/ClientCapabilityProviderTests.cs b/test/Lsp.Tests/ClientCapabilityProviderTests.cs index 4168c7d8d..a7509f88f 100644 --- a/test/Lsp.Tests/ClientCapabilityProviderTests.cs +++ b/test/Lsp.Tests/ClientCapabilityProviderTests.cs @@ -32,7 +32,7 @@ public class ClientCapabilityProviderTests public void Should_AllowSupportedCapabilities(IJsonRpcHandler handler, object instance) { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var collection = new SharedHandlerCollection( @@ -77,7 +77,7 @@ public void Should_AllowSupportedCapabilities(IJsonRpcHandler handler, object in public void Should_AllowUnsupportedCapabilities(IJsonRpcHandler handler, object instance) { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var collection = new SharedHandlerCollection( @@ -115,7 +115,7 @@ public void Should_AllowUnsupportedCapabilities(IJsonRpcHandler handler, object public void Should_AllowNullSupportedCapabilities(IJsonRpcHandler handler, object instance) { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var collection = new SharedHandlerCollection( @@ -154,7 +154,7 @@ public void Should_AllowNullSupportedCapabilities(IJsonRpcHandler handler, objec public void Should_DisallowDynamicSupportedCapabilities(IJsonRpcHandler handler, object instance) { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var collection = new SharedHandlerCollection( @@ -194,7 +194,7 @@ public void Should_DisallowDynamicSupportedCapabilities(IJsonRpcHandler handler, public void Should_Handle_Mixed_Capabilities() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var codeActionHandler = Substitute.For(); var definitionHandler = Substitute.For(); @@ -243,7 +243,7 @@ public void Should_Handle_Mixed_Capabilities() public void GH162_TextDocumentSync_Should_Work_Without_WillSave_Or_WillSaveWaitUntil() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var collection = new SharedHandlerCollection( @@ -263,7 +263,7 @@ public void GH162_TextDocumentSync_Should_Work_Without_WillSave_Or_WillSaveWaitU { TextDocument = new TextDocumentClientCapabilities { - Synchronization = new SynchronizationCapability + Synchronization = new TextSynchronizationCapability { DidSave = true, DynamicRegistration = false, @@ -280,7 +280,7 @@ public void GH162_TextDocumentSync_Should_Work_Without_WillSave_Or_WillSaveWaitU public void GH162_TextDocumentSync_Should_Work_With_WillSave_Or_WillSaveWaitUntil() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var willSaveTextDocumentHandler = Substitute.For(); var willSaveWaitUntilTextDocumentHandler = Substitute.For(); var didSaveTextDocumentHandler = Substitute.For(); @@ -306,7 +306,7 @@ public void GH162_TextDocumentSync_Should_Work_With_WillSave_Or_WillSaveWaitUnti { TextDocument = new TextDocumentClientCapabilities { - Synchronization = new SynchronizationCapability + Synchronization = new TextSynchronizationCapability { DidSave = true, DynamicRegistration = false, diff --git a/test/Lsp.Tests/FluentAssertionsExtensions.cs b/test/Lsp.Tests/FluentAssertionsExtensions.cs index abfc4ba60..7378b1acc 100644 --- a/test/Lsp.Tests/FluentAssertionsExtensions.cs +++ b/test/Lsp.Tests/FluentAssertionsExtensions.cs @@ -14,7 +14,7 @@ public static EquivalencyAssertionOptions ConfigureForSupports(this Equiva return options .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) .ComparingByMembers>() - .ComparingByMembers>() + .ComparingByMembers>() .ComparingByMembers>() .ComparingByMembers>() .ComparingByMembers>() diff --git a/test/Lsp.Tests/FoundationTests.cs b/test/Lsp.Tests/FoundationTests.cs index 88d01deee..9d728f846 100644 --- a/test/Lsp.Tests/FoundationTests.cs +++ b/test/Lsp.Tests/FoundationTests.cs @@ -392,6 +392,7 @@ Func ForAnyParameter(Func m) var returns = ForAnyParameter(info => info.ParameterType.GetGenericArguments().LastOrDefault() == returnType); var isAction = ForAnyParameter(info => info.ParameterType.Name.StartsWith(nameof(Action))); var isFunc = ForAnyParameter(info => info.ParameterType.Name.StartsWith("Func")); + var takesParameter = ForAnyParameter(info => info.ParameterType.GetGenericArguments().FirstOrDefault() == descriptor.ParamsType); var takesCapability = ForAnyParameter(info => info.ParameterType.GetGenericArguments().Skip(1).FirstOrDefault() == descriptor.CapabilityType); @@ -522,6 +523,7 @@ Func ForAnyParameter(Func m) Func isAction = info => info.ReturnType.Name == "Void"; Func takesParameter = info => info.GetParameters().Skip(1).Any(z => z.ParameterType == descriptor.ParamsType); + if (!TypeHandlerExtensionData.HandlersToSkip.All(z => descriptor.HandlerType != z)) return; if (descriptor.IsRequest && descriptor.HasPartialItems) { Func partialReturnType = info => @@ -688,7 +690,7 @@ public HandlersShouldHaveMethodAttributeData() { foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes.Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) - .Except(new[] { typeof(ITextDocumentSyncHandler) }) + .Except(new[] { typeof(ITextDocumentSyncHandler), typeof(INotebookDocumentSyncHandler) }) ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; @@ -731,7 +733,7 @@ public TypeHandlerData() ); foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes.Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) - .Except(new[] { typeof(ITextDocumentSyncHandler), typeof(IExecuteCommandHandler<>) }) + .Except(new[] { typeof(ITextDocumentSyncHandler), typeof(INotebookDocumentSyncHandler), typeof(IExecuteCommandHandler<>) }) ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; @@ -747,7 +749,10 @@ public class TypeHandlerExtensionData : TheoryData z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) - .Except(new[] { typeof(ITextDocumentSyncHandler) }) + .Except(new[] { typeof(ITextDocumentSyncHandler) , typeof(INotebookDocumentSyncHandler)}) ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; diff --git a/test/Lsp.Tests/HandlerResolverTests.cs b/test/Lsp.Tests/HandlerResolverTests.cs index 6273d6259..e311e6601 100644 --- a/test/Lsp.Tests/HandlerResolverTests.cs +++ b/test/Lsp.Tests/HandlerResolverTests.cs @@ -68,7 +68,7 @@ public void Should_Contain_AllDefinedTextDocumentSyncMethods(string key, int cou var handler = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider(new [] { typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly })); handler.Initialize(); - var sub = (IJsonRpcHandler) TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.something"), "csharp"); + var sub = (IJsonRpcHandler) TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.something"), "csharp"); handler.Add(sub); handler.Should().Contain(x => x.Method == key); @@ -133,9 +133,9 @@ public void Should_Contain_AllDefinedMethods_ForDifferentKeys(string key, int co var handler = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, new TextDocumentIdentifiers(), Substitute.For(), new LspHandlerTypeDescriptorProvider(new [] { typeof(FoundationTests).Assembly, typeof(LanguageServer).Assembly, typeof(LanguageClient).Assembly, typeof(IRegistrationManager).Assembly, typeof(LspRequestRouter).Assembly })); handler.Initialize(); - var sub = TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + var sub = TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); - var sub2 = TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cake"), "csharp"); + var sub2 = TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cake"), "csharp"); handler.Add(sub); handler.Add(sub2); @@ -155,7 +155,7 @@ public void Should_Contain_AllDefinedMethods_OnLanguageServer(Type requestHandle reg.GetRegistrationOptions(Arg.Any()) .Returns( new TextDocumentSyncRegistrationOptions() { - DocumentSelector = new DocumentSelector() + DocumentSelector = new TextDocumentSelector() } ); handler.Add(sub); @@ -176,7 +176,7 @@ public void Should_Contain_AllDefinedMethods_OnLanguageServer_WithDifferentKeys( reg.GetRegistrationOptions(Arg.Any()) .Returns( new TextDocumentSyncRegistrationOptions { - DocumentSelector = new DocumentSelector() + DocumentSelector = new TextDocumentSelector() } ); var sub2 = (IJsonRpcHandler) Substitute.For(new[] { requestHandler, type2 }, new object[0]); @@ -184,7 +184,7 @@ public void Should_Contain_AllDefinedMethods_OnLanguageServer_WithDifferentKeys( reg2.GetRegistrationOptions(Arg.Any()) .Returns( new TextDocumentSyncRegistrationOptions { - DocumentSelector = new DocumentSelector() + DocumentSelector = new TextDocumentSelector() } ); handler.Add(sub); @@ -232,7 +232,7 @@ public void Should_DealWithClassesThatImplementMultipleHandlers_BySettingKeyAcco ( (ICodeLensHandler) codeLensHandler ).GetRegistrationOptions(Arg.Any(), Arg.Any()) .Returns( new CodeLensRegistrationOptions { - DocumentSelector = new DocumentSelector(DocumentFilter.ForLanguage("foo")) + DocumentSelector = new TextDocumentSelector(TextDocumentFilter.ForLanguage("foo")) } ); @@ -251,7 +251,7 @@ public static IEnumerable Should_DealWithClassesThatImplementMultipleH ( (ICodeLensHandler) codeLensHandler ).GetRegistrationOptions(Arg.Any(), Arg.Any()) .Returns( new CodeLensRegistrationOptions { - DocumentSelector = new DocumentSelector() + DocumentSelector = new TextDocumentSelector() } ); @@ -261,7 +261,7 @@ public static IEnumerable Should_DealWithClassesThatImplementMultipleH ( (IDocumentLinkHandler) documentLinkHandler ).GetRegistrationOptions(Arg.Any(), Arg.Any()) .Returns( new DocumentLinkRegistrationOptions { - DocumentSelector = new DocumentSelector() + DocumentSelector = new TextDocumentSelector() } ); @@ -271,7 +271,7 @@ public static IEnumerable Should_DealWithClassesThatImplementMultipleH ( (ICompletionHandler) completionHandler ).GetRegistrationOptions(Arg.Any(), Arg.Any()) .Returns( new CompletionRegistrationOptions { - DocumentSelector = new DocumentSelector() + DocumentSelector = new TextDocumentSelector() } ); diff --git a/test/Lsp.Tests/LspRequestRouterTests.cs b/test/Lsp.Tests/LspRequestRouterTests.cs index 1774e5f28..a017aeaa6 100644 --- a/test/Lsp.Tests/LspRequestRouterTests.cs +++ b/test/Lsp.Tests/LspRequestRouterTests.cs @@ -45,7 +45,7 @@ public LspRequestRouterTests(ITestOutputHelper testOutputHelper) : base(testOutp public async Task ShouldRouteToCorrect_Notification() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); textDocumentSyncHandler.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); @@ -83,9 +83,9 @@ await textDocumentSyncHandler.Received(1) public async Task ShouldRouteToCorrect_Notification_WithManyHandlers() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentSyncHandler2 = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cake"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cake"), "csharp"); textDocumentSyncHandler.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); textDocumentSyncHandler2.Handle(Arg.Any(), Arg.Any()) @@ -131,12 +131,12 @@ await textDocumentSyncHandler2.Received(1) public async Task ShouldRouteToCorrect_Request() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); textDocumentSyncHandler.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); var codeActionHandler = Substitute.For(); - codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeActionRegistrationOptions { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") }); + codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeActionRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") }); codeActionHandler .Handle(Arg.Any(), Arg.Any()) .Returns(new CommandOrCodeActionContainer()); @@ -175,16 +175,16 @@ public async Task ShouldRouteToCorrect_Request() public async Task ShouldRouteToCorrect_Request_WithManyHandlers() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentSyncHandler2 = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cake"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cake"), "csharp"); textDocumentSyncHandler.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); textDocumentSyncHandler2.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); var codeActionHandler = Substitute.For(); - codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeActionRegistrationOptions { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") }); + codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeActionRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") }); codeActionHandler .Handle(Arg.Any(), Arg.Any()) .Returns(new CommandOrCodeActionContainer()); @@ -196,7 +196,7 @@ public async Task ShouldRouteToCorrect_Request_WithManyHandlers() .Returns(new CommandOrCodeActionContainer()); registry.OnCodeAction( codeActionDelegate, - (_, _) => new CodeActionRegistrationOptions { DocumentSelector = DocumentSelector.ForPattern("**/*.cake") } + (_, _) => new CodeActionRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cake") } ); var textDocumentIdentifiers = new TextDocumentIdentifiers(); @@ -237,22 +237,22 @@ public async Task ShouldRouteToCorrect_Request_WithManyHandlers() public async Task ShouldRouteToCorrect_Request_WithManyHandlers_CodeLensHandler() { var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentSyncHandler2 = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cake"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cake"), "csharp"); textDocumentSyncHandler.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); textDocumentSyncHandler2.Handle(Arg.Any(), Arg.Any()) .Returns(Unit.Value); var codeActionHandler = Substitute.For(); - codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeLensRegistrationOptions { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") }); + codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeLensRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") }); codeActionHandler .Handle(Arg.Any(), Arg.Any()) .Returns(new CodeLensContainer()); var codeActionHandler2 = Substitute.For(); - codeActionHandler2.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeLensRegistrationOptions { DocumentSelector = DocumentSelector.ForPattern("**/*.cake") }); + codeActionHandler2.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeLensRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cake") }); codeActionHandler2 .Handle(Arg.Any(), Arg.Any()) .Returns(new CodeLensContainer()); diff --git a/test/Lsp.Tests/Matchers/TextDocumentMatcherTests.cs b/test/Lsp.Tests/Matchers/TextDocumentMatcherTests.cs index 424c9a75e..1d3271072 100644 --- a/test/Lsp.Tests/Matchers/TextDocumentMatcherTests.cs +++ b/test/Lsp.Tests/Matchers/TextDocumentMatcherTests.cs @@ -90,7 +90,7 @@ public void Should_Return_Did_Open_Text_Document_Handler_Descriptor() { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentIdentifiers = new TextDocumentIdentifiers(); AutoSubstitute.Provide(textDocumentIdentifiers); var collection = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, textDocumentIdentifiers, Substitute.For(), @@ -121,7 +121,7 @@ public void Should_Return_Did_Open_Text_Document_Handler_Descriptor_With_Sepcial { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cshtml"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cshtml"), "csharp"); var textDocumentIdentifiers = new TextDocumentIdentifiers(); AutoSubstitute.Provide(textDocumentIdentifiers); var collection = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, textDocumentIdentifiers, Substitute.For(), @@ -152,7 +152,7 @@ public void Should_Return_Did_Change_Text_Document_Descriptor() { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentIdentifiers = new TextDocumentIdentifiers(); AutoSubstitute.Provide(textDocumentIdentifiers); var collection = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, textDocumentIdentifiers, Substitute.For(), @@ -181,7 +181,7 @@ public void Should_Return_Did_Save_Text_Document_Descriptor() { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentIdentifiers = new TextDocumentIdentifiers(); AutoSubstitute.Provide(textDocumentIdentifiers); var collection = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, textDocumentIdentifiers, Substitute.For(), @@ -210,7 +210,7 @@ public void Should_Return_Did_Close_Text_Document_Descriptor() { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentIdentifiers = new TextDocumentIdentifiers(); AutoSubstitute.Provide(textDocumentIdentifiers); var collection = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, textDocumentIdentifiers, Substitute.For(), @@ -239,7 +239,7 @@ public void Should_Return_Code_Lens_Descriptor() { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); var textDocumentIdentifiers = new TextDocumentIdentifiers(); AutoSubstitute.Provide(textDocumentIdentifiers); var collection = new SharedHandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue, textDocumentIdentifiers, Substitute.For(), @@ -253,7 +253,7 @@ public void Should_Return_Code_Lens_Descriptor() codeLensHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()) .Returns( new CodeLensRegistrationOptions { - DocumentSelector = new DocumentSelector(new DocumentFilter { Pattern = "**/*.cs" }) + DocumentSelector = new TextDocumentSelector(new TextDocumentFilter { Pattern = "**/*.cs" }) } ); @@ -261,7 +261,7 @@ public void Should_Return_Code_Lens_Descriptor() codeLensHandler2.GetRegistrationOptions(Arg.Any(), Arg.Any()) .Returns( new CodeLensRegistrationOptions { - DocumentSelector = new DocumentSelector(new DocumentFilter { Pattern = "**/*.cake" }) + DocumentSelector = new TextDocumentSelector(new TextDocumentFilter { Pattern = "**/*.cake" }) } ); collection.Add(codeLensHandler, codeLensHandler2); @@ -294,11 +294,11 @@ public void Should_Return_Did_Folding_Range_handler() { // Given var textDocumentSyncHandler = - TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.ps*1"), "powershell"); + TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.ps*1"), "powershell"); var handler = Substitute.For(); handler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns( new FoldingRangeRegistrationOptions { - DocumentSelector = new DocumentSelector(new DocumentFilter { Pattern = "**/*.ps*1" }) + DocumentSelector = new TextDocumentSelector(new TextDocumentFilter { Pattern = "**/*.ps*1" }) } ); var textDocumentIdentifiers = new TextDocumentIdentifiers(); diff --git a/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs b/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs index e322ee26f..a49a11af9 100644 --- a/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs +++ b/test/Lsp.Tests/MediatorTestsRequestHandlerOfTRequestTResponse.cs @@ -34,11 +34,11 @@ public class MediatorTestsRequestHandlerOfTRequestTResponse : AutoTestBase [Fact] public async Task RequestsCancellation() { - var textDocumentSyncHandler = TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cs"), "csharp"); + var textDocumentSyncHandler = TextDocumentSyncHandlerExtensions.With(TextDocumentSelector.ForPattern("**/*.cs"), "csharp"); textDocumentSyncHandler.Handle(Arg.Any(), Arg.Any()).Returns(Unit.Value); var codeActionHandler = Substitute.For(); - codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeActionRegistrationOptions { DocumentSelector = DocumentSelector.ForPattern("**/*.cs") }); + codeActionHandler.GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new CodeActionRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") }); codeActionHandler .Handle(Arg.Any(), Arg.Any()) .Returns( diff --git a/test/Lsp.Tests/Models/CodeActionRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/CodeActionRegistrationOptionsTests.cs index ddcd2a9ce..f1bf752f1 100644 --- a/test/Lsp.Tests/Models/CodeActionRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/CodeActionRegistrationOptionsTests.cs @@ -14,12 +14,12 @@ public class CodeActionRegistrationOptionsTests public void SimpleTest(string expected) { var model = new CodeActionRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp", Pattern = "pattern", Scheme = "scheme" - }, new DocumentFilter { + }, new TextDocumentFilter { Language = "vb", Pattern = "pattern", Scheme = "scheme" diff --git a/test/Lsp.Tests/Models/CodeLensRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/CodeLensRegistrationOptionsTests.cs index 6580c82e1..4642672a8 100644 --- a/test/Lsp.Tests/Models/CodeLensRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/CodeLensRegistrationOptionsTests.cs @@ -14,12 +14,12 @@ public class CodeLensRegistrationOptionsTests public void SimpleTest(string expected) { var model = new CodeLensRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp", Pattern = "pattern", Scheme = "scheme" - }, new DocumentFilter { + }, new TextDocumentFilter { Language = "vb", Pattern = "pattern", Scheme = "scheme" diff --git a/test/Lsp.Tests/Models/CompletionRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/CompletionRegistrationOptionsTests.cs index c2ac494e5..6e1469343 100644 --- a/test/Lsp.Tests/Models/CompletionRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/CompletionRegistrationOptionsTests.cs @@ -14,8 +14,8 @@ public class CompletionRegistrationOptionsTests public void SimpleTest(string expected) { var model = new CompletionRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp" } ), diff --git a/test/Lsp.Tests/Models/DocumentFilterTests.cs b/test/Lsp.Tests/Models/DocumentFilterTests.cs index 5bc97de06..f7e9330db 100644 --- a/test/Lsp.Tests/Models/DocumentFilterTests.cs +++ b/test/Lsp.Tests/Models/DocumentFilterTests.cs @@ -13,12 +13,12 @@ public class DocumentFilterTests [JsonFixture] public void Empty(string expected) { - var model = new DocumentFilter(); + var model = new TextDocumentFilter(); var result = Fixture.SerializeObject(model); result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } @@ -26,14 +26,14 @@ public void Empty(string expected) [JsonFixture] public void OnlyLanguage(string expected) { - var model = new DocumentFilter { + var model = new TextDocumentFilter { Language = "csharp" }; var result = Fixture.SerializeObject(model); result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } @@ -41,14 +41,14 @@ public void OnlyLanguage(string expected) [JsonFixture] public void OnlyScheme(string expected) { - var model = new DocumentFilter { + var model = new TextDocumentFilter { Scheme = "abc" }; var result = Fixture.SerializeObject(model); result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } @@ -56,14 +56,14 @@ public void OnlyScheme(string expected) [JsonFixture] public void OnlyPattern(string expected) { - var model = new DocumentFilter { + var model = new TextDocumentFilter { Pattern = "123**" }; var result = Fixture.SerializeObject(model); result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } @@ -71,7 +71,7 @@ public void OnlyPattern(string expected) [JsonFixture] public void Mixed(string expected) { - var model = new DocumentFilter { + var model = new TextDocumentFilter { Pattern = "123**", Language = "csharp" }; @@ -79,7 +79,7 @@ public void Mixed(string expected) result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } @@ -87,7 +87,7 @@ public void Mixed(string expected) [JsonFixture] public void Full(string expected) { - var model = new DocumentFilter { + var model = new TextDocumentFilter { Pattern = "123**", Language = "csharp", Scheme = "abc" @@ -96,7 +96,7 @@ public void Full(string expected) result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } } diff --git a/test/Lsp.Tests/Models/DocumentLinkRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/DocumentLinkRegistrationOptionsTests.cs index 5cdf60282..bcbc3b33b 100644 --- a/test/Lsp.Tests/Models/DocumentLinkRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/DocumentLinkRegistrationOptionsTests.cs @@ -14,8 +14,8 @@ public class DocumentLinkRegistrationOptionsTests public void SimpleTest(string expected) { var model = new DocumentLinkRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp" } ), diff --git a/test/Lsp.Tests/Models/DocumentOnTypeFormattingRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/DocumentOnTypeFormattingRegistrationOptionsTests.cs index a0d8a54dc..dc2e08b0e 100644 --- a/test/Lsp.Tests/Models/DocumentOnTypeFormattingRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/DocumentOnTypeFormattingRegistrationOptionsTests.cs @@ -14,8 +14,8 @@ public class DocumentOnTypeFormattingRegistrationOptionsTests public void SimpleTest(string expected) { var model = new DocumentOnTypeFormattingRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp" } ), diff --git a/test/Lsp.Tests/Models/DocumentSelectorTests.cs b/test/Lsp.Tests/Models/DocumentSelectorTests.cs index e0662a017..c342f531d 100644 --- a/test/Lsp.Tests/Models/DocumentSelectorTests.cs +++ b/test/Lsp.Tests/Models/DocumentSelectorTests.cs @@ -13,12 +13,12 @@ public class DocumentSelectorTests [JsonFixture] public void SimpleTest(string expected) { - var model = new DocumentSelector( - new DocumentFilter { + var model = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp", - }, new DocumentFilter { + }, new TextDocumentFilter { Pattern = "**/*.vb" - }, new DocumentFilter { + }, new TextDocumentFilter { Scheme = "visualbasic" } ); @@ -26,7 +26,7 @@ public void SimpleTest(string expected) result.Should().Be(expected); - var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); + var deresult = new LspSerializer(ClientVersion.Lsp3).DeserializeObject(expected); deresult.Should().BeEquivalentTo(model, x => x.UsingStructuralRecordEquality()); } } diff --git a/test/Lsp.Tests/Models/InitializeParamsTests.cs b/test/Lsp.Tests/Models/InitializeParamsTests.cs index 84f74a7a4..71e953074 100644 --- a/test/Lsp.Tests/Models/InitializeParamsTests.cs +++ b/test/Lsp.Tests/Models/InitializeParamsTests.cs @@ -45,7 +45,7 @@ public void SimpleTest(string expected) SnippetSupport = true } }, - Synchronization = new SynchronizationCapability { + Synchronization = new TextSynchronizationCapability { DynamicRegistration = true, WillSave = true, DidSave = true, diff --git a/test/Lsp.Tests/Models/SignatureHelpRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/SignatureHelpRegistrationOptionsTests.cs index 026d9a736..38ad96d60 100644 --- a/test/Lsp.Tests/Models/SignatureHelpRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/SignatureHelpRegistrationOptionsTests.cs @@ -14,8 +14,8 @@ public class SignatureHelpRegistrationOptionsTests public void SimpleTest(string expected) { var model = new SignatureHelpRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp" } ), diff --git a/test/Lsp.Tests/Models/TextDocumentChangeRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/TextDocumentChangeRegistrationOptionsTests.cs index 3433e8b21..5d92be46b 100644 --- a/test/Lsp.Tests/Models/TextDocumentChangeRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/TextDocumentChangeRegistrationOptionsTests.cs @@ -15,8 +15,8 @@ public class TextDocumentChangeRegistrationOptionsTests public void SimpleTest(string expected) { var model = new TextDocumentChangeRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp" } ), diff --git a/test/Lsp.Tests/Models/TextDocumentSaveRegistrationOptionsTests.cs b/test/Lsp.Tests/Models/TextDocumentSaveRegistrationOptionsTests.cs index a25d5231a..f7bac42c3 100644 --- a/test/Lsp.Tests/Models/TextDocumentSaveRegistrationOptionsTests.cs +++ b/test/Lsp.Tests/Models/TextDocumentSaveRegistrationOptionsTests.cs @@ -14,8 +14,8 @@ public class TextDocumentSaveRegistrationOptionsTests public void SimpleTest(string expected) { var model = new TextDocumentSaveRegistrationOptions { - DocumentSelector = new DocumentSelector( - new DocumentFilter { + DocumentSelector = new TextDocumentSelector( + new TextDocumentFilter { Language = "csharp" } ), diff --git a/test/Lsp.Tests/SemanticTokensDocumentTests.cs b/test/Lsp.Tests/SemanticTokensDocumentTests.cs index 41752c565..71ded91b9 100644 --- a/test/Lsp.Tests/SemanticTokensDocumentTests.cs +++ b/test/Lsp.Tests/SemanticTokensDocumentTests.cs @@ -299,14 +299,14 @@ private void Tokenize(string document, SemanticTokensBuilder builder) var faker = new Faker() .RuleFor( z => z.Type, - f => f.PickRandom(SemanticTokenType.Defaults).OrNull(f, 0.2f) ?? new SemanticTokenType("none") + f => f.PickRandom(_legend.TokenTypes.AsEnumerable()).OrNull(f, 0.2f) ?? new SemanticTokenType("none") ) .RuleFor( x => x.Modifiers, f => Enumerable.Range(0, f.Random.Int(0, 3)) .Select( z => - f.PickRandom(SemanticTokenModifier.Defaults).OrNull(f, 0.2f) ?? + f.PickRandom(_legend.TokenModifiers.AsEnumerable()).OrNull(f, 0.2f) ?? new SemanticTokenModifier("none") ) .ToArray() @@ -503,6 +503,6 @@ static void Main(string[] args) } } } -".Replace("\r\n", "\n"); +".Replace("\r\n", "\n", StringComparison.Ordinal); } } diff --git a/test/Lsp.Tests/TextDocumentSyncHandlerExtensions.cs b/test/Lsp.Tests/TextDocumentSyncHandlerExtensions.cs index 93e010b9a..e899ca4a1 100644 --- a/test/Lsp.Tests/TextDocumentSyncHandlerExtensions.cs +++ b/test/Lsp.Tests/TextDocumentSyncHandlerExtensions.cs @@ -8,15 +8,15 @@ namespace Lsp.Tests { internal static class TextDocumentSyncHandlerExtensions { - public static ITextDocumentSyncHandler With(DocumentSelector? documentSelector, string language) => + public static ITextDocumentSyncHandler With(TextDocumentSelector? documentSelector, string language) => Substitute.For().With(documentSelector, language); - public static ITextDocumentSyncHandler With(this ITextDocumentSyncHandler handler, DocumentSelector? documentSelector, string language) + public static ITextDocumentSyncHandler With(this ITextDocumentSyncHandler handler, TextDocumentSelector? documentSelector, string language) { - ( (IDidChangeTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentChangeRegistrationOptions() { DocumentSelector = documentSelector }); - ( (IDidOpenTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentOpenRegistrationOptions() { DocumentSelector = documentSelector }); - ( (IDidCloseTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentCloseRegistrationOptions() { DocumentSelector = documentSelector }); - ( (IDidSaveTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentSaveRegistrationOptions() { DocumentSelector = documentSelector }); + ( (IDidChangeTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentChangeRegistrationOptions() { DocumentSelector = documentSelector }); + ( (IDidOpenTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentOpenRegistrationOptions() { DocumentSelector = documentSelector }); + ( (IDidCloseTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentCloseRegistrationOptions() { DocumentSelector = documentSelector }); + ( (IDidSaveTextDocumentHandler) handler ).GetRegistrationOptions(Arg.Any(), Arg.Any()).Returns(new TextDocumentSaveRegistrationOptions() { DocumentSelector = documentSelector }); handler.GetTextDocumentAttributes(Arg.Any()) .Returns(c => new TextDocumentAttributes(c.Arg(), language)); From 48865d806270073a317f3720079490b9d7ce3ae0 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 22 May 2022 14:28:59 -0400 Subject: [PATCH 045/647] Better behavior with progress observables --- .../Contexts/GeneratorData.cs | 4 +- .../Contexts/RequestItem.cs | 1 + .../GenerateHandlerMethodsGenerator.cs | 4 +- .../GeneratorDiagnostics.cs | 2 +- src/JsonRpc.Generators/Helpers.cs | 28 +++--- .../RegistrationOptionsGenerator.cs | 2 +- .../Strategies/SendMethodRequestStrategy.cs | 8 +- ...bstractHandlers.PartialWithInitialValue.cs | 12 +-- src/Protocol/Features/ProgressFeature.cs | 2 +- ...guageProtocolDelegatingHandlers.Partial.cs | 32 +++---- ...egatingHandlers.PartialWithInitialValue.cs | 16 ++-- src/Protocol/Models/IPartialItem.cs | 1 + src/Protocol/Progress/IProgressManager.cs | 23 ++++- .../PartialItemRequestProgressObservable.cs | 6 +- ...thInitialValueRequestProgressObservable.cs | 10 +- .../PartialItemsRequestProgressObservable.cs | 25 +++-- ...thInitialValueRequestProgressObservable.cs | 30 +++--- src/Protocol/Progress/ProgressManager.cs | 92 ++++++++++++------- 18 files changed, 172 insertions(+), 126 deletions(-) diff --git a/src/JsonRpc.Generators/Contexts/GeneratorData.cs b/src/JsonRpc.Generators/Contexts/GeneratorData.cs index f51ed9832..f83292bda 100644 --- a/src/JsonRpc.Generators/Contexts/GeneratorData.cs +++ b/src/JsonRpc.Generators/Contexts/GeneratorData.cs @@ -43,6 +43,7 @@ HashSet additionalUsings if (IsRequest(candidateClass)) { var responseType = GetResponseType(candidateClass, symbol); + var (partialItem, inheritsFromSelf) = GetPartialItem(candidateClass, symbol, requestType, compilation); return new RequestItem( candidateClass, symbol, @@ -54,9 +55,10 @@ HashSet additionalUsings responseType.Syntax.GetSyntaxName() == "Unit", GetCapability(candidateClass, symbol, lspAttributes), GetRegistrationOptions(candidateClass, symbol, lspAttributes), - GetPartialItem(candidateClass, symbol, requestType), + partialItem, GetPartialItems(candidateClass, symbol, requestType), symbol.AllInterfaces.Concat(requestType.Symbol.AllInterfaces).Any(z => z.Name.EndsWith("WithInitialValue", StringComparison.Ordinal)), + inheritsFromSelf, additionalUsings, new List(), model, compilation diff --git a/src/JsonRpc.Generators/Contexts/RequestItem.cs b/src/JsonRpc.Generators/Contexts/RequestItem.cs index df9bfa5e9..5d3af252e 100644 --- a/src/JsonRpc.Generators/Contexts/RequestItem.cs +++ b/src/JsonRpc.Generators/Contexts/RequestItem.cs @@ -18,6 +18,7 @@ record RequestItem( SyntaxSymbol? PartialItem, SyntaxSymbol? PartialItems, bool PartialHasInitialValue, + bool PartialItemInheritsFromSelf, HashSet AdditionalUsings, List AssemblyJsonRpcHandlersAttributeArguments, SemanticModel Model, diff --git a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs index 964cf139b..1ebd19587 100644 --- a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs +++ b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs @@ -60,7 +60,7 @@ syntaxNode is TypeDeclarationSyntax tds { diagnostic = Diagnostic.Create( GeneratorDiagnostics.Exception, syntaxContext.Node.GetLocation(), e.Message, - e.StackTrace ?? string.Empty + e.StackTrace?.Replace("\n", " ") ?? string.Empty, e.ToString() ); Debug.WriteLine(e); Debug.WriteLine(e.StackTrace); @@ -106,7 +106,7 @@ private void GenerateHandlerMethods( context.ReportDiagnostic( Diagnostic.Create( GeneratorDiagnostics.Exception, candidateClass.GetLocation(), - $"Strategy {strategy.GetType().FullName} failed!" + " - " + e.Message, e.StackTrace ?? string.Empty + $"Strategy {strategy.GetType().FullName} failed!" + " - " + e.Message, e.StackTrace?.Replace("\n", " ") ?? string.Empty ) ); Debug.WriteLine($"Strategy {strategy.GetType().FullName} failed!"); diff --git a/src/JsonRpc.Generators/GeneratorDiagnostics.cs b/src/JsonRpc.Generators/GeneratorDiagnostics.cs index 7cdfa732c..f33e909a4 100644 --- a/src/JsonRpc.Generators/GeneratorDiagnostics.cs +++ b/src/JsonRpc.Generators/GeneratorDiagnostics.cs @@ -8,7 +8,7 @@ internal static class GeneratorDiagnostics { public static DiagnosticDescriptor Exception { get; } = new DiagnosticDescriptor( "JRPC0001", "Exception", - "{0} - {1}", "JRPC", DiagnosticSeverity.Error, true + "{0} - {1} {2}", "JRPC", DiagnosticSeverity.Error, true ); public static DiagnosticDescriptor NoHandlerRegistryProvided { get; } = new DiagnosticDescriptor( diff --git a/src/JsonRpc.Generators/Helpers.cs b/src/JsonRpc.Generators/Helpers.cs index 7e81c9c22..0cf80b1ff 100644 --- a/src/JsonRpc.Generators/Helpers.cs +++ b/src/JsonRpc.Generators/Helpers.cs @@ -250,7 +250,9 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT return new SyntaxSymbol(type ?? ResolveTypeName(localSymbol), localSymbol); } - public static SyntaxSymbol? GetPartialItem(TypeDeclarationSyntax syntax, INamedTypeSymbol symbol, SyntaxSymbol requestType) + public static (SyntaxSymbol? partialItem, bool inheritsFromSelf) GetPartialItem( + TypeDeclarationSyntax syntax, INamedTypeSymbol symbol, SyntaxSymbol requestType, Compilation compilation + ) { var handlerInterface = symbol.AllInterfaces.Concat(requestType.Symbol.AllInterfaces) .FirstOrDefault( @@ -258,14 +260,17 @@ public static SyntaxSymbol GetResponseType(TypeDeclarationSyntax syntax, INamedT { Name: "IPartialItemWithInitialValue", TypeArguments.Length: 2 } ); var localSymbol = handlerInterface?.TypeArguments[0] as INamedTypeSymbol; - if (localSymbol == null) return null; + if (localSymbol == null) return ( null, false ); var type = syntax.BaseList?.Types .Select(z => z.Type is GenericNameSyntax genericNameSyntax ? genericNameSyntax : null) .Where(z => z != null) .Where(z => z is { Identifier.Text: "IPartialItemRequest" or "IPartialItemWithInitialValueRequest", Arity: 2 }) .Select(z => z!.TypeArgumentList.Arguments[1]) .FirstOrDefault(); - return new SyntaxSymbol(type ?? ResolveTypeName(localSymbol), localSymbol); + return ( + new SyntaxSymbol(type ?? ResolveTypeName(localSymbol), localSymbol), + handlerInterface!.TypeArguments.Length == 2 && compilation.HasImplicitConversion(handlerInterface!.TypeArguments[1], handlerInterface.TypeArguments[0]) + ); } public static NameSyntax ResolveTypeName(ITypeSymbol symbol) @@ -351,11 +356,12 @@ private static ArgumentListSyntax GetHandlerArgumentList() => ); public static ArgumentListSyntax GetRegistrationHandlerArgumentList( - TypeSyntax registrationOptionsName, TypeSyntax registrationType, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument, TypeSyntax? capabilityType, bool includeId + TypeSyntax registrationOptionsName, TypeSyntax registrationType, ArgumentSyntax handlerArgument, ArgumentSyntax? initialArgument, + TypeSyntax? capabilityType, bool includeId ) => ArgumentList( SeparatedList( - (includeId + ( includeId ? new[] { Argument(IdentifierName("id")), @@ -368,7 +374,7 @@ public static ArgumentListSyntax GetRegistrationHandlerArgumentList( initialArgument!, handlerArgument, Argument(GetRegistrationOptionsAdapter(registrationOptionsName, registrationType, capabilityType)) - }) + } ) .Where(z => z is not null) ) ); @@ -877,7 +883,9 @@ public static ArrowExpressionClauseSyntax GetRequestInvokeExpression() => ) ); - public static ArrowExpressionClauseSyntax GetPartialInvokeExpression(TypeSyntax responseType, TypeSyntax? partialItemType) + public static ArrowExpressionClauseSyntax GetPartialInvokeExpression( + TypeSyntax responseType, TypeSyntax? partialItemType, bool partialItemTypeInheritsFromSelf + ) { var realResponseType = responseType is NullableTypeSyntax nts ? nts.ElementType : responseType; var factoryArgument = Argument( @@ -889,13 +897,11 @@ public static ArrowExpressionClauseSyntax GetPartialInvokeExpression(TypeSyntax ); var arguments = new[] { - Argument( - IdentifierName(@"request") - ), + Argument(IdentifierName(@"request")), factoryArgument, Argument(IdentifierName("cancellationToken")) }; - if (partialItemType is { }) + if (partialItemType is { } && !partialItemTypeInheritsFromSelf) { var realPartialItemType = partialItemType is NullableTypeSyntax nts2 ? nts2.ElementType : partialItemType; arguments = new[] diff --git a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs index 6a32b6efd..fc3bfddf8 100644 --- a/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs +++ b/src/JsonRpc.Generators/RegistrationOptionsGenerator.cs @@ -312,7 +312,7 @@ private void GenerateRegistrationOptions( catch (Exception e) { context.ReportDiagnostic( - Diagnostic.Create(GeneratorDiagnostics.Exception, registrationOptions.GetLocation(), e.Message, e.StackTrace ?? string.Empty) + Diagnostic.Create(GeneratorDiagnostics.Exception, registrationOptions.GetLocation(), e.Message, e.StackTrace?.Replace("\n", " ") ?? string.Empty, e.ToString()) ); Debug.WriteLine(e); Debug.WriteLine(e.StackTrace); diff --git a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs index 54cf6194b..ab11d12ba 100644 --- a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs @@ -62,7 +62,11 @@ public IEnumerable Apply(SourceProductionContext contex ) .WithParameterList(parameterList) .WithExpressionBody( - Helpers.GetPartialInvokeExpression(request.Response.Syntax, request.PartialHasInitialValue ? null : request.PartialItem.Syntax) + Helpers.GetPartialInvokeExpression( + request.Response.Syntax, + request.PartialHasInitialValue ? null : request.PartialItem.Syntax, + request.PartialItemInheritsFromSelf + ) ) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); yield break; @@ -97,7 +101,7 @@ public IEnumerable Apply(SourceProductionContext contex ) ) .WithParameterList(parameterList) - .WithExpressionBody(Helpers.GetPartialInvokeExpression(request.Response.Syntax, default)) + .WithExpressionBody(Helpers.GetPartialInvokeExpression(request.Response.Syntax, default, false)) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); yield break; } diff --git a/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs b/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs index 1d7491b6b..870020020 100644 --- a/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs +++ b/src/Protocol/AbstractHandlers.PartialWithInitialValue.cs @@ -20,8 +20,8 @@ public abstract class PartialResultWithInitialValue, IJsonRpcRequestHandler where TItem : class? - where TParams : IPartialItemWithInitialValueRequest - where TResponse : class? + where TParams : IPartialItemWithInitialValueRequest + where TResponse : TItem? where TRegistrationOptions : class, new() where TCapability : ICapability { @@ -68,8 +68,8 @@ public abstract class PartialResultWithInitialValue, IJsonRpcRequestHandler where TItem : class? - where TParams : IPartialItemWithInitialValueRequest - where TResponse : class? + where TParams : IPartialItemWithInitialValueRequest + where TResponse : TItem? where TRegistrationOptions : class, new() { private readonly IProgressManager _progressManager; @@ -115,8 +115,8 @@ public abstract class PartialResultWithInitialValueCapability, IJsonRpcRequestHandler where TItem : class? - where TParams : IPartialItemWithInitialValueRequest - where TResponse : class? + where TParams : IPartialItemWithInitialValueRequest + where TResponse : TItem? where TCapability : ICapability { private readonly IProgressManager _progressManager; diff --git a/src/Protocol/Features/ProgressFeature.cs b/src/Protocol/Features/ProgressFeature.cs index e6484714c..ee48a6187 100644 --- a/src/Protocol/Features/ProgressFeature.cs +++ b/src/Protocol/Features/ProgressFeature.cs @@ -132,7 +132,7 @@ public static IRequestProgressObservable RequestProgress factory, Func reverseFactory, CancellationToken cancellationToken = default - ) + ) where TResponse : TItem { @params.SetPartialResultToken(new ProgressToken(Guid.NewGuid().ToString())); diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs index 4ed018d85..7df35bc0b 100644 --- a/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.Partial.cs @@ -65,10 +65,10 @@ CancellationToken cancellationToken { _handler(request, observer, Capability, cancellationToken); await observer; - return _factory(default); + return default; } - var subject = new AsyncSubject(); + using var subject = new Subject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -128,10 +128,10 @@ public PartialResult( { _handler(request, observer, cancellationToken); await observer; - return _factory(default); + return default; } - var subject = new AsyncSubject(); + using var subject = new Subject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -184,10 +184,10 @@ public PartialResultCapability( { _handler(request, Capability, observer, cancellationToken); await observer; - return _factory(default); + return default; } - var subject = new AsyncSubject(); + using var subject = new Subject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -232,10 +232,10 @@ public PartialResult(Guid id, Action, CancellationToke { _handler(request, observer, cancellationToken); await observer; - return _factory(default); + return default; } - var subject = new AsyncSubject(); + using var subject = new Subject(); var task = subject .Select(_factory) .ToTask(cancellationToken, _progressManager.Scheduler) @@ -293,10 +293,10 @@ public PartialResults( { _handler(request, observer, Capability, cancellationToken); await observer; - return _factory(Enumerable.Empty()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( new List(), (acc, items) => { @@ -360,10 +360,10 @@ public PartialResults( { _handler(request, observer, cancellationToken); await observer; - return _factory(Enumerable.Empty()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( new List(), (acc, items) => { @@ -422,10 +422,10 @@ public PartialResultsCapability( { _handler(request, observer, Capability, cancellationToken); await observer; - return _factory(Enumerable.Empty()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( new List(), (acc, items) => { @@ -481,10 +481,10 @@ public PartialResults( { _handler(request, observer, cancellationToken); await observer; - return _factory(Enumerable.Empty()); + return default; } - var subject = new Subject>(); + using var subject = new Subject>(); var task = subject .Aggregate( new List(), (acc, items) => { diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs index 67925b9b3..50573ab29 100644 --- a/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.PartialWithInitialValue.cs @@ -15,9 +15,9 @@ public sealed class PartialResultWithInitialValue, IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IPartialItemWithInitialValueRequest + where TParams : IPartialItemWithInitialValueRequest where TItem : class? - where TResponse : class? + where TResponse : TItem? where TRegistrationOptions : class, new() where TCapability : ICapability { @@ -88,9 +88,9 @@ public sealed class PartialResultWithInitialValue, IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IPartialItemWithInitialValueRequest + where TParams : IPartialItemWithInitialValueRequest where TItem : class? - where TResponse : class? + where TResponse : TItem? where TRegistrationOptions : class, new() { private readonly Action, CancellationToken> _handler; @@ -157,9 +157,9 @@ public sealed class PartialResultWithInitialValueCapability, IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IPartialItemWithInitialValueRequest + where TParams : IPartialItemWithInitialValueRequest where TItem : class? - where TResponse : class? + where TResponse : TItem? where TCapability : ICapability { private readonly Action, CancellationToken> _handler; @@ -220,9 +220,9 @@ public PartialResultWithInitialValueCapability( public sealed class PartialResultWithInitialValue : IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IPartialItemWithInitialValueRequest + where TParams : IPartialItemWithInitialValueRequest where TItem : class? - where TResponse : class? + where TResponse : TItem? { private readonly Action, CancellationToken> _handler; private readonly IProgressManager _progressManager; diff --git a/src/Protocol/Models/IPartialItem.cs b/src/Protocol/Models/IPartialItem.cs index 3ddfddae5..14f8cf847 100644 --- a/src/Protocol/Models/IPartialItem.cs +++ b/src/Protocol/Models/IPartialItem.cs @@ -10,6 +10,7 @@ public interface IPartialItemRequest : IRequest, IP } public interface IPartialItemWithInitialValueRequest : IRequest, IPartialItemWithInitialValue + where TResponse : T { } } diff --git a/src/Protocol/Progress/IProgressManager.cs b/src/Protocol/Progress/IProgressManager.cs index 1981927b6..14d3f5059 100644 --- a/src/Protocol/Progress/IProgressManager.cs +++ b/src/Protocol/Progress/IProgressManager.cs @@ -12,6 +12,18 @@ public interface IProgressManager : IProgressHandler IProgressObservable Monitor(ProgressToken token); IProgressObservable Monitor(ProgressToken token, Func factory); + IRequestProgressObservable MonitorUntil( + IPartialItemRequest request, + Func factory, + CancellationToken cancellationToken + ) where TResult : TItem; + + IRequestProgressObservable MonitorUntil( + IPartialItemRequest request, + Func factory, + CancellationToken cancellationToken + ) where TResult : TItem; + IRequestProgressObservable MonitorUntil( IPartialItemRequest request, Func factory, @@ -36,7 +48,7 @@ IRequestProgressObservable, TResponse> MonitorUntil request, Func, TResponse> factory, CancellationToken cancellationToken - ) where TResponse : IEnumerable?; + ) where TResponse : IEnumerable; IRequestProgressObservable MonitorUntil( IPartialItemsRequest, TItem> request, @@ -47,16 +59,17 @@ IRequestProgressObservable, TResponse> MonitorUntil request, Func, TResponse> factory, CancellationToken cancellationToken - ) where TResponse : IEnumerable?; + ) where TResponse : IEnumerable; IProgressObserver For(ProgressToken token, CancellationToken cancellationToken); IProgressObserver For(IPartialItemRequest request, CancellationToken cancellationToken); - IProgressObserverWithInitialValue For(IPartialItemWithInitialValueRequest request, CancellationToken cancellationToken); + IProgressObserverWithInitialValue For(IPartialItemWithInitialValueRequest request, CancellationToken cancellationToken) + where TInitial : TItem; IProgressObserver> For(IPartialItemsRequest request, CancellationToken cancellationToken) - where TResponse : IEnumerable?; + where TResponse : IEnumerable; IProgressObserverWithInitialValue> For(IPartialItemsWithInitialValueRequest request, CancellationToken cancellationToken) - where TInitial : IEnumerable?; + where TInitial : IEnumerable; IScheduler Scheduler { get; } } } diff --git a/src/Protocol/Progress/PartialItemRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemRequestProgressObservable.cs index 2be977be1..d67c79f2d 100644 --- a/src/Protocol/Progress/PartialItemRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemRequestProgressObservable.cs @@ -39,10 +39,10 @@ Action onCompleteAction { requestResult .Do( - _ => + result => { if (_receivedPartialData) return; - _dataSubject.OnNext(reverseFactory(_)); + _dataSubject.OnNext(reverseFactory(result)); }, _dataSubject.OnError, _dataSubject.OnCompleted @@ -86,7 +86,7 @@ public void OnNext(JToken value) { if (_dataSubject.IsDisposed) return; _receivedPartialData = true; - _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)); + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)!); } public void Dispose() diff --git a/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs index 55b1e99a3..f66770327 100644 --- a/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemWithInitialValueRequestProgressObservable.cs @@ -18,6 +18,7 @@ internal class PartialItemWithInitialValueRequestProgressObservable _task; private bool _receivedInitialValue; + private bool _receivedPartialData; public PartialItemWithInitialValueRequestProgressObservable( ISerializer serializer, @@ -36,10 +37,10 @@ Action onCompleteAction { requestResult .Do( - _ => + result => { - if (_receivedInitialValue) return; - _dataSubject.OnNext(_); + if (_receivedPartialData) return; + _dataSubject.OnNext(result); }, _dataSubject.OnError, _dataSubject.OnCompleted @@ -82,6 +83,7 @@ private void OnError(Exception error) public void OnNext(JToken value) { if (_dataSubject.IsDisposed) return; + _receivedPartialData = true; if (!_receivedInitialValue) { _receivedInitialValue = true; @@ -89,7 +91,7 @@ public void OnNext(JToken value) } else { - _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)); + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)!); } } diff --git a/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs index fbef42084..113a70020 100644 --- a/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemsRequestProgressObservable.cs @@ -16,12 +16,12 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress { - internal class PartialItemsRequestProgressObservable : IRequestProgressObservable, TResult>, IObserver, + internal class PartialItemsRequestProgressObservable : IRequestProgressObservable?, TResult>, IObserver, IDisposable where TResult : IEnumerable? { private readonly ISerializer _serializer; - private readonly ReplaySubject> _dataSubject; + private readonly ReplaySubject?> _dataSubject; private readonly CompositeDisposable _disposable; private readonly Task _task; private bool _receivedPartialData; @@ -36,7 +36,7 @@ Action onCompleteAction ) { _serializer = serializer; - _dataSubject = new ReplaySubject>(int.MaxValue, Scheduler.Immediate); + _dataSubject = new ReplaySubject?>(int.MaxValue, Scheduler.Immediate); _disposable = new CompositeDisposable { _dataSubject }; _task = Observable.Create( observer => new CompositeDisposable @@ -46,6 +46,7 @@ Action onCompleteAction new List(), (acc, data) => { + if (data is null) return acc; acc.AddRange(data); return acc; } @@ -56,15 +57,13 @@ Action onCompleteAction .Do( result => { - if (result is not null) - { - _dataSubject.OnNext(result); - } + if (_receivedPartialData) return; + _dataSubject.OnNext(result); }, _dataSubject.OnError, _dataSubject.OnCompleted ), - (items, result) => (items?.Count() ?? 0) > (result?.Count() ?? 0) ? items : result + (items, result) => _receivedPartialData ? items : result ) .Subscribe(observer), Disposable.Create(onCompleteAction) @@ -104,7 +103,7 @@ public void OnNext(JToken value) { if (_dataSubject.IsDisposed) return; _receivedPartialData = true; - _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)); + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)!); } public void Dispose() @@ -114,7 +113,7 @@ public void Dispose() } // public IDisposable Subscribe(IObserver> observer) => _disposable.IsDisposed ? Disposable.Empty : _dataSubject.Subscribe(observer); - public IDisposable Subscribe(IObserver> observer) + public IDisposable Subscribe(IObserver?> observer) { return _dataSubject.Subscribe(observer); } @@ -131,14 +130,14 @@ public TaskAwaiter GetAwaiter() } } - internal class PartialItemsRequestProgressObservable : PartialItemsRequestProgressObservable?>, + internal class PartialItemsRequestProgressObservable : PartialItemsRequestProgressObservable>, IRequestProgressObservable { public PartialItemsRequestProgressObservable( ISerializer serializer, ProgressToken token, - IObservable?> requestResult, - Func, Container?> factory, + IObservable> requestResult, + Func, Container> factory, CancellationToken cancellationToken, Action onCompleteAction, ILogger logger diff --git a/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs b/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs index a84e6df78..28cebcb99 100644 --- a/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs +++ b/src/Protocol/Progress/PartialItemsWithInitialValueRequestProgressObservable.cs @@ -19,13 +19,14 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Progress internal class PartialItemsWithInitialValueRequestProgressObservable : IRequestProgressObservable, TResult>, IObserver, IDisposable - where TResult : IEnumerable? + where TResult : IEnumerable { private readonly ISerializer _serializer; - private readonly ReplaySubject> _dataSubject; + private readonly ReplaySubject?> _dataSubject; private readonly CompositeDisposable _disposable; private readonly Task _task; private bool _receivedInitialValue; + private bool _receivedPartialData; public PartialItemsWithInitialValueRequestProgressObservable( ISerializer serializer, @@ -37,35 +38,27 @@ Action onCompleteAction ) { _serializer = serializer; - _dataSubject = new ReplaySubject>(int.MaxValue, Scheduler.Immediate); + _dataSubject = new ReplaySubject?>(int.MaxValue, Scheduler.Immediate); _disposable = new CompositeDisposable { _dataSubject }; _task = Observable.Create( observer => new CompositeDisposable { _dataSubject - .Aggregate( - default(TResult), (acc, items) => - { - if (acc is null && items is TResult r) return r; - return factory(acc, items); - } - ) + .Aggregate(default(TResult), (acc, items) => acc is null && items is TResult r ? r : factory(acc, items)) .ForkJoin( requestResult .Do( result => { - if (result is not null) - { - _dataSubject.OnNext(result); - } + if (_receivedPartialData) return; + _dataSubject.OnNext(result); }, _dataSubject.OnError, _dataSubject.OnCompleted ), - (items, result) => (items?.Count() ?? 0) > (result?.Count() ?? 0) ? items : result + (items, result) => _receivedPartialData ? items : result ) - .Subscribe(observer), + .Subscribe(observer!), Disposable.Create(onCompleteAction) } ) @@ -102,6 +95,7 @@ private void OnError(Exception error) public void OnNext(JToken value) { if (_dataSubject.IsDisposed) return; + _receivedPartialData = true; if (!_receivedInitialValue) { _receivedInitialValue = true; @@ -109,7 +103,7 @@ public void OnNext(JToken value) } else { - _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)); + _dataSubject.OnNext(value.ToObject(_serializer.JsonSerializer)!); } } @@ -122,7 +116,7 @@ public void Dispose() // public IDisposable Subscribe(IObserver> observer) => _disposable.IsDisposed ? Disposable.Empty : _dataSubject.Subscribe(observer); public IDisposable Subscribe(IObserver> observer) { - return _dataSubject.Subscribe(observer); + return _dataSubject.Subscribe(observer!); } #pragma warning disable VSTHRD003 diff --git a/src/Protocol/Progress/ProgressManager.cs b/src/Protocol/Progress/ProgressManager.cs index ae3fe8592..290e06476 100644 --- a/src/Protocol/Progress/ProgressManager.cs +++ b/src/Protocol/Progress/ProgressManager.cs @@ -48,7 +48,7 @@ Task IRequestHandler.Handle(ProgressParams request, return Unit.Task; } - public IProgressObservable Monitor(ProgressToken token) => Monitor(token, x => x.ToObject(_serializer.JsonSerializer)); + public IProgressObservable Monitor(ProgressToken token) => Monitor(token, x => x.ToObject(_serializer.JsonSerializer)!); public IProgressObservable Monitor(ProgressToken token, Func factory) { @@ -65,12 +65,12 @@ public IProgressObservable Monitor(ProgressToken token, Func fa public IRequestProgressObservable MonitorUntil( IPartialItemRequest request, Func factory, + Func reverseFactory, CancellationToken cancellationToken ) { request.SetPartialResultToken(); - if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) - && o is IRequestProgressObservable observable) + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable observable) { return observable; } @@ -80,7 +80,7 @@ CancellationToken cancellationToken request.PartialResultToken!, MakeRequest(request), (_, x) => factory(x), - _ => default!, + reverseFactory, cancellationToken, () => _activeObservables.TryRemove(request.PartialResultToken!, out _) ); @@ -90,10 +90,35 @@ CancellationToken cancellationToken public IRequestProgressObservable MonitorUntil( IPartialItemRequest request, - Func factory, + Func factory, Func reverseFactory, CancellationToken cancellationToken ) + { + request.SetPartialResultToken(); + if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable observable) + { + return observable; + } + + observable = new PartialItemRequestProgressObservable( + _serializer, + request.PartialResultToken!, + MakeRequest(request), + factory, + reverseFactory, + cancellationToken, + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) + ); + _activeObservables.TryAdd(request.PartialResultToken!, observable); + return observable; + } + + public IRequestProgressObservable MonitorUntil( + IPartialItemRequest request, + Func factory, + CancellationToken cancellationToken + ) where TResult : TItem { request.SetPartialResultToken(); if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) @@ -107,7 +132,7 @@ CancellationToken cancellationToken request.PartialResultToken!, MakeRequest(request), (_, x) => factory(x), - reverseFactory, + x => x, cancellationToken, () => _activeObservables.TryRemove(request.PartialResultToken!, out _) ); @@ -118,9 +143,8 @@ CancellationToken cancellationToken public IRequestProgressObservable MonitorUntil( IPartialItemRequest request, Func factory, - Func reverseFactory, CancellationToken cancellationToken - ) + ) where TResult : TItem { request.SetPartialResultToken(); if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) && o is IRequestProgressObservable observable) @@ -130,14 +154,14 @@ CancellationToken cancellationToken observable = new PartialItemRequestProgressObservable( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), factory, - reverseFactory, + x => x, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _) + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } @@ -156,13 +180,13 @@ CancellationToken cancellationToken observable = new PartialItemWithInitialValueRequestProgressObservable( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), factory, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _) + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } @@ -180,13 +204,13 @@ CancellationToken cancellationToken observable = new PartialItemsRequestProgressObservable>( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), x => x, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _) - ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) + )!; + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } @@ -194,7 +218,7 @@ public IRequestProgressObservable, TResponse> MonitorUntil request, Func, TResponse> factory, CancellationToken cancellationToken ) - where TResponse : IEnumerable? + where TResponse : IEnumerable { request.SetPartialResultToken(); if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) @@ -205,12 +229,12 @@ public IRequestProgressObservable, TResponse> MonitorUntil( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), factory, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _) - ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) + )!; + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } @@ -224,14 +248,14 @@ public IRequestProgressObservable MonitorUntil(IPartialItemsReques observable = new PartialItemsRequestProgressObservable( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), x => new Container(x), cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _), + () => _activeObservables.TryRemove(request.PartialResultToken!, out _), _logger.Value ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } @@ -240,7 +264,7 @@ public IRequestProgressObservable, TResponse> MonitorUntil request, Func, TResponse> factory, CancellationToken cancellationToken ) - where TResponse : IEnumerable? + where TResponse : IEnumerable { request.SetPartialResultToken(); if (_activeObservables.TryGetValue(request.PartialResultToken!, out var o) @@ -251,12 +275,12 @@ public IRequestProgressObservable, TResponse> MonitorUntil( _serializer, - request.PartialResultToken, + request.PartialResultToken!, MakeRequest(request), factory, cancellationToken, - () => _activeObservables.TryRemove(request.PartialResultToken, out _) + () => _activeObservables.TryRemove(request.PartialResultToken!, out _) ); - _activeObservables.TryAdd(request.PartialResultToken, observable); + _activeObservables.TryAdd(request.PartialResultToken!, observable); return observable; } @@ -289,7 +313,7 @@ public IProgressObserver For(IPartialItemRequest For( IPartialItemWithInitialValueRequest request, CancellationToken cancellationToken - ) + ) where TResponse : TItem { if (request.PartialResultToken == null) return ProgressObserver.Noop; if (_activeObservers.TryGetValue(request.PartialResultToken, out var o) && o is IProgressObserverWithInitialValue observer) @@ -305,7 +329,7 @@ public IProgressObserverWithInitialValue For } public IProgressObserver> For(IPartialItemsRequest request, CancellationToken cancellationToken) - where TResponse : IEnumerable? + where TResponse : IEnumerable { if (request.PartialResultToken == null) return ProgressObserver>.Noop; if (_activeObservers.TryGetValue(request.PartialResultToken, out var o) && o is IProgressObserver> observer) @@ -323,7 +347,7 @@ public IProgressObserver> For(IPartialItems public IProgressObserverWithInitialValue> For( IPartialItemsWithInitialValueRequest request, CancellationToken cancellationToken ) - where TInitial : IEnumerable? + where TInitial : IEnumerable { if (request.PartialResultToken == null) return ProgressObserver>.Noop; if (_activeObservers.TryGetValue(request.PartialResultToken, out var o) From 39c31a049434b5d2f94b5fdc5ff7bc0a8eb2438b Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Mon, 30 May 2022 11:38:53 -0400 Subject: [PATCH 046/647] moved more tests to verify --- .../Features/Document/CallHierarchyFeature.cs | 8 +- .../Features/Document/DiagnosticsFeature.cs | 4 +- .../Features/Document/InlineValueFeature.cs | 31 +- .../Features/Document/MonikerFeature.cs | 2 +- .../Features/Document/TypeHierarchyFeature.cs | 289 +-- .../AutoImplementParamsGeneratorTests.cs | 27 +- .../EnumLikeStringGeneratorTests.cs | 2 +- .../GeneratedRegistrationOptionsTests.cs | 8 +- test/Generation.Tests/GenerationHelpers.cs | 61 + .../JsonRpcGenerationTests.cs | 29 +- test/Generation.Tests/LspFeatureTests.cs | 36 +- .../TypedCanBeResolvedTests.cs | 295 +-- ...agically_Implements_Properties.verified.cs | 23 + ...ly_Implements_IEnumLikeString.verified.cs} | 3 +- ....00AssemblyRegistrationOptions.verified.cs | 5 + ...CodeActionRegistrationOptions.verified.cs} | 3 +- ....00AssemblyRegistrationOptions.verified.cs | 5 + ...CodeActionRegistrationOptions.verified.cs} | 3 +- ....00AssemblyRegistrationOptions.verified.cs | 5 + ...paceSymbolRegistrationOptions.verified.cs} | 3 +- ....00AssemblyRegistrationOptions.verified.cs | 5 + ...paceSymbolRegistrationOptions.verified.cs} | 3 +- ...tic_If_Missing_Information.00.verified.txt | 30 + ...tion.01AssemblyJsonRpcHandlers.verified.cs | 4 + ...ests.00AttachRequestArguments.verified.cs} | 3 +- ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...able.01LaunchRequestArguments.verified.cs} | 3 +- ...ypes.00AttachRequestArguments.verified.cs} | 3 +- ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...nses.00AttachRequestArguments.verified.cs} | 3 +- ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...ames.00AssemblyJsonRpcHandlers.verified.cs | 4 + ...uageProtocolInitializeHandler.verified.cs} | 3 +- ....00Test0_ExecuteCommandParams1.verified.cs | 26 + ...Types.01ExecuteCommandParams1.verified.cs} | 3 +- ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...dler.00AssemblyJsonRpcHandlers.verified.cs | 4 + ...andler.01ICapabilitiesHandler.verified.cs} | 3 +- ...ction_DidChangeTextHandler.00.verified.txt | 17 + ...dler.01AssemblyJsonRpcHandlers.verified.cs | 4 + ...IDidChangeTextDocumentHandler.verified.cs} | 3 +- ...fers_Direction_ExitHandler.00.verified.txt | 17 + ...dler.01AssemblyJsonRpcHandlers.verified.cs | 4 + ...on_ExitHandler.02IExitHandler.verified.cs} | 3 +- ...dler.00AssemblyJsonRpcHandlers.verified.cs | 4 + ...andler.01IFoldingRangeHandler.verified.cs} | 3 +- ...dler.00AssemblyJsonRpcHandlers.verified.cs | 4 + ...ns_ExitHandler.01IExitHandler.verified.cs} | 3 +- ...ests.00AssemblyJsonRpcHandlers.verified.cs | 4 + ...Requests.01IDefinitionHandler.verified.cs} | 3 +- ...uests_And_Infers_Direction.00.verified.txt | 17 + ...tion.01AssemblyJsonRpcHandlers.verified.cs | 4 + ...irection.02IDefinitionHandler.verified.cs} | 3 +- ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...Type_As_Source.01RenameParams.verified.cs} | 3 +- ...sions.00AssemblyCapabilityKeys.verified.cs | 13 + ...ions.01DiscoverUnitTestsParams.verified.cs | 87 + ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...Language_Extensions.03UnitTest.verified.cs | 78 + ....04AssemblyRegistrationOptions.verified.cs | 5 + ....05UnitTestRegistrationOptions.verified.cs | 47 + ...ng_Custom_Language_Extensions.verified.txt | 624 ----- ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...sk_Return.01RegistrationParams.verified.cs | 49 + ...Return.02RegistrationContainer.verified.cs | 108 + ...s_Generating_Void_Task_Return.verified.txt | 484 ---- ...ource.00AssemblyCapabilityKeys.verified.cs | 15 + ...1Test0_SymbolInformationParams.verified.cs | 29 + ....02Test0_WorkspaceSymbolParams.verified.cs | 29 + ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...urce.04SymbolInformationParams.verified.cs | 90 + ...pe_As_Source.05WorkspaceSymbol.verified.cs | 54 + ...Source.06WorkspaceSymbolParams.verified.cs | 90 + ....07AssemblyRegistrationOptions.verified.cs | 5 + ...spaceSymbolRegistrationOptions.verified.cs | 39 + ...upports_Params_Type_As_Source.verified.txt | 2213 ----------------- ...ating_Strongly_Typed_Container.verified.cs | 108 + ...olved_Data.00CodeLensContainer.verified.cs | 108 + ...ved_Data.01Test0_CodeLensTyped.verified.cs | 183 ++ ..._Typed_ICanBeResolved_Data.00.received.txt | 17 + ...neratedAssemblyJsonRpcHandlers.received.cs | 4 + ...ata.02PublishDiagnosticsParams.received.cs | 49 + .../Lsp.Integration.Tests/InlineValueTests.cs | 78 + .../Lsp.Integration.Tests.csproj | 8 +- test/Lsp.Integration.Tests/MonikerTests.cs | 4 +- test/Lsp.Integration.Tests/Properties.cs | 2 +- .../TypedTypeHierarchyTests.cs | 237 ++ 88 files changed, 2025 insertions(+), 3903 deletions(-) create mode 100644 test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs rename test/Generation.Tests/snapshots/{EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt => EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs} (96%) create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs} (97%) create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs} (97%) create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs} (93%) create mode 100644 test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs} (93%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt => JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs} (98%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt => JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs} (98%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt => JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs} (98%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt => JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs} (98%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt => JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs} (96%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt => JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs} (98%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs} (97%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs} (98%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs} (97%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs} (99%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs} (97%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt => JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs} (99%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt => JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs} (99%) create mode 100644 test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt => JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs} (99%) create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt create mode 100644 test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs create mode 100644 test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs create mode 100644 test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs create mode 100644 test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt create mode 100644 test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs create mode 100644 test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs create mode 100644 test/Lsp.Integration.Tests/InlineValueTests.cs create mode 100644 test/Lsp.Integration.Tests/TypedTypeHierarchyTests.cs diff --git a/src/Protocol/Features/Document/CallHierarchyFeature.cs b/src/Protocol/Features/Document/CallHierarchyFeature.cs index 73f0949dd..6e49ee177 100644 --- a/src/Protocol/Features/Document/CallHierarchyFeature.cs +++ b/src/Protocol/Features/Document/CallHierarchyFeature.cs @@ -112,8 +112,8 @@ public abstract record CallHierarchyBaseCallParams : ICanBeResolved JToken? ICanBeResolved.Data { - get => Item.GetRawData(); - init => Item.SetRawData(value); + get => Item?.GetRawData(); + init => Item?.SetRawData(value); } } @@ -124,8 +124,8 @@ public abstract record CallHierarchyBaseCallParams : ICanBeResolved JToken? ICanBeResolved.Data { - get => Item.GetRawData(); - init => Item.SetRawData(value); + get => Item?.GetRawData(); + init => Item?.SetRawData(value); } } diff --git a/src/Protocol/Features/Document/DiagnosticsFeature.cs b/src/Protocol/Features/Document/DiagnosticsFeature.cs index 0c1bf067f..45ab5acb1 100644 --- a/src/Protocol/Features/Document/DiagnosticsFeature.cs +++ b/src/Protocol/Features/Document/DiagnosticsFeature.cs @@ -121,13 +121,13 @@ public static RelatedDocumentDiagnosticReport From(RelatedDocumentDiagnosticRepo internal class Converter : JsonConverter { - public override void WriteJson(JsonWriter writer, RelatedDocumentDiagnosticReport value, JsonSerializer serializer) + public override void WriteJson(JsonWriter writer, RelatedDocumentDiagnosticReport? value, JsonSerializer serializer) { throw new NotImplementedException(); } public override RelatedDocumentDiagnosticReport ReadJson( - JsonReader reader, Type objectType, RelatedDocumentDiagnosticReport existingValue, bool hasExistingValue, JsonSerializer serializer + JsonReader reader, Type objectType, RelatedDocumentDiagnosticReport? existingValue, bool hasExistingValue, JsonSerializer serializer ) { throw new NotImplementedException(); diff --git a/src/Protocol/Features/Document/InlineValueFeature.cs b/src/Protocol/Features/Document/InlineValueFeature.cs index 5440fd3a9..769806c78 100644 --- a/src/Protocol/Features/Document/InlineValueFeature.cs +++ b/src/Protocol/Features/Document/InlineValueFeature.cs @@ -63,7 +63,7 @@ public partial record InlineValueContext /// public Range StoppedLocation { get; set; } } - + [Parallel] [Method(WorkspaceNames.InlineValueRefresh, Direction.ServerToClient)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] @@ -94,22 +94,30 @@ public override InlineValueBase ReadJson( ) { var result = JObject.Load(reader); - if (result["text"] is { Type: JTokenType.String }) + if (result.ContainsKey("text")) { - return result.ToObject(); + return new InlineValueText() + { + Range = result["range"]!.ToObject()!, + Text = result["text"]!.Value()! + }; } - if (result["variableName"] is { Type: JTokenType.String }) + if (result.ContainsKey("variableName") || result.ContainsKey("caseSensitiveLookup")) { - return result.ToObject(); + return new InlineValueVariableLookup() + { + Range = result["range"].ToObject()!, + VariableName = result["variableName"]!.Value()!, + CaseSensitiveLookup = result["caseSensitiveLookup"]?.Value() ?? false, + }; } - if (result["expression"] is { Type: JTokenType.String }) + return new InlineValueEvaluatableExpression() { - return result.ToObject(); - } - - return null!; + Range = result["range"].ToObject()!, + Expression = result["expression"]?.Value() + }; } } } @@ -119,7 +127,6 @@ public override InlineValueBase ReadJson( /// /// @since 3.17.0 /// - [JsonConverter(typeof(Converter))] public partial record InlineValueText : InlineValueBase { /// @@ -138,7 +145,6 @@ public partial record InlineValueText : InlineValueBase /// /// @since 3.17.0 /// - [JsonConverter(typeof(Converter))] public partial record InlineValueVariableLookup : InlineValueBase { /// @@ -163,7 +169,6 @@ public partial record InlineValueVariableLookup : InlineValueBase /// /// @since 3.17.0 /// - [JsonConverter(typeof(Converter))] public partial record InlineValueEvaluatableExpression : InlineValueBase { /// diff --git a/src/Protocol/Features/Document/MonikerFeature.cs b/src/Protocol/Features/Document/MonikerFeature.cs index fe9cfab03..336f42b30 100644 --- a/src/Protocol/Features/Document/MonikerFeature.cs +++ b/src/Protocol/Features/Document/MonikerFeature.cs @@ -23,7 +23,7 @@ namespace Models /// [Parallel] [Method(TextDocumentNames.Moniker, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document")] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "Monikers")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(MonikerRegistrationOptions))] diff --git a/src/Protocol/Features/Document/TypeHierarchyFeature.cs b/src/Protocol/Features/Document/TypeHierarchyFeature.cs index 8ca5918a4..02c25f411 100644 --- a/src/Protocol/Features/Document/TypeHierarchyFeature.cs +++ b/src/Protocol/Features/Document/TypeHierarchyFeature.cs @@ -106,7 +106,7 @@ public override string ToString() } } - public abstract record TypeHierarchyBaseCallParams : ICanBeResolved + public abstract record TypeHierarchyBaseParams : ICanBeResolved { public TypeHierarchyItem Item { get; init; } = null!; @@ -117,7 +117,7 @@ public abstract record TypeHierarchyBaseCallParams : ICanBeResolved } } - public abstract record TypeHierarchyBaseCallParams : ICanBeResolved + public abstract record TypeHierarchyBaseParams : ICanBeResolved where T : class?, IHandlerIdentity? { public TypeHierarchyItem Item { get; init; } = null!; @@ -130,7 +130,7 @@ public abstract record TypeHierarchyBaseCallParams : ICanBeResolved } /// - /// The parameter of a `TypeHierarchy/supertypesCalls` request. + /// The parameter of a `TypeHierarchy/supertypes` request. /// /// @since 3.16.0 /// @@ -140,42 +140,23 @@ public abstract record TypeHierarchyBaseCallParams : ICanBeResolved [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [Capability(typeof(TypeHierarchyCapability))] - public partial record TypeHierarchySupertypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, TypeHierarchySupertypesCall>, + public partial record TypeHierarchySupertypesParams : TypeHierarchyBaseParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchyItem>, IDoesNotParticipateInRegistration; /// - /// The parameter of a `TypeHierarchy/supertypesCalls` request. + /// The parameter of a `TypeHierarchy/supertypes` request. /// /// @since 3.16.0 /// [Method(TextDocumentNames.TypeHierarchySupertypes, Direction.ClientToServer)] - public partial record TypeHierarchySupertypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, TypeHierarchySupertypesCall>, + public partial record TypeHierarchySupertypesParams : TypeHierarchyBaseParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchyItem>, IDoesNotParticipateInRegistration where T : class?, IHandlerIdentity?; /// - /// Represents an supertypes call, e.g. a caller of a method or constructor. - /// - /// @since 3.16.0 - /// - public partial record TypeHierarchySupertypesCall - { - /// - /// The item that makes the call. - /// - public TypeHierarchyItem From { get; init; } = null!; - - /// - /// The range at which at which the calls appears. This is relative to the caller - /// denoted by [`this.from`](#TypeHierarchySupertypesCall.from). - /// - public Container FromRanges { get; init; } = null!; - } - - /// - /// The parameter of a `TypeHierarchy/subtypesCalls` request. + /// The parameter of a `TypeHierarchy/subtypes` request. /// /// @since 3.16.0 /// @@ -185,15 +166,15 @@ public partial record TypeHierarchySupertypesCall [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [Capability(typeof(TypeHierarchyCapability))] - public partial record TypeHierarchySubtypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, TypeHierarchySubtypesCall>, + public partial record TypeHierarchySubtypesParams : TypeHierarchyBaseParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchyItem>, IDoesNotParticipateInRegistration { - public static TypeHierarchySubtypesCallsParams Create(TypeHierarchySubtypesCallsParams item) + public static TypeHierarchySubtypesParams Create(TypeHierarchySubtypesParams item) where T : class?, IHandlerIdentity? { - return new TypeHierarchySubtypesCallsParams + return new TypeHierarchySubtypesParams { Item = item.Item, PartialResultToken = item.PartialResultToken, @@ -203,19 +184,19 @@ public static TypeHierarchySubtypesCallsParams Create(TypeHierarchySubtype } /// - /// The parameter of a `TypeHierarchy/subtypesCalls` request. + /// The parameter of a `TypeHierarchy/subtypes` request. /// /// @since 3.16.0 /// [Method(TextDocumentNames.TypeHierarchySubtypes, Direction.ClientToServer)] - public partial record TypeHierarchySubtypesCallsParams : TypeHierarchyBaseCallParams, IWorkDoneProgressParams, - IPartialItemsRequest?, TypeHierarchySubtypesCall>, + public partial record TypeHierarchySubtypesParams : TypeHierarchyBaseParams, IWorkDoneProgressParams, + IPartialItemsRequest?, TypeHierarchyItem>, IDoesNotParticipateInRegistration where T : class?, IHandlerIdentity? { - public static TypeHierarchySubtypesCallsParams Create(TypeHierarchySubtypesCallsParams item) + public static TypeHierarchySubtypesParams Create(TypeHierarchySubtypesParams item) { - return new TypeHierarchySubtypesCallsParams + return new TypeHierarchySubtypesParams { Item = item.Item, PartialResultToken = item.PartialResultToken, @@ -223,39 +204,19 @@ public static TypeHierarchySubtypesCallsParams Create(TypeHierarchySubtypesCalls }; } - public static implicit operator TypeHierarchySubtypesCallsParams(TypeHierarchySubtypesCallsParams item) + public static implicit operator TypeHierarchySubtypesParams(TypeHierarchySubtypesParams item) { return Create(item); } - public static implicit operator TypeHierarchySubtypesCallsParams(TypeHierarchySubtypesCallsParams item) + public static implicit operator TypeHierarchySubtypesParams(TypeHierarchySubtypesParams item) { - return TypeHierarchySubtypesCallsParams.Create(item); + return TypeHierarchySubtypesParams.Create(item); } } /// - /// Represents an subtypes call, e.g. calling a getter from a method or a method from a constructor etc. - /// - /// @since 3.16.0 - /// - public partial record TypeHierarchySubtypesCall - { - /// - /// The item that is called. - /// - public TypeHierarchyItem To { get; init; } = null!; - - /// - /// The range at which this item is called. This is the range relative to the caller, e.g the item - /// passed to [`provideTypeHierarchySubtypesCalls`](#TypeHierarchyItemProvider.provideTypeHierarchySubtypesCalls) - /// and not [`this.to`](#TypeHierarchySubtypesCall.to). - /// - public Container FromRanges { get; init; } = null!; - } - - /// - /// Call hierarchy options used during static or dynamic registration. + /// Type hierarchy options used during static or dynamic registration. /// /// @since 3.16.0 /// @@ -269,7 +230,7 @@ public partial class TypeHierarchyRegistrationOptions : ITextDocumentRegistratio namespace Client.Capabilities { /// - /// Capabilities specific to the `textDocument/TypeHierarchy`. + /// Capabilities specific to the `textDocument/typeHierarchy`. /// /// @since 3.16.0 /// @@ -299,8 +260,8 @@ protected TypeHierarchyHandlerBase() : this(Guid.NewGuid()) } public abstract Task?> Handle(TypeHierarchyPrepareParams request, CancellationToken cancellationToken); - public abstract Task?> Handle(TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken); - public abstract Task?> Handle(TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken); + public abstract Task?> Handle(TypeHierarchySupertypesParams request, CancellationToken cancellationToken); + public abstract Task?> Handle(TypeHierarchySubtypesParams request, CancellationToken cancellationToken); } public abstract class PartialTypeHierarchyHandlerBase : AbstractHandlers.PartialResults?, @@ -324,28 +285,28 @@ protected PartialTypeHierarchyHandlerBase(IProgressManager progressManager) : th { } - public Task?> Handle(TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken) + public Task?> Handle(TypeHierarchySupertypesParams request, CancellationToken cancellationToken) { return _supertypes.Handle(request, cancellationToken); } - public Task?> Handle(TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken) + public Task?> Handle(TypeHierarchySubtypesParams request, CancellationToken cancellationToken) { return _subtypes.Handle(request, cancellationToken); } protected abstract void Handle( - TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySupertypesParams request, IObserver> results, CancellationToken cancellationToken ); protected abstract void Handle( - TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySubtypesParams request, IObserver> results, CancellationToken cancellationToken ); private class PartialSupertypes : AbstractHandlers.PartialResults< - TypeHierarchySupertypesCallsParams, - Container?, - TypeHierarchySupertypesCall, + TypeHierarchySupertypesParams, + Container?, + TypeHierarchyItem, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >, ITypeHierarchySupertypesHandler @@ -355,15 +316,15 @@ private class PartialSupertypes : AbstractHandlers.PartialResults< Guid ICanBeIdentifiedHandler.Id => _id; public PartialSupertypes(Guid id, IProgressManager progressManager, PartialTypeHierarchyHandlerBase self) : - base(progressManager, Container.From) + base(progressManager, Container.From) { _id = id; _self = self; } protected override void Handle( - TypeHierarchySupertypesCallsParams request, - IObserver> results, + TypeHierarchySupertypesParams request, + IObserver> results, CancellationToken cancellationToken ) { @@ -380,8 +341,8 @@ protected internal override TypeHierarchyRegistrationOptions CreateRegistrationO } } - private class PartialSubtypes : AbstractHandlers.PartialResults?, - TypeHierarchySubtypesCall, TypeHierarchyRegistrationOptions + private class PartialSubtypes : AbstractHandlers.PartialResults?, + TypeHierarchyItem, TypeHierarchyRegistrationOptions , TypeHierarchyCapability>, ITypeHierarchySubtypesHandler { private readonly PartialTypeHierarchyHandlerBase _self; @@ -389,7 +350,7 @@ private class PartialSubtypes : AbstractHandlers.PartialResults _id; public PartialSubtypes(Guid id, IProgressManager progressManager, PartialTypeHierarchyHandlerBase self) : - base(progressManager, Container.From) + base(progressManager, Container.From) { _id = id; @@ -397,7 +358,7 @@ public PartialSubtypes(Guid id, IProgressManager progressManager, PartialTypeHie } protected override void Handle( - TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySubtypesParams request, IObserver> results, CancellationToken cancellationToken ) { _self.Handle(request, results, cancellationToken); @@ -430,12 +391,12 @@ protected TypeHierarchyHandlerBase() : this(Guid.NewGuid()) return Container.From(response?.Select(TypeHierarchyItem.From)!); } - public sealed override Task?> Handle( - TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken + public sealed override Task?> Handle( + TypeHierarchySupertypesParams request, CancellationToken cancellationToken ) { - return HandleSupertypesCalls( - new TypeHierarchySupertypesCallsParams + return HandleSupertypes( + new TypeHierarchySupertypesParams { Item = request.Item, PartialResultToken = request.PartialResultToken, @@ -445,12 +406,12 @@ protected TypeHierarchyHandlerBase() : this(Guid.NewGuid()) ); } - public sealed override Task?> Handle( - TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken + public sealed override Task?> Handle( + TypeHierarchySubtypesParams request, CancellationToken cancellationToken ) { - return HandleSubtypesCalls( - new TypeHierarchySubtypesCallsParams + return HandleSubtypes( + new TypeHierarchySubtypesParams { Item = request.Item, PartialResultToken = request.PartialResultToken, @@ -462,12 +423,12 @@ protected TypeHierarchyHandlerBase() : this(Guid.NewGuid()) protected abstract Task>?> HandlePrepare(TypeHierarchyPrepareParams request, CancellationToken cancellationToken); - protected abstract Task?> HandleSupertypesCalls( - TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken + protected abstract Task?> HandleSupertypes( + TypeHierarchySupertypesParams request, CancellationToken cancellationToken ); - protected abstract Task?> HandleSubtypesCalls( - TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken + protected abstract Task?> HandleSubtypes( + TypeHierarchySubtypesParams request, CancellationToken cancellationToken ); } @@ -496,11 +457,11 @@ protected abstract void Handle( ); protected sealed override void Handle( - TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySupertypesParams request, IObserver> results, CancellationToken cancellationToken ) { Handle( - new TypeHierarchySupertypesCallsParams + new TypeHierarchySupertypesParams { Item = request.Item, PartialResultToken = request.PartialResultToken, @@ -512,15 +473,15 @@ protected sealed override void Handle( } protected abstract void Handle( - TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySupertypesParams request, IObserver> results, CancellationToken cancellationToken ); protected sealed override void Handle( - TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySubtypesParams request, IObserver> results, CancellationToken cancellationToken ) { Handle( - new TypeHierarchySubtypesCallsParams + new TypeHierarchySubtypesParams { Item = request.Item, PartialResultToken = request.PartialResultToken, @@ -532,7 +493,7 @@ protected sealed override void Handle( } protected abstract void Handle( - TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySubtypesParams request, IObserver> results, CancellationToken cancellationToken ); } @@ -541,8 +502,8 @@ public static partial class TypeHierarchyExtensions public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Func?>> handler, - Func?>> supertypesHandler, - Func?>> subtypesHandler, + Func?>> supertypesHandler, + Func?>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) { @@ -564,8 +525,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( .AddHandler( TextDocumentNames.TypeHierarchySupertypes, new LanguageProtocolDelegatingHandlers.Request< - TypeHierarchySupertypesCallsParams, - Container?, + TypeHierarchySupertypesParams, + Container?, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -577,8 +538,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( .AddHandler( TextDocumentNames.TypeHierarchySubtypes, new LanguageProtocolDelegatingHandlers.Request< - TypeHierarchySubtypesCallsParams, - Container?, + TypeHierarchySubtypesParams, + Container?, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -593,9 +554,9 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Func>?>> handler, - Func, TypeHierarchyCapability, CancellationToken, Task?>> + Func, TypeHierarchyCapability, CancellationToken, Task?>> supertypesHandler, - Func, TypeHierarchyCapability, CancellationToken, Task?>> + Func, TypeHierarchyCapability, CancellationToken, Task?>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? @@ -613,8 +574,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Func?>> handler, - Func?>> supertypesHandler, - Func?>> subtypesHandler, + Func?>> supertypesHandler, + Func?>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) { @@ -636,8 +597,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( .AddHandler( TextDocumentNames.TypeHierarchySupertypes, new LanguageProtocolDelegatingHandlers.Request< - TypeHierarchySupertypesCallsParams, - Container?, + TypeHierarchySupertypesParams, + Container?, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -648,8 +609,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( ) .AddHandler( TextDocumentNames.TypeHierarchySubtypes, - new LanguageProtocolDelegatingHandlers.Request?, + new LanguageProtocolDelegatingHandlers.Request?, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -664,8 +625,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Func>?>> handler, - Func, TypeHierarchyCapability, Task?>> supertypesHandler, - Func, TypeHierarchyCapability, Task?>> subtypesHandler, + Func, TypeHierarchyCapability, Task?>> supertypesHandler, + Func, TypeHierarchyCapability, Task?>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -682,8 +643,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Func>?>> handler, - Func, CancellationToken, Task?>> supertypesHandler, - Func, CancellationToken, Task?>> subtypesHandler, + Func, CancellationToken, Task?>> supertypesHandler, + Func, CancellationToken, Task?>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -700,8 +661,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Func>?>> handler, - Func, Task?>> supertypesHandler, - Func, Task?>> subtypesHandler, + Func, Task?>> supertypesHandler, + Func, Task?>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -718,9 +679,9 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Action>, TypeHierarchyCapability, CancellationToken> handler, - Action>, TypeHierarchyCapability, CancellationToken> + Action>, TypeHierarchyCapability, CancellationToken> supertypesHandler, - Action>, TypeHierarchyCapability, CancellationToken> + Action>, TypeHierarchyCapability, CancellationToken> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) @@ -744,8 +705,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( .AddHandler( TextDocumentNames.TypeHierarchySupertypes, _ => new LanguageProtocolDelegatingHandlers.PartialResults< - TypeHierarchySupertypesCallsParams, - Container?, TypeHierarchySupertypesCall, + TypeHierarchySupertypesParams, + Container?, TypeHierarchyItem, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -753,14 +714,14 @@ public static ILanguageServerRegistry OnTypeHierarchy( PartialAdapter.Adapt(supertypesHandler), RegistrationAdapter.Adapt(registrationOptionsFactory), _.GetRequiredService(), - Container.From + Container.From ) ) .AddHandler( TextDocumentNames.TypeHierarchySubtypes, _ => new LanguageProtocolDelegatingHandlers.PartialResults< - TypeHierarchySubtypesCallsParams, - Container?, TypeHierarchySubtypesCall, + TypeHierarchySubtypesParams, + Container?, TypeHierarchyItem, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -768,7 +729,7 @@ public static ILanguageServerRegistry OnTypeHierarchy( PartialAdapter.Adapt(subtypesHandler), RegistrationAdapter.Adapt(registrationOptionsFactory), _.GetRequiredService(), - Container.From + Container.From ) ) ; @@ -777,9 +738,9 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Action>>, TypeHierarchyCapability, CancellationToken> handler, - Action, IObserver>, TypeHierarchyCapability, CancellationToken> + Action, IObserver>, TypeHierarchyCapability, CancellationToken> supertypesHandler, - Action, IObserver>, TypeHierarchyCapability, CancellationToken> + Action, IObserver>, TypeHierarchyCapability, CancellationToken> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? @@ -799,8 +760,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Action>, TypeHierarchyCapability> handler, - Action>, TypeHierarchyCapability> supertypesHandler, - Action>, TypeHierarchyCapability> subtypesHandler, + Action>, TypeHierarchyCapability> supertypesHandler, + Action>, TypeHierarchyCapability> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) { @@ -824,8 +785,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( .AddHandler( TextDocumentNames.TypeHierarchySupertypes, _ => new LanguageProtocolDelegatingHandlers.PartialResults< - TypeHierarchySupertypesCallsParams, - Container?, TypeHierarchySupertypesCall, + TypeHierarchySupertypesParams, + Container?, TypeHierarchyItem, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -833,14 +794,14 @@ public static ILanguageServerRegistry OnTypeHierarchy( PartialAdapter.Adapt(supertypesHandler), RegistrationAdapter.Adapt(registrationOptionsFactory), _.GetRequiredService(), - Container.From + Container.From ) ) .AddHandler( TextDocumentNames.TypeHierarchySubtypes, _ => new LanguageProtocolDelegatingHandlers.PartialResults< - TypeHierarchySubtypesCallsParams, - Container?, TypeHierarchySubtypesCall, + TypeHierarchySubtypesParams, + Container?, TypeHierarchyItem, TypeHierarchyRegistrationOptions, TypeHierarchyCapability >( @@ -848,7 +809,7 @@ public static ILanguageServerRegistry OnTypeHierarchy( PartialAdapter.Adapt(subtypesHandler), RegistrationAdapter.Adapt(registrationOptionsFactory), _.GetRequiredService(), - Container.From + Container.From ) ) ; @@ -857,8 +818,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Action>>, TypeHierarchyCapability> handler, - Action, IObserver>, TypeHierarchyCapability> supertypesHandler, - Action, IObserver>, TypeHierarchyCapability> subtypesHandler, + Action, IObserver>, TypeHierarchyCapability> supertypesHandler, + Action, IObserver>, TypeHierarchyCapability> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -876,8 +837,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Action>>, CancellationToken> handler, - Action, IObserver>, CancellationToken> supertypesHandler, - Action, IObserver>, CancellationToken> subtypesHandler, + Action, IObserver>, CancellationToken> supertypesHandler, + Action, IObserver>, CancellationToken> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -895,8 +856,8 @@ public static ILanguageServerRegistry OnTypeHierarchy( public static ILanguageServerRegistry OnTypeHierarchy( this ILanguageServerRegistry registry, Action>>> handler, - Action, IObserver>> supertypesHandler, - Action, IObserver>> subtypesHandler, + Action, IObserver>> supertypesHandler, + Action, IObserver>> subtypesHandler, RegistrationOptionsDelegate? registrationOptionsFactory ) where T : class?, IHandlerIdentity? { @@ -916,28 +877,28 @@ private class DelegatingTypeHierarchyHandler : TypeHierarchyHandlerBase wh private readonly Func>?>> _handlePrepare; - private readonly Func, TypeHierarchyCapability, CancellationToken, - Task?>> - _handleSupertypesCalls; + private readonly Func, TypeHierarchyCapability, CancellationToken, + Task?>> + _handleSupertypes; - private readonly Func, TypeHierarchyCapability, CancellationToken, - Task?>> - _handleSubtypesCalls; + private readonly Func, TypeHierarchyCapability, CancellationToken, + Task?>> + _handleSubtypes; private readonly RegistrationOptionsDelegate _registrationOptionsFactory; public DelegatingTypeHierarchyHandler( Func>?>> handlePrepare, - Func, TypeHierarchyCapability, CancellationToken, Task?>> - handleSupertypesCalls, - Func, TypeHierarchyCapability, CancellationToken, Task?>> - handleSubtypesCalls, + Func, TypeHierarchyCapability, CancellationToken, Task?>> + handleSupertypes, + Func, TypeHierarchyCapability, CancellationToken, Task?>> + handleSubtypes, RegistrationOptionsDelegate registrationOptionsFactory ) { _handlePrepare = handlePrepare; - _handleSupertypesCalls = handleSupertypesCalls; - _handleSubtypesCalls = handleSubtypesCalls; + _handleSupertypes = handleSupertypes; + _handleSubtypes = handleSubtypes; _registrationOptionsFactory = registrationOptionsFactory; } @@ -946,18 +907,18 @@ RegistrationOptionsDelegate?> HandleSupertypesCalls( - TypeHierarchySupertypesCallsParams request, CancellationToken cancellationToken + protected override Task?> HandleSupertypes( + TypeHierarchySupertypesParams request, CancellationToken cancellationToken ) { - return _handleSupertypesCalls(request, Capability, cancellationToken); + return _handleSupertypes(request, Capability, cancellationToken); } - protected override Task?> HandleSubtypesCalls( - TypeHierarchySubtypesCallsParams request, CancellationToken cancellationToken + protected override Task?> HandleSubtypes( + TypeHierarchySubtypesParams request, CancellationToken cancellationToken ) { - return _handleSubtypesCalls(request, Capability, cancellationToken); + return _handleSubtypes(request, Capability, cancellationToken); } protected internal override TypeHierarchyRegistrationOptions CreateRegistrationOptions( @@ -973,11 +934,11 @@ private class DelegatingPartialTypeHierarchyHandler : PartialTypeHierarchyHan private readonly Action>>, TypeHierarchyCapability, CancellationToken> _handleParams; - private readonly Action, IObserver>, TypeHierarchyCapability, + private readonly Action, IObserver>, TypeHierarchyCapability, CancellationToken> _handleSupertypes; - private readonly Action, IObserver>, TypeHierarchyCapability, + private readonly Action, IObserver>, TypeHierarchyCapability, CancellationToken> _handleSubtypes; @@ -986,9 +947,9 @@ private readonly Action>>, TypeHierarchyCapability, CancellationToken> handleParams, - Action, IObserver>, TypeHierarchyCapability, CancellationToken> + Action, IObserver>, TypeHierarchyCapability, CancellationToken> handleSupertypes, - Action, IObserver>, TypeHierarchyCapability, CancellationToken> + Action, IObserver>, TypeHierarchyCapability, CancellationToken> handleSubtypes, RegistrationOptionsDelegate registrationOptionsFactory ) : base(progressManager) @@ -1007,14 +968,14 @@ protected override void Handle( } protected override void Handle( - TypeHierarchySupertypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySupertypesParams request, IObserver> results, CancellationToken cancellationToken ) { _handleSupertypes(request, results, Capability, cancellationToken); } protected override void Handle( - TypeHierarchySubtypesCallsParams request, IObserver> results, CancellationToken cancellationToken + TypeHierarchySubtypesParams request, IObserver> results, CancellationToken cancellationToken ) { _handleSubtypes(request, results, Capability, cancellationToken); diff --git a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs index 3565b53ae..03653d58b 100644 --- a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs +++ b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs @@ -4,6 +4,7 @@ namespace Generation.Tests { + [UsesVerify] public class AutoImplementParamsGeneratorTests { [Fact] @@ -23,31 +24,7 @@ namespace Test public partial class DeclarationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest { } } "; - var expected = @" -#nullable enable -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using Newtonsoft.Json; -using System.ComponentModel; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; - -namespace Test -{ - public partial class DeclarationParams - { - [Optional] - public ProgressToken? WorkDoneToken { get; init; } - - [Optional] - public ProgressToken? PartialResultToken { get; init; } - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(GenerationHelpers.GenerateAll(source)); } } } diff --git a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs index 4ba031458..1bad0d8cd 100644 --- a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs +++ b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs @@ -21,7 +21,7 @@ public readonly partial struct ThreadEventReason } } "; - await Verify(GenerationHelpers.Generate(source)); + await Verify(GenerationHelpers.GenerateAll(source)); } } } diff --git a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs index 4a1d3026c..2a4e132f8 100644 --- a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs +++ b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs @@ -21,7 +21,7 @@ namespace Test public partial class WorkspaceSymbolRegistrationOptions { } } "; - await Verify(await GenerationHelpers.Generate(source)); + await Verify(await GenerationHelpers.GenerateAll(source)); } [Fact] @@ -40,7 +40,7 @@ public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptio } "; - await Verify(await GenerationHelpers.Generate(source)); + await Verify(await GenerationHelpers.GenerateAll(source)); } [Fact] @@ -91,7 +91,7 @@ public partial class CodeActionRegistrationOptions } } #nullable restore"; - await Verify(await GenerationHelpers.Generate(source)); + await Verify(await GenerationHelpers.GenerateAll(source)); } [Fact] @@ -161,7 +161,7 @@ public override StaticCodeActionRegistrationOptions Convert(CodeActionRegistrati } #nullable restore"; - await Verify(await GenerationHelpers.Generate(source)); + await Verify(await GenerationHelpers.GenerateAll(source)); } } } diff --git a/test/Generation.Tests/GenerationHelpers.cs b/test/Generation.Tests/GenerationHelpers.cs index 5dc0da1a2..0726a2008 100644 --- a/test/Generation.Tests/GenerationHelpers.cs +++ b/test/Generation.Tests/GenerationHelpers.cs @@ -3,6 +3,7 @@ using System.Collections.Immutable; using System.IO; using System.Linq; +using System.Reflection; using System.Threading.Tasks; using FluentAssertions; using MediatR; @@ -12,6 +13,7 @@ using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol.Client; using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.JsonRpc.Generators; using OmniSharp.Extensions.LanguageServer.Protocol.Server; using Xunit; @@ -52,8 +54,12 @@ static GenerationHelpers() MetadataReferences = coreMetaReferences .Concat(otherAssemblies.Distinct().Select(x => MetadataReference.CreateFromFile(x.Location))) .ToImmutableArray(); + + AllGenerators = typeof(StronglyTypedGenerator).Assembly.GetTypes().Where(z => typeof(IIncrementalGenerator).IsAssignableFrom(z) && z.GetCustomAttributes().Any()).ToImmutableArray(); } + public static ImmutableArray AllGenerators { get; set; } + internal const string CrLf = "\r\n"; internal const string Lf = "\n"; internal const string DefaultFilePathPrefix = "Test"; @@ -87,6 +93,61 @@ public static string NormalizeToLf(string input) return input.Replace(CrLf, Lf); } + public static async Task GenerateAll(string source) + { + var document = CreateProject(source).Documents.Single(); + var tree = await document.GetSyntaxTreeAsync(); + if (tree is null) + { + throw new InvalidOperationException("Could not get the syntax tree of the sources"); + } + + var compilation = (CSharpCompilation)( await document.Project.GetCompilationAsync() )!; + if (compilation is null) + { + throw new InvalidOperationException("Could not compile the sources"); + } + + GeneratorDriver driver = CSharpGeneratorDriver.Create( + AllGenerators.Select(z => Activator.CreateInstance(z) as IIncrementalGenerator).Select(z => z.AsSourceGenerator()).ToImmutableArray(), + ImmutableArray.Empty, + compilation.SyntaxTrees[0].Options as CSharpParseOptions + ); + + driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); + return driver.GetRunResult(); + } + + public static async Task GeneratorRun(string source) where T : IIncrementalGenerator, new() + { + var document = CreateProject(source).Documents.Single(); + var tree = await document.GetSyntaxTreeAsync(); + if (tree is null) + { + throw new InvalidOperationException("Could not get the syntax tree of the sources"); + } + + var compilation = (CSharpCompilation)( await document.Project.GetCompilationAsync() )!; + if (compilation is null) + { + throw new InvalidOperationException("Could not compile the sources"); + } + + var diagnostics = compilation.GetDiagnostics(); +// Assert.Empty(diagnostics.Where(x => x.Severity >= DiagnosticSeverity.Warning)); + + IIncrementalGenerator generator = new T(); + + GeneratorDriver driver = CSharpGeneratorDriver.Create( + ImmutableArray.Create(generator.AsSourceGenerator()), + ImmutableArray.Empty, + compilation.SyntaxTrees[0].Options as CSharpParseOptions + ); + + driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out diagnostics); + return driver.GetRunResult(); + } + public static async Task> GenerateAsync(string source) where T : IIncrementalGenerator, new() { var document = CreateProject(source).Documents.Single(); diff --git a/test/Generation.Tests/JsonRpcGenerationTests.cs b/test/Generation.Tests/JsonRpcGenerationTests.cs index 129651727..614fd3cdf 100644 --- a/test/Generation.Tests/JsonRpcGenerationTests.cs +++ b/test/Generation.Tests/JsonRpcGenerationTests.cs @@ -34,7 +34,7 @@ public interface IExitHandler : IJsonRpcNotificationHandler } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -78,7 +78,7 @@ public partial record ExecuteCommandParams : IRequest, IWorkDoneProgressPa } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -108,6 +108,7 @@ public interface IExitHandler : IJsonRpcNotificationHandler var a = () => AssertGeneratedAsExpected(source, ""); await a.Should().ThrowAsync().WithMessage("*Could not infer the request router(s)*"); await a.Should().ThrowAsync("cache").WithMessage("*Could not infer the request router(s)*"); + await Verify(GenerateAll(source)); } [Fact] @@ -127,7 +128,7 @@ namespace OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test public interface ICapabilitiesHandler : IJsonRpcNotificationHandler { } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } @@ -155,7 +156,7 @@ public interface IExitHandler : IJsonRpcNotificationHandler } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -183,7 +184,7 @@ public interface IDidChangeTextDocumentHandler : IJsonRpcNotificationHandler(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -213,7 +214,7 @@ public interface IFoldingRangeHandler : IJsonRpcRequestHandler(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -239,7 +240,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Test public interface IDefinitionHandler : IJsonRpcRequestHandler, IRegistration { } }"; - await Verify(GenerationHelpers.Generate(source)); + await Verify(GenerationHelpers.GenerateAll(source)); } @@ -266,7 +267,7 @@ namespace Test public interface IDefinitionHandler : IJsonRpcRequestHandler, IRegistration { } }"; - await Verify(GenerationHelpers.Generate(source)); + await Verify(GenerationHelpers.GenerateAll(source)); } [Fact] @@ -297,7 +298,7 @@ namespace Test [Serial, Method(GeneralNames.Initialize, Direction.ClientToServer), GenerateHandlerMethods(typeof(ILanguageServerRegistry), MethodName = ""OnLanguageProtocolInitialize""), GenerateRequestMethods(typeof(ITextDocumentLanguageClient), MethodName = ""RequestLanguageProtocolInitialize"")] public interface ILanguageProtocolInitializeHandler : IJsonRpcRequestHandler {} }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -319,7 +320,7 @@ public class AttachResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class AttachRequestArguments: IRequest { } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -341,7 +342,7 @@ public class LaunchResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class LaunchRequestArguments: IRequest { } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -363,7 +364,7 @@ public class AttachResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class AttachRequestArguments: IRequest { } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -385,7 +386,7 @@ public class AttachResponse { } [GenerateHandler(AllowDerivedRequests = true), GenerateHandlerMethods, GenerateRequestMethods] public class AttachRequestArguments: IRequest { } }"; - await Verify(Generate(source)); + await Verify(GenerateAll(source)); } [Fact] @@ -417,7 +418,7 @@ public partial class RenameParams : ITextDocumentIdentifierParams, IRequest(source)); + await Verify(GenerateAll(source)); } } } diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 1d087b085..624281bc5 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -12,17 +12,7 @@ public class LspFeatureTests public async Task Supports_Params_Type_As_Source() { var source = FeatureFixture.ReadSource("Workspace.WorkspaceSymbolsFeature.cs"); - await Verify( - new - { - RegistrationOptionsGenerator = await GenerationHelpers.GenerateAsync(source), - StronglyTypedGenerator = await GenerationHelpers.GenerateAsync(source), - GenerateHandlerMethodsGenerator = await GenerationHelpers.GenerateAsync(source), - AutoImplementParamsGenerator = await GenerationHelpers.GenerateAsync(source), - AssemblyCapabilityKeyAttributeGenerator = await GenerationHelpers.GenerateAsync(source), - AssemblyJsonRpcHandlersAttributeGenerator = await GenerationHelpers.GenerateAsync(source), - EnumLikeStringGenerator = await GenerationHelpers.GenerateAsync(source), - }); + await Verify(GenerationHelpers.GenerateAll(source)); } [Fact] @@ -82,17 +72,7 @@ public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions } #nullable restore"; - await Verify( - new - { - RegistrationOptionsGenerator = await GenerationHelpers.GenerateAsync(source), - StronglyTypedGenerator = await GenerationHelpers.GenerateAsync(source), - GenerateHandlerMethodsGenerator = await GenerationHelpers.GenerateAsync(source), - AutoImplementParamsGenerator = await GenerationHelpers.GenerateAsync(source), - AssemblyCapabilityKeyAttributeGenerator = await GenerationHelpers.GenerateAsync(source), - AssemblyJsonRpcHandlersAttributeGenerator = await GenerationHelpers.GenerateAsync(source), - EnumLikeStringGenerator = await GenerationHelpers.GenerateAsync(source), - }); + await Verify(GenerationHelpers.GenerateAll(source)); } [Fact] @@ -142,17 +122,7 @@ public partial class Registration } #nullable restore"; - await Verify( - new - { - RegistrationOptionsGenerator = await GenerationHelpers.GenerateAsync(source), - StronglyTypedGenerator = await GenerationHelpers.GenerateAsync(source), - GenerateHandlerMethodsGenerator = await GenerationHelpers.GenerateAsync(source), - AutoImplementParamsGenerator = await GenerationHelpers.GenerateAsync(source), - AssemblyCapabilityKeyAttributeGenerator = await GenerationHelpers.GenerateAsync(source), - AssemblyJsonRpcHandlersAttributeGenerator = await GenerationHelpers.GenerateAsync(source), - EnumLikeStringGenerator = await GenerationHelpers.GenerateAsync(source), - }); + await Verify(GenerationHelpers.GenerateAll(source)); } } } diff --git a/test/Generation.Tests/TypedCanBeResolvedTests.cs b/test/Generation.Tests/TypedCanBeResolvedTests.cs index e3512ef7e..2d0f91e00 100644 --- a/test/Generation.Tests/TypedCanBeResolvedTests.cs +++ b/test/Generation.Tests/TypedCanBeResolvedTests.cs @@ -4,6 +4,7 @@ namespace Generation.Tests { + [UsesVerify] public class TypedCanBeResolvedTests { [Fact] @@ -59,190 +60,7 @@ public partial record CodeLens : IRequest, ICanBeResolved } #nullable restore"; - var expected = @" -using System; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using MediatR; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Immutable; -using System.Linq; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ - public partial record CodeLens - { - public CodeLens WithData(TData data) - where TData : class?, IHandlerIdentity? - { - return new CodeLens{Range = Range, Command = Command, Data = data}; - } - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""item"")] - public static CodeLens? From(CodeLens? item) - where T : class?, IHandlerIdentity? => item switch - { - not null => item, - _ => null - }; - } - - /// - /// A code lens represents a command that should be shown along with - /// source text, like the number of references, a way to run tests, etc. - /// - /// A code lens is _unresolved_ when no command is associated to it. For performance - /// reasons the creation of a code lens and resolving should be done in two stages. - /// - [DebuggerDisplay(""{"" + nameof(DebuggerDisplay) + "",nq}"")] - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial record CodeLens : ICanBeResolved where T : class?, IHandlerIdentity? - { - /// - /// The range in which this code lens is valid. Should only span a single line. - /// - public Range Range { get; init; } - - [Optional] - public Command? Command { get; init; } - - /// - /// A data entry field that is preserved on a code lens item between - /// a code lens and a code lens resolve request. - /// - [Optional] - public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } - - private string DebuggerDisplay => $""{Range}{(Command != null ? $"" {Command}"" : """")}""; - public override string ToString() => DebuggerDisplay; - public CodeLens WithData(TData data) - where TData : class?, IHandlerIdentity? - { - return new CodeLens{Range = Range, Command = Command, Data = data}; - } - - JToken? ICanBeResolved.Data { get; init; } - - private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } - - public static implicit operator CodeLens(CodeLens value) => new CodeLens{Range = value.Range, Command = value.Command, JData = value.Data}; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""value"")] - public static implicit operator CodeLens? (CodeLens? value) => value switch - { - not null => new CodeLens{Range = value.Range, Command = value.Command, Data = value.JData}, - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""item"")] - public static CodeLens? From(CodeLens? item) => item switch - { - not null => item, - _ => null - }; - } - - public partial class CodeLensContainer : ContainerBase> where T : class?, IHandlerIdentity? - { - public CodeLensContainer() : this(Enumerable.Empty>()) - { - } - - public CodeLensContainer(IEnumerable> items) : base(items) - { - } - - public CodeLensContainer(params CodeLens[] items) : base(items) - { - } - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(IEnumerable>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(params CodeLens[] items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (Collection>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(Collection>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (List>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(List>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (in ImmutableArray>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(in ImmutableArray>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (ImmutableList>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(ImmutableList>? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""container"")] - public static implicit operator CodeLensContainer? (CodeLensContainer? container) => container switch - { - not null => new CodeLensContainer(container.Select(value => (CodeLens)value)), - _ => null - }; - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(GenerationHelpers.GenerateAll(source)); } [Fact] @@ -298,114 +116,7 @@ public partial class CodeLens : IRequest, ICanBeResolved } #nullable restore"; - var expected = @"using System; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using MediatR; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Immutable; -using System.Linq; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Test -{ - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial class CodeLensContainer : ContainerBase - { - public CodeLensContainer() : this(Enumerable.Empty()) - { - } - - public CodeLensContainer(IEnumerable items) : base(items) - { - } - - public CodeLensContainer(params CodeLens[] items) : base(items) - { - } - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(IEnumerable? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(params CodeLens[] items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (Collection? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(Collection? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (List? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(List? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (in ImmutableArray? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(in ImmutableArray? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static implicit operator CodeLensContainer? (ImmutableList? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull(""items"")] - public static CodeLensContainer? From(ImmutableList? items) => items switch - { - not null => new CodeLensContainer(items), - _ => null - }; - } -} -#nullable restore"; - await GenerationHelpers.AssertGeneratedAsExpected(source, expected); + await Verify(GenerationHelpers.GenerateAll(source)); } } } diff --git a/test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs b/test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs new file mode 100644 index 000000000..e3807daac --- /dev/null +++ b/test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs @@ -0,0 +1,23 @@ +ο»Ώ//HintName: Test0_DeclarationParams.cs +#nullable enable +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace Test +{ + public partial class DeclarationParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + + [Optional] + public ProgressToken? PartialResultToken { get; init; } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs similarity index 96% rename from test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt rename to test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs index d5586f89e..106762da2 100644 --- a/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.txt +++ b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs @@ -1,4 +1,5 @@ -ο»Ώ#nullable enable +ο»Ώ//HintName: Test0_ThreadEventReason.cs +#nullable enable using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..f95248a5d --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; + +[assembly: AssemblyRegistrationOptions(typeof(CodeActionRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs similarity index 97% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs index 6f0f0e782..62d94c13b 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.verified.txt +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing System; +ο»Ώ//HintName: CodeActionRegistrationOptions.cs +using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..f95248a5d --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Test; + +[assembly: AssemblyRegistrationOptions(typeof(CodeActionRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs similarity index 97% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs index 28928dfda..5a0e34232 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.verified.txt +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing System; +ο»Ώ//HintName: CodeActionRegistrationOptions.cs +using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..0980e8e3b --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using Test; + +[assembly: AssemblyRegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs similarity index 93% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs index 01837585c..95ed84ad2 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.verified.txt +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol; +ο»Ώ//HintName: WorkspaceSymbolRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..0980e8e3b --- /dev/null +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using Test; + +[assembly: AssemblyRegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs similarity index 93% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs index 72a814123..6d824bc71 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.verified.txt +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing OmniSharp.Extensions.LanguageServer.Protocol; +ο»Ώ//HintName: WorkspaceSymbolRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt new file mode 100644 index 000000000..d9ba20eca --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt @@ -0,0 +1,30 @@ +ο»Ώ{ + Diagnostics: [ + { + Id: JRPC1003, + Title: Cannot infer request router(s), + Severity: Error, + WarningLevel: 0, + Location: Test0.cs: (15,66)-(15,88), + Description: , + HelpLink: , + MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Message: Could not infer the request router(s) to use, please specify the target interface(s)., + Category: JsonRPC, + CustomTags: [] + }, + { + Id: JRPC1003, + Title: Cannot infer request router(s), + Severity: Error, + WarningLevel: 0, + Location: Test0.cs: (15,90)-(15,112), + Description: , + HelpLink: , + MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Message: Could not infer the request router(s) to use, please specify the target interface(s)., + Category: JsonRPC, + CustomTags: [] + } + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..fb24aabc1 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(Test.IExitHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs similarity index 98% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs index c8d6fe2aa..f357428f4 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: AttachRequestArguments.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..98d717787 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.DebugAdapter.Protocol.Bogus.IAttachRequestHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..afa35602e --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.DebugAdapter.Protocol.Bogus.ILaunchRequestHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs similarity index 98% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs index 6f976f45a..3063989f1 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: LaunchRequestArguments.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs similarity index 98% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs index c8d6fe2aa..f357428f4 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: AttachRequestArguments.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..98d717787 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.DebugAdapter.Protocol.Bogus.IAttachRequestHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs similarity index 98% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs index bb407fc31..4c980a0dc 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: AttachRequestArguments.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Bogus; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..98d717787 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.DebugAdapter.Protocol.Bogus.IAttachRequestHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..56b28ef07 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(Test.ILanguageProtocolInitializeHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs similarity index 96% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs index 7338bcc42..fd9218d16 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: ILanguageProtocolInitializeHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs new file mode 100644 index 000000000..c029a1565 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs @@ -0,0 +1,26 @@ +ο»Ώ//HintName: Test0_ExecuteCommandParams1.cs +#nullable enable +using System; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + public partial record ExecuteCommandParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs similarity index 98% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs index 2e3c4907c..fb306e58b 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: ExecuteCommandParams1.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..77e84be8c --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Workspace.IExecuteCommandHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..d39145513 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.DebugAdapter.Protocol.Events.Test.ICapabilitiesHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs similarity index 97% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs index c332f2f34..047814fe1 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: ICapabilitiesHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Client; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt new file mode 100644 index 000000000..a8e983cca --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt @@ -0,0 +1,17 @@ +ο»Ώ{ + Diagnostics: [ + { + Id: JRPC1001, + Title: No Response Router Provided, + Severity: Info, + WarningLevel: 1, + Location: Test0.cs: (17,21)-(17,50), + Description: , + HelpLink: , + MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., + Message: No Response Router Provided for handler {0}, defaulting to {1}., + Category: JsonRPC, + CustomTags: [] + } + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..8955cd33f --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.IDidChangeTextDocumentHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs similarity index 98% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs index c6a4389c7..7ac848a1a 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: IDidChangeTextDocumentHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt new file mode 100644 index 000000000..4b754600e --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt @@ -0,0 +1,17 @@ +ο»Ώ{ + Diagnostics: [ + { + Id: JRPC1001, + Title: No Response Router Provided, + Severity: Info, + WarningLevel: 1, + Location: Test0.cs: (16,21)-(16,33), + Description: , + HelpLink: , + MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., + Message: No Response Router Provided for handler {0}, defaulting to {1}., + Category: JsonRPC, + CustomTags: [] + } + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..9fdf26ab7 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.IExitHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs similarity index 97% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs index 3010363c9..54465bacd 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: IExitHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..f6973f906 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.IFoldingRangeHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs similarity index 99% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs index 8b22ac216..2d2b401f0 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: IFoldingRangeHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..fb24aabc1 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(Test.IExitHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs similarity index 97% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs index 78415af70..e49ba5dff 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: IExitHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..c9c8868a1 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(Test.IDefinitionHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs similarity index 99% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs index ef6fe9dde..4d353e742 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: IDefinitionHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt new file mode 100644 index 000000000..a88f4f32a --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt @@ -0,0 +1,17 @@ +ο»Ώ{ + Diagnostics: [ + { + Id: JRPC1001, + Title: No Response Router Provided, + Severity: Info, + WarningLevel: 1, + Location: Test0.cs: (17,21)-(17,39), + Description: , + HelpLink: , + MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., + Message: No Response Router Provided for handler {0}, defaulting to {1}., + Category: JsonRPC, + CustomTags: [] + } + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..b16bc991b --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: AssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.IDefinitionHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs similarity index 99% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs index 676c48fd3..83fb31b79 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: IDefinitionHandler.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..c6b18d692 --- /dev/null +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Bogus.Handlers.IRenameHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs similarity index 99% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs index eb10b6688..ffd2f3504 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs @@ -1,4 +1,5 @@ -ο»Ώusing MediatR; +ο»Ώ//HintName: RenameParams.cs +using MediatR; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs new file mode 100644 index 000000000..1a13aaaf2 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs @@ -0,0 +1,13 @@ +ο»Ώ//HintName: AssemblyCapabilityKeys.cs +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; + +[assembly: AssemblyCapabilityKey(typeof(Lsp.Tests.Integration.Fixtures.UnitTestCapability), "workspace", "unitTests")] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs new file mode 100644 index 000000000..f8b259c71 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs @@ -0,0 +1,87 @@ +ο»Ώ//HintName: DiscoverUnitTestsParams.cs +using Lsp.Tests.Integration.Fixtures; +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/discover", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IDiscoverUnitTestsHandler : IJsonRpcRequestHandler>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class DiscoverUnitTestsHandlerBase : AbstractHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class DiscoverUnitTestsPartialHandlerBase : AbstractHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler + { + protected DiscoverUnitTestsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + } + } +} +#nullable restore + +namespace Lsp.Tests.Integration.Fixtures +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class DiscoverUnitTestsExtensions + { + public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, UnitTestCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container> RequestDiscoverUnitTests(this ILanguageClient mediator, DiscoverUnitTestsParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..c8f044efb --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(Lsp.Tests.Integration.Fixtures.IUnitTestHandler), typeof(Lsp.Tests.Integration.Fixtures.IDiscoverUnitTestsHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs new file mode 100644 index 000000000..fc42c89cb --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs @@ -0,0 +1,78 @@ +ο»Ώ//HintName: UnitTest.cs +using Lsp.Tests.Integration.Fixtures; +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [Parallel, Method("tests/run", Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IUnitTestHandler : IJsonRpcNotificationHandler, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class UnitTestHandlerBase : AbstractHandlers.Notification, IUnitTestHandler + { + } +} +#nullable restore + +namespace Lsp.Tests.Integration.Fixtures +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class UnitTestExtensions + { + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static void SendUnitTest(this ILanguageClient mediator, UnitTest request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..8bd5dc965 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using Lsp.Tests.Integration.Fixtures; +using OmniSharp.Extensions.LanguageServer.Protocol; + +[assembly: AssemblyRegistrationOptions(typeof(UnitTestRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs new file mode 100644 index 000000000..5604552b9 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs @@ -0,0 +1,47 @@ +ο»Ώ//HintName: UnitTestRegistrationOptions.cs +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [RegistrationOptionsKey("unitTestDiscovery")] + [RegistrationOptionsConverterAttribute(typeof(UnitTestRegistrationOptionsConverter))] + public partial class UnitTestRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + + class UnitTestRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + public UnitTestRegistrationOptionsConverter() + { + } + + public override StaticOptions Convert(UnitTestRegistrationOptions source) + { + return new StaticOptions{SupportsDebugging = source.SupportsDebugging, WorkDoneProgress = source.WorkDoneProgress}; + } + } + + [RegistrationOptionsKey("unitTestDiscovery")] + public partial class StaticOptions : IWorkDoneProgressOptions + { + [Optional] + public bool SupportsDebugging { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt deleted file mode 100644 index 30be59b44..000000000 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.verified.txt +++ /dev/null @@ -1,624 +0,0 @@ -ο»Ώ{ - RegistrationOptionsGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.RegistrationOptionsGenerator/UnitTestRegistrationOptions.cs -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [RegistrationOptionsKey("unitTestDiscovery")] - [RegistrationOptionsConverterAttribute(typeof(UnitTestRegistrationOptionsConverter))] - public partial class UnitTestRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - - class UnitTestRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - public UnitTestRegistrationOptionsConverter() - { - } - - public override StaticOptions Convert(UnitTestRegistrationOptions source) - { - return new StaticOptions{SupportsDebugging = source.SupportsDebugging, WorkDoneProgress = source.WorkDoneProgress}; - } - } - - [RegistrationOptionsKey("unitTestDiscovery")] - public partial class StaticOptions : IWorkDoneProgressOptions - { - [Optional] - public bool SupportsDebugging { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore - - ], - StronglyTypedGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - ], - GenerateHandlerMethodsGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/UnitTest.cs -using Lsp.Tests.Integration.Fixtures; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IUnitTestHandler : IJsonRpcNotificationHandler, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class UnitTestHandlerBase : AbstractHandlers.Notification, IUnitTestHandler - { - } -} -#nullable restore - -namespace Lsp.Tests.Integration.Fixtures -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class UnitTestExtensions - { - public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Action handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnUnitTest(this ILanguageServerRegistry registry, Func handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/run", new LanguageProtocolDelegatingHandlers.Notification(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static void SendUnitTest(this ILanguageClient mediator, UnitTest request) => mediator.SendNotification(request); - } -#nullable restore -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/DiscoverUnitTestsParams.cs -using Lsp.Tests.Integration.Fixtures; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IDiscoverUnitTestsHandler : IJsonRpcRequestHandler>, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class DiscoverUnitTestsHandlerBase : AbstractHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class DiscoverUnitTestsPartialHandlerBase : AbstractHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>, IDiscoverUnitTestsHandler - { - protected DiscoverUnitTestsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) - { - } - } -} -#nullable restore - -namespace Lsp.Tests.Integration.Fixtures -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class DiscoverUnitTestsExtensions - { - public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnDiscoverUnitTests(this ILanguageServerRegistry registry, Func>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/discover", new LanguageProtocolDelegatingHandlers.Request, UnitTestRegistrationOptions, UnitTestCapability>(HandlerAdapter.Adapt>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveDiscoverUnitTests(this ILanguageServerRegistry registry, Action>, UnitTestCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler("tests/discover", _ => new LanguageProtocolDelegatingHandlers.PartialResults, UnitTest, UnitTestRegistrationOptions, UnitTestCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static IRequestProgressObservable, Container> RequestDiscoverUnitTests(this ILanguageClient mediator, DiscoverUnitTestsParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); - } -#nullable restore -} - ], - AutoImplementParamsGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - ], - AssemblyCapabilityKeyAttributeGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AssemblyCapabilityKeyAttributeGenerator/AssemblyCapabilityKeys.cs -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -[assembly: AssemblyCapabilityKey(typeof(Lsp.Tests.Integration.Fixtures.UnitTestCapability), "workspace", "unitTests")] - ], - AssemblyJsonRpcHandlersAttributeGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - ], - EnumLikeStringGenerator: [ -//HintName: Test0.cs - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel, Method("tests/run", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest - { - public string Name { get; set; } = null!; - } - - [Parallel, Method("tests/discover", Direction.ClientToServer)] - [ - GenerateHandler, - GenerateHandlerMethods(typeof(ILanguageServerRegistry)), - GenerateRequestMethods(typeof(ILanguageClient)) - ] - [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class DiscoverUnitTestsParams : IPartialItemsRequest, UnitTest>, IWorkDoneProgressParams - { - public ProgressToken? PartialResultToken { get; set; } = null!; - public ProgressToken? WorkDoneToken { get; set; } = null!; - } - - [CapabilityKey("workspace", "unitTests")] - public partial class UnitTestCapability : DynamicCapability - { - public string Property { get; set; } = null!; - } - - [GenerateRegistrationOptions("unitTestDiscovery")] - public partial class UnitTestRegistrationOptions : IWorkDoneProgressOptions - { - [Optional] public bool SupportsDebugging { get; set; } - } -} -#nullable restore - ] -} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..4541b31e9 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.IRegisterCapabilityHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs new file mode 100644 index 000000000..735e6c6cc --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs @@ -0,0 +1,49 @@ +ο»Ώ//HintName: RegistrationParams.cs +using Lsp.Tests.Integration.Fixtures; +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client +{ + [Parallel, Method(ClientNames.RegisterCapability, Direction.ServerToClient)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IRegisterCapabilityHandler : IJsonRpcRequestHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class RegisterCapabilityHandlerBase : AbstractHandlers.Request, IRegisterCapabilityHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Client +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class RegisterCapabilityExtensions + { + public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); + public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs new file mode 100644 index 000000000..1b270e475 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs @@ -0,0 +1,108 @@ +ο»Ώ//HintName: RegistrationContainer.cs +// ------------------------------------------------------------------------------ +// +// This code was generated a code generator. +// +// ------------------------------------------------------------------------------ +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace Lsp.Tests.Integration.Fixtures +{ + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial class RegistrationContainer : ContainerBase + { + public RegistrationContainer() : this(Enumerable.Empty()) + { + } + + public RegistrationContainer(IEnumerable items) : base(items) + { + } + + public RegistrationContainer(params Registration[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(IEnumerable? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (Registration[] items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(params Registration[] items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (Collection? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(Collection? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (List? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(List? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (in ImmutableArray? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(in ImmutableArray? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator RegistrationContainer? (ImmutableList? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static RegistrationContainer? From(ImmutableList? items) => items switch + { + not null => new RegistrationContainer(items), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt deleted file mode 100644 index 3b3df7fc7..000000000 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.verified.txt +++ /dev/null @@ -1,484 +0,0 @@ -ο»Ώ{ - RegistrationOptionsGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - ], - StronglyTypedGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.StronglyTypedGenerator/RegistrationContainer.cs -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Immutable; -using System.Linq; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial class RegistrationContainer : ContainerBase - { - public RegistrationContainer() : this(Enumerable.Empty()) - { - } - - public RegistrationContainer(IEnumerable items) : base(items) - { - } - - public RegistrationContainer(params Registration[] items) : base(items) - { - } - - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static RegistrationContainer? From(IEnumerable? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator RegistrationContainer? (Registration[] items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static RegistrationContainer? From(params Registration[] items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator RegistrationContainer? (Collection? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static RegistrationContainer? From(Collection? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator RegistrationContainer? (List? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static RegistrationContainer? From(List? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator RegistrationContainer? (in ImmutableArray? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static RegistrationContainer? From(in ImmutableArray? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static implicit operator RegistrationContainer? (ImmutableList? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] - public static RegistrationContainer? From(ImmutableList? items) => items switch - { - not null => new RegistrationContainer(items), - _ => null - }; - } -} -#nullable restore - - ], - GenerateHandlerMethodsGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/RegistrationParams.cs -using Lsp.Tests.Integration.Fixtures; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Client -{ - [Parallel, Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IRegisterCapabilityHandler : IJsonRpcRequestHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class RegisterCapabilityHandlerBase : AbstractHandlers.Request, IRegisterCapabilityHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Client -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class RegisterCapabilityExtensions - { - public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); - public static ILanguageClientRegistry OnRegisterCapability(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(ClientNames.RegisterCapability, new DelegatingHandlers.Request(HandlerAdapter.Adapt(handler))); - } -#nullable restore -} - ], - AutoImplementParamsGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - ], - AssemblyCapabilityKeyAttributeGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - ], - AssemblyJsonRpcHandlersAttributeGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - ], - EnumLikeStringGenerator: [ -//HintName: Test0.cs - -// ------------------------------------------------------------------------------ -// -// This code was generated a code generator. -// -// ------------------------------------------------------------------------------ - -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; - -#nullable enable -namespace Lsp.Tests.Integration.Fixtures -{ - [Parallel] - [Method(ClientNames.RegisterCapability, Direction.ServerToClient)] - [ - GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client", Name = "RegisterCapability"), - GenerateHandlerMethods(typeof(ILanguageClientRegistry), - GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer)) - ] - public class RegistrationParams : IJsonRpcRequest - { - public RegistrationContainer Registrations { get; set; } = null!; - } - - /// - /// General parameters to to regsiter for a capability. - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [GenerateContainer] - public partial class Registration - { - } -} -#nullable restore - ] -} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs new file mode 100644 index 000000000..e65f6034a --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs @@ -0,0 +1,15 @@ +ο»Ώ//HintName: AssemblyCapabilityKeys.cs +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System.Diagnostics; + +[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs new file mode 100644 index 000000000..6e5bc00cc --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs @@ -0,0 +1,29 @@ +ο»Ώ//HintName: Test0_SymbolInformationParams.cs +#nullable enable +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + public partial record SymbolInformationParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + + [Optional] + public ProgressToken? PartialResultToken { get; init; } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs new file mode 100644 index 000000000..02b1bdf8e --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs @@ -0,0 +1,29 @@ +ο»Ώ//HintName: Test0_WorkspaceSymbolParams.cs +#nullable enable +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + public partial record WorkspaceSymbolParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + + [Optional] + public ProgressToken? PartialResultToken { get; init; } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..bd7d44297 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Workspace.ISymbolInformationHandler), typeof(OmniSharp.Extensions.LanguageServer.Protocol.Workspace.IWorkspaceSymbolsHandler), typeof(OmniSharp.Extensions.LanguageServer.Protocol.Workspace.IWorkspaceSymbolResolveHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs new file mode 100644 index 000000000..0e54434af --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs @@ -0,0 +1,90 @@ +ο»Ώ//HintName: SymbolInformationParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface ISymbolInformationHandler : IJsonRpcRequestHandler?>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SymbolInformationHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, ISymbolInformationHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SymbolInformationPartialHandlerBase : AbstractHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, ISymbolInformationHandler + { + protected SymbolInformationPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + } + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class SymbolInformationExtensions + { + public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container?> RequestSymbolInformation(this ITextDocumentLanguageClient mediator, SymbolInformationParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + public static IRequestProgressObservable, Container?> RequestSymbolInformation(this ILanguageClient mediator, SymbolInformationParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs new file mode 100644 index 000000000..84e9927ec --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs @@ -0,0 +1,54 @@ +ο»Ώ//HintName: WorkspaceSymbol.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Parallel, Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IWorkspaceSymbolResolveHandler : IJsonRpcRequestHandler, ICapability + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class WorkspaceSymbolResolveHandlerBase : AbstractHandlers.RequestCapability, IWorkspaceSymbolResolveHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class WorkspaceSymbolResolveExtensions + { + public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, new LanguageProtocolDelegatingHandlers.RequestCapability(HandlerAdapter.Adapt(handler))); + public static Task ResolveWorkspaceSymbol(this IWorkspaceLanguageClient mediator, WorkspaceSymbol request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task ResolveWorkspaceSymbol(this ILanguageClient mediator, WorkspaceSymbol request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs new file mode 100644 index 000000000..887ecfa47 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs @@ -0,0 +1,90 @@ +ο»Ώ//HintName: WorkspaceSymbolParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ + [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IWorkspaceSymbolsHandler : IJsonRpcRequestHandler?>, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class WorkspaceSymbolsHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class WorkspaceSymbolsPartialHandlerBase : AbstractHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler + { + protected WorkspaceSymbolsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) + { + } + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class WorkspaceSymbolsExtensions + { + public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); + } + + public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ITextDocumentLanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ILanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..374b0232e --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +[assembly: AssemblyRegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs new file mode 100644 index 000000000..729e7fe59 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs @@ -0,0 +1,39 @@ +ο»Ώ//HintName: WorkspaceSymbolRegistrationOptions.cs +using System.Diagnostics; +using MediatR; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; +using OmniSharp.Extensions.LanguageServer.Protocol; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + [Optional] + public bool WorkDoneProgress { get; set; } + + [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] + public partial class StaticOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + [Optional] + public bool ResolveProvider { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt deleted file mode 100644 index e652fd4a5..000000000 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.verified.txt +++ /dev/null @@ -1,2213 +0,0 @@ -ο»Ώ{ - RegistrationOptionsGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.RegistrationOptionsGenerator/WorkspaceSymbolRegistrationOptions.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using OmniSharp.Extensions.LanguageServer.Protocol; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - public partial class WorkspaceSymbolRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions - { - [Optional] - public bool WorkDoneProgress { get; set; } - - [RegistrationOptionsKey(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - public partial class StaticOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - [Optional] - public bool WorkDoneProgress { get; set; } - } - } -} -#nullable restore - - ], - StronglyTypedGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - ], - GenerateHandlerMethodsGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/SymbolInformationParams.cs -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ - [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface ISymbolInformationHandler : IJsonRpcRequestHandler?>, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class SymbolInformationHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, ISymbolInformationHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class SymbolInformationPartialHandlerBase : AbstractHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, ISymbolInformationHandler - { - protected SymbolInformationPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) - { - } - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class SymbolInformationExtensions - { - public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnSymbolInformation(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveSymbolInformation(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, SymbolInformation, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static IRequestProgressObservable, Container?> RequestSymbolInformation(this ITextDocumentLanguageClient mediator, SymbolInformationParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); - public static IRequestProgressObservable, Container?> RequestSymbolInformation(this ILanguageClient mediator, SymbolInformationParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); - } -#nullable restore -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/WorkspaceSymbolParams.cs -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Progress; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ - [Parallel, Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IWorkspaceSymbolsHandler : IJsonRpcRequestHandler?>, IRegistration - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class WorkspaceSymbolsHandlerBase : AbstractHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class WorkspaceSymbolsPartialHandlerBase : AbstractHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>, IWorkspaceSymbolsHandler - { - protected WorkspaceSymbolsPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, Container.From) - { - } - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class WorkspaceSymbolsExtensions - { - public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry OnWorkspaceSymbols(this ILanguageServerRegistry registry, Func?>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, new LanguageProtocolDelegatingHandlers.Request?, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(HandlerAdapter.Adapt?>(handler), RegistrationAdapter.Adapt(registrationOptions))); - } - - public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static ILanguageServerRegistry ObserveWorkspaceSymbols(this ILanguageServerRegistry registry, Action>, WorkspaceSymbolCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) - { - return registry.AddHandler(WorkspaceNames.WorkspaceSymbol, _ => new LanguageProtocolDelegatingHandlers.PartialResults?, WorkspaceSymbol, WorkspaceSymbolRegistrationOptions, WorkspaceSymbolCapability>(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), Container.From)); - } - - public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ITextDocumentLanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); - public static IRequestProgressObservable, Container?> RequestWorkspaceSymbols(this ILanguageClient mediator, WorkspaceSymbolParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, Container.From, cancellationToken); - } -#nullable restore -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.GenerateHandlerMethodsGenerator/WorkspaceSymbol.cs -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ - [Parallel, Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IWorkspaceSymbolResolveHandler : IJsonRpcRequestHandler, ICapability - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class WorkspaceSymbolResolveHandlerBase : AbstractHandlers.RequestCapability, IWorkspaceSymbolResolveHandler - { - } -} -#nullable restore - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class WorkspaceSymbolResolveExtensions - { - public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, RequestHandler.For(handler)); - public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, RequestHandler.For(handler)); - public static ILanguageServerRegistry OnWorkspaceSymbolResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(WorkspaceNames.WorkspaceSymbolResolve, new LanguageProtocolDelegatingHandlers.RequestCapability(HandlerAdapter.Adapt(handler))); - public static Task ResolveWorkspaceSymbol(this IWorkspaceLanguageClient mediator, WorkspaceSymbol request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - public static Task ResolveWorkspaceSymbol(this ILanguageClient mediator, WorkspaceSymbol request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); - } -#nullable restore -} - ], - AutoImplementParamsGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AutoImplementParamsGenerator/Test0_SymbolInformationParams.cs -#nullable enable -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using Newtonsoft.Json; -using System.ComponentModel; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - public partial record SymbolInformationParams - { - [Optional] - public ProgressToken? WorkDoneToken { get; init; } - - [Optional] - public ProgressToken? PartialResultToken { get; init; } - } -} -#nullable restore - - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AutoImplementParamsGenerator/Test0_WorkspaceSymbolParams.cs -#nullable enable -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using Newtonsoft.Json; -using System.ComponentModel; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; - -namespace OmniSharp.Extensions.LanguageServer.Protocol.Models -{ - public partial record WorkspaceSymbolParams - { - [Optional] - public ProgressToken? WorkDoneToken { get; init; } - - [Optional] - public ProgressToken? PartialResultToken { get; init; } - } -} -#nullable restore - - ], - AssemblyCapabilityKeyAttributeGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - -//HintName: OmniSharp.Extensions.JsonRpc.Generators/OmniSharp.Extensions.JsonRpc.Generators.AssemblyCapabilityKeyAttributeGenerator/AssemblyCapabilityKeys.cs -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; -using System.Diagnostics; - -[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - ], - AssemblyJsonRpcHandlersAttributeGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - ], - EnumLikeStringGenerator: [ -//HintName: Test0.cs -using System.Diagnostics; -using MediatR; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; - -// ReSharper disable once CheckNamespace -namespace OmniSharp.Extensions.LanguageServer.Protocol -{ - namespace Models - { - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "SymbolInformation"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record SymbolInformationParams : IPartialItemsRequest?, SymbolInformation>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - /// - /// The parameters of a Workspace Symbol Request. - /// - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbol, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbols"), GenerateHandlerMethods, - GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WorkspaceSymbolRegistrationOptions)), Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbolParams : IPartialItemsRequest?, WorkspaceSymbol>, IWorkDoneProgressParams - { - /// - /// A non-empty query string - /// - public string Query { get; init; } - } - - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - public partial record SymbolInformation - { - /// - /// The name of this symbol. - /// - public string Name { get; init; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; init; } - - /// - /// Tags for this completion item. - /// - /// @since 3.16.0 - /// - [Optional] - public Container? Tags { get; init; } - - /// - /// Indicates if this item is deprecated. - /// - [Optional] - public bool Deprecated { get; init; } - - /// - /// The location of this symbol. - /// - public Location Location { get; init; } - - /// - /// The name of the symbol containing this symbol. - /// - [Optional] - public string? ContainerName { get; init; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - /// - /// A special workspace symbol that supports locations without a range - /// - /// @since 3.17.0 - proposed state - /// - [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] - [Parallel] - [Method(WorkspaceNames.WorkspaceSymbolResolve, Direction.ClientToServer)] - [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace", Name = "WorkspaceSymbolResolve")] - [GenerateHandlerMethods] - [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [Capability(typeof(WorkspaceSymbolCapability))] - public partial record WorkspaceSymbol : IRequest - { - /// - /// The name of this symbol. - /// - public string Name { get; set; } - - /// - /// The kind of this symbol. - /// - public SymbolKind Kind { get; set; } - - /// - /// Tags for this completion item. - /// - [Optional] - public Container? Tags { get; set; } - - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - - /// - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - /// - [Optional] - public string? ContainerName { get; set; } - - private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; - - /// - public override string ToString() => DebuggerDisplay; - } - - [GenerateRegistrationOptions(nameof(ServerCapabilities.WorkspaceSymbolProvider))] - [RegistrationOptionsConverter(typeof(WorkspaceSymbolRegistrationOptionsConverter))] - [RegistrationName(WorkspaceNames.WorkspaceSymbol)] - public partial class WorkspaceSymbolRegistrationOptions : IWorkDoneProgressOptions - { - /// - /// The server provides support to resolve additional - /// information for a workspace symbol. - /// - [Optional] - public bool ResolveProvider { get; set; } - - private class WorkspaceSymbolRegistrationOptionsConverter : RegistrationOptionsConverterBase - { - private readonly IHandlersManager _handlersManager; - - public WorkspaceSymbolRegistrationOptionsConverter(IHandlersManager handlersManager) - { - _handlersManager = handlersManager; - } - - public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) - { - return new() - { - ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IWorkspaceSymbolResolveHandler)), - WorkDoneProgress = source.WorkDoneProgress, - }; - } - } - } - } - - namespace Client.Capabilities - { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] - public partial class WorkspaceSymbolCapability : DynamicCapability // - { - /// - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - /// - [Optional] - public SymbolKindCapabilityOptions? SymbolKind { get; set; } - - /// - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - [Optional] - public Supports TagSupport { get; set; } - - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - [Optional] - public ResolveSupportCapabilityOptions? ResolveSupport { get; set; } - } - - /// - /// The client supports tags on `SymbolInformation`.Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set tot true. - /// Clients supporting tags have to handle unknown tags gracefully. - /// - /// @since 3.16.0 - /// - public class TagSupportCapabilityOptions - { - /// - /// The tags supported by the client. - /// - public Container ValueSet { get; set; } = null!; - } - - /// - /// Specific capabilities for the `SymbolKind`. - /// - public class SymbolKindCapabilityOptions - { - /// - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - /// - [Optional] - public Container? ValueSet { get; set; } - } - - /// - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - /// - /// @since 3.17.0 - proposedState - /// - public partial class ResolveSupportCapabilityOptions - { - /// - /// The properties that a client can resolve lazily. Usually - /// `location.range` - /// - public Container Properties { get; set; } = new(); - } - } -} - ] -} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs new file mode 100644 index 000000000..2238bdb8b --- /dev/null +++ b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs @@ -0,0 +1,108 @@ +ο»Ώ//HintName: CodeLensContainer.cs +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial class CodeLensContainer : ContainerBase + { + public CodeLensContainer() : this(Enumerable.Empty()) + { + } + + public CodeLensContainer(IEnumerable items) : base(items) + { + } + + public CodeLensContainer(params CodeLens[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(IEnumerable? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(params CodeLens[] items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (Collection? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(Collection? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (List? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(List? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (in ImmutableArray? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(in ImmutableArray? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (ImmutableList? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(ImmutableList? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs new file mode 100644 index 000000000..2238bdb8b --- /dev/null +++ b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs @@ -0,0 +1,108 @@ +ο»Ώ//HintName: CodeLensContainer.cs +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial class CodeLensContainer : ContainerBase + { + public CodeLensContainer() : this(Enumerable.Empty()) + { + } + + public CodeLensContainer(IEnumerable items) : base(items) + { + } + + public CodeLensContainer(params CodeLens[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(IEnumerable? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(params CodeLens[] items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (Collection? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(Collection? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (List? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(List? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (in ImmutableArray? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(in ImmutableArray? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (ImmutableList? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(ImmutableList? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs new file mode 100644 index 000000000..be79042af --- /dev/null +++ b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs @@ -0,0 +1,183 @@ +ο»Ώ//HintName: Test0_CodeLensTyped.cs +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + public partial record CodeLens + { + public CodeLens WithData(TData data) + where TData : class?, IHandlerIdentity? + { + return new CodeLens{Range = Range, Command = Command, Data = data}; + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] + public static CodeLens? From(CodeLens? item) + where T : class?, IHandlerIdentity? => item switch + { + not null => item, + _ => null + }; + } + + /// + /// A code lens represents a command that should be shown along with + /// source text, like the number of references, a way to run tests, etc. + /// + /// A code lens is _unresolved_ when no command is associated to it. For performance + /// reasons the creation of a code lens and resolving should be done in two stages. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial record CodeLens : ICanBeResolved where T : class?, IHandlerIdentity? + { + /// + /// The range in which this code lens is valid. Should only span a single line. + /// + public Range Range { get; init; } + + [Optional] + public Command? Command { get; init; } + + /// + /// A data entry field that is preserved on a code lens item between + /// a code lens and a code lens resolve request. + /// + [Optional] + public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } + + private string DebuggerDisplay => $"{Range}{(Command != null ? $" {Command}" : "")}"; + public override string ToString() => DebuggerDisplay; + public CodeLens WithData(TData data) + where TData : class?, IHandlerIdentity? + { + return new CodeLens{Range = Range, Command = Command, Data = data}; + } + + JToken? ICanBeResolved.Data { get; init; } + + private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } + + public static implicit operator CodeLens(CodeLens value) => new CodeLens{Range = value.Range, Command = value.Command, JData = value.Data}; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("value")] + public static implicit operator CodeLens? (CodeLens? value) => value switch + { + not null => new CodeLens{Range = value.Range, Command = value.Command, Data = value.JData}, + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] + public static CodeLens? From(CodeLens? item) => item switch + { + not null => item, + _ => null + }; + } + + public partial class CodeLensContainer : ContainerBase> where T : class?, IHandlerIdentity? + { + public CodeLensContainer() : this(Enumerable.Empty>()) + { + } + + public CodeLensContainer(IEnumerable> items) : base(items) + { + } + + public CodeLensContainer(params CodeLens[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(IEnumerable>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (CodeLens[] items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(params CodeLens[] items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (Collection>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(Collection>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (List>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(List>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (in ImmutableArray>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(in ImmutableArray>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator CodeLensContainer? (ImmutableList>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static CodeLensContainer? From(ImmutableList>? items) => items switch + { + not null => new CodeLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("container")] + public static implicit operator CodeLensContainer? (CodeLensContainer? container) => container switch + { + not null => new CodeLensContainer(container.Select(value => (CodeLens)value)), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt new file mode 100644 index 000000000..0f206832a --- /dev/null +++ b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt @@ -0,0 +1,17 @@ +ο»Ώ{ + Diagnostics: [ + { + Id: JRPC1003, + Title: Cannot infer request router(s), + Severity: Error, + WarningLevel: 0, + Location: Test0.cs: (16,4)-(16,26), + Description: , + HelpLink: , + MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Message: Could not infer the request router(s) to use, please specify the target interface(s)., + Category: JsonRPC, + CustomTags: [] + } + ] +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs new file mode 100644 index 000000000..30d33a7db --- /dev/null +++ b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(Test.Document.IPublishDiagnosticsHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs new file mode 100644 index 000000000..7acaed031 --- /dev/null +++ b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs @@ -0,0 +1,49 @@ +ο»Ώ//HintName: PublishDiagnosticsParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Test.Document; +using Test.Models; + +#nullable enable +namespace Test.Document +{ + [Parallel, Method(TextDocumentNames.PublishDiagnostics, Direction.ServerToClient)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IPublishDiagnosticsHandler : IJsonRpcNotificationHandler, ICapability + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class PublishDiagnosticsHandlerBase : AbstractHandlers.NotificationCapability, IPublishDiagnosticsHandler + { + } +} +#nullable restore + +namespace Test.Document +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class PublishDiagnosticsExtensions + { + public static void PublishDiagnostics(this ITextDocumentLanguageServer mediator, PublishDiagnosticsParams request) => mediator.SendNotification(request); + public static void PublishDiagnostics(this ILanguageServer mediator, PublishDiagnosticsParams request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Lsp.Integration.Tests/InlineValueTests.cs b/test/Lsp.Integration.Tests/InlineValueTests.cs new file mode 100644 index 000000000..52bb4ce8c --- /dev/null +++ b/test/Lsp.Integration.Tests/InlineValueTests.cs @@ -0,0 +1,78 @@ +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; +using NSubstitute; +using OmniSharp.Extensions.JsonRpc.Testing; +using OmniSharp.Extensions.LanguageProtocol.Testing; +using OmniSharp.Extensions.LanguageServer.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Server; +using Serilog.Events; +using Xunit; +using Xunit.Abstractions; + +namespace Lsp.Integration.Tests +{ + public class InlineValueTests : LanguageProtocolTestBase + { + private readonly Func?>> _request; + + public InlineValueTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) + { + _request = Substitute.For?>>>(); + } + + [Fact] + public async Task Should_Get_InlineValues() + { + _request.Invoke(Arg.Any(), Arg.Any()) + .Returns( + new Container( + new InlineValueText() + { + Range = new (new (1, 1), (1, 2)), + Text = "Text Value", + }, + new InlineValueEvaluatableExpression() + { + Range = new (new (3, 1), (3, 2)), + Expression = "" + }, + new InlineValueVariableLookup() + { + Range = new (new (2, 1), (2, 2)), + VariableName = "value", + CaseSensitiveLookup = true + } + ) + ); + + + var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); + + var result = await client.RequestInlineValues(new InlineValueParams(), CancellationToken); + + result.Should().HaveCount(3); + result.Select(z => z.GetType()).Should().ContainInOrder( + typeof(InlineValueText), typeof(InlineValueEvaluatableExpression), typeof(InlineValueVariableLookup) + ); + } + + private void ServerOptionsAction(LanguageServerOptions obj) + { + obj.OnInlineValues( + _request, (_, _) => new InlineValueRegistrationOptions + { + DocumentSelector = TextDocumentSelector.ForLanguage("csharp"), + } + ); + } + + private void ClientOptionsAction(LanguageClientOptions obj) + { + } + } +} diff --git a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj index fcb489822..a1e77a076 100644 --- a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj +++ b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj @@ -19,12 +19,6 @@ - + diff --git a/test/Lsp.Integration.Tests/MonikerTests.cs b/test/Lsp.Integration.Tests/MonikerTests.cs index a72c6ef04..f0109b4de 100644 --- a/test/Lsp.Integration.Tests/MonikerTests.cs +++ b/test/Lsp.Integration.Tests/MonikerTests.cs @@ -44,7 +44,7 @@ public async Task Should_Get_Monikers() var (client, _) = await Initialize(ClientOptionsAction, ServerOptionsAction); - var result = await client.RequestMoniker(new MonikerParams(), CancellationToken); + var result = await client.RequestMonikers(new MonikerParams(), CancellationToken); result.Should().HaveCount(1); result.Should().Match(z => z.Any(x => x.Kind == MonikerKind.Export)); @@ -52,7 +52,7 @@ public async Task Should_Get_Monikers() private void ServerOptionsAction(LanguageServerOptions obj) { - obj.OnMoniker( + obj.OnMonikers( _request, (_, _) => new MonikerRegistrationOptions { DocumentSelector = TextDocumentSelector.ForLanguage("csharp"), diff --git a/test/Lsp.Integration.Tests/Properties.cs b/test/Lsp.Integration.Tests/Properties.cs index 627fca850..22c3b6b74 100644 --- a/test/Lsp.Integration.Tests/Properties.cs +++ b/test/Lsp.Integration.Tests/Properties.cs @@ -1,3 +1,3 @@ using Xunit; -[assembly: CollectionBehavior(MaxParallelThreads = 10)] +//[assembly: CollectionBehavior(MaxParallelThreads = 10)] diff --git a/test/Lsp.Integration.Tests/TypedTypeHierarchyTests.cs b/test/Lsp.Integration.Tests/TypedTypeHierarchyTests.cs new file mode 100644 index 000000000..ffaa80f78 --- /dev/null +++ b/test/Lsp.Integration.Tests/TypedTypeHierarchyTests.cs @@ -0,0 +1,237 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Threading.Tasks; +using System.Threading.Tasks; +using FluentAssertions; +using Lsp.Integration.Tests.Fixtures; +using NSubstitute; +using OmniSharp.Extensions.JsonRpc.Testing; +using OmniSharp.Extensions.LanguageProtocol.Testing; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using Serilog.Events; +using Xunit; +using Xunit.Abstractions; + +namespace Lsp.Integration.Tests +{ + public class TypedTypeHierarchyTests : LanguageProtocolTestBase + { + public TypedTypeHierarchyTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) + { + } + + [Fact] + public async Task Should_Aggregate_With_All_Related_Handlers() + { + var subtypeHandlerA = Substitute.For, Task?>>>(); + var subtypeHandlerB = Substitute.For, Task?>>>(); + var supertypeHandlerA = Substitute.For, Task?>>>(); + var supertypeHandlerB = Substitute.For, Task?>>>(); + var (client, _) = await Initialize( + options => { options.EnableAllCapabilities(); }, options => + { + var identifier = Substitute.For(); + identifier.GetTextDocumentAttributes(Arg.Any()).Returns( + call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") + ); + options.AddTextDocumentIdentifier(identifier); + + options.OnTypeHierarchy( + @params => Task.FromResult( + new Container?>( + new TypeHierarchyItem + { + Name = "Test", + Kind = SymbolKind.Boolean, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + )!, + supertypeHandlerA, + subtypeHandlerA, + (_, _) => new() + { + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") + } + ); + + options.OnTypeHierarchy( + @params => Task.FromResult( + new Container?>( + new TypeHierarchyItem + { + Name = "Test Nested", + Kind = SymbolKind.Constant, + Data = new Nested + { + Date = DateTimeOffset.MinValue + } + } + ) + )!, + supertypeHandlerB, + subtypeHandlerB, + (_, _) => new() + { + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") + } + ); + } + ); + + var items = await client.RequestTypeHierarchyPrepare( + new TypeHierarchyPrepareParams + { + TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), + } + ); + + var lens = items.ToArray(); + lens.Select(z => z.Name).Should().Contain(new[] { "Test", "Test Nested" }); + + var subtypeItems = await Task.WhenAll( + lens.Select(z => client.RequestTypeHierarchySubtypes(new TypeHierarchySubtypesParams { Item = z }).AsTask()) + ); + subtypeHandlerA.Received(1).Invoke(Arg.Any>()); + subtypeHandlerB.Received(1).Invoke(Arg.Any>()); + var supertypeItems = await Task.WhenAll( + lens.Select(z => client.RequestTypeHierarchySupertypes(new TypeHierarchySupertypesParams { Item = z }).AsTask()) + ); + supertypeHandlerA.Received(1).Invoke(Arg.Any>()); + supertypeHandlerB.Received(1).Invoke(Arg.Any>()); + } + + [Fact] + public async Task Should_Resolve_With_Data_Capability() + { + var subtypeHandler = Substitute.For, Task?>>>(); + var supertypeHandler = Substitute.For, Task?>>>(); + var (client, _) = await Initialize( + options => { options.EnableAllCapabilities(); }, options => + { + options.OnTypeHierarchy( + @params => Task.FromResult( + new Container?>( + new TypeHierarchyItem + { + Name = "Test", + Kind = SymbolKind.Boolean, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + )!, + supertypeHandler, + subtypeHandler, + (_, _) => new() + { + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") + } + ); + } + ); + + var items = await client.RequestTypeHierarchyPrepare( + new TypeHierarchyPrepareParams + { + TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), + } + ); + + var item = items.Single(); + + var subtypeItems = await client.RequestTypeHierarchySubtypes(new TypeHierarchySubtypesParams { Item = item }); + subtypeHandler.Received(1).Invoke(Arg.Any>()); + var supertypeItems = await client.RequestTypeHierarchySupertypes(new TypeHierarchySupertypesParams { Item = item }); + supertypeHandler.Received(1).Invoke(Arg.Any>()); + } + + [Fact] + public async Task Should_Resolve_With_Partial_Data_Capability() + { + var subtypeHandler = Substitute.For, IObserver>>>(); + var supertypeHandler = Substitute.For, IObserver>>>(); + var (client, _) = await Initialize( + options => { }, options => + { + options.OnTypeHierarchy( + (completionParams, observer) => + { + var a = new Container?>( + new Container?>( + new TypeHierarchyItem + { + Name = "Test", + Kind = SymbolKind.Boolean, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + (a, b) => + { + supertypeHandler(a, b); + b.OnNext(Enumerable.Empty()); + b.OnCompleted(); + }, + (a, b) => + { + subtypeHandler(a, b); + b.OnNext(Enumerable.Empty()); + b.OnCompleted(); + }, + (_, _) => new() + ); + } + ); + + var items = await client + .RequestTypeHierarchyPrepare(new TypeHierarchyPrepareParams { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), }) + .Take(1) + .ToTask(CancellationToken); + + var item = items.Single(); + + var subtypeItems = await client + .RequestTypeHierarchySubtypes(new TypeHierarchySubtypesParams { Item = item }) + .Take(1) + .ToTask(CancellationToken); + subtypeHandler.Received(1).Invoke(Arg.Any>(), Arg.Any>>()); + var supertypeItems = await client + .RequestTypeHierarchySupertypes(new TypeHierarchySupertypesParams { Item = item }) + .Take(1) + .ToTask(CancellationToken); + supertypeHandler.Received(1).Invoke(Arg.Any>(), Arg.Any>>()); + } + } +} From fc6c9438a02cbd5296d9bfe67f24670a4935bd39 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 19 Jun 2022 22:16:02 -0400 Subject: [PATCH 047/647] Worked on updating generation to fix a few problems --- .gitignore | 1 + src/Protocol/Models/StringOrMarkupContent.cs | 3 + test/Generation.Tests/LspFeatureTests.cs | 163 ++++ ...sts.cs => TypedCodeActionTests.cs.disable} | 0 ...Tests.cs => TypedCodeLensTests.cs.disable} | 12 +- ...s.cs => TypedDocumentLinkTests.cs.disable} | 0 .../TypedInlayHintTests.cs.disable | 708 ++++++++++++++++++ 7 files changed, 881 insertions(+), 6 deletions(-) rename test/Lsp.Integration.Tests/{TypedCodeActionTests.cs => TypedCodeActionTests.cs.disable} (100%) rename test/Lsp.Integration.Tests/{TypedCodeLensTests.cs => TypedCodeLensTests.cs.disable} (98%) rename test/Lsp.Integration.Tests/{TypedDocumentLinkTests.cs => TypedDocumentLinkTests.cs.disable} (100%) create mode 100644 test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable diff --git a/.gitignore b/.gitignore index f2f6f24b6..99a0f4a92 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ coverage.info /codealike.json .tmp/ .nuke/temp/ +**/*.received.cs diff --git a/src/Protocol/Models/StringOrMarkupContent.cs b/src/Protocol/Models/StringOrMarkupContent.cs index 9b9ce5de7..0e0421faa 100644 --- a/src/Protocol/Models/StringOrMarkupContent.cs +++ b/src/Protocol/Models/StringOrMarkupContent.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; @@ -17,8 +18,10 @@ public record StringOrMarkupContent public MarkupContent? MarkupContent { get; } public bool HasMarkupContent => String == null; + [return: NotNullIfNotNull("value")] public static implicit operator StringOrMarkupContent?(string? value) => value is null ? null : new StringOrMarkupContent(value); + [return: NotNullIfNotNull("markupContent")] public static implicit operator StringOrMarkupContent?(MarkupContent? markupContent) => markupContent is null ? null : new StringOrMarkupContent(markupContent); private string DebuggerDisplay => $"{( HasString ? String : HasMarkupContent ? MarkupContent!.ToString() : string.Empty )}"; diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 624281bc5..295cd69bd 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -124,5 +124,168 @@ public partial class Registration await Verify(GenerationHelpers.GenerateAll(source)); } + + [Fact] + public async Task Supports_Nullable_Params_With_Typed_Data() + { + var source = @" +using System.Diagnostics; +using System.Linq; +using MediatR; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + namespace Models + { + [Parallel] + [Method(TextDocumentNames.CodeLens, Direction.ClientToServer)] + [GenerateHandler(""OmniSharp.Extensions.LanguageServer.Protocol.Document.Test"")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [RegistrationOptions(typeof(SubLensRegistrationOptions))] + [Capability(typeof(SubLensCapability))] + [Resolver(typeof(SubLens))] + public partial record SubLensParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, IPartialItemsRequest + { + /// + /// The document to request code lens for. + /// + public TextDocumentIdentifier TextDocument { get; init; } = null!; + } + + public partial class SubLensContainer {} + + /// + /// A code lens represents a command that should be shown along with + /// source text, like the number of references, a way to run tests, etc. + /// + /// A code lens is _unresolved_ when no command is associated to it. For performance + /// reasons the creation of a code lens and resolving should be done in two stages. + /// + [DebuggerDisplay(""{"" + nameof(DebuggerDisplay) + "",nq}"")] + [Parallel] + [Method(TextDocumentNames.CodeLensResolve, Direction.ClientToServer)] + [GenerateHandler(""OmniSharp.Extensions.LanguageServer.Protocol.Document.Test"", Name = ""SubLensResolve"")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateTypedData] + [GenerateContainer] + [Capability(typeof(SubLensCapability))] + public partial record SubLens : IRequest, ICanBeResolved, IDoesNotParticipateInRegistration + { + /// + /// The range in which this code lens is valid. Should only span a single line. + /// + public Range Range { get; init; } = null!; + + /// + /// The command this code lens represents. + /// + [Optional] + public Command? Command { get; init; } + + /// + /// A data entry field that is preserved on a code lens item between + /// a code lens and a code lens resolve request. + /// + [Optional] + public JToken? Data { get; init; } + + private string DebuggerDisplay => $""{Range}{( Command != null ? $"" {Command}"" : """" )}""; + + /// + public override string ToString() + { + return DebuggerDisplay; + } + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.SubLensProvider))] + [RegistrationOptionsConverter(typeof(SubLensRegistrationOptionsConverter))] + [RegistrationName(TextDocumentNames.CodeLens)] + public partial class SubLensRegistrationOptions : IWorkDoneProgressOptions, ITextDocumentRegistrationOptions + { + /// + /// Code lens has a resolve provider as well. + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class SubLensRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public SubLensRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(SubLensRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(ISubLensResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress + }; + } + } + } + + [Parallel] + [Method(WorkspaceNames.CodeLensRefresh, Direction.ServerToClient)] + [GenerateHandler(""OmniSharp.Extensions.LanguageServer.Protocol.Workspace.Test"")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] + [Capability(typeof(SubLensWorkspaceClientCapabilities))] + public partial record SubLensRefreshParams : IRequest; + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.CodeLens))] + public partial class SubLensCapability : DynamicCapability + { + } + + /// + /// Capabilities specific to the code lens requests scoped to the + /// workspace. + /// + /// @since 3.16.0. + /// + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.CodeLens))] + public class SubLensWorkspaceClientCapabilities : ICapability + { + /// + /// Whether the client implementation supports a refresh request send from the server + /// to the client. This is useful if a server detects a change which requires a + /// re-calculation of all code lenses. + /// + [Optional] + public bool RefreshSupport { get; set; } + } + } + + namespace Document + { + } +} +"; + + await Verify(GenerationHelpers.GenerateAll(source)); + } } } diff --git a/test/Lsp.Integration.Tests/TypedCodeActionTests.cs b/test/Lsp.Integration.Tests/TypedCodeActionTests.cs.disable similarity index 100% rename from test/Lsp.Integration.Tests/TypedCodeActionTests.cs rename to test/Lsp.Integration.Tests/TypedCodeActionTests.cs.disable diff --git a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs.disable similarity index 98% rename from test/Lsp.Integration.Tests/TypedCodeLensTests.cs rename to test/Lsp.Integration.Tests/TypedCodeLensTests.cs.disable index 8b5f5c41d..4785ba663 100644 --- a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs +++ b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs.disable @@ -39,7 +39,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnCodeLens( codeLensParams => { - return Task.FromResult( + return Task.FromResult( new CodeLensContainer( new CodeLens { @@ -71,7 +71,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnCodeLens( codeLensParams => { - return Task.FromResult( + return Task.FromResult( new CodeLensContainer( new CodeLens { @@ -98,7 +98,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnCodeLens( codeLensParams => { - return Task.FromResult( + return Task.FromResult( new CodeLensContainer( new CodeLens { @@ -121,7 +121,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnCodeLens( codeLensParams => { - return Task.FromResult( + return Task.FromResult( new CodeLensContainer( new CodeLens { @@ -167,7 +167,7 @@ public async Task Should_Resolve_With_Data_Capability() options.OnCodeLens( (codeLensParams, capability, token) => { - return Task.FromResult( + return Task.FromResult( new CodeLensContainer( new CodeLens { @@ -270,7 +270,7 @@ public async Task Should_Resolve_With_Data_CancellationToken() options.OnCodeLens( (codeLensParams, token) => { - return Task.FromResult( + return Task.FromResult>( new CodeLensContainer( new CodeLens { diff --git a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs.disable similarity index 100% rename from test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs rename to test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs.disable diff --git a/test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable b/test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable new file mode 100644 index 000000000..2b9f3092c --- /dev/null +++ b/test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable @@ -0,0 +1,708 @@ +using System; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Threading.Tasks; +using System.Threading.Tasks; +using FluentAssertions; +using Lsp.Integration.Tests.Fixtures; +using Newtonsoft.Json.Linq; +using NSubstitute; +using OmniSharp.Extensions.JsonRpc.Testing; +using OmniSharp.Extensions.LanguageProtocol.Testing; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using Serilog.Events; +using Xunit; +using Xunit.Abstractions; + +namespace Lsp.Integration.Tests +{ + public class TypedInlayHintTests : LanguageProtocolTestBase + { + public TypedInlayHintTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) + { + } + + [Fact] + public async Task Should_Aggregate_With_All_Related_Handlers() + { + var (client, _) = await Initialize( + options => { }, options => + { + var identifier = Substitute.For(); + identifier.GetTextDocumentAttributes(Arg.Any()).Returns( + call => new TextDocumentAttributes(call.ArgAt(0), "file", "csharp") + ); + options.AddTextDocumentIdentifier(identifier); + + options.OnInlayHints( + inlayHintParams => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "data-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + ); + }, + l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-a" } }); }, + (_, _) => new InlayHintRegistrationOptions + { + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") + } + ); + + options.OnInlayHints( + inlayHintParams => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Kind = InlayHintKind.Parameter, + Label = new StringOrInlayHintLabelParts("my hint"), + Position = (1, 2), + PaddingLeft = true, + PaddingRight = true, + Data = new Nested + { + Date = DateTimeOffset.Now + } + } + ) + ); + }, + l => { return Task.FromResult(l with { }); }, + (_, _) => new InlayHintRegistrationOptions + { + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") + } + ); + + options.OnInlayHints( + inlayHintParams => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Kind = InlayHintKind.Parameter, + Label = "my hint", + Position = (1, 2), + PaddingLeft = true, + PaddingRight = true, + } + ) + ); + }, + l => { return Task.FromResult(l with { Label = new List() { new InlayHintLabelPart() }, }); }, + (_, _) => new InlayHintRegistrationOptions + { + DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") + } + ); + + options.OnInlayHints( + inlayHintParams => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "not-included", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + } + } + ) + ); + }, + l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-d" } }); }, + (_, _) => new InlayHintRegistrationOptions + { + DocumentSelector = TextDocumentSelector.ForLanguage("vb") + } + ); + } + ); + + var InlayHint = await client.RequestInlayHint( + new InlayHintParams + { + TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), + } + ); + + var lens = InlayHint.ToArray(); + + var responses = await Task.WhenAll(lens.Select(z => client.ResolveInlayHint(z))); + responses.Select(z => z.Command!.Name).Should().Contain(new[] { "resolved-a", "resolved-b", "resolved-c" }); + responses.Select(z => z.Command!.Name).Should().NotContain("resolved-d"); + lens.Length.Should().Be(3); + } + + [Fact] + public async Task Should_Resolve_With_Data_Capability() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.OnInlayHints( + (InlayHintParams, capability, token) => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + ); + }, + (lens, capability, token) => + { + lens.Data.Id.Should().NotBeEmpty(); + lens.Data.Child.Should().NotBeNull(); + lens.Data.Name.Should().Be("name"); + return Task.FromResult(lens with { Command = lens.Command with { Name = "resolved" } }); + return Task.FromResult(lens); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var items = await client.RequestInlayHint(new InlayHintParams()); + + var item = items.Single(); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_With_Partial_Data_Capability() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.ObserveInlayHint( + (InlayHintParams, observer, capability, token) => + { + var a = new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + (InlayHint, capability, token) => + { + InlayHint.Data.Id.Should().NotBeEmpty(); + InlayHint.Data.Child.Should().NotBeNull(); + InlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_With_Data_CancellationToken() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.OnInlayHints( + (InlayHintParams, token) => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + ); + }, + (InlayHint, token) => + { + InlayHint.Data.Id.Should().NotBeEmpty(); + InlayHint.Data.Child.Should().NotBeNull(); + InlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var items = await client.RequestInlayHint(new InlayHintParams()); + + var item = items.Single(); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_With_Partial_Data_CancellationToken() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.ObserveInlayHint( + (InlayHintParams, observer, token) => + { + var a = new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + (InlayHint, token) => + { + InlayHint.Data.Id.Should().NotBeEmpty(); + InlayHint.Data.Child.Should().NotBeNull(); + InlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_With_Data() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.OnInlayHints( + inlayHintParams => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ) + ); + }, + InlayHint => + { + InlayHint.Data.Id.Should().NotBeEmpty(); + InlayHint.Data.Child.Should().NotBeNull(); + InlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var items = await client.RequestInlayHint(new InlayHintParams()); + + var item = items.Single(); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_With_Partial_Data() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.ObserveInlayHint( + (InlayHintParams, observer) => + { + var a = new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + Data = new Data + { + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + } + } + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + InlayHint => + { + InlayHint.Data.Id.Should().NotBeEmpty(); + InlayHint.Data.Child.Should().NotBeNull(); + InlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + + [Fact] + public async Task Should_Resolve_Capability() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.OnInlayHints( + (InlayHintParams, capability, token) => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + } + } + ) + ); + }, + (InlayHint, capability, token) => + { + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var items = await client.RequestInlayHint(new InlayHintParams()); + + var item = items.Single(); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_Partial_Capability() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.ObserveInlayHint( + (InlayHintParams, observer, capability, token) => + { + var a = new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + } + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + (InlayHint, capability, token) => + { + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_CancellationToken() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.OnInlayHints( + (InlayHintParams, token) => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + } + ) + ); + }, + (InlayHint, token) => + { + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var items = await client.RequestInlayHint(new InlayHintParams()); + + var item = items.Single(); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_Partial_CancellationToken() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.ObserveInlayHint( + (InlayHintParams, observer, token) => + { + var a = new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + } + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + (InlayHint, token) => + { + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.OnInlayHints( + inlayHintParams => + { + return Task.FromResult( + new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + } + ) + ); + }, + InlayHint => + { + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var items = await client.RequestInlayHint(new InlayHintParams()); + + var item = items.Single(); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + + [Fact] + public async Task Should_Resolve_Partial() + { + var (client, _) = await Initialize( + options => { }, options => + { + options.ObserveInlayHint( + (InlayHintParams, observer) => + { + var a = new InlayHintContainer( + new InlayHint + { + Command = new Command + { + Name = "execute-a", + Arguments = JArray.FromObject(new object[] { 1, "2", false }) + }, + } + ); + + observer.OnNext(a); + observer.OnCompleted(); + }, + InlayHint => + { + return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); + return Task.FromResult(InlayHint); + }, + (_, _) => new InlayHintRegistrationOptions() + ); + } + ); + + var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); + + item = await client.ResolveInlayHint(item); + item.Command!.Name.Should().Be("resolved"); + } + } +} From 73efad870c0e75cfa946636f9eb8c0f916ee1baa Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Mon, 4 Jul 2022 14:46:07 -0400 Subject: [PATCH 048/647] wip updates --- .../GenerateHandlerMethodsGenerator.cs | 5 +- src/JsonRpc.Generators/Helpers.cs | 28 ++ .../SendMethodNotificationStrategy.cs | 26 +- .../Strategies/SendMethodRequestStrategy.cs | 1 + .../SendMethodTypedResolveRequestStrategy.cs | 133 +++++++ .../StronglyTypedGenerator.cs | 75 +++- .../Features/Document/CodeActionFeature.cs | 5 +- .../Features/Document/CodeLensFeature.cs | 5 +- .../Features/Document/ColorFeature.cs | 2 +- .../Features/Document/DeclarationFeature.cs | 2 +- .../Features/Document/DefinitionFeature.cs | 2 +- .../Document/DocumentHighlightFeature.cs | 2 + .../Features/Document/DocumentLinkFeature.cs | 4 +- .../Document/DocumentSymbolFeature.cs | 4 +- .../Document/ImplementationFeature.cs | 2 +- .../Features/Document/InlayHintFeature.cs | 20 +- .../Features/Document/ReferencesFeature.cs | 5 +- .../Document/TypeDefinitionFeature.cs | 2 +- test/Generation.Tests/LspFeatureTests.cs | 338 ++++++++++++++++++ ...guageProtocolInitializeHandler.verified.cs | 2 +- ..._Hint.00AssemblyCapabilityKeys.verified.cs | 18 + ..._Hint.01Test0_OutlayHintParams.verified.cs | 31 ++ ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...Hint.02Test0_OutlayHintParams1.verified.cs | 0 ...neratedAssemblyJsonRpcHandlers.verified.cs | 0 ...pports_Inlay_Hint.03OutlayHint.verified.cs | 70 ++++ ...pports_Inlay_Hint.04OutlayHint.verified.cs | 0 ..._Inlay_Hint.04OutlayHintParams.verified.cs | 152 ++++++++ ....05AssemblyRegistrationOptions.verified.cs | 5 + ..._Inlay_Hint.05OutlayHintParams.verified.cs | 0 ...Inlay_Hint.06OutlayHintParams1.verified.cs | 0 ...6OutlayHintRegistrationOptions.verified.cs | 47 +++ ....07AssemblyRegistrationOptions.verified.cs | 0 ...lay_Hint.07OutlayHintContainer.verified.cs | 109 ++++++ ...8OutlayHintRegistrationOptions.verified.cs | 0 ...y_Hint.08Test0_OutlayHintTyped.verified.cs | 240 +++++++++++++ ...lay_Hint.09OutlayHintContainer.verified.cs | 0 ...y_Hint.10Test0_OutlayHintTyped.verified.cs | 0 ..._Data.00AssemblyCapabilityKeys.verified.cs | 18 + ...ped_Data.01Test0_SubLensParams.verified.cs | 33 ++ ...neratedAssemblyJsonRpcHandlers.verified.cs | 4 + ...rams_With_Typed_Data.03SubLens.verified.cs | 69 ++++ ...ith_Typed_Data.04SubLensParams.verified.cs | 259 ++++++++++++++ ...ed_Data.05SubLensRefreshParams.verified.cs | 61 ++++ ....06AssemblyRegistrationOptions.verified.cs | 5 + ...a.07SubLensRegistrationOptions.verified.cs | 43 +++ ..._Typed_Data.08SubLensContainer.verified.cs | 107 ++++++ ...yped_Data.09Test0_SubLensTyped.verified.cs | 195 ++++++++++ ...sts.cs.disable => TypedCodeActionTests.cs} | 0 ...Tests.cs.disable => TypedCodeLensTests.cs} | 4 +- ...s.cs.disable => TypedDocumentLinkTests.cs} | 2 +- ...ests.cs.disable => TypedInlayHintTests.cs} | 109 ++++-- 52 files changed, 2181 insertions(+), 67 deletions(-) create mode 100644 src/JsonRpc.Generators/Strategies/SendMethodTypedResolveRequestStrategy.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02Test0_OutlayHintParams1.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHint.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05OutlayHintParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintParams1.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07AssemblyRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08OutlayHintRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.09OutlayHintContainer.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.10Test0_OutlayHintTyped.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs create mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs rename test/Lsp.Integration.Tests/{TypedCodeActionTests.cs.disable => TypedCodeActionTests.cs} (100%) rename test/Lsp.Integration.Tests/{TypedCodeLensTests.cs.disable => TypedCodeLensTests.cs} (99%) rename test/Lsp.Integration.Tests/{TypedDocumentLinkTests.cs.disable => TypedDocumentLinkTests.cs} (99%) rename test/Lsp.Integration.Tests/{TypedInlayHintTests.cs.disable => TypedInlayHintTests.cs} (88%) diff --git a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs index 1ebd19587..d5e3632b8 100644 --- a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs +++ b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs @@ -201,11 +201,14 @@ private static ImmutableArray GetCompilationU new OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy(false), new OnRequestMethodGeneratorWithoutRegistrationOptionsStrategy(true), new OnRequestTypedResolveMethodGeneratorWithoutRegistrationOptionsStrategy(), +// new OnRequestTypedMethodGeneratorWithoutRegistrationOptionsStrategy(), new OnRequestMethodGeneratorWithRegistrationOptionsStrategy(false), new OnRequestMethodGeneratorWithRegistrationOptionsStrategy(true), new OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy(), +// new OnRequestTypedMethodGeneratorWithRegistrationOptionsStrategy(), new SendMethodNotificationStrategy(), - new SendMethodRequestStrategy() + new SendMethodRequestStrategy(), + new SendMethodTypedResolveRequestStrategy() ); var actionStrategies = ImmutableArray.Create( new EnsureNamespaceStrategy(), diff --git a/src/JsonRpc.Generators/Helpers.cs b/src/JsonRpc.Generators/Helpers.cs index 0cf80b1ff..7ce048f46 100644 --- a/src/JsonRpc.Generators/Helpers.cs +++ b/src/JsonRpc.Generators/Helpers.cs @@ -883,6 +883,34 @@ public static ArrowExpressionClauseSyntax GetRequestInvokeExpression() => ) ); + public static ArrowExpressionClauseSyntax GetRequestReturningInvokeExpression(ExpressionSyntax requestName, TypeSyntax responseType) => + ArrowExpressionClause( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("client"), + IdentifierName("SendRequest"))) + .WithArgumentList( + ArgumentList( + SeparatedList( + new []{ + Argument(requestName), + Argument((IdentifierName(@"request")))}))), + GenericName( + Identifier("Returning")) + .WithTypeArgumentList( + TypeArgumentList( + SingletonSeparatedList(responseType))))) + .WithArgumentList( + ArgumentList( + SingletonSeparatedList( + Argument( + IdentifierName("cancellationToken"))))) + ); + public static ArrowExpressionClauseSyntax GetPartialInvokeExpression( TypeSyntax responseType, TypeSyntax? partialItemType, bool partialItemTypeInheritsFromSelf ) diff --git a/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs index 265473f86..9ae36ef86 100644 --- a/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/SendMethodNotificationStrategy.cs @@ -25,19 +25,19 @@ public IEnumerable Apply(SourceProductionContext contex .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); yield return method - .WithParameterList( - ParameterList( - SeparatedList( - new[] { - Parameter(Identifier("mediator")) - .WithType(extensionMethodContext.Item) - .WithModifiers(TokenList(Token(SyntaxKind.ThisKeyword))), - Parameter(Identifier("request")) - .WithType(notification.Request.Syntax) - } - ) - ) - ); + .WithParameterList( + ParameterList( + SeparatedList( + new[] { + Parameter(Identifier("mediator")) + .WithType(extensionMethodContext.Item) + .WithModifiers(TokenList(Token(SyntaxKind.ThisKeyword))), + Parameter(Identifier("request")) + .WithType(notification.Request.Syntax) + } + ) + ) + ); } } } diff --git a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs index ab11d12ba..b7d2f28a4 100644 --- a/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs +++ b/src/JsonRpc.Generators/Strategies/SendMethodRequestStrategy.cs @@ -125,6 +125,7 @@ public IEnumerable Apply(SourceProductionContext contex .WithParameterList(parameterList) .WithExpressionBody(Helpers.GetRequestInvokeExpression()) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); + } } } diff --git a/src/JsonRpc.Generators/Strategies/SendMethodTypedResolveRequestStrategy.cs b/src/JsonRpc.Generators/Strategies/SendMethodTypedResolveRequestStrategy.cs new file mode 100644 index 000000000..e0191d84b --- /dev/null +++ b/src/JsonRpc.Generators/Strategies/SendMethodTypedResolveRequestStrategy.cs @@ -0,0 +1,133 @@ +using System.Net; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using OmniSharp.Extensions.JsonRpc.Generators.Contexts; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace OmniSharp.Extensions.JsonRpc.Generators.Strategies; + +internal class SendMethodTypedResolveRequestStrategy : IExtensionMethodContextGeneratorStrategy +{ + public IEnumerable Apply(SourceProductionContext context, ExtensionMethodContext extensionMethodContext, GeneratorData item) + { + if (item is not RequestItem request) yield break; + if (extensionMethodContext is not { IsProxy: true }) yield break; + if (item.JsonRpcAttributes.AllowDerivedRequests) yield break; + if (item is not { LspAttributes: { Resolver: { } } }) yield break; + if (request.Response.Syntax.GetSyntaxName() == "Unit") yield break; +// if (request.Request.Symbol.Name != "OutlayHintParams") yield break; + + TypeSyntax requestType = item.Request.Syntax; + TypeSyntax responseType = GenericName(Identifier(request.Response.Symbol.Name)) + .WithTypeArgumentList(TypeArgumentList(SingletonSeparatedList(IdentifierName("T")))); + + responseType = request.Response.Syntax is NullableTypeSyntax ? NullableType(responseType) : responseType; + + var parameterList = ParameterList( + SeparatedList( + new[] + { + Parameter(Identifier("mediator")) + .WithType(extensionMethodContext.Item) + .WithModifiers(TokenList(Token(SyntaxKind.ThisKeyword))), + Parameter(Identifier("request")) + .WithType(requestType), + Parameter(Identifier("cancellationToken")) + .WithType(IdentifierName("CancellationToken")) + .WithDefault( + EqualsValueClause( + LiteralExpression(SyntaxKind.DefaultLiteralExpression, Token(SyntaxKind.DefaultKeyword)) + ) + ) + } + ) + ); +// +// if (request.PartialItem is not null) +// { +// request.AdditionalUsings.Add("OmniSharp.Extensions.LanguageServer.Protocol.Progress"); +// yield return MethodDeclaration( +// GenericName( +// Identifier("IRequestProgressObservable") +// ) +// .WithTypeArgumentList( +// TypeArgumentList( +// SeparatedList( +// new[] +// { +// request.PartialItem.Syntax, +// responseType +// } +// ) +// ) +// ), +// Identifier(item.JsonRpcAttributes.RequestMethodName) +// ) +// .WithModifiers( +// TokenList( +// Token(SyntaxKind.PublicKeyword), +// Token(SyntaxKind.StaticKeyword) +// ) +// ) +// .WithParameterList(parameterList) +// .WithExpressionBody( +// Helpers.GetPartialInvokeExpression( +// request.Response.Syntax, +// request.PartialHasInitialValue ? null : request.PartialItem.Syntax, +// request.PartialItemInheritsFromSelf +// ) +// ) +// .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); +// yield break; +// } +// +// if (request.PartialItems is not null) +// { +// request.AdditionalUsings.Add("OmniSharp.Extensions.LanguageServer.Protocol.Progress"); +// var partialItemsSyntax = +// GenericName("IEnumerable").WithTypeArgumentList(TypeArgumentList(SeparatedList(new[] { request.PartialItems!.Syntax }))); +// yield return MethodDeclaration( +// GenericName( +// Identifier("IRequestProgressObservable") +// ) +// .WithTypeArgumentList( +// TypeArgumentList( +// SeparatedList( +// new[] +// { +// partialItemsSyntax, +// responseType +// } +// ) +// ) +// ), +// Identifier(item.JsonRpcAttributes.RequestMethodName) +// ) +// .WithModifiers( +// TokenList( +// Token(SyntaxKind.PublicKeyword), +// Token(SyntaxKind.StaticKeyword) +// ) +// ) +// .WithParameterList(parameterList) +// .WithExpressionBody(Helpers.GetPartialInvokeExpression(responseType, default, false)) +// .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); +// yield break; +// } + + + var responseSyntax = GenericName("Task").WithTypeArgumentList(TypeArgumentList(SeparatedList(new[] { responseType }))); + yield return MethodDeclaration(responseSyntax, item.JsonRpcAttributes.RequestMethodName) + .WithModifiers( + TokenList( + Token(SyntaxKind.PublicKeyword), + Token(SyntaxKind.StaticKeyword) + ) + ) + .WithTypeParameterList(TypeParameterList(SingletonSeparatedList(TypeParameter("T")))) + .WithParameterList(parameterList) + .WithExpressionBody(Helpers.GetRequestReturningInvokeExpression(Helpers.GetJsonRpcMethodName(item.TypeDeclaration), responseType)) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); + } +} diff --git a/src/JsonRpc.Generators/StronglyTypedGenerator.cs b/src/JsonRpc.Generators/StronglyTypedGenerator.cs index 951a8552c..f02fe9ab3 100644 --- a/src/JsonRpc.Generators/StronglyTypedGenerator.cs +++ b/src/JsonRpc.Generators/StronglyTypedGenerator.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Collections.Immutable; using System.IO; using System.Linq; using System.Text; @@ -48,6 +49,15 @@ TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or Recor }, (syntaxContext, _) => syntaxContext ); + var typedParamsCandidatesSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( + (syntaxNode, _) => syntaxNode switch + { + TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) when typeDeclarationSyntax + .AttributeLists.ContainsAttribute("GenerateRequestMethods") => true, + _ => false + }, (syntaxContext, _) => syntaxContext + ); + var canBeResolvedSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( (syntaxNode, _) => syntaxNode is TypeDeclarationSyntax { BaseList: { } } typeDeclarationSyntax and (ClassDeclarationSyntax or RecordDeclarationSyntax) @@ -64,8 +74,14 @@ TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or Recor && typeDeclarationSyntax.Members.OfType().Any(z => z.Identifier.Text == "Data") && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanHaveData"), (syntaxContext, _) => syntaxContext ); - + context.RegisterSourceOutput(createContainersSyntaxProvider.Combine(attributes), GenerateContainerClass); + context.RegisterSourceOutput(typedParamsCandidatesSyntaxProvider + .Combine(canBeResolvedSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) + .Combine(canHaveDataSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) + .Combine(createContainersSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) + .Select((tuple, token) => (candidate: tuple.Left.Left.Left, resolvedItems: tuple.Left.Left.Right.Concat(tuple.Left.Right).Concat(tuple.Right).ToImmutableArray())), + GenerateTypedParams); context.RegisterSourceOutput(canBeResolvedSyntaxProvider.Combine(attributes), GenerateCanBeResolvedClass); context.RegisterSourceOutput(canHaveDataSyntaxProvider.Combine(attributes), GenerateCanHaveDataClass); } @@ -119,6 +135,63 @@ private void GenerateContainerClass(SourceProductionContext context, (GeneratorS ); } + private void GenerateTypedParams(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, ImmutableArray resolvedItems) valueTuple) + { + var (syntaxContext, resolvedItems) = valueTuple; + var classToContain = (TypeDeclarationSyntax)syntaxContext.Node; + var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(classToContain); + + if (typeSymbol == null) return; + var handlerInterface = typeSymbol.AllInterfaces.FirstOrDefault(z => z.Name == "IRequest" && z.Arity == 1); + if (handlerInterface is null) return; + var responseSymbol = handlerInterface?.TypeArguments[0]; + + var isTyped = resolvedItems + .Any( + item => + { + var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(item); + return symbol is not null && SymbolEqualityComparer.Default.Equals(responseSymbol, symbol); + } + ); + + // TODO: Start here to finish creating strongly typed params + var paramsType = CreateContainerClass(classToContain, containerName) + .AddAttributeLists( + AttributeList( + SeparatedList( + new[] + { + Attribute(ParseName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")), + Attribute(ParseName("System.Runtime.CompilerServices.CompilerGeneratedAttribute")) + } + ) + ) + ); + + var cu = CompilationUnit() + .WithUsings(classToContain.SyntaxTree.GetCompilationUnitRoot().Usings) + .AddMembers( + NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) + .AddMembers(container) + .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) + .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) + ); + + foreach (var ns in RequiredUsings) + { + if (cu.Usings.All(z => z.Name.ToFullString() != ns)) + { + cu = cu.AddUsings(UsingDirective(ParseName(ns))); + } + } + + context.AddSource( + $"{containerName ?? classToContain.Identifier.Text + "Container"}.cs", + cu.NormalizeWhitespace().GetText(Encoding.UTF8) + ); + } + private void GenerateCanBeResolvedClass(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, AttributeData attributeData) valueTuple) { var (syntaxContext, attributeData) = valueTuple; diff --git a/src/Protocol/Features/Document/CodeActionFeature.cs b/src/Protocol/Features/Document/CodeActionFeature.cs index 516bf42cb..36ca7aac9 100644 --- a/src/Protocol/Features/Document/CodeActionFeature.cs +++ b/src/Protocol/Features/Document/CodeActionFeature.cs @@ -30,7 +30,7 @@ namespace Models [RegistrationOptions(typeof(CodeActionRegistrationOptions))] [Capability(typeof(CodeActionCapability))] [Resolver(typeof(CodeAction))] - public partial record CodeActionParams : ITextDocumentIdentifierParams, IPartialItemsRequest, + public partial record CodeActionParams : ITextDocumentIdentifierParams, IPartialItemsRequest, IWorkDoneProgressParams { /// @@ -49,6 +49,9 @@ public partial record CodeActionParams : ITextDocumentIdentifierParams, IPartial public CodeActionContext Context { get; init; } = null!; } + // marker class is required + public partial class CommandOrCodeActionContainer {} + /// /// Contains additional diagnostic information about the context in which /// a code action is run. diff --git a/src/Protocol/Features/Document/CodeLensFeature.cs b/src/Protocol/Features/Document/CodeLensFeature.cs index 8e2434f5d..fa9af0f21 100644 --- a/src/Protocol/Features/Document/CodeLensFeature.cs +++ b/src/Protocol/Features/Document/CodeLensFeature.cs @@ -25,7 +25,7 @@ namespace Models [RegistrationOptions(typeof(CodeLensRegistrationOptions))] [Capability(typeof(CodeLensCapability))] [Resolver(typeof(CodeLens))] - public partial record CodeLensParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, IPartialItemsRequest + public partial record CodeLensParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, IPartialItemsRequest { /// /// The document to request code lens for. @@ -33,6 +33,9 @@ public partial record CodeLensParams : ITextDocumentIdentifierParams, IWorkDoneP public TextDocumentIdentifier TextDocument { get; init; } = null!; } + // marker class is required + public partial class CodeLensContainer {} + /// /// A code lens represents a command that should be shown along with /// source text, like the number of references, a way to run tests, etc. diff --git a/src/Protocol/Features/Document/ColorFeature.cs b/src/Protocol/Features/Document/ColorFeature.cs index ee8d60b24..35eb9b96b 100644 --- a/src/Protocol/Features/Document/ColorFeature.cs +++ b/src/Protocol/Features/Document/ColorFeature.cs @@ -20,7 +20,7 @@ namespace Models [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(DocumentColorRegistrationOptions))] [Capability(typeof(ColorProviderCapability))] - public partial record DocumentColorParams : IPartialItemsRequest, ColorInformation>, IWorkDoneProgressParams + public partial record DocumentColorParams : IPartialItemsRequest?, ColorInformation>, IWorkDoneProgressParams { /// /// The text document. diff --git a/src/Protocol/Features/Document/DeclarationFeature.cs b/src/Protocol/Features/Document/DeclarationFeature.cs index 38654f594..f959bad58 100644 --- a/src/Protocol/Features/Document/DeclarationFeature.cs +++ b/src/Protocol/Features/Document/DeclarationFeature.cs @@ -18,7 +18,7 @@ namespace Models [RegistrationOptions(typeof(DeclarationRegistrationOptions))] [Capability(typeof(DeclarationCapability))] public partial record DeclarationParams : TextDocumentPositionParams, IWorkDoneProgressParams, - IPartialItemsRequest; + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.DeclarationProvider))] [RegistrationName(TextDocumentNames.Declaration)] diff --git a/src/Protocol/Features/Document/DefinitionFeature.cs b/src/Protocol/Features/Document/DefinitionFeature.cs index 8da8b62d4..ea10d2a37 100644 --- a/src/Protocol/Features/Document/DefinitionFeature.cs +++ b/src/Protocol/Features/Document/DefinitionFeature.cs @@ -18,7 +18,7 @@ namespace Models [RegistrationOptions(typeof(DefinitionRegistrationOptions))] [Capability(typeof(DefinitionCapability))] public partial record DefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, - IPartialItemsRequest; + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.DefinitionProvider))] [RegistrationName(TextDocumentNames.Definition)] diff --git a/src/Protocol/Features/Document/DocumentHighlightFeature.cs b/src/Protocol/Features/Document/DocumentHighlightFeature.cs index 552354a3d..484a1edaf 100644 --- a/src/Protocol/Features/Document/DocumentHighlightFeature.cs +++ b/src/Protocol/Features/Document/DocumentHighlightFeature.cs @@ -21,6 +21,8 @@ namespace Models [Capability(typeof(DocumentHighlightCapability))] public partial record DocumentHighlightParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest; + + public partial class DocumentHighlightContainer { } /// /// A document highlight is a range inside a text document which deserves diff --git a/src/Protocol/Features/Document/DocumentLinkFeature.cs b/src/Protocol/Features/Document/DocumentLinkFeature.cs index 5dd5dd796..3b15e4134 100644 --- a/src/Protocol/Features/Document/DocumentLinkFeature.cs +++ b/src/Protocol/Features/Document/DocumentLinkFeature.cs @@ -24,7 +24,7 @@ namespace Models [RegistrationOptions(typeof(DocumentLinkRegistrationOptions))] [Capability(typeof(DocumentLinkCapability))] [Resolver(typeof(DocumentLink))] - public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IPartialItemsRequest, + public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IPartialItemsRequest, IWorkDoneProgressParams { /// @@ -32,6 +32,8 @@ public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IParti /// public TextDocumentIdentifier TextDocument { get; init; } = null!; } + + public partial class DocumentLinkContainer { } /// /// A document link is a range in a text document that links to an internal or external resource, like another diff --git a/src/Protocol/Features/Document/DocumentSymbolFeature.cs b/src/Protocol/Features/Document/DocumentSymbolFeature.cs index 067e65fbd..2ed9ad534 100644 --- a/src/Protocol/Features/Document/DocumentSymbolFeature.cs +++ b/src/Protocol/Features/Document/DocumentSymbolFeature.cs @@ -22,7 +22,7 @@ namespace Models [RegistrationOptions(typeof(DocumentSymbolRegistrationOptions))] [Capability(typeof(DocumentSymbolCapability))] public partial record DocumentSymbolParams : ITextDocumentIdentifierParams, - IPartialItemsRequest, + IPartialItemsRequest, IWorkDoneProgressParams { /// @@ -30,6 +30,8 @@ public partial record DocumentSymbolParams : ITextDocumentIdentifierParams, /// public TextDocumentIdentifier TextDocument { get; init; } = null!; } + + public partial class SymbolInformationOrDocumentSymbolContainer {} [JsonConverter(typeof(SymbolInformationOrDocumentSymbolConverter))] [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] diff --git a/src/Protocol/Features/Document/ImplementationFeature.cs b/src/Protocol/Features/Document/ImplementationFeature.cs index 0d0bf5394..cacc80ac8 100644 --- a/src/Protocol/Features/Document/ImplementationFeature.cs +++ b/src/Protocol/Features/Document/ImplementationFeature.cs @@ -18,7 +18,7 @@ namespace Models [RegistrationOptions(typeof(ImplementationRegistrationOptions))] [Capability(typeof(ImplementationCapability))] public partial record ImplementationParams : TextDocumentPositionParams, IWorkDoneProgressParams, - IPartialItemsRequest; + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.ImplementationProvider))] [RegistrationName(TextDocumentNames.Implementation)] diff --git a/src/Protocol/Features/Document/InlayHintFeature.cs b/src/Protocol/Features/Document/InlayHintFeature.cs index aa2ca1c8f..55b92973e 100644 --- a/src/Protocol/Features/Document/InlayHintFeature.cs +++ b/src/Protocol/Features/Document/InlayHintFeature.cs @@ -1,4 +1,5 @@ -ο»Ώusing System.Diagnostics; +ο»Ώusing System.Collections.ObjectModel; +using System.Diagnostics; using MediatR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -26,8 +27,9 @@ namespace Models GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) ] [RegistrationOptions(typeof(InlayHintRegistrationOptions)), Capability(typeof(InlayHintWorkspaceClientCapabilities))] + [Resolver(typeof(InlayHint))] public partial record InlayHintParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, - IRequest?> + IRequest { /// /// The text document. @@ -52,8 +54,9 @@ public partial record InlayHintParams : ITextDocumentIdentifierParams, IWorkDone [GenerateHandlerMethods] [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [GenerateTypedData] + [GenerateContainer] [Capability(typeof(InlayHintWorkspaceClientCapabilities))] - public partial record InlayHint : ICanBeResolved, IRequest + public partial record InlayHint : ICanBeResolved, IRequest, IDoesNotParticipateInRegistration { /// /// The position of this hint. @@ -125,6 +128,8 @@ public partial record InlayHint : ICanBeResolved, IRequest private string DebuggerDisplay => ToString(); } + + public partial class InlayHintContainer {} /// /// An inlay hint label part allows for interactive and composite labels @@ -183,6 +188,7 @@ public record StringOrInlayHintLabelParts public StringOrInlayHintLabelParts(string value) => String = value; public StringOrInlayHintLabelParts(IEnumerable inlayHintLabelParts) => InlayHintLabelParts = new(inlayHintLabelParts); + public StringOrInlayHintLabelParts(Container inlayHintLabelParts) => InlayHintLabelParts = new(inlayHintLabelParts); public string? String { get; } public bool HasString => InlayHintLabelParts is null; @@ -191,8 +197,12 @@ public record StringOrInlayHintLabelParts public static implicit operator StringOrInlayHintLabelParts?(string? value) => value is null ? null : new StringOrInlayHintLabelParts(value); - public static implicit operator StringOrInlayHintLabelParts?(MarkupContent? markupContent) => - markupContent is null ? null : new StringOrInlayHintLabelParts(markupContent); + public static implicit operator StringOrInlayHintLabelParts?(Container? parts) => + parts is null ? null : new StringOrInlayHintLabelParts(parts); + public static implicit operator StringOrInlayHintLabelParts?(List? parts) => + parts is null ? null : new StringOrInlayHintLabelParts(parts); + public static implicit operator StringOrInlayHintLabelParts?(Collection? parts) => + parts is null ? null : new StringOrInlayHintLabelParts(parts); private string DebuggerDisplay => $"{( HasString ? String : HasInlayHintLabelParts ? string.Join(", ", InlayHintLabelParts!.Select(z => z.ToString())) : string.Empty )}"; diff --git a/src/Protocol/Features/Document/ReferencesFeature.cs b/src/Protocol/Features/Document/ReferencesFeature.cs index 28f19715b..92a0ebb9e 100644 --- a/src/Protocol/Features/Document/ReferencesFeature.cs +++ b/src/Protocol/Features/Document/ReferencesFeature.cs @@ -18,10 +18,13 @@ namespace Models GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) ] [RegistrationOptions(typeof(ReferenceRegistrationOptions)), Capability(typeof(ReferenceCapability))] - public partial record ReferenceParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest + public partial record ReferenceParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialItemsRequest { public ReferenceContext Context { get; init; } } + + public partial class LocationContainer {} + public record ReferenceContext { /// diff --git a/src/Protocol/Features/Document/TypeDefinitionFeature.cs b/src/Protocol/Features/Document/TypeDefinitionFeature.cs index 504742323..134a2edce 100644 --- a/src/Protocol/Features/Document/TypeDefinitionFeature.cs +++ b/src/Protocol/Features/Document/TypeDefinitionFeature.cs @@ -18,7 +18,7 @@ namespace Models [RegistrationOptions(typeof(TypeDefinitionRegistrationOptions))] [Capability(typeof(TypeDefinitionCapability))] public partial record TypeDefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, - IPartialItemsRequest; + IPartialItemsRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.TypeDefinitionProvider))] [RegistrationName(TextDocumentNames.TypeDefinition)] diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 295cd69bd..50c7541a5 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -125,6 +125,344 @@ public partial class Registration await Verify(GenerationHelpers.GenerateAll(source)); } + [Fact] + public async Task Supports_Inlay_Hint() + { + var source = @" +using System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +// ReSharper disable once CheckNamespace +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test +{ + namespace Models + { + [Parallel] + [Method(TextDocumentNames.InlayHint, Direction.ClientToServer)] + [ + GenerateHandler(""OmniSharp.Extensions.LanguageServer.Protocol.Document"", Name = ""OutlayHints""), + GenerateHandlerMethods, + GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) + ] + [RegistrationOptions(typeof(OutlayHintRegistrationOptions)), Capability(typeof(OutlayHintWorkspaceClientCapabilities))] + [Resolver(typeof(OutlayHint))] + public partial record OutlayHintParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, + IRequest + { + /// + /// The text document. + /// + public TextDocumentIdentifier TextDocument { get; init; } + + /// + /// The visible document range for which inlay hints should be computed. + /// + public Range Range { get; init; } + } + + /// + /// Outlay hint information. + /// + /// @since 3.17.0 + /// + [DebuggerDisplay(""{"" + nameof(DebuggerDisplay) + "",nq}"")] + [Parallel] + [Method(TextDocumentNames.InlayHintResolve, Direction.ClientToServer)] + [GenerateHandler(""OmniSharp.Extensions.LanguageServer.Protocol.Document"", Name = ""OutlayHintResolve"")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateTypedData] + [GenerateContainer] + [Capability(typeof(OutlayHintWorkspaceClientCapabilities))] + public partial record OutlayHint : ICanBeResolved, IRequest, IDoesNotParticipateInRegistration + { + /// + /// The position of this hint. + /// + public Position Position { get; init; } + + /// + /// The label of this hint. A human readable string or an array of + /// OutlayHintLabelPart label parts. + /// + /// *Note* that neither the string nor the label part can be empty. + /// + public StringOrOutlayHintLabelParts Label { get; init; } + + /// + /// The kind of this hint. Can be omitted in which case the client + /// should fall back to a reasonable default. + /// + public OutlayHintKind? Kind { get; init; } + + /// + /// Optional text edits that are performed when accepting this inlay hint. + /// + /// *Note* that edits are expected to change the document so that the inlay + /// hint (or its nearest variant) is now part of the document and the inlay + /// hint itself is now obsolete. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Container? TextEdits { get; init; } + + /// + /// The tooltip text when you hover over this item. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public StringOrMarkupContent? Tooltip { get; init; } + + /// + /// Render padding before the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + /// + [Optional] + public bool? PaddingLeft { get; init; } + + /// + /// Render padding after the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + /// + [Optional] + public bool? PaddingRight { get; init; } + + /// + /// A data entry field that is preserved on a document link between a + /// DocumentLinkRequest and a DocumentLinkResolveRequest. + /// + [Optional] + public JToken? Data { get; init; } + + private string DebuggerDisplay => ToString(); + } + + public partial class OutlayHintContainer {} + + /// + /// An inlay hint label part allows for interactive and composite labels + /// of inlay hints. + /// + /// @since 3.17.0 + /// + [DebuggerDisplay(""{"" + nameof(DebuggerDisplay) + "",nq}"")] + public partial record OutlayHintLabelPart + { + /// + /// The value of this label part. + /// + public string Value { get; init; } + + /// + /// The tooltip text when you hover over this label part. Depending on + /// the client capability `inlayHint.resolveSupport` clients might resolve + /// this property late using the resolve request. + /// + [Optional] + public StringOrMarkupContent? Tooltip { get; init; } + + /// + /// An optional source code location that represents this + /// label part. + /// + /// The editor will use this location for the hover and for code navigation + /// features: This part will become a clickable link that resolves to the + /// definition of the symbol at the given location (not necessarily the + /// location itself), it shows the hover that shows at the given location, + /// and it shows a context menu with further code navigation commands. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Location? Location { get; init; } + + /// + /// An optional command for this label part. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Command? Command { get; init; } + + private string DebuggerDisplay => ToString(); + } + + [JsonConverter(typeof(Converter))] + [DebuggerDisplay(""{"" + nameof(DebuggerDisplay) + "",nq}"")] + public record StringOrOutlayHintLabelParts + { + public StringOrOutlayHintLabelParts(string value) => String = value; + + public StringOrOutlayHintLabelParts(IEnumerable inlayHintLabelParts) => OutlayHintLabelParts = new(inlayHintLabelParts); + + public string? String { get; } + public bool HasString => OutlayHintLabelParts is null; + public Container? OutlayHintLabelParts { get; } + public bool HasOutlayHintLabelParts => OutlayHintLabelParts is { }; + + public static implicit operator StringOrOutlayHintLabelParts?(string? value) => value is null ? null : new StringOrOutlayHintLabelParts(value); + + public static implicit operator StringOrOutlayHintLabelParts?(MarkupContent? markupContent) => + markupContent is null ? null : new StringOrOutlayHintLabelParts(markupContent); + + private string DebuggerDisplay => + $""{( HasString ? String : HasOutlayHintLabelParts ? string.Join("", "", OutlayHintLabelParts!.Select(z => z.ToString())) : string.Empty )}""; + + /// + public override string ToString() => DebuggerDisplay; + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, StringOrOutlayHintLabelParts value, JsonSerializer serializer) + { + if (value.HasString) + { + writer.WriteValue(value.String); + } + else + { + serializer.Serialize(writer, value.OutlayHintLabelParts ?? Array.Empty()); + } + } + + public override StringOrOutlayHintLabelParts ReadJson( + JsonReader reader, Type objectType, StringOrOutlayHintLabelParts existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + if (reader.TokenType == JsonToken.StartArray) + { + var result = JArray.Load(reader); + return new StringOrOutlayHintLabelParts(result.ToObject>()); + } + + if (reader.TokenType == JsonToken.String) + { + return new StringOrOutlayHintLabelParts(( reader.Value as string )!); + } + + return """"; + } + + public override bool CanRead => true; + } + } + + /// + /// Outlay hint kinds. + /// + /// @since 3.17.0 + /// + /// + [JsonConverter(typeof(NumberEnumConverter))] + public enum OutlayHintKind + { + /// + /// An inlay hint that for a type annotation. + /// + Type = 1, + + /// + /// An inlay hint that is for a parameter. + /// + Parameter = 2 + } + + [GenerateRegistrationOptions(nameof(ServerCapabilities.OutlayHintProvider))] + [RegistrationOptionsConverter(typeof(OutlayHintRegistrationOptionsConverter))] + [RegistrationName(TextDocumentNames.OutlayHint)] + public partial class OutlayHintRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + /// + [Optional] + public bool ResolveProvider { get; set; } + + private class OutlayHintRegistrationOptionsConverter : RegistrationOptionsConverterBase + { + private readonly IHandlersManager _handlersManager; + + public OutlayHintRegistrationOptionsConverter(IHandlersManager handlersManager) + { + _handlersManager = handlersManager; + } + + public override StaticOptions Convert(OutlayHintRegistrationOptions source) + { + return new() + { + ResolveProvider = source.ResolveProvider || _handlersManager.Descriptors.Any(z => z.HandlerType == typeof(IOutlayHintResolveHandler)), + WorkDoneProgress = source.WorkDoneProgress, + }; + } + } + } + } + + namespace Client.Capabilities + { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.OutlayHint))] + public partial class OutlayHintWorkspaceClientCapabilities : DynamicCapability + { + /// + /// Indicates which properties a client can resolve lazily on a inlay + /// hint. + /// + [Optional] + public OutlayHintCapabilityResolveSupport? ResolveSupport { get; set; } + } + + /// + /// Indicates which properties a client can resolve lazily on a inlay + /// hint. + /// + public class OutlayHintCapabilityResolveSupport + { + /// + /// The properties that a client can resolve lazily. + /// + public Container Properties { get; set; } + } + } + + namespace Document + { + } +} +"; + + await Verify(GenerationHelpers.GenerateAll(source)); + } + [Fact] public async Task Supports_Nullable_Params_With_Typed_Data() { diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs index fd9218d16..9baa8fc4c 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs @@ -29,4 +29,4 @@ public static partial class LanguageProtocolInitializeExtensions public static Task RequestLanguageProtocolInitialize(this ITextDocumentLanguageClient mediator, InitializeParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); } #nullable restore -} \ No newline at end of file +} diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs new file mode 100644 index 000000000..0f2104845 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs @@ -0,0 +1,18 @@ +ο»Ώ//HintName: AssemblyCapabilityKeys.cs +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using System.Diagnostics; + +[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.Client.Capabilities.OutlayHintWorkspaceClientCapabilities), nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.OutlayHint))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs new file mode 100644 index 000000000..a2a33f902 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs @@ -0,0 +1,31 @@ +ο»Ώ//HintName: Test0_OutlayHintParams.cs +#nullable enable +using System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + public partial record OutlayHintParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..71e76711d --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Document.IOutlayHintsHandler), typeof(OmniSharp.Extensions.LanguageServer.Protocol.Document.IOutlayHintResolveHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02Test0_OutlayHintParams1.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02Test0_OutlayHintParams1.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs new file mode 100644 index 000000000..578724f25 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs @@ -0,0 +1,70 @@ +ο»Ώ//HintName: OutlayHint.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document +{ + [Parallel, Method(TextDocumentNames.InlayHintResolve, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IOutlayHintResolveHandler : IJsonRpcRequestHandler, IDoesNotParticipateInRegistration, ICapability, ICanBeIdentifiedHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class OutlayHintResolveHandlerBase : AbstractHandlers.RequestCapability, IOutlayHintResolveHandler + { + protected OutlayHintResolveHandlerBase(System.Guid id) : base() + { + _id = id; + } + + protected OutlayHintResolveHandlerBase() : this(Guid.NewGuid()) + { + } + + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class OutlayHintResolveExtensions + { + public static ILanguageServerRegistry OnOutlayHintResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(TextDocumentNames.InlayHintResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnOutlayHintResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(TextDocumentNames.InlayHintResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnOutlayHintResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(TextDocumentNames.InlayHintResolve, new LanguageProtocolDelegatingHandlers.RequestCapability(HandlerAdapter.Adapt(handler))); + public static Task ResolveOutlayHint(this ITextDocumentLanguageClient mediator, OutlayHint request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task ResolveOutlayHint(this ILanguageClient mediator, OutlayHint request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHint.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHint.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs new file mode 100644 index 000000000..81e903049 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs @@ -0,0 +1,152 @@ +ο»Ώ//HintName: OutlayHintParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document +{ + [Parallel, Method(TextDocumentNames.InlayHint, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface IOutlayHintsHandler : IJsonRpcRequestHandler, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class OutlayHintsHandlerBase : AbstractHandlers.Request, IOutlayHintsHandler, IOutlayHintResolveHandler + { + protected OutlayHintsHandlerBase(System.Guid id) : base() + { + _id = id; + } + + protected OutlayHintsHandlerBase() : this(Guid.NewGuid()) + { + } + + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + public abstract Task Handle(OutlayHint request, CancellationToken cancellationToken); + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class OutlayHintsHandlerBase : OutlayHintsHandlerBase where T : class?, IHandlerIdentity? + { + protected OutlayHintsHandlerBase(Guid id) : base(id) + { + } + + protected OutlayHintsHandlerBase() : this(Guid.NewGuid()) + { + } + + public sealed override async Task Handle(OutlayHintParams request, CancellationToken cancellationToken) => await HandleParams(request, cancellationToken).ConfigureAwait(false); + public sealed override async Task Handle(OutlayHint request, CancellationToken cancellationToken) => await HandleResolve(request, cancellationToken).ConfigureAwait(false); + protected abstract Task> HandleParams(OutlayHintParams request, CancellationToken cancellationToken); + protected abstract Task> HandleResolve(OutlayHint request, CancellationToken cancellationToken); + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class OutlayHintsExtensions + { + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.InlayHint, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.InlayHint, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.InlayHint, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.InlayHint, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))).AddHandler(TextDocumentNames.InlayHintResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.InlayHint, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))).AddHandler(TextDocumentNames.InlayHintResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.InlayHint, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))).AddHandler(TextDocumentNames.InlayHintResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func?>> handler, Func, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(new DelegatingOutlayHintsHandler(RegistrationAdapter.Adapt(registrationOptions), HandlerAdapter.Adapt?>(handler), HandlerAdapter.Adapt, OutlayHint>(resolveHandler))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func?>> handler, Func, CancellationToken, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(new DelegatingOutlayHintsHandler(RegistrationAdapter.Adapt(registrationOptions), HandlerAdapter.Adapt?>(handler), HandlerAdapter.Adapt, OutlayHint>(resolveHandler))); + } + + public static ILanguageServerRegistry OnOutlayHints(this ILanguageServerRegistry registry, Func?>> handler, Func, OutlayHintWorkspaceClientCapabilities, CancellationToken, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(new DelegatingOutlayHintsHandler(RegistrationAdapter.Adapt(registrationOptions), HandlerAdapter.Adapt?>(handler), HandlerAdapter.Adapt, OutlayHint>(resolveHandler))); + } + + public static Task RequestOutlayHints(this ITextDocumentLanguageClient mediator, OutlayHintParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task RequestOutlayHints(this ILanguageClient mediator, OutlayHintParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + private sealed class DelegatingOutlayHintsHandler : OutlayHintsHandlerBase where T : class?, IHandlerIdentity? + { + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + protected internal override OutlayHintRegistrationOptions CreateRegistrationOptions(OutlayHintWorkspaceClientCapabilities capability, ClientCapabilities clientCapabilities) => _registrationOptionsFactory(capability, clientCapabilities); + private readonly Func?>> _handleParams; + private readonly Func, OutlayHintWorkspaceClientCapabilities, CancellationToken, Task>> _handleResolve; + public DelegatingOutlayHintsHandler(RegistrationOptionsDelegate registrationOptionsFactory, Func?>> handleParams, Func, OutlayHintWorkspaceClientCapabilities, CancellationToken, Task>> handleResolve) : base() + { + _registrationOptionsFactory = registrationOptionsFactory; + _handleParams = handleParams; + _handleResolve = handleResolve; + } + + protected override Task?> HandleParams(OutlayHintParams request, CancellationToken cancellationToken) => _handleParams(request, Capability, cancellationToken); + protected override Task> HandleResolve(OutlayHint request, CancellationToken cancellationToken) => _handleResolve(request, Capability, cancellationToken); + } + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..ea38385cf --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; + +[assembly: AssemblyRegistrationOptions(typeof(OutlayHintRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05OutlayHintParams.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintParams1.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintParams1.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs new file mode 100644 index 000000000..5d2e1e0d3 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs @@ -0,0 +1,47 @@ +ο»Ώ//HintName: OutlayHintRegistrationOptions.cs +using System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.OutlayHintProvider))] + public partial class OutlayHintRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + public TextDocumentSelector? DocumentSelector { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + + [RegistrationOptionsKey(nameof(ServerCapabilities.OutlayHintProvider))] + public partial class StaticOptions : IWorkDoneProgressOptions + { + /// + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + /// + [Optional] + public bool ResolveProvider { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs new file mode 100644 index 000000000..604492ca9 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs @@ -0,0 +1,109 @@ +ο»Ώ//HintName: OutlayHintContainer.cs +using System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial class OutlayHintContainer : ContainerBase + { + public OutlayHintContainer() : this(Enumerable.Empty()) + { + } + + public OutlayHintContainer(IEnumerable items) : base(items) + { + } + + public OutlayHintContainer(params OutlayHint[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(IEnumerable? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (OutlayHint[] items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(params OutlayHint[] items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (Collection? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(Collection? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (List? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(List? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (in ImmutableArray? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(in ImmutableArray? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (ImmutableList? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(ImmutableList? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08OutlayHintRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08OutlayHintRegistrationOptions.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs new file mode 100644 index 000000000..7adc1f307 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs @@ -0,0 +1,240 @@ +ο»Ώ//HintName: Test0_OutlayHintTyped.cs +using System.Diagnostics; +using MediatR; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; +using System.Linq; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + public partial record OutlayHint + { + public OutlayHint WithData(TData data) + where TData : class?, IHandlerIdentity? + { + return new OutlayHint{Position = Position, Label = Label, Kind = Kind, TextEdits = TextEdits, Tooltip = Tooltip, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, Data = data}; + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] + public static OutlayHint? From(OutlayHint? item) + where T : class?, IHandlerIdentity? => item switch + { + not null => item, + _ => null + }; + } + + /// + /// Outlay hint information. + /// + /// @since 3.17.0 + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document", Name = "OutlayHintResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateContainer] + [Capability(typeof(OutlayHintWorkspaceClientCapabilities))] + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial record OutlayHint : ICanBeResolved where T : class?, IHandlerIdentity? + { + /// + /// The position of this hint. + /// + public Position Position { get; init; } + + /// + /// The label of this hint. A human readable string or an array of + /// OutlayHintLabelPart label parts. + /// + /// *Note* that neither the string nor the label part can be empty. + /// + public StringOrOutlayHintLabelParts Label { get; init; } + + /// + /// The kind of this hint. Can be omitted in which case the client + /// should fall back to a reasonable default. + /// + public OutlayHintKind? Kind { get; init; } + + /// + /// Optional text edits that are performed when accepting this inlay hint. + /// + /// *Note* that edits are expected to change the document so that the inlay + /// hint (or its nearest variant) is now part of the document and the inlay + /// hint itself is now obsolete. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public Container? TextEdits { get; init; } + + /// + /// The tooltip text when you hover over this item. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + /// + [Optional] + public StringOrMarkupContent? Tooltip { get; init; } + + /// + /// Render padding before the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + /// + [Optional] + public bool? PaddingLeft { get; init; } + + /// + /// Render padding after the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + /// + [Optional] + public bool? PaddingRight { get; init; } + + /// + /// A data entry field that is preserved on a document link between a + /// DocumentLinkRequest and a DocumentLinkResolveRequest. + /// + [Optional] + public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } + + private string DebuggerDisplay => ToString(); + public OutlayHint WithData(TData data) + where TData : class?, IHandlerIdentity? + { + return new OutlayHint{Position = Position, Label = Label, Kind = Kind, TextEdits = TextEdits, Tooltip = Tooltip, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, Data = data}; + } + + JToken? ICanBeResolved.Data { get; init; } + + private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } + + public static implicit operator OutlayHint(OutlayHint value) => new OutlayHint{Position = value.Position, Label = value.Label, Kind = value.Kind, TextEdits = value.TextEdits, Tooltip = value.Tooltip, PaddingLeft = value.PaddingLeft, PaddingRight = value.PaddingRight, JData = value.Data}; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("value")] + public static implicit operator OutlayHint? (OutlayHint? value) => value switch + { + not null => new OutlayHint{Position = value.Position, Label = value.Label, Kind = value.Kind, TextEdits = value.TextEdits, Tooltip = value.Tooltip, PaddingLeft = value.PaddingLeft, PaddingRight = value.PaddingRight, Data = value.JData}, + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] + public static OutlayHint? From(OutlayHint? item) => item switch + { + not null => item, + _ => null + }; + } + + public partial class OutlayHintContainer : ContainerBase> where T : class?, IHandlerIdentity? + { + public OutlayHintContainer() : this(Enumerable.Empty>()) + { + } + + public OutlayHintContainer(IEnumerable> items) : base(items) + { + } + + public OutlayHintContainer(params OutlayHint[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(IEnumerable>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (OutlayHint[] items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(params OutlayHint[] items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (Collection>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(Collection>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (List>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(List>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (in ImmutableArray>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(in ImmutableArray>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator OutlayHintContainer? (ImmutableList>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static OutlayHintContainer? From(ImmutableList>? items) => items switch + { + not null => new OutlayHintContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("container")] + public static implicit operator OutlayHintContainer? (OutlayHintContainer? container) => container switch + { + not null => new OutlayHintContainer(container.Select(value => (OutlayHint)value)), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.09OutlayHintContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.09OutlayHintContainer.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.10Test0_OutlayHintTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.10Test0_OutlayHintTyped.verified.cs new file mode 100644 index 000000000..e69de29bb diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs new file mode 100644 index 000000000..917a0660e --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs @@ -0,0 +1,18 @@ +ο»Ώ//HintName: AssemblyCapabilityKeys.cs +using MediatR; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using System.Diagnostics; +using System.Linq; + +[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.Client.Capabilities.SubLensCapability), nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.CodeLens)), AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Test.Client.Capabilities.SubLensWorkspaceClientCapabilities), nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.CodeLens))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs new file mode 100644 index 000000000..49c21d78e --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs @@ -0,0 +1,33 @@ +ο»Ώ//HintName: Test0_SubLensParams.cs +#nullable enable +using System.Diagnostics; +using System.Linq; +using MediatR; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using Newtonsoft.Json; +using System.ComponentModel; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + public partial record SubLensParams + { + [Optional] + public ProgressToken? WorkDoneToken { get; init; } + + [Optional] + public ProgressToken? PartialResultToken { get; init; } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs new file mode 100644 index 000000000..4a53684f5 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs @@ -0,0 +1,4 @@ +ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs +using OmniSharp.Extensions.JsonRpc; + +[assembly: AssemblyJsonRpcHandlers(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Document.Test.ISubLensHandler), typeof(OmniSharp.Extensions.LanguageServer.Protocol.Document.Test.ISubLensResolveHandler), typeof(OmniSharp.Extensions.LanguageServer.Protocol.Workspace.Test.ISubLensRefreshHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs new file mode 100644 index 000000000..a54bc6e06 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs @@ -0,0 +1,69 @@ +ο»Ώ//HintName: SubLens.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Document.Test; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document.Test +{ + [Parallel, Method(TextDocumentNames.CodeLensResolve, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface ISubLensResolveHandler : IJsonRpcRequestHandler, IDoesNotParticipateInRegistration, ICapability, ICanBeIdentifiedHandler + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SubLensResolveHandlerBase : AbstractHandlers.RequestCapability, ISubLensResolveHandler + { + protected SubLensResolveHandlerBase(System.Guid id) : base() + { + _id = id; + } + + protected SubLensResolveHandlerBase() : this(Guid.NewGuid()) + { + } + + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class SubLensResolveExtensions + { + public static ILanguageServerRegistry OnSubLensResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(TextDocumentNames.CodeLensResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnSubLensResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(TextDocumentNames.CodeLensResolve, RequestHandler.For(handler)); + public static ILanguageServerRegistry OnSubLensResolve(this ILanguageServerRegistry registry, Func> handler) => registry.AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.RequestCapability(HandlerAdapter.Adapt(handler))); + public static Task ResolveSubLens(this ITextDocumentLanguageClient mediator, SubLens request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + public static Task ResolveSubLens(this ILanguageClient mediator, SubLens request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs new file mode 100644 index 000000000..083023a2d --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs @@ -0,0 +1,259 @@ +ο»Ώ//HintName: SubLensParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Document.Test; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Progress; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document.Test +{ + [Parallel, Method(TextDocumentNames.CodeLens, Direction.ClientToServer)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface ISubLensHandler : IJsonRpcRequestHandler, IRegistration + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SubLensHandlerBase : AbstractHandlers.Request, ISubLensHandler, ISubLensResolveHandler + { + protected SubLensHandlerBase(System.Guid id) : base() + { + _id = id; + } + + protected SubLensHandlerBase() : this(Guid.NewGuid()) + { + } + + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + public abstract Task Handle(SubLens request, CancellationToken cancellationToken); + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SubLensHandlerBase : SubLensHandlerBase where T : class?, IHandlerIdentity? + { + protected SubLensHandlerBase(Guid id) : base(id) + { + } + + protected SubLensHandlerBase() : this(Guid.NewGuid()) + { + } + + public sealed override async Task Handle(SubLensParams request, CancellationToken cancellationToken) => await HandleParams(request, cancellationToken).ConfigureAwait(false); + public sealed override async Task Handle(SubLens request, CancellationToken cancellationToken) => await HandleResolve(request, cancellationToken).ConfigureAwait(false); + protected abstract Task> HandleParams(SubLensParams request, CancellationToken cancellationToken); + protected abstract Task> HandleResolve(SubLens request, CancellationToken cancellationToken); + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SubLensPartialHandlerBase : AbstractHandlers.PartialResults, ISubLensHandler, ISubLensResolveHandler + { + protected SubLensPartialHandlerBase(System.Guid id, IProgressManager progressManager) : base(progressManager, SubLensContainer.From) + { + _id = id; + } + + protected SubLensPartialHandlerBase(IProgressManager progressManager) : this(Guid.NewGuid(), progressManager) + { + } + + private readonly Guid _id; + Guid ICanBeIdentifiedHandler.Id => _id; + public abstract Task Handle(SubLens request, CancellationToken cancellationToken); + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SubLensPartialHandlerBase : SubLensPartialHandlerBase where T : class?, IHandlerIdentity? + { + protected SubLensPartialHandlerBase(Guid id, IProgressManager progressManager) : base(id, progressManager) + { + } + + protected SubLensPartialHandlerBase(IProgressManager progressManager) : this(Guid.NewGuid(), progressManager) + { + } + + protected sealed override void Handle(SubLensParams request, IObserver> results, CancellationToken cancellationToken) => Handle(request, new LanguageProtocolDelegatingHandlers.TypedPartialObserver, SubLens>(results, SubLens.From), cancellationToken); + public sealed override async Task Handle(SubLens request, CancellationToken cancellationToken) + { + var response = await HandleResolve(request, cancellationToken).ConfigureAwait(false); + return response; + } + + protected abstract void Handle(SubLensParams request, IObserver>> results, CancellationToken cancellationToken); + protected abstract Task> HandleResolve(SubLens request, CancellationToken cancellationToken); + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Document.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class SubLensExtensions + { + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.CodeLens, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.CodeLens, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.CodeLens, new LanguageProtocolDelegatingHandlers.Request(HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.CodeLens, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), SubLensContainer.From)); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.CodeLens, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), SubLensContainer.From)); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>, SubLensCapability, CancellationToken> handler, RegistrationOptionsDelegate registrationOptions) + { + return registry.AddHandler(TextDocumentNames.CodeLens, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), SubLensContainer.From)); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.CodeLens, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))).AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.CodeLens, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))).AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.CodeLens, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions))).AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.CodeLens, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), SubLensContainer.From)).AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>, CancellationToken> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.CodeLens, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), SubLensContainer.From)).AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>, SubLensCapability, CancellationToken> handler, Func> resolveHandler, RegistrationOptionsDelegate registrationOptions) + { + var id = Guid.NewGuid(); + return registry.AddHandler(TextDocumentNames.CodeLens, _ => new LanguageProtocolDelegatingHandlers.PartialResults(PartialAdapter.Adapt(handler), RegistrationAdapter.Adapt(registrationOptions), _.GetService(), SubLensContainer.From)).AddHandler(TextDocumentNames.CodeLensResolve, new LanguageProtocolDelegatingHandlers.Request(id, HandlerAdapter.Adapt(resolveHandler), RegistrationAdapter.Adapt(registrationOptions))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func?>> handler, Func, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(new DelegatingSubLensHandler(RegistrationAdapter.Adapt(registrationOptions), HandlerAdapter.Adapt?>(handler), HandlerAdapter.Adapt, SubLens>(resolveHandler))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func?>> handler, Func, CancellationToken, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(new DelegatingSubLensHandler(RegistrationAdapter.Adapt(registrationOptions), HandlerAdapter.Adapt?>(handler), HandlerAdapter.Adapt, SubLens>(resolveHandler))); + } + + public static ILanguageServerRegistry OnSubLens(this ILanguageServerRegistry registry, Func?>> handler, Func, SubLensCapability, CancellationToken, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(new DelegatingSubLensHandler(RegistrationAdapter.Adapt(registrationOptions), HandlerAdapter.Adapt?>(handler), HandlerAdapter.Adapt, SubLens>(resolveHandler))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>>> handler, Func, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(_ => new DelegatingSubLensPartialHandler(_.GetService(), RegistrationAdapter.Adapt(registrationOptions), PartialAdapter.Adapt>(handler), HandlerAdapter.Adapt, SubLens>(resolveHandler))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>>, CancellationToken> handler, Func, CancellationToken, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(_ => new DelegatingSubLensPartialHandler(_.GetService(), RegistrationAdapter.Adapt(registrationOptions), PartialAdapter.Adapt>(handler), HandlerAdapter.Adapt, SubLens>(resolveHandler))); + } + + public static ILanguageServerRegistry ObserveSubLens(this ILanguageServerRegistry registry, Action>>, SubLensCapability, CancellationToken> handler, Func, SubLensCapability, CancellationToken, Task>> resolveHandler, RegistrationOptionsDelegate registrationOptions) + where T : class?, IHandlerIdentity? + { + return registry.AddHandler(_ => new DelegatingSubLensPartialHandler(_.GetService(), RegistrationAdapter.Adapt(registrationOptions), PartialAdapter.Adapt>(handler), HandlerAdapter.Adapt, SubLens>(resolveHandler))); + } + + public static IRequestProgressObservable, SubLensContainer?> RequestSubLens(this ITextDocumentLanguageClient mediator, SubLensParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, SubLensContainer.From, cancellationToken); + public static IRequestProgressObservable, SubLensContainer?> RequestSubLens(this ILanguageClient mediator, SubLensParams request, CancellationToken cancellationToken = default) => mediator.ProgressManager.MonitorUntil(request, SubLensContainer.From, cancellationToken); + private sealed class DelegatingSubLensHandler : SubLensHandlerBase where T : class?, IHandlerIdentity? + { + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + protected internal override SubLensRegistrationOptions CreateRegistrationOptions(SubLensCapability capability, ClientCapabilities clientCapabilities) => _registrationOptionsFactory(capability, clientCapabilities); + private readonly Func?>> _handleParams; + private readonly Func, SubLensCapability, CancellationToken, Task>> _handleResolve; + public DelegatingSubLensHandler(RegistrationOptionsDelegate registrationOptionsFactory, Func?>> handleParams, Func, SubLensCapability, CancellationToken, Task>> handleResolve) : base() + { + _registrationOptionsFactory = registrationOptionsFactory; + _handleParams = handleParams; + _handleResolve = handleResolve; + } + + protected override Task?> HandleParams(SubLensParams request, CancellationToken cancellationToken) => _handleParams(request, Capability, cancellationToken); + protected override Task> HandleResolve(SubLens request, CancellationToken cancellationToken) => _handleResolve(request, Capability, cancellationToken); + } + + private sealed class DelegatingSubLensPartialHandler : SubLensPartialHandlerBase where T : class?, IHandlerIdentity? + { + private readonly RegistrationOptionsDelegate _registrationOptionsFactory; + protected internal override SubLensRegistrationOptions CreateRegistrationOptions(SubLensCapability capability, ClientCapabilities clientCapabilities) => _registrationOptionsFactory(capability, clientCapabilities); + private readonly Action>>, SubLensCapability, CancellationToken> _handle; + private readonly Func, SubLensCapability, CancellationToken, Task>> _handleResolve; + public DelegatingSubLensPartialHandler(IProgressManager progressManager, RegistrationOptionsDelegate registrationOptionsFactory, Action>>, SubLensCapability, CancellationToken> handle, Func, SubLensCapability, CancellationToken, Task>> handleResolve) : base(progressManager) + { + _registrationOptionsFactory = registrationOptionsFactory; + _handle = handle; + _handleResolve = handleResolve; + } + + protected override void Handle(SubLensParams request, IObserver>> results, CancellationToken cancellationToken) => _handle(request, results, Capability, cancellationToken); + protected override Task> HandleResolve(SubLens request, CancellationToken cancellationToken) => _handleResolve(request, Capability, cancellationToken); + } + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs new file mode 100644 index 000000000..d41c4734e --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs @@ -0,0 +1,61 @@ +ο»Ώ//HintName: SubLensRefreshParams.cs +using MediatR; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.DebugAdapter.Protocol; +using OmniSharp.Extensions.DebugAdapter.Protocol.Events; +using OmniSharp.Extensions.DebugAdapter.Protocol.Models; +using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Workspace.Test; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace.Test +{ + [Parallel, Method(WorkspaceNames.CodeLensRefresh, Direction.ServerToClient)] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial interface ISubLensRefreshHandler : IJsonRpcNotificationHandler, ICapability + { + } + + [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] + abstract public partial class SubLensRefreshHandlerBase : AbstractHandlers.NotificationCapability, ISubLensRefreshHandler + { + } +} +#nullable restore + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Workspace.Test +{ +#nullable enable + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public static partial class SubLensRefreshExtensions + { + public static ILanguageClientRegistry OnSubLensRefresh(this ILanguageClientRegistry registry, Action handler) => registry.AddHandler(WorkspaceNames.CodeLensRefresh, NotificationHandler.For(handler)); + public static ILanguageClientRegistry OnSubLensRefresh(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(WorkspaceNames.CodeLensRefresh, NotificationHandler.For(handler)); + public static ILanguageClientRegistry OnSubLensRefresh(this ILanguageClientRegistry registry, Action handler) => registry.AddHandler(WorkspaceNames.CodeLensRefresh, NotificationHandler.For(handler)); + public static ILanguageClientRegistry OnSubLensRefresh(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(WorkspaceNames.CodeLensRefresh, NotificationHandler.For(handler)); + public static ILanguageClientRegistry OnSubLensRefresh(this ILanguageClientRegistry registry, Action handler) => registry.AddHandler(WorkspaceNames.CodeLensRefresh, new LanguageProtocolDelegatingHandlers.NotificationCapability(HandlerAdapter.Adapt(handler))); + public static ILanguageClientRegistry OnSubLensRefresh(this ILanguageClientRegistry registry, Func handler) => registry.AddHandler(WorkspaceNames.CodeLensRefresh, new LanguageProtocolDelegatingHandlers.NotificationCapability(HandlerAdapter.Adapt(handler))); + public static void SendSubLensRefresh(this IWorkspaceLanguageServer mediator, SubLensRefreshParams request) => mediator.SendNotification(request); + public static void SendSubLensRefresh(this ILanguageServer mediator, SubLensRefreshParams request) => mediator.SendNotification(request); + } +#nullable restore +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs new file mode 100644 index 000000000..8906112fa --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs @@ -0,0 +1,5 @@ +ο»Ώ//HintName: AssemblyRegistrationOptions.cs +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Test.Models; + +[assembly: AssemblyRegistrationOptions(typeof(SubLensRegistrationOptions))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs new file mode 100644 index 000000000..eec350d8b --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs @@ -0,0 +1,43 @@ +ο»Ώ//HintName: SubLensRegistrationOptions.cs +using System.Diagnostics; +using System.Linq; +using MediatR; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + [RegistrationOptionsKey(nameof(ServerCapabilities.SubLensProvider))] + public partial class SubLensRegistrationOptions : OmniSharp.Extensions.LanguageServer.Protocol.IRegistrationOptions + { + public TextDocumentSelector? DocumentSelector { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + + [RegistrationOptionsKey(nameof(ServerCapabilities.SubLensProvider))] + public partial class StaticOptions : IWorkDoneProgressOptions + { + /// + /// Code lens has a resolve provider as well. + /// + [Optional] + public bool ResolveProvider { get; set; } + + [Optional] + public bool WorkDoneProgress { get; set; } + } + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs new file mode 100644 index 000000000..01b4eeb97 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs @@ -0,0 +1,107 @@ +ο»Ώ//HintName: SubLensContainer.cs +using System.Diagnostics; +using System.Linq; +using MediatR; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial class SubLensContainer : ContainerBase + { + public SubLensContainer() : this(Enumerable.Empty()) + { + } + + public SubLensContainer(IEnumerable items) : base(items) + { + } + + public SubLensContainer(params SubLens[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(IEnumerable? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (SubLens[] items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(params SubLens[] items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (Collection? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(Collection? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (List? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(List? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (in ImmutableArray? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(in ImmutableArray? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (ImmutableList? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(ImmutableList? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + } +} +#nullable restore diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs new file mode 100644 index 000000000..19c4b8d68 --- /dev/null +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs @@ -0,0 +1,195 @@ +ο»Ώ//HintName: Test0_SubLensTyped.cs +using System.Diagnostics; +using System.Linq; +using MediatR; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.JsonRpc; +using OmniSharp.Extensions.JsonRpc.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; +using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Immutable; + +#nullable enable +namespace OmniSharp.Extensions.LanguageServer.Protocol.Test.Models +{ + public partial record SubLens + { + public SubLens WithData(TData data) + where TData : class?, IHandlerIdentity? + { + return new SubLens{Range = Range, Command = Command, Data = data}; + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] + public static SubLens? From(SubLens? item) + where T : class?, IHandlerIdentity? => item switch + { + not null => item, + _ => null + }; + } + + /// + /// A code lens represents a command that should be shown along with + /// source text, like the number of references, a way to run tests, etc. + /// + /// A code lens is _unresolved_ when no command is associated to it. For performance + /// reasons the creation of a code lens and resolving should be done in two stages. + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [Parallel] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Document.Test", Name = "SubLensResolve")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] + [GenerateContainer] + [Capability(typeof(SubLensCapability))] + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] + public partial record SubLens : ICanBeResolved where T : class?, IHandlerIdentity? + { + /// + /// The range in which this code lens is valid. Should only span a single line. + /// + public Range Range { get; init; } = null !; + /// + /// The command this code lens represents. + /// + [Optional] + public Command? Command { get; init; } + + /// + /// A data entry field that is preserved on a code lens item between + /// a code lens and a code lens resolve request. + /// + [Optional] + public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } + + private string DebuggerDisplay => $"{Range}{(Command != null ? $" {Command}" : "")}"; + /// + public override string ToString() + { + return DebuggerDisplay; + } + + public SubLens WithData(TData data) + where TData : class?, IHandlerIdentity? + { + return new SubLens{Range = Range, Command = Command, Data = data}; + } + + JToken? ICanBeResolved.Data { get; init; } + + private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } + + public static implicit operator SubLens(SubLens value) => new SubLens{Range = value.Range, Command = value.Command, JData = value.Data}; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("value")] + public static implicit operator SubLens? (SubLens? value) => value switch + { + not null => new SubLens{Range = value.Range, Command = value.Command, Data = value.JData}, + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] + public static SubLens? From(SubLens? item) => item switch + { + not null => item, + _ => null + }; + } + + public partial class SubLensContainer : ContainerBase> where T : class?, IHandlerIdentity? + { + public SubLensContainer() : this(Enumerable.Empty>()) + { + } + + public SubLensContainer(IEnumerable> items) : base(items) + { + } + + public SubLensContainer(params SubLens[] items) : base(items) + { + } + + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(IEnumerable>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (SubLens[] items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(params SubLens[] items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (Collection>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(Collection>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (List>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(List>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (in ImmutableArray>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(in ImmutableArray>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static implicit operator SubLensContainer? (ImmutableList>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("items")] + public static SubLensContainer? From(ImmutableList>? items) => items switch + { + not null => new SubLensContainer(items), + _ => null + }; + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("container")] + public static implicit operator SubLensContainer? (SubLensContainer? container) => container switch + { + not null => new SubLensContainer(container.Select(value => (SubLens)value)), + _ => null + }; + } +} +#nullable restore diff --git a/test/Lsp.Integration.Tests/TypedCodeActionTests.cs.disable b/test/Lsp.Integration.Tests/TypedCodeActionTests.cs similarity index 100% rename from test/Lsp.Integration.Tests/TypedCodeActionTests.cs.disable rename to test/Lsp.Integration.Tests/TypedCodeActionTests.cs diff --git a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs.disable b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs similarity index 99% rename from test/Lsp.Integration.Tests/TypedCodeLensTests.cs.disable rename to test/Lsp.Integration.Tests/TypedCodeLensTests.cs index 4785ba663..48cc3689c 100644 --- a/test/Lsp.Integration.Tests/TypedCodeLensTests.cs.disable +++ b/test/Lsp.Integration.Tests/TypedCodeLensTests.cs @@ -167,7 +167,7 @@ public async Task Should_Resolve_With_Data_Capability() options.OnCodeLens( (codeLensParams, capability, token) => { - return Task.FromResult( + return Task.FromResult?>( new CodeLensContainer( new CodeLens { @@ -270,7 +270,7 @@ public async Task Should_Resolve_With_Data_CancellationToken() options.OnCodeLens( (codeLensParams, token) => { - return Task.FromResult>( + return Task.FromResult?>( new CodeLensContainer( new CodeLens { diff --git a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs.disable b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs similarity index 99% rename from test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs.disable rename to test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs index c0fcc0037..f3e8a238b 100644 --- a/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs.disable +++ b/test/Lsp.Integration.Tests/TypedDocumentLinkTests.cs @@ -66,7 +66,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnDocumentLink( codeLensParams => { - return Task.FromResult( + return Task.FromResult?>( new DocumentLinkContainer( new DocumentLink { diff --git a/test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable b/test/Lsp.Integration.Tests/TypedInlayHintTests.cs similarity index 88% rename from test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable rename to test/Lsp.Integration.Tests/TypedInlayHintTests.cs index 2b9f3092c..7213763d0 100644 --- a/test/Lsp.Integration.Tests/TypedInlayHintTests.cs.disable +++ b/test/Lsp.Integration.Tests/TypedInlayHintTests.cs @@ -39,15 +39,10 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnInlayHints( inlayHintParams => { - return Task.FromResult( + return Task.FromResult?>( new InlayHintContainer( new InlayHint { - Command = new Command - { - Name = "data-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, Data = new Data { Child = new Nested @@ -61,7 +56,23 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-a" } }); }, + l => + { + return Task.FromResult( + l with + { + TextEdits = new List() + { + new AnnotatedTextEdit() + { + Range = new Range(( 1, 1 ), ( 1, 3 )), + AnnotationId = "id1", + NewText = "MyText1" + } + }, + } + ); + }, (_, _) => new InlayHintRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") @@ -77,7 +88,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() { Kind = InlayHintKind.Parameter, Label = new StringOrInlayHintLabelParts("my hint"), - Position = (1, 2), + Position = ( 1, 2 ), PaddingLeft = true, PaddingRight = true, Data = new Nested @@ -88,7 +99,22 @@ public async Task Should_Aggregate_With_All_Related_Handlers() ) ); }, - l => { return Task.FromResult(l with { }); }, + l => + { + return Task.FromResult( + l with + { + TextEdits = new List() + { + new TextEdit() + { + Range = new Range(( 1, 1 ), ( 1, 3 )), + NewText = "MyText2" + } + }, + } + ); + }, (_, _) => new InlayHintRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") @@ -104,14 +130,30 @@ public async Task Should_Aggregate_With_All_Related_Handlers() { Kind = InlayHintKind.Parameter, Label = "my hint", - Position = (1, 2), + Position = ( 1, 2 ), PaddingLeft = true, PaddingRight = true, } ) ); }, - l => { return Task.FromResult(l with { Label = new List() { new InlayHintLabelPart() }, }); }, + l => + { + return Task.FromResult( + l with + { + TextEdits = new List() + { + new AnnotatedTextEdit() + { + Range = new Range(( 1, 1 ), ( 1, 3 )), + AnnotationId = "id3", + NewText = "MyText3" + } + }, + } + ); + }, (_, _) => new InlayHintRegistrationOptions { DocumentSelector = TextDocumentSelector.ForPattern("**/*.cs") @@ -121,20 +163,26 @@ public async Task Should_Aggregate_With_All_Related_Handlers() options.OnInlayHints( inlayHintParams => { - return Task.FromResult( + return Task.FromResult( new InlayHintContainer( new InlayHint { - Command = new Command - { - Name = "not-included", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - } } ) ); }, - l => { return Task.FromResult(l with { Command = l.Command with { Name = "resolved-d" } }); }, + l => { return Task.FromResult(l with + { + TextEdits = new List() + { + new AnnotatedTextEdit() + { + Range = new Range(( 1, 1 ), ( 1, 3 )), + AnnotationId = "id4", + NewText = "Not Found" + } + } + }); }, (_, _) => new InlayHintRegistrationOptions { DocumentSelector = TextDocumentSelector.ForLanguage("vb") @@ -143,7 +191,7 @@ public async Task Should_Aggregate_With_All_Related_Handlers() } ); - var InlayHint = await client.RequestInlayHint( + var InlayHint = await client.RequestInlayHints( new InlayHintParams { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), @@ -152,10 +200,11 @@ public async Task Should_Aggregate_With_All_Related_Handlers() var lens = InlayHint.ToArray(); - var responses = await Task.WhenAll(lens.Select(z => client.ResolveInlayHint(z))); - responses.Select(z => z.Command!.Name).Should().Contain(new[] { "resolved-a", "resolved-b", "resolved-c" }); - responses.Select(z => z.Command!.Name).Should().NotContain("resolved-d"); + var responses = (await Task.WhenAll(lens.Select(z => client.ResolveInlayHint(z)))).SelectMany(z => z.TextEdits ?? Array.Empty()).ToArray(); + responses.Select(z => z.NewText).Should().Contain(new[] { "MyText1", "MyText2", "MyText3" }); + responses.Select(z => z.NewText).Should().NotContain("Not Found"); lens.Length.Should().Be(3); + responses.OfType().Should().HaveCount(2); } [Fact] @@ -167,15 +216,10 @@ public async Task Should_Resolve_With_Data_Capability() options.OnInlayHints( (InlayHintParams, capability, token) => { - return Task.FromResult( + return Task.FromResult?>( new InlayHintContainer( new InlayHint { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, Data = new Data { Child = new Nested @@ -194,20 +238,19 @@ public async Task Should_Resolve_With_Data_Capability() lens.Data.Id.Should().NotBeEmpty(); lens.Data.Child.Should().NotBeNull(); lens.Data.Name.Should().Be("name"); - return Task.FromResult(lens with { Command = lens.Command with { Name = "resolved" } }); - return Task.FromResult(lens); + return Task.FromResult(lens with { Data = lens.Data with { Name = "Resolved"} }); }, (_, _) => new InlayHintRegistrationOptions() ); } ); - var items = await client.RequestInlayHint(new InlayHintParams()); - + var items = await client.SendRequest(TextDocumentNames.InlayHint, new InlayHintParams()).Returning?>(CancellationToken); + client.TextDocument.RequestInlayHints() var item = items.Single(); item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); + item.Data!.Name.Should().Be("resolved"); } [Fact] From 04aa6376d13473e7f5b6b3fc2ce27c25bb8757f2 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 10 Jul 2022 00:41:53 -0400 Subject: [PATCH 049/647] Fixed failing tests, disabled new generators for the moment, they can be re-done in the future --- sample/SampleServer/SampleServer.csproj | 16 +- sample/SampleServer/TextDocumentHandler.cs | 10 +- .../GenerateHandlerMethodsGenerator.cs | 4 +- .../GeneratorDiagnostics.cs | 4 + .../StronglyTypedGenerator.cs | 98 +---- .../Converters/NumberEnumConverter.cs | 10 +- .../TypedInlayHintTests.cs | 409 ++---------------- 7 files changed, 92 insertions(+), 459 deletions(-) diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index f793325cd..0300dcca5 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -3,23 +3,17 @@ Exe false - netcoreapp3.1 + net6.0 win7-x64 latest - - - - - - - - - - + + + + diff --git a/sample/SampleServer/TextDocumentHandler.cs b/sample/SampleServer/TextDocumentHandler.cs index d3d7d684b..e9a06b74a 100644 --- a/sample/SampleServer/TextDocumentHandler.cs +++ b/sample/SampleServer/TextDocumentHandler.cs @@ -146,7 +146,7 @@ public MyWorkspaceSymbolsHandler(IServerWorkDoneManager serverWorkDoneManager, I _logger = logger; } - public async Task> Handle( + public async Task> Handle( WorkspaceSymbolParams request, CancellationToken cancellationToken ) @@ -190,9 +190,8 @@ CancellationToken cancellationToken partialResults.OnNext( new[] { - new SymbolInformation { + new WorkspaceSymbol { ContainerName = "Partial Container", - Deprecated = true, Kind = SymbolKind.Constant, Location = new Location { Range = new Range( @@ -221,15 +220,14 @@ CancellationToken cancellationToken ); partialResults.OnCompleted(); - return new SymbolInformation[] { }; + return new WorkspaceSymbol[] { }; } try { return new[] { - new SymbolInformation { + new WorkspaceSymbol { ContainerName = "Container", - Deprecated = true, Kind = SymbolKind.Constant, Location = new Location { Range = new Range( diff --git a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs index d5e3632b8..24cfc1473 100644 --- a/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs +++ b/src/JsonRpc.Generators/GenerateHandlerMethodsGenerator.cs @@ -207,8 +207,8 @@ private static ImmutableArray GetCompilationU new OnRequestTypedResolveMethodGeneratorWithRegistrationOptionsStrategy(), // new OnRequestTypedMethodGeneratorWithRegistrationOptionsStrategy(), new SendMethodNotificationStrategy(), - new SendMethodRequestStrategy(), - new SendMethodTypedResolveRequestStrategy() + new SendMethodRequestStrategy()/*, + new SendMethodTypedResolveRequestStrategy()*/ ); var actionStrategies = ImmutableArray.Create( new EnsureNamespaceStrategy(), diff --git a/src/JsonRpc.Generators/GeneratorDiagnostics.cs b/src/JsonRpc.Generators/GeneratorDiagnostics.cs index f33e909a4..42ae8b41a 100644 --- a/src/JsonRpc.Generators/GeneratorDiagnostics.cs +++ b/src/JsonRpc.Generators/GeneratorDiagnostics.cs @@ -10,6 +10,10 @@ internal static class GeneratorDiagnostics "JRPC0001", "Exception", "{0} - {1} {2}", "JRPC", DiagnosticSeverity.Error, true ); + public static DiagnosticDescriptor ExceptionWarning { get; } = new DiagnosticDescriptor( + "JRPC0002", "Exception", + "{0} - {1} {2}", "JRPC", DiagnosticSeverity.Warning, true + ); public static DiagnosticDescriptor NoHandlerRegistryProvided { get; } = new DiagnosticDescriptor( "JRPC1000", "No Handler Registry Provided", diff --git a/src/JsonRpc.Generators/StronglyTypedGenerator.cs b/src/JsonRpc.Generators/StronglyTypedGenerator.cs index f02fe9ab3..2ef2d9f0f 100644 --- a/src/JsonRpc.Generators/StronglyTypedGenerator.cs +++ b/src/JsonRpc.Generators/StronglyTypedGenerator.cs @@ -30,13 +30,13 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var attributes = context.CompilationProvider .Select( (compilation, _) => new AttributeData( - compilation.GetTypeByMetadataName( - "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute" - )!, - compilation.GetTypeByMetadataName( - "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateContainerAttribute" - )! - ) + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateTypedDataAttribute" + )!, + compilation.GetTypeByMetadataName( + "OmniSharp.Extensions.LanguageServer.Protocol.Generation.GenerateContainerAttribute" + )! + ) ); var createContainersSyntaxProvider = context.SyntaxProvider.CreateSyntaxProvider( @@ -74,16 +74,22 @@ TypeDeclarationSyntax typeDeclarationSyntax and (ClassDeclarationSyntax or Recor && typeDeclarationSyntax.Members.OfType().Any(z => z.Identifier.Text == "Data") && typeDeclarationSyntax.BaseList.Types.Any(z => z.Type.GetSyntaxName() == "ICanHaveData"), (syntaxContext, _) => syntaxContext ); - + context.RegisterSourceOutput(createContainersSyntaxProvider.Combine(attributes), GenerateContainerClass); - context.RegisterSourceOutput(typedParamsCandidatesSyntaxProvider - .Combine(canBeResolvedSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) - .Combine(canHaveDataSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) - .Combine(createContainersSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) - .Select((tuple, token) => (candidate: tuple.Left.Left.Left, resolvedItems: tuple.Left.Left.Right.Concat(tuple.Left.Right).Concat(tuple.Right).ToImmutableArray())), - GenerateTypedParams); context.RegisterSourceOutput(canBeResolvedSyntaxProvider.Combine(attributes), GenerateCanBeResolvedClass); context.RegisterSourceOutput(canHaveDataSyntaxProvider.Combine(attributes), GenerateCanHaveDataClass); + // TODO: Add support for generating handler methods and interfaces that take in the strongly typed data. +// context.RegisterSourceOutput( +// typedParamsCandidatesSyntaxProvider +// .Combine(canBeResolvedSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) +// .Combine(canHaveDataSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) +// .Combine(createContainersSyntaxProvider.Select((z, _) => (TypeDeclarationSyntax)z.Node).Collect()) +// .Select( +// (tuple, token) => ( candidate: tuple.Left.Left.Left, +// resolvedItems: tuple.Left.Left.Right.Concat(tuple.Left.Right).Concat(tuple.Right).ToImmutableArray() ) +// ), +// GenerateTypedParams +// ); } private void GenerateContainerClass(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, AttributeData attributeData) valueTuple) @@ -135,63 +141,6 @@ private void GenerateContainerClass(SourceProductionContext context, (GeneratorS ); } - private void GenerateTypedParams(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, ImmutableArray resolvedItems) valueTuple) - { - var (syntaxContext, resolvedItems) = valueTuple; - var classToContain = (TypeDeclarationSyntax)syntaxContext.Node; - var typeSymbol = syntaxContext.SemanticModel.GetDeclaredSymbol(classToContain); - - if (typeSymbol == null) return; - var handlerInterface = typeSymbol.AllInterfaces.FirstOrDefault(z => z.Name == "IRequest" && z.Arity == 1); - if (handlerInterface is null) return; - var responseSymbol = handlerInterface?.TypeArguments[0]; - - var isTyped = resolvedItems - .Any( - item => - { - var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(item); - return symbol is not null && SymbolEqualityComparer.Default.Equals(responseSymbol, symbol); - } - ); - - // TODO: Start here to finish creating strongly typed params - var paramsType = CreateContainerClass(classToContain, containerName) - .AddAttributeLists( - AttributeList( - SeparatedList( - new[] - { - Attribute(ParseName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")), - Attribute(ParseName("System.Runtime.CompilerServices.CompilerGeneratedAttribute")) - } - ) - ) - ); - - var cu = CompilationUnit() - .WithUsings(classToContain.SyntaxTree.GetCompilationUnitRoot().Usings) - .AddMembers( - NamespaceDeclaration(ParseName(typeSymbol.ContainingNamespace.ToDisplayString())) - .AddMembers(container) - .WithLeadingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)))) - .WithTrailingTrivia(TriviaList(Trivia(NullableDirectiveTrivia(Token(SyntaxKind.RestoreKeyword), true)))) - ); - - foreach (var ns in RequiredUsings) - { - if (cu.Usings.All(z => z.Name.ToFullString() != ns)) - { - cu = cu.AddUsings(UsingDirective(ParseName(ns))); - } - } - - context.AddSource( - $"{containerName ?? classToContain.Identifier.Text + "Container"}.cs", - cu.NormalizeWhitespace().GetText(Encoding.UTF8) - ); - } - private void GenerateCanBeResolvedClass(SourceProductionContext context, (GeneratorSyntaxContext syntaxContext, AttributeData attributeData) valueTuple) { var (syntaxContext, attributeData) = valueTuple; @@ -226,7 +175,7 @@ private static void CreateTypedClass( INamedTypeSymbol? generateTypedDataAttributeSymbol, INamedTypeSymbol? generateContainerAttributeSymbol, bool includeHandlerIdentity - ) + ) { var attribute = typeSymbol?.GetAttributes() .FirstOrDefault(z => SymbolEqualityComparer.Default.Equals(z.AttributeClass, generateTypedDataAttributeSymbol)); @@ -295,13 +244,14 @@ bool includeHandlerIdentity if (container is { }) { var containerName = container is { ConstructorArguments: { Length: > 0 } arguments } ? arguments[0].Value as string : null; - + var typedContainer = CreateContainerClass(typedClass, containerName) .WithHandlerIdentityConstraint(includeHandlerIdentity); var typedArgumentList = TypeArgumentList(SingletonSeparatedList(IdentifierName("T"))); - if (!(container is { NamedArguments: { Length: > 0 } namedArguments } && namedArguments.FirstOrDefault(z => z.Key == "GenerateImplicitConversion") is { Value.Value: false })) + if (!( container is { NamedArguments: { Length: > 0 } namedArguments } + && namedArguments.FirstOrDefault(z => z.Key == "GenerateImplicitConversion") is { Value.Value: false } )) { typedContainer = typedContainer .AddMembers( diff --git a/src/Protocol/Serialization/Converters/NumberEnumConverter.cs b/src/Protocol/Serialization/Converters/NumberEnumConverter.cs index f318cad3b..7563be77d 100644 --- a/src/Protocol/Serialization/Converters/NumberEnumConverter.cs +++ b/src/Protocol/Serialization/Converters/NumberEnumConverter.cs @@ -9,9 +9,13 @@ internal class NumberEnumConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => new JValue(value).WriteTo(writer); - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) => Enum.Parse( - Nullable.GetUnderlyingType(objectType) ?? objectType, reader.Value.ToString() - ); + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + return Enum.Parse( + Nullable.GetUnderlyingType(objectType) ?? objectType, reader.Value.ToString() + ); + } public override bool CanRead => true; diff --git a/test/Lsp.Integration.Tests/TypedInlayHintTests.cs b/test/Lsp.Integration.Tests/TypedInlayHintTests.cs index 7213763d0..e104c8fe0 100644 --- a/test/Lsp.Integration.Tests/TypedInlayHintTests.cs +++ b/test/Lsp.Integration.Tests/TypedInlayHintTests.cs @@ -191,14 +191,14 @@ l with } ); - var InlayHint = await client.RequestInlayHints( + var inlayHints = await client.RequestInlayHints( new InlayHintParams { TextDocument = new TextDocumentIdentifier("/some/path/file.cs"), } ); - var lens = InlayHint.ToArray(); + var lens = inlayHints.ToArray(); var responses = (await Task.WhenAll(lens.Select(z => client.ResolveInlayHint(z)))).SelectMany(z => z.TextEdits ?? Array.Empty()).ToArray(); responses.Select(z => z.NewText).Should().Contain(new[] { "MyText1", "MyText2", "MyText3" }); @@ -238,72 +238,20 @@ public async Task Should_Resolve_With_Data_Capability() lens.Data.Id.Should().NotBeEmpty(); lens.Data.Child.Should().NotBeNull(); lens.Data.Name.Should().Be("name"); - return Task.FromResult(lens with { Data = lens.Data with { Name = "Resolved"} }); + return Task.FromResult(lens with { Data = lens.Data with { Name = "resolved"} }); }, (_, _) => new InlayHintRegistrationOptions() ); } ); - var items = await client.SendRequest(TextDocumentNames.InlayHint, new InlayHintParams()).Returning?>(CancellationToken); - client.TextDocument.RequestInlayHints() + var items = await client.TextDocument.RequestInlayHints(new InlayHintParams()); var item = items.Single(); item = await client.ResolveInlayHint(item); - item.Data!.Name.Should().Be("resolved"); + item.GetRawData()!.Name.Should().Be("resolved"); } - - [Fact] - public async Task Should_Resolve_With_Partial_Data_Capability() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.ObserveInlayHint( - (InlayHintParams, observer, capability, token) => - { - var a = new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, - Data = new Data - { - Child = new Nested - { - Date = DateTimeOffset.MinValue - }, - Id = Guid.NewGuid(), - Name = "name" - } - } - ); - - observer.OnNext(a); - observer.OnCompleted(); - }, - (InlayHint, capability, token) => - { - InlayHint.Data.Id.Should().NotBeEmpty(); - InlayHint.Data.Child.Should().NotBeNull(); - InlayHint.Data.Name.Should().Be("name"); - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - + [Fact] public async Task Should_Resolve_With_Data_CancellationToken() { @@ -317,11 +265,6 @@ public async Task Should_Resolve_With_Data_CancellationToken() new InlayHintContainer( new InlayHint { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, Data = new Data { Child = new Nested @@ -335,76 +278,24 @@ public async Task Should_Resolve_With_Data_CancellationToken() ) ); }, - (InlayHint, token) => + (inlayHint, token) => { - InlayHint.Data.Id.Should().NotBeEmpty(); - InlayHint.Data.Child.Should().NotBeNull(); - InlayHint.Data.Name.Should().Be("name"); - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); + inlayHint.Data.Id.Should().NotBeEmpty(); + inlayHint.Data.Child.Should().NotBeNull(); + inlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(inlayHint with { Data = inlayHint.Data with { Name = "resolved"} }); }, (_, _) => new InlayHintRegistrationOptions() ); } ); - var items = await client.RequestInlayHint(new InlayHintParams()); + var items = await client.RequestInlayHints(new InlayHintParams()); var item = items.Single(); item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - - [Fact] - public async Task Should_Resolve_With_Partial_Data_CancellationToken() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.ObserveInlayHint( - (InlayHintParams, observer, token) => - { - var a = new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, - Data = new Data - { - Child = new Nested - { - Date = DateTimeOffset.MinValue - }, - Id = Guid.NewGuid(), - Name = "name" - } - } - ); - - observer.OnNext(a); - observer.OnCompleted(); - }, - (InlayHint, token) => - { - InlayHint.Data.Id.Should().NotBeEmpty(); - InlayHint.Data.Child.Should().NotBeNull(); - InlayHint.Data.Name.Should().Be("name"); - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); + item.GetRawData()!.Name.Should().Be("resolved"); } [Fact] @@ -420,11 +311,6 @@ public async Task Should_Resolve_With_Data() new InlayHintContainer( new InlayHint { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, Data = new Data { Child = new Nested @@ -438,79 +324,25 @@ public async Task Should_Resolve_With_Data() ) ); }, - InlayHint => + inlayHint => { - InlayHint.Data.Id.Should().NotBeEmpty(); - InlayHint.Data.Child.Should().NotBeNull(); - InlayHint.Data.Name.Should().Be("name"); - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); + inlayHint.Data.Id.Should().NotBeEmpty(); + inlayHint.Data.Child.Should().NotBeNull(); + inlayHint.Data.Name.Should().Be("name"); + return Task.FromResult(inlayHint with { Data = inlayHint.Data with { Name = "resolved"} }); }, (_, _) => new InlayHintRegistrationOptions() ); } ); - var items = await client.RequestInlayHint(new InlayHintParams()); + var items = await client.RequestInlayHints(new InlayHintParams()); var item = items.Single(); item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - - [Fact] - public async Task Should_Resolve_With_Partial_Data() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.ObserveInlayHint( - (InlayHintParams, observer) => - { - var a = new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, - Data = new Data - { - Child = new Nested - { - Date = DateTimeOffset.MinValue - }, - Id = Guid.NewGuid(), - Name = "name" - } - } - ); - - observer.OnNext(a); - observer.OnCompleted(); - }, - InlayHint => - { - InlayHint.Data.Id.Should().NotBeEmpty(); - InlayHint.Data.Child.Should().NotBeNull(); - InlayHint.Data.Name.Should().Be("name"); - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); + item.GetRawData()!.Name.Should().Be("resolved"); } - - [Fact] public async Task Should_Resolve_Capability() { @@ -524,149 +356,35 @@ public async Task Should_Resolve_Capability() new InlayHintContainer( new InlayHint { - Command = new Command + Data = JObject.FromObject(new Data { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - } - } - ) - ); - }, - (InlayHint, capability, token) => - { - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var items = await client.RequestInlayHint(new InlayHintParams()); - - var item = items.Single(); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - - [Fact] - public async Task Should_Resolve_Partial_Capability() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.ObserveInlayHint( - (InlayHintParams, observer, capability, token) => - { - var a = new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, - } - ); - - observer.OnNext(a); - observer.OnCompleted(); - }, - (InlayHint, capability, token) => - { - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - - [Fact] - public async Task Should_Resolve_CancellationToken() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.OnInlayHints( - (InlayHintParams, token) => - { - return Task.FromResult( - new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + }) } ) ); }, - (InlayHint, token) => + (inlayHint, capability, token) => { - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); + inlayHint.Data["Name"] = "resolved"; + return Task.FromResult(inlayHint with { Data = inlayHint.Data}); }, (_, _) => new InlayHintRegistrationOptions() ); } ); - var items = await client.RequestInlayHint(new InlayHintParams()); + var items = await client.RequestInlayHints(new InlayHintParams()); var item = items.Single(); item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - - [Fact] - public async Task Should_Resolve_Partial_CancellationToken() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.ObserveInlayHint( - (InlayHintParams, observer, token) => - { - var a = new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, - } - ); - - observer.OnNext(a); - observer.OnCompleted(); - }, - (InlayHint, token) => - { - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); + item.GetRawData()!.Name.Should().Be("resolved"); } [Fact] @@ -682,70 +400,35 @@ public async Task Should_Resolve() new InlayHintContainer( new InlayHint { - Command = new Command + Data = JToken.FromObject(new Data { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, + Child = new Nested + { + Date = DateTimeOffset.MinValue + }, + Id = Guid.NewGuid(), + Name = "name" + }) } ) ); }, - InlayHint => + inlayHint => { - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); + inlayHint.Data["Name"] = "resolved"; + return Task.FromResult(inlayHint with { Data = inlayHint.Data}); }, (_, _) => new InlayHintRegistrationOptions() ); } ); - var items = await client.RequestInlayHint(new InlayHintParams()); + var items = await client.RequestInlayHints(new InlayHintParams()); var item = items.Single(); item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); - } - - [Fact] - public async Task Should_Resolve_Partial() - { - var (client, _) = await Initialize( - options => { }, options => - { - options.ObserveInlayHint( - (InlayHintParams, observer) => - { - var a = new InlayHintContainer( - new InlayHint - { - Command = new Command - { - Name = "execute-a", - Arguments = JArray.FromObject(new object[] { 1, "2", false }) - }, - } - ); - - observer.OnNext(a); - observer.OnCompleted(); - }, - InlayHint => - { - return Task.FromResult(InlayHint with { Command = InlayHint.Command with { Name = "resolved" } }); - return Task.FromResult(InlayHint); - }, - (_, _) => new InlayHintRegistrationOptions() - ); - } - ); - - var item = await client.RequestInlayHint(new InlayHintParams()).SelectMany(z => z).Take(1).ToTask(CancellationToken); - - item = await client.ResolveInlayHint(item); - item.Command!.Name.Should().Be("resolved"); + item.GetRawData()!.Name.Should().Be("resolved"); } } } From 5b4200919940902c01f59dcabcc3f176213dc3c9 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andschwa@users.noreply.github.com> Date: Thu, 13 Oct 2022 03:54:42 -0700 Subject: [PATCH 050/647] Fix bug caused by `System.Threading.Tasks` v4.7.1 (#892) * Remove duplicate `JetBrains.ReSharper.CommandLineTools` package reference This line was a duplicate and the build tools complained about it. * Bump SampleServer's `Microsoft.Extensions.Logging` package In order to allow it to restore since this dependency was updated upstream, and that was causing it to fail to restore due to the detected forced downgrade. * Fix bug caused by `System.Threading.Tasks` v4.7.1 Unfortunately `System.Threading.Tasks` v4.7.1 is broken. Its package manifest states that it depends on `System.Threading.Tasks.Extensions` >= v4.5.4 (assembly version v4.2.0.1); however, for some reason it actually requests v4.2.0.0. While neither OmniSharp nor PowerShell Editor Services, the downstream library where this bug appeared, ship that version of the library, it can sometimes be found in the Global Assembly Cache on Windows. When present (due to an installation by some other program), it gets loaded, and then other dependencies (correctly) request v4.2.0.1 which also gets loaded. When both are loaded, a `System.MissingMethodException` is thrown! Specifically the method `ChannelReader.ReadAsync` (from `System.Threading.Tasks`) on the type `Tasks.ValueTask` (provided by `System.Threading.Tasks.Extensions`) can no longer be resolved. I do not know enough about the intricacies of method/type resolution in the full .NET Framework as to explain precisely why the presence of v4.2.0.0 causes this resolution to fail, but it certainly does. Upgrading `System.Threading.Tasks` to v6.0.0 is confirmed to solve the problem, since the newer package correctly requests `System.Threading.Tasks.Extensions` v4.2.0.1. --- .build/.build.csproj | 1 - Directory.Packages.props | 2 +- sample/SampleServer/SampleServer.csproj | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.build/.build.csproj b/.build/.build.csproj index 7233e8972..509faac59 100644 --- a/.build/.build.csproj +++ b/.build/.build.csproj @@ -14,7 +14,6 @@ - diff --git a/Directory.Packages.props b/Directory.Packages.props index 8562ba115..6916daa35 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -49,7 +49,7 @@ - + diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index f793325cd..c53281cd5 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -10,7 +10,7 @@ - + From 82934b6ebd417cd875c81c9b639c5b58b8866175 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Wed, 26 Oct 2022 20:58:23 -0400 Subject: [PATCH 051/647] disable macos builds for now (#894) --- .azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index a8652a9ce..2854ab770 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -63,9 +63,9 @@ jobs: Linux: BuildName: 'Linux' ImageName: 'ubuntu-latest' - macOS: - BuildName: 'macOS' - ImageName: 'macOS-latest' + # macOS: + # BuildName: 'macOS' + # ImageName: 'macOS-latest' pool: vmImage: $(ImageName) steps: From 9b583ba8319534b1d704b7d3ba2d63fb8d67b6ce Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Wed, 26 Oct 2022 21:00:06 -0400 Subject: [PATCH 052/647] disable macos builds for now --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40913842c..f36ecefe5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,10 @@ jobs: strategy: fail-fast: false matrix: - os: [macOS-latest, windows-latest, ubuntu-latest] + os: + # - macOS-latest + - windows-latest + - ubuntu-latest runs-on: ${{ matrix.os }} steps: - name: Checkout From 43301e932b06d5fd70080e13f8fd79d5823e947e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:31:37 +0000 Subject: [PATCH 053/647] Update dependency BenchmarkDotNet to v0.13.2 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index c20468ddb..810e76f0d 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From 158311d485788655d739fdebf731936dea36bf4c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:31:28 +0000 Subject: [PATCH 054/647] Update Rocket Surgery Other --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- Directory.Packages.props | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f36ecefe5..bbe2ae843 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,4 +159,4 @@ jobs: secrets: RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}' RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}' - uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.1 + uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.2 diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 42e5d0c0a..ae17fcd39 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -39,7 +39,7 @@ jobs: # move any issues to that milestone in the event the release is renamed - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.1 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.2 with: default-label: 'mysterious' github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }} diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 21d01ef67..d0f21ec53 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -39,7 +39,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.1 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.2 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 118cc29c5..35351166a 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -48,7 +48,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.1 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.2 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Directory.Packages.props b/Directory.Packages.props index 6916daa35..26e524869 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From fe85bbf5bd02fea803c57d353367393d4fc66ffd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:31:56 +0000 Subject: [PATCH 055/647] Update dependency Snapper to v2.3.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 26e524869..f3456f69a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -53,7 +53,7 @@ - + From 70c2bfbaaa68d7309a572674b7cf4543d9630b86 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:32:31 +0000 Subject: [PATCH 056/647] Update coverlet to v3.2.0 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f3456f69a..20e4823f5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -45,8 +45,8 @@ - - + + From aa9e522cd69116cf7d64ba7f47a1111915089b42 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:32:23 +0000 Subject: [PATCH 057/647] Update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 20e4823f5..29f8a9841 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From 612d4e02b51fb4cc35edf7b33cccda9ef6ca8be6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:32:02 +0000 Subject: [PATCH 058/647] Update dependency dotnet-sdk to v6.0.403 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 4fda00640..afde5be54 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.200", + "version": "6.0.403", "rollForward": "latestMinor" } } From 8ced599e08d81668c0ad658b91952b9e3519b294 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:53:19 +0000 Subject: [PATCH 059/647] Update dependency Microsoft.NETFramework.ReferenceAssemblies to v1.0.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 29f8a9841..ff124fa46 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,7 +7,7 @@ - + From e88cb175c8c95b6de243cce56c36cf67c66081f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 15:42:00 +0000 Subject: [PATCH 060/647] Update reportgenerator to v5.1.12 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e1a1594e1..2e21e23b9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.6", + "version": "5.1.12", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index ff124fa46..755bb3987 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From c14b70e0ae948c0fe6f72d09a49fda70334a7247 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 15:42:12 +0000 Subject: [PATCH 061/647] Update dependency FluentAssertions to v6.8.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 755bb3987..d15f4e8c0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From fe27432e15eb0b2dcffa6b750b3c692bbfc6651c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:02:06 +0000 Subject: [PATCH 062/647] Update github actions --- .github/workflows/ci.yml | 6 +++--- .github/workflows/close-milestone.yml | 8 ++++---- .github/workflows/draft-release.yml | 6 +++--- .github/workflows/sync-labels.yml | 4 ++-- .github/workflows/update-milestone.yml | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbe2ae843..a4b4caa67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 with: clean: 'false' fetch-depth: '0' @@ -97,11 +97,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v2.1.0 + uses: actions/setup-dotnet@v2.1.1 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v2.1.0 + uses: actions/setup-dotnet@v2.1.1 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index ae17fcd39..cc195fcc3 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,23 +10,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.13 + uses: gittools/actions/gitversion/setup@v0.9.15 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.13 + uses: gittools/actions/gitreleasemanager/setup@v0.9.15 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.13 + uses: gittools/actions/gitversion/execute@v0.9.15 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index d0f21ec53..93e958483 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -22,13 +22,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.13 + uses: gittools/actions/gitversion/setup@v0.9.15 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.13 + uses: gittools/actions/gitversion/execute@v0.9.15 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index f1710e13b..601aacb35 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,11 +16,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v3.1.1 + uses: crazy-max/ghaction-github-labeler@v3.2.0 with: yaml-file: .github/labels.yml skip-delete: false diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 35351166a..4a4a202bc 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 with: ref: ${{ github.sha }} fetch-depth: 0 @@ -23,20 +23,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.9.13 + uses: gittools/actions/gitversion/setup@v0.9.15 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.9.13 + uses: gittools/actions/gitreleasemanager/setup@v0.9.15 with: versionSpec: '0.11.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.13 + uses: gittools/actions/gitversion/execute@v0.9.15 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From b7018f1b9e5add8f38a4647c116daea07c1e50f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:20:51 +0000 Subject: [PATCH 063/647] Update dependency NSubstitute to v4.4.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d15f4e8c0..1ead6ff1f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From be509719ee4bf2827002adcf0aca608ca327ee5e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:21:35 +0000 Subject: [PATCH 064/647] Update github actions --- .github/workflows/ci.yml | 4 ++-- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4b4caa67..d1b7282c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,11 +97,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v2.1.1 + uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v2.1.1 + uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 601aacb35..0b2ce9086 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,7 +20,7 @@ jobs: - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v3.2.0 + uses: crazy-max/ghaction-github-labeler@v4.1.0 with: yaml-file: .github/labels.yml skip-delete: false From 0681062b771aaabdcd04400a343a6f730117bc36 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:41:02 +0000 Subject: [PATCH 065/647] Update jetbrains to v2022.2.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2e21e23b9..f76b41082 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.1.1", + "version": "2022.2.4", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 1ead6ff1f..7c57a2d2a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 974709de3db93747a531c14deaed8167d8f2cf24 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:58:49 +0000 Subject: [PATCH 066/647] Update gitversion to v5.11.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f76b41082..03fe9db99 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "5.10.1", + "version": "5.11.1", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 7c57a2d2a..f15940eda 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From c72c6f80dfe4f6a0ea3aae95aa10c0400172f92c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 22:46:59 +0000 Subject: [PATCH 067/647] Update dependency @types/mocha to v10 --- vscode-testextension/package-lock.json | 6 +++--- vscode-testextension/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index a3b636974..c6691e9b7 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -11,9 +11,9 @@ "dev": true }, "@types/mocha": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.0.0.tgz", - "integrity": "sha512-jWeYcTo3sCH/rMgsdYXDTO85GNRyTCII5dayMIu/ZO4zbEot1E3iNGaOwpLReLUHjeNQFkgeNNVYlY4dX6azQQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", + "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", "dev": true }, "@types/node": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index fb7291b4a..17f0075e1 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -46,7 +46,7 @@ "postinstall": "node ./node_modules/vscode/bin/install" }, "devDependencies": { - "@types/mocha": "8.0.0", + "@types/mocha": "10.0.1", "@types/node": "14.0.25", "typescript": "3.9.10", "vscode": "1.1.37" From 7fd2219f194a9ef2a8901bb131c5fa12272305ce Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andschwa@users.noreply.github.com> Date: Fri, 2 Dec 2022 11:31:07 -0800 Subject: [PATCH 068/647] Set max depth for JSON serializer to mitigate known DOS vulnerability (#902) The other option is to update Newtonsoft.Json, which now also sets the maximum depth by default, but this mitigates without having to update. --- src/JsonRpc/Serialization/SerializerBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonRpc/Serialization/SerializerBase.cs b/src/JsonRpc/Serialization/SerializerBase.cs index 868be57c6..b50131e13 100644 --- a/src/JsonRpc/Serialization/SerializerBase.cs +++ b/src/JsonRpc/Serialization/SerializerBase.cs @@ -19,7 +19,7 @@ protected virtual JsonSerializer CreateSerializer() protected virtual JsonSerializerSettings CreateSerializerSettings() { - var settings = JsonConvert.DefaultSettings != null ? JsonConvert.DefaultSettings() : new JsonSerializerSettings(); + var settings = JsonConvert.DefaultSettings != null ? JsonConvert.DefaultSettings() : new JsonSerializerSettings { MaxDepth = 128 }; AddOrReplaceConverters(settings.Converters); return _settings = settings; } From aac9b5986b5bba08ce8fedd94871a067acea2fd5 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andschwa@users.noreply.github.com> Date: Fri, 2 Dec 2022 11:33:03 -0800 Subject: [PATCH 069/647] Fix type forwarding for `init`/`record` workaround (#895) * Update `nuke.globaltool` to fix macOS CI * Revert "disable macos builds for now" This reverts commit 82934b6ebd417cd875c81c9b639c5b58b8866175 and commit 9b583ba8319534b1d704b7d3ba2d63fb8d67b6ce. * Fix type forwarding for `init` and `record` workaround * Only target `net6.0` for tests So they don't need `IsExternalInit` defined too. --- .azure-pipelines.yml | 6 ++--- .config/dotnet-tools.json | 2 +- .github/workflows/ci.yml | 5 +--- sample/SampleServer/SampleServer.csproj | 2 +- src/JsonRpc.Generators/Records.cs | 13 ++++------- src/JsonRpc/Nullable/Records.cs | 13 ++++------- test/Client.Tests/Client.Tests.csproj | 2 +- test/Dap.Tests/Dap.Tests.csproj | 4 ++-- test/Dap.Tests/Records.cs | 23 ------------------- test/Generation.Tests/Generation.Tests.csproj | 2 +- test/Generation.Tests/Records.cs | 23 ------------------- test/JsonRpc.Tests/JsonRpc.Tests.csproj | 2 +- .../Lsp.Integration.Tests.csproj | 2 +- test/Lsp.Integration.Tests/Records.cs | 23 ------------------- test/Lsp.Tests/Lsp.Tests.csproj | 2 +- test/Lsp.Tests/Records.cs | 23 ------------------- 16 files changed, 23 insertions(+), 124 deletions(-) delete mode 100644 test/Dap.Tests/Records.cs delete mode 100644 test/Generation.Tests/Records.cs delete mode 100644 test/Lsp.Integration.Tests/Records.cs delete mode 100644 test/Lsp.Tests/Records.cs diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 2854ab770..a8652a9ce 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -63,9 +63,9 @@ jobs: Linux: BuildName: 'Linux' ImageName: 'ubuntu-latest' - # macOS: - # BuildName: 'macOS' - # ImageName: 'macOS-latest' + macOS: + BuildName: 'macOS' + ImageName: 'macOS-latest' pool: vmImage: $(ImageName) steps: diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 03fe9db99..66a687c6d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "6.0.3", + "version": "6.2.1", "commands": [ "nuke" ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1b7282c7..6c952a261 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,10 +75,7 @@ jobs: strategy: fail-fast: false matrix: - os: - # - macOS-latest - - windows-latest - - ubuntu-latest + os: [macOS-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index c53281cd5..c7a131ab7 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -3,7 +3,7 @@ Exe false - netcoreapp3.1 + net6.0 win7-x64 latest diff --git a/src/JsonRpc.Generators/Records.cs b/src/JsonRpc.Generators/Records.cs index 66cef4915..8682d81e7 100644 --- a/src/JsonRpc.Generators/Records.cs +++ b/src/JsonRpc.Generators/Records.cs @@ -1,6 +1,8 @@ #pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NET45 || NET451 || NET452 || NET6 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48 +#if NET5_0_OR_GREATER +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))] +#else + using System.ComponentModel; // ReSharper disable once CheckNamespace @@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices /// This class should not be used by developers in source code. /// [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit + internal static class IsExternalInit { } } diff --git a/src/JsonRpc/Nullable/Records.cs b/src/JsonRpc/Nullable/Records.cs index 207d2246e..8682d81e7 100644 --- a/src/JsonRpc/Nullable/Records.cs +++ b/src/JsonRpc/Nullable/Records.cs @@ -1,6 +1,8 @@ #pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP +#if NET5_0_OR_GREATER +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))] +#else + using System.ComponentModel; // ReSharper disable once CheckNamespace @@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices /// This class should not be used by developers in source code. /// [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit + internal static class IsExternalInit { } } diff --git a/test/Client.Tests/Client.Tests.csproj b/test/Client.Tests/Client.Tests.csproj index 07ae8a6c0..190ea9ba0 100644 --- a/test/Client.Tests/Client.Tests.csproj +++ b/test/Client.Tests/Client.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;net6.0 + net6.0 OmniSharp.Extensions.LanguageClient.Tests OmniSharp.Extensions.LanguageServer.Client.Tests diff --git a/test/Dap.Tests/Dap.Tests.csproj b/test/Dap.Tests/Dap.Tests.csproj index e61abe1ff..68e5f8284 100644 --- a/test/Dap.Tests/Dap.Tests.csproj +++ b/test/Dap.Tests/Dap.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - netcoreapp3.1;net6.0 + net6.0 true AnyCPU @@ -16,6 +16,6 @@ - + diff --git a/test/Dap.Tests/Records.cs b/test/Dap.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Dap.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif diff --git a/test/Generation.Tests/Generation.Tests.csproj b/test/Generation.Tests/Generation.Tests.csproj index 8f8f18ef0..eef43b102 100644 --- a/test/Generation.Tests/Generation.Tests.csproj +++ b/test/Generation.Tests/Generation.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/Generation.Tests/Records.cs b/test/Generation.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Generation.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif diff --git a/test/JsonRpc.Tests/JsonRpc.Tests.csproj b/test/JsonRpc.Tests/JsonRpc.Tests.csproj index 163f47307..315c78b25 100644 --- a/test/JsonRpc.Tests/JsonRpc.Tests.csproj +++ b/test/JsonRpc.Tests/JsonRpc.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj index fcb489822..4d655de2e 100644 --- a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj +++ b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0;netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/Lsp.Integration.Tests/Records.cs b/test/Lsp.Integration.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Lsp.Integration.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif diff --git a/test/Lsp.Tests/Lsp.Tests.csproj b/test/Lsp.Tests/Lsp.Tests.csproj index fcb489822..4d655de2e 100644 --- a/test/Lsp.Tests/Lsp.Tests.csproj +++ b/test/Lsp.Tests/Lsp.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0;netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/Lsp.Tests/Records.cs b/test/Lsp.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Lsp.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif From 12438009e6ecce15ae845322177d3f8a3a70c1ff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 20:36:04 +0000 Subject: [PATCH 070/647] Update dependency Rocket.Surgery.Nuke to v0.17.22 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f15940eda..351c2948b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From 14c6b82eb8d068a2827b3fff2274b0748c4b30a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 20:51:36 +0000 Subject: [PATCH 071/647] Update RocketSurgeonsGuild/actions action to v0.3.3 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c952a261..151c1ff00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,4 +156,4 @@ jobs: secrets: RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}' RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}' - uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.2 + uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.3 diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index cc195fcc3..999166bc9 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -39,7 +39,7 @@ jobs: # move any issues to that milestone in the event the release is renamed - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.2 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.3 with: default-label: 'mysterious' github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }} diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 93e958483..506397397 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -39,7 +39,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.2 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.3 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 4a4a202bc..944b72cac 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -48,7 +48,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.2 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.3 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} From ccf40fee100d3213f11db42e79724b2628a922ac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 7 Dec 2022 11:42:43 +0000 Subject: [PATCH 072/647] Update jetbrains to v2022.3.0 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 66a687c6d..5e84e10a9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.2.4", + "version": "2022.3.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 351c2948b..8a6b61ea9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From c662aa78bf16dc28a07e83082a2dec652eac2fc8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 20:28:25 +0000 Subject: [PATCH 073/647] Update actions/checkout action to v3.2.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 151c1ff00..49942de16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 999166bc9..dae737822 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 506397397..71113bd12 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 0b2ce9086..894067aed 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 944b72cac..626187bf7 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 140954838eec840cf18e0c17aa7691887abb59a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 17:49:12 +0000 Subject: [PATCH 074/647] Update dependency dotnet-sdk to v6.0.404 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index afde5be54..56a84230a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.403", + "version": "6.0.404", "rollForward": "latestMinor" } } From 7c7acc133c7df6682bc52fcb7c913d412f65e08c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 23:31:32 +0000 Subject: [PATCH 075/647] Update dependency Rocket.Surgery.Nuke to v0.18.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8a6b61ea9..4c1e8b35b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From 7b60085242e711d3fe08d64362a18bcd67913e5b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 17 Dec 2022 19:51:30 +0000 Subject: [PATCH 076/647] Update reportgenerator to v5.1.13 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5e84e10a9..f46599cd8 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.12", + "version": "5.1.13", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 4c1e8b35b..f77a780ec 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From aa6aa45355a25322d7f1b1ed718dfa105244717f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 21 Dec 2022 15:53:13 +0000 Subject: [PATCH 077/647] Update jetbrains to v2022.3.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f46599cd8..27d0bc851 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.3.0", + "version": "2022.3.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index f77a780ec..3a7ca8f80 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 84b112a8b0606815211a3807b77d8bbc38c4dcda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 21 Dec 2022 21:13:54 +0000 Subject: [PATCH 078/647] Update dependency Rocket.Surgery.Nuke to v0.19.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3a7ca8f80..9a588992b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From 8f5325a013c0009c0ecb1089147fd49bba3aa8a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 11:52:59 +0000 Subject: [PATCH 079/647] Update dependency BenchmarkDotNet to v0.13.3 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 810e76f0d..49931d536 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From cf3bb06f518231d8db5d3f553fb65f3c606ab845 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Jan 2023 11:00:32 +0000 Subject: [PATCH 080/647] Update dependency husky to v8 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e560ad123..cdc9d7595 100644 --- a/package-lock.json +++ b/package-lock.json @@ -199,9 +199,9 @@ "dev": true }, "husky": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", - "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", "dev": true }, "indent-string": { diff --git a/package.json b/package.json index f731e5687..c539d8869 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "devDependencies": { "@prettier/plugin-xml": "1.2.0", - "husky": "7.0.4", + "husky": "8.0.3", "lint-staged": "12.3.4", "prettier": "2.5.1" }, From 6cb86e44ec60c02eecff1dd93681ff989ecb63c0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:26:54 +0000 Subject: [PATCH 081/647] Update actions/checkout action to v3.3.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49942de16..ccdf749dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index dae737822..ddc2cfbea 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 71113bd12..6b637f19e 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 894067aed..81c1dbade 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 626187bf7..369fc6edd 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 9455b98ef86b508eca8a3ffc7382f778adc88f02 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 20:15:41 +0000 Subject: [PATCH 082/647] Update dependency dotnet-sdk to v6.0.405 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 56a84230a..160244ede 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.404", + "version": "6.0.405", "rollForward": "latestMinor" } } From 2671c0b9f4faab82fc0b3890590a9fc4a578a227 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:07:12 +0000 Subject: [PATCH 083/647] Update dependency FluentAssertions to v6.9.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9a588992b..077da2e25 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 15eeb58e3d0d41a57ea9aa6a3a25d2a276a76323 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:21:11 +0000 Subject: [PATCH 084/647] Update dependency Rocket.Surgery.Nuke to v0.19.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 077da2e25..3aa8288f0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From bae83ee08c74c297d0070222e0722503a4c27777 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 19:22:36 +0000 Subject: [PATCH 085/647] Update dependency BenchmarkDotNet to v0.13.4 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 49931d536..4b5238af7 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From be4674f396088009718c8a894020de53d9f8ffd7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 10:09:21 +0000 Subject: [PATCH 086/647] Update dependency Microsoft.CodeAnalysis.Analyzers to v3.3.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3aa8288f0..b175dee09 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + From 72b3270ddbb3843f4893e0aa72d6ab9e2156db54 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 21:35:15 +0000 Subject: [PATCH 087/647] Update reportgenerator to v5.1.14 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 27d0bc851..edff2a3e1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.13", + "version": "5.1.14", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index b175dee09..bda7c4bd9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 521db5759d657349f1f1472ddf2a9818423a8f20 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:40:35 +0000 Subject: [PATCH 088/647] Update reportgenerator to v5.1.15 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index edff2a3e1..911f84fa4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.14", + "version": "5.1.15", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index bda7c4bd9..37513efd4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 4d3f497e9118465512c576deef3e8ad8c762113d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 16:11:34 +0000 Subject: [PATCH 089/647] Update gitversion to v5.12.0 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 911f84fa4..cdaecb90e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "5.11.1", + "version": "5.12.0", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 37513efd4..3814b563d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 06b1019177cd1e744a00dca6b2068c03d85abae8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:31:21 +0000 Subject: [PATCH 090/647] Update jetbrains to v2022.3.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index cdaecb90e..3c502e59a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.3.1", + "version": "2022.3.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 3814b563d..d902b95a9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 3efdc1e789ff8009b8d9332b2a7031ca2a753ce4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 19:51:21 +0000 Subject: [PATCH 091/647] Update dependency XunitXml.TestLogger to v3.0.78 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d902b95a9..6a194fdaf 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -44,7 +44,7 @@ - + From 503e7e7a96ee545fafb138b61560fcc1b4017bb2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 22:22:21 +0000 Subject: [PATCH 092/647] Update reportgenerator to v5.1.16 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3c502e59a..f446cdbeb 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.15", + "version": "5.1.16", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 6a194fdaf..2a63a9f34 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From c458ac1616b0967061e845c512d7488ece6a0ced Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 16:24:55 +0000 Subject: [PATCH 093/647] Update dependency Serilog.Sinks.XUnit to v3.0.5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2a63a9f34..6c1132ac7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From dfd0bc1022fba45d44fad078816f8debe486a6d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 22:13:32 +0000 Subject: [PATCH 094/647] Update reportgenerator to v5.1.17 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f446cdbeb..0511377a9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.16", + "version": "5.1.17", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 6c1132ac7..89d8fd528 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 21873b6bf1008829693ed1b2cd9154c20c852278 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Feb 2023 19:10:29 +0000 Subject: [PATCH 095/647] Update dependency FluentAssertions to v6.10.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 89d8fd528..c6f1262f2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 48bbebfa919bd4947f42c515cc770e12a3201009 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Feb 2023 14:57:44 +0000 Subject: [PATCH 096/647] Update dependency NSubstitute to v5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c6f1262f2..f5490993b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 87467b8cad2a19836f38f017a1dddcfa6454bc70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 09:41:08 +0000 Subject: [PATCH 097/647] Update dependency dotnet-sdk to v6.0.406 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 160244ede..212719103 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.405", + "version": "6.0.406", "rollForward": "latestMinor" } } From 8d7009832583f608756692c855f41bb5f431ed6d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:29:11 +0000 Subject: [PATCH 098/647] Update dependency BenchmarkDotNet to v0.13.5 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 4b5238af7..87217e4bb 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From 14f7926e5a4112187824a22ddd7db7c17c883c4f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:06:48 +0000 Subject: [PATCH 099/647] Update reportgenerator to v5.1.18 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 0511377a9..0cff57cae 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.17", + "version": "5.1.18", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index f5490993b..ed00fbaed 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From e6e32c6fb2aedab04e4a2f0ee91cd90bafa66dd7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Mar 2023 08:29:30 +0000 Subject: [PATCH 100/647] Update reportgenerator to v5.1.19 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 0cff57cae..9da305875 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.18", + "version": "5.1.19", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index ed00fbaed..9bd9f6960 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 6ba72632d364b25a731b5716356bf2c4231fdfe6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Mar 2023 05:52:31 +0000 Subject: [PATCH 101/647] Update gittools/actions action to v0.10.0 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index ddc2cfbea..5a8dc8633 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -15,18 +15,18 @@ jobs: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.15 + uses: gittools/actions/gitversion/setup@v0.10.0 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.15 + uses: gittools/actions/gitreleasemanager/setup@v0.10.0 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.15 + uses: gittools/actions/gitversion/execute@v0.10.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 6b637f19e..3bff4875d 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -22,13 +22,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.15 + uses: gittools/actions/gitversion/setup@v0.10.0 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.15 + uses: gittools/actions/gitversion/execute@v0.10.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 369fc6edd..0996b2746 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -23,20 +23,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.9.15 + uses: gittools/actions/gitversion/setup@v0.10.0 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.9.15 + uses: gittools/actions/gitreleasemanager/setup@v0.10.0 with: versionSpec: '0.11.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.15 + uses: gittools/actions/gitversion/execute@v0.10.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 70d0b308578a628fbd4c47cc36f012d015903341 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Mar 2023 12:07:15 +0000 Subject: [PATCH 102/647] Update gittools/actions action to v0.10.1 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 5a8dc8633..a65391798 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -15,18 +15,18 @@ jobs: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.0 + uses: gittools/actions/gitversion/setup@v0.10.1 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.10.0 + uses: gittools/actions/gitreleasemanager/setup@v0.10.1 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.0 + uses: gittools/actions/gitversion/execute@v0.10.1 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 3bff4875d..33c0baa9c 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -22,13 +22,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.0 + uses: gittools/actions/gitversion/setup@v0.10.1 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.0 + uses: gittools/actions/gitversion/execute@v0.10.1 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 0996b2746..4258a9d9d 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -23,20 +23,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.10.0 + uses: gittools/actions/gitversion/setup@v0.10.1 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.10.0 + uses: gittools/actions/gitreleasemanager/setup@v0.10.1 with: versionSpec: '0.11.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.0 + uses: gittools/actions/gitversion/execute@v0.10.1 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From cfcc83494679f3622f6fdae1b081370b05c7b37b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Mar 2023 16:34:23 +0000 Subject: [PATCH 103/647] Update gittools/actions action to v0.10.2 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index a65391798..f306bae92 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -15,18 +15,18 @@ jobs: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.1 + uses: gittools/actions/gitversion/setup@v0.10.2 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.10.1 + uses: gittools/actions/gitreleasemanager/setup@v0.10.2 with: versionSpec: '0.11.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.1 + uses: gittools/actions/gitversion/execute@v0.10.2 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 33c0baa9c..0e53ee19d 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -22,13 +22,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.1 + uses: gittools/actions/gitversion/setup@v0.10.2 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.1 + uses: gittools/actions/gitversion/execute@v0.10.2 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 4258a9d9d..fd9631acc 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -23,20 +23,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.10.1 + uses: gittools/actions/gitversion/setup@v0.10.2 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.10.1 + uses: gittools/actions/gitreleasemanager/setup@v0.10.2 with: versionSpec: '0.11.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.1 + uses: gittools/actions/gitversion/execute@v0.10.2 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From ca27bad7067e58da29a750e370807c34e3d93d3e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 12:13:06 +0000 Subject: [PATCH 104/647] Update dependency dotnet-sdk to v6.0.407 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 212719103..9e8687e71 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.406", + "version": "6.0.407", "rollForward": "latestMinor" } } From 75d945e7a504377325573bb845c3b35e7d93bfca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 18:41:47 +0000 Subject: [PATCH 105/647] Update dependency nuke.globaltool to v6.3.0 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9da305875..9bf4bf794 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "6.2.1", + "version": "6.3.0", "commands": [ "nuke" ] From 1034a7ea6b3310b020d7b6e5612388db903541ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 18:41:03 +0000 Subject: [PATCH 106/647] Update dependency vscode-languageclient to v7.0.0 --- vscode-testextension/package-lock.json | 60 ++++++++++++++++++++------ 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index a3b636974..cf6c4c208 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -34,14 +34,12 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -68,8 +66,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "debug": { "version": "4.1.1", @@ -182,11 +179,18 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -335,18 +339,41 @@ "integrity": "sha512-nIXUeSMKfqvqSG75s1JuUy0UgjE3d0NERjGz7AUGDFXX0/roVUEbaio5VBdus30nty8v0FCf/6MbCSrH5RybcQ==" }, "vscode-languageclient": { - "version": "7.0.0-next.8", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.8.tgz", - "integrity": "sha512-qgQBImLm24tjhvc42YbLLRYWibwSgccUruy0GhVOr69BZRfT3CkMeeQfjIdumrfCCYPu/vPdJ6KjtAYamBCESw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", + "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", "requires": { - "semver": "^6.3.0", - "vscode-languageserver-protocol": "3.16.0-next.6" + "minimatch": "^3.0.4", + "semver": "^7.3.4", + "vscode-languageserver-protocol": "3.16.0" }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" + }, + "vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "requires": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" } } }, @@ -425,6 +452,11 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } From be43babe581813d7797a67ce2d43ca851f6d9d49 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 21:36:52 +0000 Subject: [PATCH 107/647] Update actions/checkout action to v3.4.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccdf749dc..810916968 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.4.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index f306bae92..31a72b518 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.4.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 0e53ee19d..0f2734a95 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.4.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 81c1dbade..a2cfe8d9b 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.4.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index fd9631acc..b4e90bd65 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.4.0 with: ref: ${{ github.sha }} fetch-depth: 0 From d7a6144233bcae487877c3aa0e32980a9c10b815 Mon Sep 17 00:00:00 2001 From: Yannick Cholette Date: Fri, 17 Mar 2023 15:48:25 -0400 Subject: [PATCH 108/647] Don't log critical message when client disconnect --- src/JsonRpc/InputHandler.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/JsonRpc/InputHandler.cs b/src/JsonRpc/InputHandler.cs index 38f4d25c3..2a16adcbe 100644 --- a/src/JsonRpc/InputHandler.cs +++ b/src/JsonRpc/InputHandler.cs @@ -144,9 +144,17 @@ public void Start() { await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false); } + catch (IOException e) + { + if (e.InnerException is SocketException se && se.SocketErrorCode == SocketError.ConnectionReset) + _logger.LogInformation(e, "Connection reset by client."); + else + throw; + + } catch (Exception e) { - _logger.LogCritical(e, "unhandled exception"); + _logger.LogCritical(e, "Unhandled exception"); } } ).Subscribe(_inputActive) From 245cd87cbcf572783d432eb14cc0a41f893f2c0c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:20:58 +0000 Subject: [PATCH 109/647] Update jetbrains to v2022.3.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9da305875..1d71c891f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.3.2", + "version": "2022.3.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 9bd9f6960..8d9072a00 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 836d74752887b14e824f95f33454359cbf598ef0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 12:58:07 +0000 Subject: [PATCH 110/647] Update jetbrains to v2023 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1d71c891f..ff8560074 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2022.3.3", + "version": "2023.1.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 8d9072a00..e101e82de 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 33c1e24b8de2591cad8d342b1ea3960c0673b9b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:15:21 +0000 Subject: [PATCH 111/647] Update actions/checkout action to v3.5.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 810916968..0d5541d1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.4.0 + uses: actions/checkout@v3.5.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 31a72b518..4832e1ad3 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.4.0 + uses: actions/checkout@v3.5.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 0f2734a95..ac7bf46e0 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.4.0 + uses: actions/checkout@v3.5.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index a2cfe8d9b..b762d362c 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.4.0 + uses: actions/checkout@v3.5.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index b4e90bd65..5ef11505b 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.4.0 + uses: actions/checkout@v3.5.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 3aaac049f1c1d76a4a871282279df04c0d195f1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 23:17:34 +0000 Subject: [PATCH 112/647] Update dependency dotnet-sdk to v6.0.408 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 9e8687e71..dbb60145c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.407", + "version": "6.0.408", "rollForward": "latestMinor" } } From d41ca56f0d21c80ce086adb7b8b1a881d47d794d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 16:05:07 +0000 Subject: [PATCH 113/647] Update actions/checkout action to v3.5.1 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d5541d1a..2c7480cf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.5.0 + uses: actions/checkout@v3.5.1 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 4832e1ad3..5a3499d4d 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.0 + uses: actions/checkout@v3.5.1 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index ac7bf46e0..efb83a8b7 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.0 + uses: actions/checkout@v3.5.1 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index b762d362c..539fe9c4d 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.0 + uses: actions/checkout@v3.5.1 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 5ef11505b..892cd261a 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.0 + uses: actions/checkout@v3.5.1 with: ref: ${{ github.sha }} fetch-depth: 0 From 288a44929c85f11b48fc6c1d9f57f8d70f76a21d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:34:56 +0000 Subject: [PATCH 114/647] Update actions/checkout action to v3.5.2 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c7480cf3..4d96cf712 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.5.1 + uses: actions/checkout@v3.5.2 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 5a3499d4d..0392f29fc 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.1 + uses: actions/checkout@v3.5.2 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index efb83a8b7..c9a54f23a 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.1 + uses: actions/checkout@v3.5.2 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 539fe9c4d..fb3cdaa99 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.1 + uses: actions/checkout@v3.5.2 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 892cd261a..a720da5ad 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.1 + uses: actions/checkout@v3.5.2 with: ref: ${{ github.sha }} fetch-depth: 0 From 71856f1c74c4c940f87bbbcef3b9c9b88561c007 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Apr 2023 21:43:44 +0000 Subject: [PATCH 115/647] Update dependency FluentAssertions to v6.11.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e101e82de..57b420154 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 47a1aae3532466b2a37aad10012881b81bce07f5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 22:28:49 +0000 Subject: [PATCH 116/647] Update jetbrains to v2023.1.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ff8560074..24313bc7b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.1.0", + "version": "2023.1.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 57b420154..de2a06dce 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From a25ef87413493bd54d00041c4196bf654e56f5c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 20:51:08 +0000 Subject: [PATCH 117/647] Update reportgenerator to v5.1.20 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 24313bc7b..5b8b29952 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.19", + "version": "5.1.20", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index de2a06dce..2b21dcdb3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 09c69fb82cb6cf43536b4c49ce75298e8cf96a63 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 20:32:43 +0000 Subject: [PATCH 118/647] Update jetbrains to v2023.1.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5b8b29952..91383ea8e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.1.1", + "version": "2023.1.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 2b21dcdb3..ea370ff17 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 08c426fd97ddb8d00c7a9c9f59ac6b039218ac30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 07:37:22 +0000 Subject: [PATCH 119/647] Update dependency System.Reactive to v6 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ea370ff17..8c96a7f1c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,7 +47,7 @@ - + From 8a12bf59a47bb88e2fd2ec16096b56eb332e355e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 May 2023 15:22:26 +0000 Subject: [PATCH 120/647] Update coverlet to v6 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8c96a7f1c..0d90fbd67 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -45,8 +45,8 @@ - - + + From 30da684b17c96f8b20431f200c19c1454e4c1bb3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 May 2023 21:45:28 +0000 Subject: [PATCH 121/647] Update reportgenerator to v5.1.21 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 91383ea8e..b0032c9d1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.20", + "version": "5.1.21", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 0d90fbd67..b80c41337 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 80dd4cb47c66009d8a36ceae976e47e160eb7de1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 13:08:00 +0000 Subject: [PATCH 122/647] Update actions/setup-dotnet action to v3.1.0 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d96cf712..5c81bc87b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,11 +94,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v3.0.3 + uses: actions/setup-dotnet@v3.1.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v3.0.3 + uses: actions/setup-dotnet@v3.1.0 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore From 42527e922d4ee59cadd028409680f00c7e0b4138 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 11:50:10 +0000 Subject: [PATCH 123/647] Update actions/setup-dotnet action to v3.2.0 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c81bc87b..2af020879 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,11 +94,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v3.1.0 + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v3.1.0 + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '6.0.x' - name: 🎁 dotnet tool restore From 3c692016d3de5dc2ea70e7bdd64dbc71ee5618fe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 16:58:01 +0000 Subject: [PATCH 124/647] Update actions/checkout action to v3.5.3 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2af020879..09b82f7cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 0392f29fc..08af1f59c 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index c9a54f23a..5eb99899a 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index fb3cdaa99..b99eac5d9 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index a720da5ad..f3d5aecea 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: ref: ${{ github.sha }} fetch-depth: 0 From bcea80dfbcc46ee7dedfa558e38c9ee6a47c1ee2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 12:01:45 +0000 Subject: [PATCH 125/647] Update dependency dotnet-sdk to v6.0.410 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index dbb60145c..953dc3511 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.408", + "version": "6.0.410", "rollForward": "latestMinor" } } From d64ea8cf16da5c0644f4655b10cb3c6764505d53 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:44:17 +0000 Subject: [PATCH 126/647] Update reportgenerator to v5.1.22 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b0032c9d1..48a7d65e3 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.21", + "version": "5.1.22", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index b80c41337..538140b5f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From fff6152f7c378a8f308e4ce6fee9cf4e05969fe3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:45:44 +0000 Subject: [PATCH 127/647] Update jetbrains to v2023.1.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 48a7d65e3..e6873e0ac 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.1.2", + "version": "2023.1.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 538140b5f..4acb36e8d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 44447d22ab2c41394673fb76a0f8d4be98494fcc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 01:46:44 +0000 Subject: [PATCH 128/647] Update dependency dotnet-sdk to v6.0.411 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 953dc3511..b361384d5 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.410", + "version": "6.0.411", "rollForward": "latestMinor" } } From d6d40c43446fbb12e5e72699fab3bf45062b6500 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 14:41:07 +0000 Subject: [PATCH 129/647] Update dependency BenchmarkDotNet to v0.13.6 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 87217e4bb..0bc39cf4b 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From a361a74499a7034be7296cf7a2b86dfc00220e84 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:23:32 +0000 Subject: [PATCH 130/647] Update reportgenerator to v5.1.23 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e6873e0ac..f22cc7aa0 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.22", + "version": "5.1.23", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 4acb36e8d..fb73d9eb3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From ae8dc6bc0273717ec506b5117ed83d6c8c6254be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 02:03:18 +0000 Subject: [PATCH 131/647] Update dependency dotnet-sdk to v6.0.412 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index b361384d5..34f34e000 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.411", + "version": "6.0.412", "rollForward": "latestMinor" } } From ca7b9ce52dd43d57d05673ffdca8cfff6bf7fba0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 18:38:00 +0000 Subject: [PATCH 132/647] Update jetbrains to v2023.1.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f22cc7aa0..20784627d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.1.3", + "version": "2023.1.4", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index fb73d9eb3..e03a8b283 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From e3da21f920d368cefc67d32c82bbc0c05992e074 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:17:36 +0000 Subject: [PATCH 133/647] Update jetbrains to v2023.2.0 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 20784627d..c97ed9e16 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.1.4", + "version": "2023.2.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index e03a8b283..021672c4f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 987cb077f16225479d2106898506b84fafd1ffc2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:02:49 +0000 Subject: [PATCH 134/647] Update dependency BenchmarkDotNet to v0.13.7 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 0bc39cf4b..532015e0a 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From a759354d3a6932f0d9d7e0d0a4d5deaf614847f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 06:04:29 +0000 Subject: [PATCH 135/647] Update dependency dotnet-sdk to v6.0.413 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 34f34e000..17717317f 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.412", + "version": "6.0.413", "rollForward": "latestMinor" } } From 540565edbc6154f575701b1db2da5bf4aaf35699 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 12 Aug 2023 21:46:42 +0000 Subject: [PATCH 136/647] Update reportgenerator to v5.1.24 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index c97ed9e16..0bc6434ab 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.23", + "version": "5.1.24", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 021672c4f..24a7c9bfb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 633b83723d08ab3fa28459f4c24d184b6b9f5562 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:59:32 +0000 Subject: [PATCH 137/647] Update dependency FluentAssertions to v6.12.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 24a7c9bfb..eefcb99fe 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 6a659a483ebb1ee755c33e936ae1251708d989cb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 12:36:43 +0000 Subject: [PATCH 138/647] Update jetbrains to v2023.2.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 0bc6434ab..59380f862 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.2.0", + "version": "2023.2.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index eefcb99fe..450a0d268 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From d6dbb601e753094da074ebee98edb6554a50f2f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:36:22 +0000 Subject: [PATCH 139/647] Update actions/checkout action to v3.6.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09b82f7cb..ead96a283 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.5.3 + uses: actions/checkout@v3.6.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 08af1f59c..f836fe1d8 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.3 + uses: actions/checkout@v3.6.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 5eb99899a..5ef73f416 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.3 + uses: actions/checkout@v3.6.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index b99eac5d9..a4e8c3451 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.3 + uses: actions/checkout@v3.6.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index f3d5aecea..a6f0dc811 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.5.3 + uses: actions/checkout@v3.6.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 3cb9ca589102f6b7df2f20cad2b8e999d519f696 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 20:50:02 +0000 Subject: [PATCH 140/647] Update crazy-max/ghaction-github-labeler action to v4.2.0 --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index a4e8c3451..a2d8bf524 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,7 +20,7 @@ jobs: - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v4.1.0 + uses: crazy-max/ghaction-github-labeler@v4.2.0 with: yaml-file: .github/labels.yml skip-delete: false From 85111c872a9fb43ac0918ee9d59c84c53a14cf5f Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 2 Sep 2023 19:08:23 +0200 Subject: [PATCH 141/647] Update xunit to v2.5.0 --- Directory.Packages.props | 6 +++--- test/JsonRpc.Tests/ProcessSchedulerTests.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 450a0d268..be82495f8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,4 +1,4 @@ -ο»Ώ + $(BaseIntermediateOutputPath)\GeneratedFiles @@ -37,8 +37,8 @@ - - + + diff --git a/test/JsonRpc.Tests/ProcessSchedulerTests.cs b/test/JsonRpc.Tests/ProcessSchedulerTests.cs index c6b661f34..f51b89e6d 100644 --- a/test/JsonRpc.Tests/ProcessSchedulerTests.cs +++ b/test/JsonRpc.Tests/ProcessSchedulerTests.cs @@ -346,7 +346,7 @@ public void Should_Handle_Exceptions_Tasks() OnCompleted(Subscribed, Unit.Default) ); var errorObservable = testScheduler.CreateColdObservable( - OnError(Subscribed, new NotSameException(), Unit.Default) + OnError(Subscribed, new NotSupportedException(), Unit.Default) ); var testObserver = testScheduler.CreateObserver(); @@ -365,7 +365,7 @@ public void Should_Handle_Exceptions_Tasks() .ToArray(); messages.Should().Contain(x => x.Value.Kind == NotificationKind.OnNext && x.Time == Subscribed); - messages.Should().Contain(x => x.Value.Kind == NotificationKind.OnError && x.Time == Subscribed * 2 && x.Value.Exception is NotSameException); + messages.Should().Contain(x => x.Value.Kind == NotificationKind.OnError && x.Time == Subscribed * 2 && x.Value.Exception is NotSupportedException); messages.Should().Contain(x => x.Value.Kind == NotificationKind.OnNext && x.Time == Subscribed * 3); } From ff2c1fc7574e77d7c4ae68ad4bad042c0bf2f749 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 2 Sep 2023 23:01:36 +0200 Subject: [PATCH 142/647] Update dependency dotnet-sdk to v7 --- .build/Solution.cs | 4 ++-- .github/workflows/ci.yml | 4 ++-- global.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.build/Solution.cs b/.build/Solution.cs index 15cf58c19..a3e9826d8 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -134,9 +134,9 @@ RocketSurgeonGitHubActionsConfiguration configuration { DotNetVersion = "3.1.x" }, - new SetupDotNetStep("Use .NET Core 6.0 SDK") + new SetupDotNetStep("Use .NET Core 7.0 SDK") { - DotNetVersion = "6.0.x" + DotNetVersion = "7.0.x" }, } ); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ead96a283..0ffa327fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,10 +97,10 @@ jobs: uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '3.1.x' - - name: πŸ”¨ Use .NET Core 6.0 SDK + - name: πŸ”¨ Use .NET Core 7.0 SDK uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: '6.0.x' + dotnet-version: '7.0.x' - name: 🎁 dotnet tool restore run: | dotnet tool restore diff --git a/global.json b/global.json index 17717317f..96f0cfd40 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.413", + "version": "7.0.400", "rollForward": "latestMinor" } } From 466a8019f96d5f44b8cef3ff6024324b301f5ae2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 13:49:03 +0000 Subject: [PATCH 143/647] Update actions/checkout action to v4 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ead96a283..b93ea81aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index f836fe1d8..48c4ed612 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 5ef73f416..da4198773 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index a2d8bf524..3f4a89a70 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index a6f0dc811..ebdb54332 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 05e543600b439dc3fb20b877f099e685cd808985 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:06:06 +0000 Subject: [PATCH 144/647] Update reportgenerator to v5.1.25 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 59380f862..73facaf23 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.24", + "version": "5.1.25", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 450a0d268..b1572a1b6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 886dbaea43e4450d3902a4817092bc7dd794243b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:34:40 +0000 Subject: [PATCH 145/647] Update dependency BenchmarkDotNet to v0.13.8 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 532015e0a..dd0656d2e 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From d6157dcbd3ac0ef2070d1b1c40d6c76f1fdc2ea1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 10 Sep 2023 14:21:53 +0000 Subject: [PATCH 146/647] Update crazy-max/ghaction-github-labeler action to v5 --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 3f4a89a70..dd03f5704 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,7 +20,7 @@ jobs: - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v4.2.0 + uses: crazy-max/ghaction-github-labeler@v5.0.0 with: yaml-file: .github/labels.yml skip-delete: false From aeb04a1a57cc2ddff93832f08daf94e6e593df7f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 08:35:27 +0000 Subject: [PATCH 147/647] Update dependency NSubstitute to v5.1.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b1572a1b6..d3ac5d926 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 82583557bee2699762e4e03989be22be02e1fb1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:50:11 +0000 Subject: [PATCH 148/647] Update dependency dotnet-sdk to v6.0.414 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 17717317f..8c21be6de 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.413", + "version": "6.0.414", "rollForward": "latestMinor" } } From 348897d245fcf9c5fa4a5b65756fa6f677213569 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 13 Sep 2023 23:21:47 -0700 Subject: [PATCH 149/647] Apply remaining 3.17 updates. --- .build/.build.csproj | 1 - language-server-protocol.sha.txt | 4 +- .../Capabilities/IWindowClientCapabilities.cs | 4 +- .../Capabilities/WindowClientCapabilities.cs | 2 +- .../Features/Document/ColorFeature.cs | 2 +- .../Features/Document/CompletionFeature.cs | 82 ++++++------ .../Features/Document/DiagnosticsFeature.cs | 2 +- .../Features/Document/DocumentLinkFeature.cs | 2 +- .../DocumentOnTypeFormattingFeature.cs | 13 +- .../Features/Document/InlayHintFeature.cs | 9 +- .../Document/LinkedEditingRangeFeature.cs | 9 +- .../Document/NotebookDocumentSyncFeature.cs | 118 +++++++++++++++--- .../Features/Document/RenameFeature.cs | 4 +- .../Document/TextDocumentSyncFeature.cs | 32 +++-- .../Features/Document/TypeHierarchyFeature.cs | 28 +++-- .../Window/ShowDocumentRequestFeature.cs | 4 +- .../Window/WorkDoneProgressFeature.cs | 23 ++-- .../Workspace/DidChangeWatchedFilesFeature.cs | 6 + .../Workspace/WorkspaceSymbolsFeature.cs | 25 ++-- src/Protocol/Models/CreateFile.cs | 4 +- src/Protocol/Models/DeleteFile.cs | 4 +- src/Protocol/Models/Diagnostic.cs | 9 +- src/Protocol/Models/FailureHandlingKind.cs | 11 +- src/Protocol/Models/FileSystemWatcher.cs | 13 +- src/Protocol/Models/GlobPattern.cs | 61 +++++++++ src/Protocol/Models/IPartialResultParams.cs | 4 +- src/Protocol/Models/Location.cs | 2 +- src/Protocol/Models/LocationLink.cs | 16 +-- ...OptionalVersionedTextDocumentIdentifier.cs | 10 +- src/Protocol/Models/Position.cs | 6 +- src/Protocol/Models/PositionEncodingKind.cs | 5 +- src/Protocol/Models/RelativePattern.cs | 36 ++++++ src/Protocol/Models/RenameFile.cs | 4 +- src/Protocol/Models/TextDocumentItem.cs | 2 +- src/Protocol/Models/TextEdit.cs | 5 +- .../Models/VersionedTextDocumentIdentifier.cs | 3 + src/Protocol/Models/WorkspaceEdit.cs | 15 ++- src/Protocol/Models/WorkspaceFolderOrUri.cs | 32 +++++ .../Converters/GlobPatternConverter.cs | 40 ++++++ .../WorkspaceFolderOrUriConverter.cs | 46 +++++++ 40 files changed, 533 insertions(+), 165 deletions(-) create mode 100644 src/Protocol/Models/GlobPattern.cs create mode 100644 src/Protocol/Models/RelativePattern.cs create mode 100644 src/Protocol/Models/WorkspaceFolderOrUri.cs create mode 100644 src/Protocol/Serialization/Converters/GlobPatternConverter.cs create mode 100644 src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs diff --git a/.build/.build.csproj b/.build/.build.csproj index 7233e8972..2ddbe7684 100644 --- a/.build/.build.csproj +++ b/.build/.build.csproj @@ -11,7 +11,6 @@ - diff --git a/language-server-protocol.sha.txt b/language-server-protocol.sha.txt index 9ff4a9d22..f1d289146 100644 --- a/language-server-protocol.sha.txt +++ b/language-server-protocol.sha.txt @@ -1,5 +1,5 @@ -- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages -lastSha: bdcc0f2 +lastSha: 5fc92456c046ed980646bb95c1d2e390d5b3ef9d -https://github.com/Microsoft/language-server-protocol/compare/ed804013dc545b0e10bcb0a57d872c414bbc1f3c..gh-pages +https://github.com/Microsoft/language-server-protocol/compare/5fc92456c046ed980646bb95c1d2e390d5b3ef9d..gh-pages diff --git a/src/Protocol/Client/Capabilities/IWindowClientCapabilities.cs b/src/Protocol/Client/Capabilities/IWindowClientCapabilities.cs index 764287c43..900bff3ea 100644 --- a/src/Protocol/Client/Capabilities/IWindowClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/IWindowClientCapabilities.cs @@ -3,7 +3,7 @@ public interface IWindowClientCapabilities : ICapabilitiesBase { /// - /// Whether client supports handling progress notifications. + /// Whether the client supports server initiated progress using the `window/workDoneProgress/create` request. /// Supports WorkDoneProgress { get; set; } @@ -21,4 +21,4 @@ public interface IWindowClientCapabilities : ICapabilitiesBase /// Supports ShowDocument { get; set; } } -} \ No newline at end of file +} diff --git a/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs b/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs index 24ba5cebc..ba40b2e0f 100644 --- a/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/WindowClientCapabilities.cs @@ -6,7 +6,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities public class WindowClientCapabilities : CapabilitiesBase, IWindowClientCapabilities { /// - /// Whether client supports handling progress notifications. + /// Whether the client supports server initiated progress using the `window/workDoneProgress/create` request. /// public Supports WorkDoneProgress { get; set; } diff --git a/src/Protocol/Features/Document/ColorFeature.cs b/src/Protocol/Features/Document/ColorFeature.cs index 35eb9b96b..457691592 100644 --- a/src/Protocol/Features/Document/ColorFeature.cs +++ b/src/Protocol/Features/Document/ColorFeature.cs @@ -76,7 +76,7 @@ public partial record ColorPresentation /// /// An [edit](#TextEdit) which is applied to a document when selecting - /// this presentation for the color. When `falsy` the [label](#ColorPresentation.label) + /// this presentation for the color. When omitted the [label](#ColorPresentation.label) /// is used. /// [Optional] diff --git a/src/Protocol/Features/Document/CompletionFeature.cs b/src/Protocol/Features/Document/CompletionFeature.cs index 4e0e49de7..d3e2a8246 100644 --- a/src/Protocol/Features/Document/CompletionFeature.cs +++ b/src/Protocol/Features/Document/CompletionFeature.cs @@ -113,14 +113,14 @@ public partial record CompletionItem : ICanBeResolved, IRequest, /// /// A string that shoud be used when comparing this item - /// with other items. When `falsy` the label is used. + /// with other items. When omitted the label is used. /// [Optional] public string? SortText { get; init; } /// /// A string that should be used when filtering a set of - /// completion items. When `falsy` the label is used. + /// completion items. When omitted the label is used. /// [Optional] @@ -128,7 +128,7 @@ public partial record CompletionItem : ICanBeResolved, IRequest, /// /// A string that should be inserted a document when selecting - /// this completion. When `falsy` the label is used. + /// this completion. When omitted the label is used. /// [Optional] @@ -223,7 +223,7 @@ public partial record CompletionItem : ICanBeResolved, IRequest, [Optional] public JToken? Data { get; init; } - private string DebuggerDisplay => $"[{Kind}] {Label}{( Tags?.Any() == true ? $" tags: {string.Join(", ", Tags.Select(z => z.ToString()))}" : "" )}"; + private string DebuggerDisplay => $"[{Kind}] {Label}{(Tags?.Any() == true ? $" tags: {string.Join(", ", Tags.Select(z => z.ToString()))}" : "")}"; /// public override string ToString() => DebuggerDisplay; @@ -351,7 +351,7 @@ public class CompletionRegistrationCompletionItemOptions /// details (see also `CompletionItemLabelDetails`) when receiving /// a completion item in a resolve call. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public bool? LabelDetailsSupport { get; set; } @@ -438,7 +438,7 @@ public CompletionList(IEnumerable items, bool isIncomplete) : ba /// signals support for this via the `completionList.itemDefaults` /// capability. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public CompletionListItemDefaults? ItemDefaults { get; set; } @@ -450,11 +450,11 @@ public CompletionList(IEnumerable items, bool isIncomplete) : ba { ItemDefaults = list.ItemDefaults }, - _ => null + _ => null }; public static CompletionList From(CompletionList? source, IEnumerable? result) - => new ((source?.Items ?? Array.Empty()).Concat(result ?? Array.Empty())) + => new((source?.Items ?? Array.Empty()).Concat(result ?? Array.Empty())) { ItemDefaults = source?.ItemDefaults }; @@ -559,7 +559,7 @@ public CompletionList(bool isIncomplete, params CompletionItem[] items) : bas /// signals support for this via the `completionList.itemDefaults` /// capability. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public CompletionListItemDefaults? ItemDefaults { get; set; } @@ -574,47 +574,47 @@ public CompletionList(bool isIncomplete, params CompletionItem[] items) : bas }, _ => null }; - + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("container")] - public static implicit operator CompletionList? (CompletionList? container) => container switch + public static implicit operator CompletionList?(CompletionList? container) => container switch { not null => new CompletionList(container.Select(value => (CompletionItem)value), container.IsIncomplete) { ItemDefaults = container.ItemDefaults }, - _ => null + _ => null }; - + } - - internal class TypedCompletionListConverter : JsonConverter - { - public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) - { - serializer.Serialize(writer, (CompletionList?)value); - } - public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) - { - var completionList = serializer.Deserialize(reader); - return objectType.GetMethod(nameof(CompletionList.Create), BindingFlags.Static | BindingFlags.Public)! - .Invoke(null, new object[] { completionList })!; - } + internal class TypedCompletionListConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + serializer.Serialize(writer, (CompletionList?)value); + } - public override bool CanConvert(Type objectType) - { - return objectType.IsGenericType && objectType.GetGenericTypeDefinition() == typeof(CompletionList<>); - } + public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) + { + var completionList = serializer.Deserialize(reader); + return objectType.GetMethod(nameof(CompletionList.Create), BindingFlags.Static | BindingFlags.Public)! + .Invoke(null, new object[] { completionList })!; + } - public override bool CanRead => true; + public override bool CanConvert(Type objectType) + { + return objectType.IsGenericType && objectType.GetGenericTypeDefinition() == typeof(CompletionList<>); } + public override bool CanRead => true; + } + public record CompletionListItemDefaults { /// /// A default commit character set. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public Container? CommitCharacters { get; init; } @@ -622,7 +622,7 @@ public record CompletionListItemDefaults /// /// A default edit range /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public RangeOrEditRange? EditRange { get; init; } @@ -630,7 +630,7 @@ public record CompletionListItemDefaults /// /// A default insert text format /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public InsertTextFormat? InsertTextFormat { get; init; } @@ -638,7 +638,7 @@ public record CompletionListItemDefaults /// /// A default insert text mode /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// public InsertTextMode? InsertTextMode { get; init; } @@ -704,7 +704,7 @@ public partial class CompletionCapability : DynamicCapability /// The client's default when the completion item doesn't provide a /// `insertTextMode` property. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public InsertTextMode? InsertTextMode { get; set; } @@ -713,7 +713,7 @@ public partial class CompletionCapability : DynamicCapability /// The client supports the following `CompletionList` specific /// capabilities. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public CompletionListCapabilityOptions? CompletionList { get; set; } @@ -723,19 +723,19 @@ public partial class CompletionCapability : DynamicCapability /// The client supports the following `CompletionList` specific /// capabilities. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// public class CompletionListCapabilityOptions { /// - /// The client supports the the following itemDefaults on + /// The client supports the following itemDefaults on /// a completion list. /// /// The value lists the supported property names of the /// `CompletionList.itemDefaults` object. If omitted /// no properties are supported. /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public Container? ItemDefaults { get; set; } @@ -832,7 +832,7 @@ public class CompletionItemCapabilityOptions /// The client has support for completion item label /// details (see also `CompletionItemLabelDetails`). /// - /// @since 3.17.0 - proposed state + /// @since 3.17.0 /// [Optional] public bool LabelDetailsSupport { get; set; } diff --git a/src/Protocol/Features/Document/DiagnosticsFeature.cs b/src/Protocol/Features/Document/DiagnosticsFeature.cs index 45ab5acb1..bf7cce533 100644 --- a/src/Protocol/Features/Document/DiagnosticsFeature.cs +++ b/src/Protocol/Features/Document/DiagnosticsFeature.cs @@ -508,7 +508,7 @@ public partial class DiagnosticClientCapabilities : DynamicCapability /// Capabilities specific to the code lens requests scoped to the /// workspace. /// - /// @since 3.16.0. + /// @since 3.17.0. /// [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Diagnostics))] public class DiagnosticWorkspaceClientCapabilities : ICapability diff --git a/src/Protocol/Features/Document/DocumentLinkFeature.cs b/src/Protocol/Features/Document/DocumentLinkFeature.cs index 3b15e4134..eeb025de4 100644 --- a/src/Protocol/Features/Document/DocumentLinkFeature.cs +++ b/src/Protocol/Features/Document/DocumentLinkFeature.cs @@ -32,7 +32,7 @@ public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IParti /// public TextDocumentIdentifier TextDocument { get; init; } = null!; } - + public partial class DocumentLinkContainer { } /// diff --git a/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs b/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs index 548d6704d..ab924e992 100644 --- a/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs +++ b/src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs @@ -28,18 +28,23 @@ public partial record DocumentOnTypeFormattingParams : ITextDocumentIdentifierPa public TextDocumentIdentifier TextDocument { get; init; } = null!; /// - /// The position at which this request was sent. + /// The position around which the on type formatting should happen. + /// This is not necessarily the exact position where the character denoted + /// by the property `ch` got typed. /// public Position Position { get; init; } = null!; /// - /// The character that has been typed. + /// The character that has been typed that triggered the formatting + /// on type request.That is not necessarily the last character that + /// got inserted into the document since the client could auto insert + /// characters as well(e.g.like automatic brace completion). /// [JsonProperty("ch")] public string Character { get; init; } = null!; /// - /// The format options. + /// The formatting options. /// public FormattingOptions Options { get; init; } = null!; } @@ -49,7 +54,7 @@ public partial record DocumentOnTypeFormattingParams : ITextDocumentIdentifierPa public partial class DocumentOnTypeFormattingRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions { /// - /// A character on which formatting should be triggered, like `}`. + /// A character on which formatting should be triggered, like `{`. /// public string FirstTriggerCharacter { get; set; } = null!; diff --git a/src/Protocol/Features/Document/InlayHintFeature.cs b/src/Protocol/Features/Document/InlayHintFeature.cs index 55b92973e..4fcb3544f 100644 --- a/src/Protocol/Features/Document/InlayHintFeature.cs +++ b/src/Protocol/Features/Document/InlayHintFeature.cs @@ -128,8 +128,8 @@ public partial record InlayHint : ICanBeResolved, IRequest, IDoesNotP private string DebuggerDisplay => ToString(); } - - public partial class InlayHintContainer {} + + public partial class InlayHintContainer { } /// /// An inlay hint label part allows for interactive and composite labels @@ -251,7 +251,6 @@ public override StringOrInlayHintLabelParts ReadJson( /// /// @since 3.17.0 /// - /// [JsonConverter(typeof(NumberEnumConverter))] public enum InlayHintKind { @@ -273,9 +272,7 @@ public partial class InlayHintRegistrationOptions : ITextDocumentRegistrationOpt { /// /// The server provides support to resolve additional - /// information for a code action. - /// - /// @since 3.16.0 + /// information for an inlay hint item. /// [Optional] public bool ResolveProvider { get; set; } diff --git a/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs b/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs index 36e2efaf5..9952ab97e 100644 --- a/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs +++ b/src/Protocol/Features/Document/LinkedEditingRangeFeature.cs @@ -25,14 +25,15 @@ public partial record LinkedEditingRanges { /// /// A list of ranges that can be renamed together. The ranges must have - /// identical length and contain identical text content. The ranges cannot overlap. + /// identical length and contain identical text content. The ranges cannot + /// overlap. /// public Container Ranges { get; init; } = null!; /// - /// An optional word pattern (regular expression) that describes valid contents for - /// the given ranges. If no pattern is provided, the client configuration's word - /// pattern will be used. + /// An optional word pattern (regular expression) that describes valid + /// contents for the given ranges. If no pattern is provided, the client + /// configuration's word pattern will be used. /// [Optional] public string? WordPattern { get; init; } diff --git a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs index 04e784371..ac8383d8d 100644 --- a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs @@ -50,7 +50,7 @@ public partial class DidOpenNotebookDocumentParams : IRequest /// public Container CellTextDocuments { get; set; } } - + /// /// The params sent in a change notebook document notification. /// @@ -316,7 +316,6 @@ public partial record NotebookCell public ExecutionSummary? ExecutionSummary { get; set; } } - public partial record ExecutionSummary { /// @@ -333,6 +332,91 @@ public partial record ExecutionSummary public bool? Success { get; set; } } + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public record NotebookCellTextDocumentFilter + { + /// + /// A filter that matches against the notebook + /// containing the notebook cell. If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + /// + public StringOrNotebookDocumentFilter Notebook { get; init; } + + /// + /// A language id like `python`. + /// + /// Will be matched against the language id of the + /// notebook cell document. '*' matches every language. + /// + [Optional] + public string? Language { get; init; } + + private string DebuggerDisplay => + $"{Notebook} {Language}"; + + /// + public override string ToString() => DebuggerDisplay; + } + + [JsonConverter(typeof(Converter))] + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public record StringOrNotebookDocumentFilter + { + public StringOrNotebookDocumentFilter(string value) => String = value; + + public StringOrNotebookDocumentFilter(NotebookDocumentFilter notebookDocumentFilter) => NotebookDocumentFilter = notebookDocumentFilter; + + public string? String { get; } + public bool HasString => NotebookDocumentFilter is null; + public NotebookDocumentFilter? NotebookDocumentFilter { get; } + public bool HasNotebookDocumentFilter => NotebookDocumentFilter is { }; + + public static implicit operator StringOrNotebookDocumentFilter?(string? value) => value is null ? null : new StringOrNotebookDocumentFilter(value); + + public static implicit operator StringOrNotebookDocumentFilter?(NotebookDocumentFilter notebookDocumentFilter) => + notebookDocumentFilter is null ? null : new StringOrNotebookDocumentFilter(notebookDocumentFilter); + + private string DebuggerDisplay => + $"{( HasString ? String : HasNotebookDocumentFilter ? NotebookDocumentFilter : string.Empty )}"; + + /// + public override string ToString() => DebuggerDisplay; + + internal class Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, StringOrNotebookDocumentFilter value, JsonSerializer serializer) + { + if (value.HasString) + { + writer.WriteValue(value.String); + } + else + { + serializer.Serialize(writer, value.NotebookDocumentFilter); + } + } + + public override StringOrNotebookDocumentFilter ReadJson( + JsonReader reader, Type objectType, StringOrNotebookDocumentFilter existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + if (reader.TokenType == JsonToken.StartObject) + { + return new StringOrNotebookDocumentFilter(JObject.Load(reader).ToObject(serializer)); + } + + if (reader.TokenType == JsonToken.String) + { + return new StringOrNotebookDocumentFilter(( reader.Value as string )!); + } + + return new StringOrNotebookDocumentFilter(""); + } + + public override bool CanRead => true; + } + } [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] public class NotebookDocumentFilter : IEquatable @@ -492,7 +576,6 @@ public record NotebookSelectorCell public string Language { get; init; } } - /// /// The notebooks to be synced /// @@ -504,9 +587,9 @@ public class NotebookSelector : IEquatable /// value is provided it matches against the /// notebook type. '*' matches every notebook. /// - public NotebookDocumentFilter? NotebookDocument { get; init; } + public StringOrNotebookDocumentFilter? Notebook { get; init; } - public bool HasNotebookDocument => NotebookDocument is not null; + public bool HasNotebook => Notebook is not null; /// /// The cells of the matching notebook to be synced. @@ -515,10 +598,9 @@ public class NotebookSelector : IEquatable public bool HasCells => Cells is not null; - public bool IsMatch(NotebookDocumentAttributes attributes) { - return NotebookDocument?.IsMatch(attributes) == true + return Notebook?.NotebookDocumentFilter?.IsMatch(attributes) == true || ( attributes.Language is not null && Cells?.Any(z => z.Language == attributes.Language) == true ); } @@ -530,9 +612,16 @@ public bool IsMatch(NotebookDocumentAttributes attributes) public static explicit operator string(NotebookSelector notebookDocumentFilter) { var items = new List(); - if (notebookDocumentFilter.HasNotebookDocument) + if (notebookDocumentFilter.HasNotebook) { - items.Add((string)notebookDocumentFilter.NotebookDocument!); + if (notebookDocumentFilter.Notebook.HasString) + { + items.Add(notebookDocumentFilter.Notebook.String); + } + else if (notebookDocumentFilter.Notebook.HasNotebookDocumentFilter) + { + items.Add((string)notebookDocumentFilter.Notebook.NotebookDocumentFilter!); + } } if (notebookDocumentFilter.HasCells) @@ -547,7 +636,7 @@ public bool Equals(NotebookSelector? other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return Equals(NotebookDocument, other.NotebookDocument) && Equals(Cells, other.Cells); + return Equals(Notebook, other.Notebook) && Equals(Cells, other.Cells); } public override bool Equals(object? obj) @@ -562,7 +651,7 @@ public override int GetHashCode() { unchecked { - return ( ( NotebookDocument != null ? NotebookDocument.GetHashCode() : 0 ) * 397 ) ^ ( Cells != null ? Cells.GetHashCode() : 0 ); + return ( ( Notebook != null ? Notebook.GetHashCode() : 0 ) * 397 ) ^ ( Cells != null ? Cells.GetHashCode() : 0 ); } } @@ -668,13 +757,14 @@ public interface INotebookDocumentRegistrationOptions : IRegistrationOptions public partial class NotebookDocumentSyncOptions : INotebookDocumentRegistrationOptions { /// - /// The notebooks to be synced + /// The notebook to be synced. If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. /// public NotebookSelector NotebookSelector { get; set; } /// /// Whether save notification should be forwarded to - /// /// the server. Will only be honored if mode === `notebook`. /// public bool? Save { get; set; } @@ -750,7 +840,7 @@ private NotebookDocumentSyncOptions AssignRegistrationOptions( ClientCapabilities = clientCapabilities; return RegistrationOptions = CreateRegistrationOptions(capability, clientCapabilities); } - + NotebookDocumentSyncOptions IRegistration.GetRegistrationOptions( NotebookDocumentSyncClientCapabilities capability, ClientCapabilities clientCapabilities ) diff --git a/src/Protocol/Features/Document/RenameFeature.cs b/src/Protocol/Features/Document/RenameFeature.cs index 65555fa95..80eab42d0 100644 --- a/src/Protocol/Features/Document/RenameFeature.cs +++ b/src/Protocol/Features/Document/RenameFeature.cs @@ -177,7 +177,7 @@ public class RenameCapability : DynamicCapability public PrepareSupportDefaultBehavior PrepareSupportDefaultBehavior { get; set; } /// - /// Whether th client honors the change annotations in + /// Whether the client honors the change annotations in /// text edits and resource operations returned via the /// `CodeAction#edit` property by for example presenting /// the workspace edit in the user interface and asking @@ -194,7 +194,7 @@ public enum PrepareSupportDefaultBehavior { /// /// The client's default behavior is to select the identifier - /// according the to language's syntax rule. + /// according to the language's syntax rule. /// Identifier = 1 } diff --git a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs index 54ab31a88..bc2d14057 100644 --- a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs @@ -59,8 +59,8 @@ public partial class TextDocumentChangeRegistrationOptions : ITextDocumentRegist } /// - /// An event describing a change to a text document. If range and rangeLength are omitted - /// the new text is considered to be the full content of the document. + /// An event describing a change to a text document. If only a text is provided + /// it is considered to be the full content of the document. /// public record TextDocumentContentChangeEvent { @@ -94,6 +94,9 @@ public record TextDocumentEdit /// /// The edits to be applied. + /// + /// @since 3.16.0 - support for AnnotatedTextEdit. This is guarded by the + /// client capability `workspace.workspaceEdit.changeAnnotationSupport` /// /// /// This can contain both and @@ -208,6 +211,18 @@ public class TextDocumentFilter : IEquatable /// /// A glob pattern, like `*.{ts,js}`. + /// + /// Glob patterns can have the following syntax: + /// - `*` to match one or more characters in a path segment + /// - `?` to match on one character in a path segment + /// - `**` to match any number of path segments, including none + /// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` + /// matches all TypeScript and JavaScript files) + /// - `[]` to declare a range of characters to match in a path segment + /// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + /// - `[!...]` to negate a range of characters to match in a path segment + /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but + /// not `example.0`) /// [Optional] public string? Pattern @@ -325,8 +340,7 @@ public override int GetHashCode() /// public override string ToString() => DebuggerDisplay; } - - + /// /// A collection of document filters used to identify valid documents /// @@ -352,7 +366,7 @@ public TextDocumentSelector(params TextDocumentFilter[] items) : base(items) public static implicit operator TextDocumentSelector(List items) => new TextDocumentSelector(items); public static implicit operator string(TextDocumentSelector? documentSelector) => - documentSelector is not null ? string.Join(", ", documentSelector.Select(x => (string) x)) : string.Empty; + documentSelector is not null ? string.Join(", ", documentSelector.Select(x => (string)x)) : string.Empty; public bool IsMatch(TextDocumentAttributes attributes) => this.Any(z => z.IsMatch(attributes)); @@ -366,7 +380,7 @@ public static implicit operator string(TextDocumentSelector? documentSelector) = private string DebuggerDisplay => this; } - + public interface ITextDocumentSyncOptions { [Optional] bool OpenClose { get; set; } @@ -375,9 +389,13 @@ public interface ITextDocumentSyncOptions [Optional] bool WillSaveWaitUntil { get; set; } [Optional] BooleanOr Save { get; set; } } - + public interface ITextDocumentRegistrationOptions : IRegistrationOptions { + /// + /// A document selector to identify the scope of the registration. If set to + /// null the document selector provided on the client side will be used. + /// TextDocumentSelector? DocumentSelector { get; set; } } diff --git a/src/Protocol/Features/Document/TypeHierarchyFeature.cs b/src/Protocol/Features/Document/TypeHierarchyFeature.cs index 02c25f411..97a5eb640 100644 --- a/src/Protocol/Features/Document/TypeHierarchyFeature.cs +++ b/src/Protocol/Features/Document/TypeHierarchyFeature.cs @@ -26,7 +26,7 @@ namespace Models /// /// The parameter of a `textDocument/prepareTypeHierarchy` request. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [Parallel] [Method(TextDocumentNames.PrepareTypeHierarchy, Direction.ClientToServer)] @@ -42,7 +42,7 @@ public partial record TypeHierarchyPrepareParams : TextDocumentPositionParams, I /// Represents programming constructs like functions or constructors in the context /// of call hierarchy. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] [GenerateTypedData] @@ -76,19 +76,23 @@ public partial record TypeHierarchyItem : ICanBeResolved public DocumentUri Uri { get; init; } = null!; /// - /// The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code. + /// The range enclosing this symbol not including leading/trailing whitespace + /// but everything else, e.g. comments and code. /// public Range Range { get; init; } = null!; /// - /// The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. - /// Must be contained by the [`range`](#TypeHierarchyItem.range). + /// The range that should be selected and revealed when this symbol is being + /// picked, e.g. the name of a function. Must be contained by the + /// [`range`](#TypeHierarchyItem.range). /// public Range SelectionRange { get; init; } = null!; /// /// A data entry field that is preserved between a call hierarchy prepare and - /// supertypes calls or subtypes calls requests. + /// supertypes or subtypes requests. It could also be used to identify the + /// type hierarchy in the server, helping improve the performance on + /// resolving supertypes and subtypes. /// [Optional] public JToken? Data { get; init; } @@ -132,7 +136,7 @@ public abstract record TypeHierarchyBaseParams : ICanBeResolved /// /// The parameter of a `TypeHierarchy/supertypes` request. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [Parallel] [Method(TextDocumentNames.TypeHierarchySupertypes, Direction.ClientToServer)] @@ -147,7 +151,7 @@ public partial record TypeHierarchySupertypesParams : TypeHierarchyBaseParams, I /// /// The parameter of a `TypeHierarchy/supertypes` request. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [Method(TextDocumentNames.TypeHierarchySupertypes, Direction.ClientToServer)] public partial record TypeHierarchySupertypesParams : TypeHierarchyBaseParams, IWorkDoneProgressParams, @@ -158,7 +162,7 @@ public partial record TypeHierarchySupertypesParams : TypeHierarchyBaseParams /// /// The parameter of a `TypeHierarchy/subtypes` request. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [Parallel] [Method(TextDocumentNames.TypeHierarchySubtypes, Direction.ClientToServer)] @@ -186,7 +190,7 @@ public static TypeHierarchySubtypesParams Create(TypeHierarchySubtypesPara /// /// The parameter of a `TypeHierarchy/subtypes` request. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [Method(TextDocumentNames.TypeHierarchySubtypes, Direction.ClientToServer)] public partial record TypeHierarchySubtypesParams : TypeHierarchyBaseParams, IWorkDoneProgressParams, @@ -218,7 +222,7 @@ public static implicit operator TypeHierarchySubtypesParams(TypeHierarchySubt /// /// Type hierarchy options used during static or dynamic registration. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [GenerateRegistrationOptions(nameof(ServerCapabilities.TypeHierarchyProvider))] [RegistrationName(TextDocumentNames.PrepareTypeHierarchy)] @@ -232,7 +236,7 @@ namespace Client.Capabilities /// /// Capabilities specific to the `textDocument/typeHierarchy`. /// - /// @since 3.16.0 + /// @since 3.17.0 /// [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.TypeHierarchy))] public partial class TypeHierarchyCapability : DynamicCapability diff --git a/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs b/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs index 7a3ed66f9..8d93114d1 100644 --- a/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs +++ b/src/Protocol/Features/Window/ShowDocumentRequestFeature.cs @@ -12,7 +12,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol namespace Models { /// - /// Params to show a document. + /// Params to show a resource. /// /// @since 3.16.0 /// @@ -31,7 +31,7 @@ public record ShowDocumentParams : IRequest /// /// Indicates to show the resource in an external program. - /// To show for example `https://code.visualstudio.com/` + /// To show, for example, `https://code.visualstudio.com/` /// in the default WEB browser set `external` to `true`. /// [Optional] diff --git a/src/Protocol/Features/Window/WorkDoneProgressFeature.cs b/src/Protocol/Features/Window/WorkDoneProgressFeature.cs index f99bb1bd6..79aed087e 100644 --- a/src/Protocol/Features/Window/WorkDoneProgressFeature.cs +++ b/src/Protocol/Features/Window/WorkDoneProgressFeature.cs @@ -57,8 +57,11 @@ public abstract record WorkDoneProgress public WorkDoneProgressKind Kind { get; } /// - /// Optional, a final message indicating to for example indicate the outcome - /// of the operation. + /// Optional, more detailed associated progress message. Contains + /// complementary information to the `title`. + /// + /// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". + /// If unset, the previous progress message(if any) is still valid. /// [Optional] public string? Message { get; init; } @@ -91,8 +94,8 @@ public WorkDoneProgressBegin() : base(WorkDoneProgressKind.Begin) /// /// Controls if a cancel button should show to allow the user to cancel the - /// long running operation. Clients that don't support cancellation are allowed - /// to ignore the setting. + /// long running operation. Clients that don't support cancellation are + /// allowed to ignore the setting. /// [Optional] public bool Cancellable { get; init; } @@ -103,7 +106,7 @@ public WorkDoneProgressBegin() : base(WorkDoneProgressKind.Begin) /// to ignore the `percentage` value in subsequent in report notifications. /// /// The value should be steadily rising. Clients are free to ignore values - /// that are not following this rule. + /// that are not following this rule. The value range is [0, 100] /// /// /// in the LSP spec @@ -137,11 +140,11 @@ public WorkDoneProgressReport() : base(WorkDoneProgressKind.Report) } /// - /// Controls enablement state of a cancel button. This property is only valid if a cancel - /// button got requested in the `WorkDoneProgressStart` payload. + /// Controls enablement state of a cancel button. This property is only valid + /// if a cancel button got requested in the `WorkDoneProgressStart` payload. /// - /// Clients that don't support cancellation or don't support control the button's - /// enablement state are allowed to ignore the setting. + /// Clients that don't support cancellation or don't support control the + /// button's enablement state are allowed to ignore the setting. /// [Optional] public bool Cancellable { get; set; } @@ -152,7 +155,7 @@ public WorkDoneProgressReport() : base(WorkDoneProgressKind.Report) /// to ignore the `percentage` value in subsequent in report notifications. /// /// The value should be steadily rising. Clients are free to ignore values - /// that are not following this rule. + /// that are not following this rule. The value range is [0, 100] /// /// /// in the LSP spec diff --git a/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs b/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs index 8cd9eef48..fe48f3cef 100644 --- a/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs +++ b/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs @@ -39,6 +39,12 @@ namespace Client.Capabilities [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.DidChangeWatchedFiles))] public partial class DidChangeWatchedFilesCapability : DynamicCapability { + /// + /// Whether the client has support for relative patterns + /// or not. + /// + [Optional] + public bool? RelativePatternSupport { get; init; } } } } diff --git a/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs b/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs index 7778d79dc..7626390d5 100644 --- a/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs +++ b/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using MediatR; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Client; @@ -30,7 +31,7 @@ public partial record SymbolInformationParams : IPartialItemsRequest public string Query { get; init; } } - + /// /// The parameters of a Workspace Symbol Request. /// @@ -121,13 +122,6 @@ public partial record WorkspaceSymbol : IRequest [Optional] public Container? Tags { get; set; } - /// - /// The location of this symbol. - /// - /// See also `SymbolInformation.location`. - /// - public LocationOrFileLocation Location { get; set; } - /// /// The name of the symbol containing this symbol. This information is for /// user interface purposes (e.g. to render a qualifier in the user interface @@ -137,6 +131,21 @@ public partial record WorkspaceSymbol : IRequest [Optional] public string? ContainerName { get; set; } + /// + /// The location of this symbol. Whether a server is allowed to + /// return a location without a range depends on the client + /// capability `workspace.symbol.resolveSupport`. + /// + /// See also `SymbolInformation.location`. + /// + public LocationOrFileLocation Location { get; set; } + + /// + /// A data entry field that is preserved on a workspace symbol between a + /// workspace symbol request and a workspace symbol resolve request. + /// + public JToken? Data { get; set; } + private string DebuggerDisplay => $"[{Kind}@{Location}] {Name}"; /// diff --git a/src/Protocol/Models/CreateFile.cs b/src/Protocol/Models/CreateFile.cs index 4ddfce1cc..76990d791 100644 --- a/src/Protocol/Models/CreateFile.cs +++ b/src/Protocol/Models/CreateFile.cs @@ -18,13 +18,13 @@ public record CreateFile : IFile public DocumentUri Uri { get; init; } = null!; /// - /// Additional Options + /// Additional options /// [Optional] public CreateFileOptions? Options { get; init; } /// - /// An optional annotation describing the operation. + /// An optional annotation identifier describing the operation. /// /// @since 3.16.0 /// diff --git a/src/Protocol/Models/DeleteFile.cs b/src/Protocol/Models/DeleteFile.cs index 5a9438caf..c1ebc4caf 100644 --- a/src/Protocol/Models/DeleteFile.cs +++ b/src/Protocol/Models/DeleteFile.cs @@ -18,13 +18,13 @@ public record DeleteFile : IFile public DocumentUri Uri { get; init; } = null!; /// - /// Delete Options. + /// Delete options. /// [Optional] public DeleteFileOptions? Options { get; init; } /// - /// An optional annotation describing the operation. + /// An optional annotation identifier describing the operation. /// /// @since 3.16.0 /// diff --git a/src/Protocol/Models/Diagnostic.cs b/src/Protocol/Models/Diagnostic.cs index b8bac7195..b61a463ff 100644 --- a/src/Protocol/Models/Diagnostic.cs +++ b/src/Protocol/Models/Diagnostic.cs @@ -26,7 +26,7 @@ public partial record Diagnostic : ICanHaveData public DiagnosticSeverity? Severity { get; init; } /// - /// The diagnostic's code. Can be omitted. + /// The diagnostic's code, which might appear in the user interface. /// [Optional] public DiagnosticCode? Code { get; init; } @@ -67,8 +67,11 @@ public partial record Diagnostic : ICanHaveData public Container? RelatedInformation { get; init; } /// - /// A data entry field that is preserved on a code lens item between - /// a code lens and a code lens resolve request. + /// A data entry field that is preserved between a + /// `textDocument/publishDiagnostics` notification and + /// `textDocument/codeAction` request. + /// + /// @since 3.16.0 /// [Optional] public JToken? Data { get; init; } diff --git a/src/Protocol/Models/FailureHandlingKind.cs b/src/Protocol/Models/FailureHandlingKind.cs index b9157d2fb..dfcf36fde 100644 --- a/src/Protocol/Models/FailureHandlingKind.cs +++ b/src/Protocol/Models/FailureHandlingKind.cs @@ -8,8 +8,9 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models public enum FailureHandlingKind { /// - /// Applying the workspace change is simply aborted if one of the changes provided - /// fails. All operations executed before the failing operation stay executed. + /// Applying the workspace change is simply aborted if one of the changes + /// provided fails. All operations executed before the failing operation + /// stay executed. /// [EnumMember(Value = "abort")] Abort, @@ -20,9 +21,9 @@ public enum FailureHandlingKind [EnumMember(Value = "transactional")] Transactional, /// - /// If the workspace edit contains only textual file changes they are executed transactional. - /// If resource changes (create, rename or delete file) are part of the change the failure - /// handling strategy is abort. + /// If the workspace edit contains only textual file changes they are + /// executed transactional. If resource changes (create, rename or delete + /// file) are part of the change the failure handling strategy is abort. /// [EnumMember(Value = "textOnlyTransactional")] TextOnlyTransactional, diff --git a/src/Protocol/Models/FileSystemWatcher.cs b/src/Protocol/Models/FileSystemWatcher.cs index 96ca17de4..3c13bae03 100644 --- a/src/Protocol/Models/FileSystemWatcher.cs +++ b/src/Protocol/Models/FileSystemWatcher.cs @@ -6,17 +6,12 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models public record FileSystemWatcher { /// - /// The glob pattern to watch. + /// The glob pattern to watch. See + /// for more detail. /// - /// Glob patterns can have the following syntax: - /// - `*` to match one or more characters in a path segment - /// - `?` to match on one character in a path segment - /// - `**` to match any number of path segments, including none - /// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) - /// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) - /// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) + /// @since 3.17.0 support for relative patterns. /// - public string GlobPattern { get; init; } = null!; + public GlobPattern GlobPattern { get; init; } /// /// The kind of events of interest. If omitted it defaults diff --git a/src/Protocol/Models/GlobPattern.cs b/src/Protocol/Models/GlobPattern.cs new file mode 100644 index 000000000..ff5672885 --- /dev/null +++ b/src/Protocol/Models/GlobPattern.cs @@ -0,0 +1,61 @@ +using System.Diagnostics; +using Newtonsoft.Json; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + /// + /// The glob pattern. Either a string pattern or a relative pattern. + /// + /// @since 3.17.0 + /// + [JsonConverter(typeof(GlobPatternConverter))] + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public record GlobPattern + { + public GlobPattern(string value) => Pattern = value; + + public GlobPattern(RelativePattern value) => RelativePattern = value; + + /// + /// The glob pattern to watch relative to the base path. Glob patterns can have + /// the following syntax: + /// - `*` to match one or more characters in a path segment + /// - `?` to match on one character in a path segment + /// - `**` to match any number of path segments, including none + /// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript + /// and JavaScript files) + /// - `[]` to declare a range of characters to match in a path segment + /// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + /// - `[!...]` to negate a range of characters to match in a path segment + /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, + /// but not `example.0`) + /// + /// @since 3.17.0 + /// + public string? Pattern { get; } + public bool HasPattern => RelativePattern is null; + + /// + /// A relative pattern is a helper to construct glob patterns that are matched + /// relatively to a base URI. The common value for a `baseUri` is a workspace + /// folder root, but it can be another absolute URI as well. + /// + /// @since 3.17.0 + /// + public RelativePattern? RelativePattern { get; } + public bool HasRelativePattern => RelativePattern is { }; + + public static implicit operator GlobPattern?(string? value) => + value is null ? null : new GlobPattern(value); + + public static implicit operator GlobPattern?(RelativePattern value) => + value is null ? null : new GlobPattern(value); + + private string DebuggerDisplay => + $"{( HasPattern ? Pattern : HasRelativePattern ? RelativePattern : string.Empty )}"; + + /// + public override string ToString() => DebuggerDisplay; + } +} diff --git a/src/Protocol/Models/IPartialResultParams.cs b/src/Protocol/Models/IPartialResultParams.cs index 3dedcf965..0e741f6a4 100644 --- a/src/Protocol/Models/IPartialResultParams.cs +++ b/src/Protocol/Models/IPartialResultParams.cs @@ -5,8 +5,8 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models public interface IPartialResultParams { /// - /// An optional token that a server can use to report partial results (e.g. streaming) to - /// the client. + /// An optional token that a server can use to report partial results (e.g. + /// streaming) to the client. /// [Optional] ProgressToken? PartialResultToken { get; init; } diff --git a/src/Protocol/Models/Location.cs b/src/Protocol/Models/Location.cs index 29814a3dd..2d1179028 100644 --- a/src/Protocol/Models/Location.cs +++ b/src/Protocol/Models/Location.cs @@ -13,7 +13,7 @@ public record Location public DocumentUri Uri { get; init; } = null!; /// - /// The range in side the document given by the uri + /// The range inside the document given by the uri /// public Range Range { get; init; } = null!; diff --git a/src/Protocol/Models/LocationLink.cs b/src/Protocol/Models/LocationLink.cs index 506b4a7da..7eb558588 100644 --- a/src/Protocol/Models/LocationLink.cs +++ b/src/Protocol/Models/LocationLink.cs @@ -7,8 +7,8 @@ public record LocationLink /// /// Span of the origin of this link. /// - /// Used as the underlined span for mouse interaction. Defaults to the word range at - /// the mouse position. + /// Used as the underlined span for mouse interaction. Defaults to the word + /// range at the mouse position. /// [Optional] public Range? OriginSelectionRange { get; init; } @@ -19,15 +19,17 @@ public record LocationLink public DocumentUri TargetUri { get; init; } = null!; /// - /// The full target range of this link. If the target for example is a symbol then target range is the - /// range enclosing this symbol not including leading/trailing whitespace but everything else - /// like comments. This information is typically used to highlight the range in the editor. + /// The full target range of this link. If the target for example is a symbol + /// then target range is the range enclosing this symbol not including + /// leading/trailing whitespace but everything else like comments. This + /// information is typically used to highlight the range in the editor. /// public Range TargetRange { get; init; } = null!; /// - /// The range that should be selected and revealed when this link is being followed, e.g the name of a function. - /// Must be contained by the the `targetRange`. See also `DocumentSymbol#range` + /// The range that should be selected and revealed when this link is being + /// followed, e.g the name of a function. Must be contained by the the + /// `targetRange`. See also `DocumentSymbol#range` /// public Range TargetSelectionRange { get; init; } = null!; } diff --git a/src/Protocol/Models/OptionalVersionedTextDocumentIdentifier.cs b/src/Protocol/Models/OptionalVersionedTextDocumentIdentifier.cs index 9f41c54f3..8f3e1e49c 100644 --- a/src/Protocol/Models/OptionalVersionedTextDocumentIdentifier.cs +++ b/src/Protocol/Models/OptionalVersionedTextDocumentIdentifier.cs @@ -6,7 +6,15 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models public record OptionalVersionedTextDocumentIdentifier : TextDocumentIdentifier { /// - /// The version number of this document. + /// The version number of this document. If an optional versioned text document + /// identifier is sent from the server to the client and the file is not + /// open in the editor(the server has not received an open notification + /// before) the server can send `null` to indicate that the version is + /// known and the content on disk is the master(as specified with document + /// content ownership). + /// + /// The version number of a document will increase after each change, + /// including undo/redo.The number doesn't need to be consecutive. /// public int? Version { get; init; } diff --git a/src/Protocol/Models/Position.cs b/src/Protocol/Models/Position.cs index 0a15facc0..696039019 100644 --- a/src/Protocol/Models/Position.cs +++ b/src/Protocol/Models/Position.cs @@ -24,7 +24,11 @@ public Position(int line, int character) public int Line { get; set; } /// - /// Character offset on a line in a document (zero-based). + /// Character offset on a line in a document (zero-based). The meaning of this + /// offset is determined by the negotiated `PositionEncodingKind`. + /// + /// If the character value is greater than the line length it defaults back + /// to the line length. /// /// /// in the LSP spec diff --git a/src/Protocol/Models/PositionEncodingKind.cs b/src/Protocol/Models/PositionEncodingKind.cs index 8e2495a02..2718ed784 100644 --- a/src/Protocol/Models/PositionEncodingKind.cs +++ b/src/Protocol/Models/PositionEncodingKind.cs @@ -3,7 +3,8 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; /// -/// A set of predefined position encoding kinds. +/// A type indicating how positions are encoded, +/// specifically what column offsets mean. /// /// @since 3.17.0 /// @@ -11,7 +12,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Models; public readonly partial struct PositionEncodingKind { /// - /// Character offsets count UTF-8 code units. + /// Character offsets count UTF-8 code units (e.g bytes). /// public static PositionEncodingKind UTF8 = new("utf-8"); diff --git a/src/Protocol/Models/RelativePattern.cs b/src/Protocol/Models/RelativePattern.cs new file mode 100644 index 000000000..66b8e6686 --- /dev/null +++ b/src/Protocol/Models/RelativePattern.cs @@ -0,0 +1,36 @@ +using System.Diagnostics; +using OmniSharp.Extensions.LanguageServer.Protocol.Generation; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + /// + /// A relative pattern is a helper to construct glob patterns that are matched + /// relatively to a base URI. The common value for a `baseUri` is a workspace + /// folder root, but it can be another absolute URI as well. + /// + /// @since 3.17.0 + /// + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + [GenerateContainer] + public record RelativePattern + { + /// + /// A workspace folder or a base URI to which this pattern will be matched + /// against relatively. + /// + public WorkspaceFolderOrUri BaseUri { get; init; } = null!; + + /// + /// The actual glob pattern; + /// + public string Pattern { get; init; } = null!; + + private string DebuggerDisplay => $"{{{BaseUri} {Pattern}}}"; + + /// + public override string ToString() + { + return DebuggerDisplay; + } + } +} diff --git a/src/Protocol/Models/RenameFile.cs b/src/Protocol/Models/RenameFile.cs index 4964dd22a..187149468 100644 --- a/src/Protocol/Models/RenameFile.cs +++ b/src/Protocol/Models/RenameFile.cs @@ -23,13 +23,13 @@ public record RenameFile : IFile public DocumentUri NewUri { get; init; } = null!; /// - /// Rename Options. + /// Rename options. /// [Optional] public RenameFileOptions? Options { get; init; } /// - /// An optional annotation describing the operation. + /// An optional annotation identifier describing the operation. /// /// @since 3.16.0 /// diff --git a/src/Protocol/Models/TextDocumentItem.cs b/src/Protocol/Models/TextDocumentItem.cs index 0a51cedf3..3878e1011 100644 --- a/src/Protocol/Models/TextDocumentItem.cs +++ b/src/Protocol/Models/TextDocumentItem.cs @@ -11,7 +11,7 @@ public record TextDocumentItem : TextDocumentIdentifier public string LanguageId { get; init; } = null!; /// - /// The version number of this document (it will strictly increase after each + /// The version number of this document (it will increase after each /// change, including undo/redo). /// public int? Version { get; init; } diff --git a/src/Protocol/Models/TextEdit.cs b/src/Protocol/Models/TextEdit.cs index 4b6ac9fff..e736b5cd0 100644 --- a/src/Protocol/Models/TextEdit.cs +++ b/src/Protocol/Models/TextEdit.cs @@ -180,7 +180,8 @@ public record ChangeAnnotation public record ChangeAnnotationIdentifier { /// - /// An optional annotation identifer describing the operation. + /// An identifier referring to a change annotation managed by a workspace + /// edit. /// /// @since 3.16.0 /// @@ -207,7 +208,7 @@ public static implicit operator ChangeAnnotationIdentifier(string identifier) public record AnnotatedTextEdit : TextEdit { /// - /// The actual annotation + /// The actual annotation identifier. /// public ChangeAnnotationIdentifier AnnotationId { get; init; } = null!; diff --git a/src/Protocol/Models/VersionedTextDocumentIdentifier.cs b/src/Protocol/Models/VersionedTextDocumentIdentifier.cs index 3e31e07c0..599070d5a 100644 --- a/src/Protocol/Models/VersionedTextDocumentIdentifier.cs +++ b/src/Protocol/Models/VersionedTextDocumentIdentifier.cs @@ -7,6 +7,9 @@ public partial record VersionedTextDocumentIdentifier : TextDocumentIdentifier { /// /// The version number of this document. + /// + /// The version number of a document will increase after each change, + /// including undo/redo.The number doesn't need to be consecutive. /// public int Version { get; init; } diff --git a/src/Protocol/Models/WorkspaceEdit.cs b/src/Protocol/Models/WorkspaceEdit.cs index 182f524ef..a65cc41ec 100644 --- a/src/Protocol/Models/WorkspaceEdit.cs +++ b/src/Protocol/Models/WorkspaceEdit.cs @@ -12,16 +12,19 @@ public record WorkspaceEdit public IDictionary>? Changes { get; init; } /// - /// An array of `TextDocumentEdit`s to express changes to n different text documents - /// where each text document edit addresses a specific version of a text document. - /// where each text document edit addresses a specific version of a text document. Or it can contain - /// above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations. + /// Depending on the client capability + /// `workspace.workspaceEdit.resourceOperations` document changes are either + /// an array of `TextDocumentEdit`s to express changes to n different text + /// documents where each text document edit addresses a specific version of + /// a text document. Or it can contain above `TextDocumentEdit`s mixed with + /// create, rename and delete file / folder operations. /// /// Whether a client supports versioned document edits is expressed via /// `WorkspaceCapability.workspaceEdit.documentChanges`. /// - /// If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then - /// only plain `TextEdit`s using the `changes` property are supported. + /// If a client neither supports `documentChanges` nor + /// `workspace.workspaceEdit.resourceOperations` then only plain `TextEdit`s + /// using the `changes` property are supported. /// [Optional] public Container? DocumentChanges { get; init; } diff --git a/src/Protocol/Models/WorkspaceFolderOrUri.cs b/src/Protocol/Models/WorkspaceFolderOrUri.cs new file mode 100644 index 000000000..4895c8458 --- /dev/null +++ b/src/Protocol/Models/WorkspaceFolderOrUri.cs @@ -0,0 +1,32 @@ +using System.Diagnostics; +using Newtonsoft.Json; +using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Models +{ + [JsonConverter(typeof(WorkspaceFolderOrUriConverter))] + [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] + public record WorkspaceFolderOrUri + { + public WorkspaceFolderOrUri(WorkspaceFolder value) => WorkspaceFolder = value; + + public WorkspaceFolderOrUri(DocumentUri value) => Uri = value; + + public WorkspaceFolder? WorkspaceFolder { get; } + public bool HasWorkspaceFolder => WorkspaceFolder is { }; + public DocumentUri? Uri { get; } + public bool HasUri => Uri is { }; + + public static implicit operator WorkspaceFolderOrUri?(WorkspaceFolder value) => + value is null ? null : new WorkspaceFolderOrUri(value); + + public static implicit operator WorkspaceFolderOrUri?(DocumentUri value) => + value is null ? null : new WorkspaceFolderOrUri(value); + + private string DebuggerDisplay => + $"{( HasWorkspaceFolder ? WorkspaceFolder : HasUri ? Uri : string.Empty )}"; + + /// + public override string ToString() => DebuggerDisplay; + } +} diff --git a/src/Protocol/Serialization/Converters/GlobPatternConverter.cs b/src/Protocol/Serialization/Converters/GlobPatternConverter.cs new file mode 100644 index 000000000..8b05f1b5b --- /dev/null +++ b/src/Protocol/Serialization/Converters/GlobPatternConverter.cs @@ -0,0 +1,40 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters +{ + internal class GlobPatternConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, GlobPattern value, JsonSerializer serializer) + { + if (value.HasPattern) + { + writer.WriteValue(value.Pattern); + } + else + { + serializer.Serialize(writer, value.RelativePattern); + } + } + + public override GlobPattern ReadJson( + JsonReader reader, Type objectType, GlobPattern existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + if (reader.TokenType == JsonToken.String) + { + return new GlobPattern(( reader.Value as string )!); + } + + if (reader.TokenType == JsonToken.StartObject) + { + return new GlobPattern(JObject.Load(reader).ToObject()); + } + + return new GlobPattern(""); + } + + public override bool CanRead => true; + } +} diff --git a/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs b/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs new file mode 100644 index 000000000..9e9ab992c --- /dev/null +++ b/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs @@ -0,0 +1,46 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; + +namespace OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters +{ + internal class WorkspaceFolderOrUriConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, WorkspaceFolderOrUri value, JsonSerializer serializer) + { + if (value.HasWorkspaceFolder) + { + serializer.Serialize(writer, value.WorkspaceFolder); + } + else + { + serializer.Serialize(writer, value.Uri); + } + } + + public override WorkspaceFolderOrUri ReadJson( + JsonReader reader, Type objectType, WorkspaceFolderOrUri existingValue, bool hasExistingValue, JsonSerializer serializer + ) + { + if (reader.TokenType == JsonToken.String) + { + return new WorkspaceFolderOrUri(( reader.Value as string )!); + } + + if (reader.TokenType == JsonToken.StartObject) + { + var obj = JObject.Load(reader); + if (obj.ContainsKey("name")) + { + return new WorkspaceFolderOrUri(obj.ToObject()); + } + + return new WorkspaceFolderOrUri(obj.ToObject()); + } + + return new WorkspaceFolderOrUri(""); + } + + public override bool CanRead => true; + } +} From 53a8f0847f12d2683d013e58d25344f5f7ccf8d5 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 13 Sep 2023 23:22:25 -0700 Subject: [PATCH 150/647] Update test snapshots --- test/Dap.Tests/FoundationTests.cs | 18 ++++++++++-------- ...Source.00AssemblyCapabilityKeys.verified.cs | 1 + ...01Test0_SymbolInformationParams.verified.cs | 1 + ...e.02Test0_WorkspaceSymbolParams.verified.cs | 1 + ...ource.04SymbolInformationParams.verified.cs | 1 + ...ype_As_Source.05WorkspaceSymbol.verified.cs | 1 + ..._Source.06WorkspaceSymbolParams.verified.cs | 1 + ...kspaceSymbolRegistrationOptions.verified.cs | 1 + test/Lsp.Tests/FoundationTests.cs | 10 +++++----- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/test/Dap.Tests/FoundationTests.cs b/test/Dap.Tests/FoundationTests.cs index 3f5a70897..f592e298a 100644 --- a/test/Dap.Tests/FoundationTests.cs +++ b/test/Dap.Tests/FoundationTests.cs @@ -140,7 +140,7 @@ public void HandlersShouldMatchParamsMethodAttribute(Type type) lhs.Direction.Should().Be(rhs.Direction, $"{type.FullName} direction does not match {paramsType.FullName}"); } - [Theory(DisplayName = "Handler interfaces should have a abstract class")] + [Theory(DisplayName = "Handler interfaces should have an abstract class")] [ClassData(typeof(TypeHandlerData))] public void HandlersShouldAbstractClass(IHandlerTypeDescriptor descriptor) { @@ -226,17 +226,19 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection( .Distinct() .ToHashSet(); - var expectedEventRegistries = descriptor.Direction switch { - Direction.ClientToServer => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ) }, - Direction.ServerToClient => new (string type, Func matcher)[] { ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) }, + var expectedEventRegistries = descriptor.Direction switch + { + Direction.ClientToServer => new (string type, Func matcher)[] { ("Server", info => info.ParameterType.Name.EndsWith("ServerRegistry")) }, + Direction.ServerToClient => new (string type, Func matcher)[] { ("Client", info => info.ParameterType.Name.EndsWith("ClientRegistry")) }, Direction.Bidirectional => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ), ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) }, _ => throw new NotImplementedException(descriptor.HandlerType.FullName) }; - var expectedRequestHandlers = descriptor.Direction switch { - Direction.ClientToServer => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("Client") ) }, - Direction.ServerToClient => new (string type, Func matcher)[] { ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) }, + var expectedRequestHandlers = descriptor.Direction switch + { + Direction.ClientToServer => new (string type, Func matcher)[] { ("Server", info => info.ParameterType.Name.EndsWith("Client")) }, + Direction.ServerToClient => new (string type, Func matcher)[] { ("Client", info => info.ParameterType.Name.EndsWith("Server")) }, Direction.Bidirectional => new (string type, Func matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("Client") ), ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) }, _ => throw new NotImplementedException(descriptor.HandlerType.FullName) @@ -526,7 +528,7 @@ private static Type GetExtensionClass(IHandlerTypeDescriptor descriptor) { var name = GetExtensionClassName(descriptor); return descriptor.HandlerType.Assembly.GetExportedTypes() - .FirstOrDefault(z => z.IsClass && z.IsAbstract && ( z.Name == name || z.Name == name + "Base" )); + .FirstOrDefault(z => z.IsClass && z.IsAbstract && (z.Name == name || z.Name == name + "Base")); } private static string GetOnMethodName(IHandlerTypeDescriptor descriptor) => "On" + SpecialCasedHandlerName(descriptor); diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs index e65f6034a..52a6b6c98 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs @@ -1,5 +1,6 @@ ο»Ώ//HintName: AssemblyCapabilityKeys.cs using MediatR; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs index 6e5bc00cc..929558a0a 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs @@ -2,6 +2,7 @@ #nullable enable using System.Diagnostics; using MediatR; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Client; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs index 02b1bdf8e..04c4234af 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs @@ -2,6 +2,7 @@ #nullable enable using System.Diagnostics; using MediatR; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Client; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs index 0e54434af..989abb90e 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs @@ -1,6 +1,7 @@ ο»Ώ//HintName: SymbolInformationParams.cs using MediatR; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs index 84e9927ec..e705bf400 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs @@ -1,6 +1,7 @@ ο»Ώ//HintName: WorkspaceSymbol.cs using MediatR; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs index 887ecfa47..41b4deebf 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs @@ -1,6 +1,7 @@ ο»Ώ//HintName: WorkspaceSymbolParams.cs using MediatR; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol; using OmniSharp.Extensions.DebugAdapter.Protocol.Events; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs index 729e7fe59..c69e87145 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs @@ -1,6 +1,7 @@ ο»Ώ//HintName: WorkspaceSymbolRegistrationOptions.cs using System.Diagnostics; using MediatR; +using Newtonsoft.Json.Linq; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; using OmniSharp.Extensions.LanguageServer.Protocol.Client; diff --git a/test/Lsp.Tests/FoundationTests.cs b/test/Lsp.Tests/FoundationTests.cs index 9d728f846..a46838a9c 100644 --- a/test/Lsp.Tests/FoundationTests.cs +++ b/test/Lsp.Tests/FoundationTests.cs @@ -142,7 +142,7 @@ public void Debugger_Display_Should_Not_Throw(Type type) { var instance = Activator.CreateInstance(type); var property = type.GetProperty("DebuggerDisplay", BindingFlags.NonPublic | BindingFlags.Instance)!; - var a1 = () => ( property.GetValue(instance) as string )!; + var a1 = () => (property.GetValue(instance) as string)!; var a2 = () => instance!.ToString()!; a1.Should().NotThrow().And.NotBeNull(); @@ -205,7 +205,7 @@ public void Registration_Converters_Should_Have_THe_Same_Properties(Type type) source.Should().Contain(destination); } - [Theory(DisplayName = "Handler interfaces should have a abstract class")] + [Theory(DisplayName = "Handler interfaces should have an class")] [ClassData(typeof(TypeHandlerData))] public void HandlersShouldAbstractClass(ILspHandlerTypeDescriptor descriptor) { @@ -392,7 +392,7 @@ Func ForAnyParameter(Func m) var returns = ForAnyParameter(info => info.ParameterType.GetGenericArguments().LastOrDefault() == returnType); var isAction = ForAnyParameter(info => info.ParameterType.Name.StartsWith(nameof(Action))); var isFunc = ForAnyParameter(info => info.ParameterType.Name.StartsWith("Func")); - + var takesParameter = ForAnyParameter(info => info.ParameterType.GetGenericArguments().FirstOrDefault() == descriptor.ParamsType); var takesCapability = ForAnyParameter(info => info.ParameterType.GetGenericArguments().Skip(1).FirstOrDefault() == descriptor.CapabilityType); @@ -772,7 +772,7 @@ public TypeHandlerExtensionData() foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes .Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z)) .Where(z => !z.Name.EndsWith("Manager")) - .Except(new[] { typeof(ITextDocumentSyncHandler) , typeof(INotebookDocumentSyncHandler)}) + .Except(new[] { typeof(ITextDocumentSyncHandler), typeof(INotebookDocumentSyncHandler) }) ) { if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue; @@ -818,7 +818,7 @@ private static Type GetExtensionClass(IHandlerTypeDescriptor descriptor) { var name = GetExtensionClassName(descriptor); return descriptor.HandlerType.Assembly.GetExportedTypes() - .FirstOrDefault(z => z.IsClass && z.IsAbstract && ( z.Name == name || z.Name == name + "Base" ))!; + .FirstOrDefault(z => z.IsClass && z.IsAbstract && (z.Name == name || z.Name == name + "Base"))!; } private static string GetOnMethodName(IHandlerTypeDescriptor descriptor) From bed3f73118991ec8f5b9fb3bc8b4c7d50e133165 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 17:52:47 +0000 Subject: [PATCH 151/647] Update codecov/codecov-action action to v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b93ea81aa..9c9be2115 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: run: | dotnet nuke Pack --skip - name: 🐿 Publish Coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: name: 'actions-${{ matrix.os }}' - name: 🏺 Publish logs From d8cc8dd36b60044401bf986d1f5b96cc3b736ea7 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 15 Sep 2023 10:40:17 -0700 Subject: [PATCH 152/647] Move to codecov-action v4 beta2 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b93ea81aa..ec11fff2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@v4.0.0 with: clean: 'false' fetch-depth: '0' @@ -117,7 +117,7 @@ jobs: run: | dotnet nuke Pack --skip - name: 🐿 Publish Coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4.0.0-beta.2 with: name: 'actions-${{ matrix.os }}' - name: 🏺 Publish logs diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 48c4ed612..5bdb84908 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@v4.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index da4198773..279a744f2 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@v4.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index dd03f5704..6b8e1de71 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@v4.0.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index ebdb54332..f881a2ada 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@v4.0.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 57a19e0ac52fe148af40f7e6b353938411e9476d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 18:09:11 +0000 Subject: [PATCH 153/647] Update dependency Serilog.Extensions.Logging to v7 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 201d01aac..fa5080f68 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From d76b8e34a7b05ad0ac78b25deb69eee7e0175709 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 15 Sep 2023 13:26:56 -0700 Subject: [PATCH 154/647] Install the pinned dotnet SDK --- .github/workflows/draft-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 279a744f2..b4dc88887 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -18,6 +18,8 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-dotnet@v3 + - name: Fetch all history for all tags and branches run: git fetch --prune From b47873987cb1705de9834dfe4fa08ec5186aa14f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 15 Sep 2023 13:41:01 -0700 Subject: [PATCH 155/647] Fix release draft action permissions --- .github/workflows/draft-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index b4dc88887..e313cf318 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -11,6 +11,9 @@ on: jobs: create_milestone_and_draft_release: + permissions: + # write permission is required to create a github release + contents: write runs-on: ubuntu-latest steps: - name: Checkout @@ -54,5 +57,5 @@ jobs: omitNameDuringUpdate: true name: 'v${{ steps.gitversion.outputs.majorMinorPatch }}' tag: 'v${{ steps.gitversion.outputs.majorMinorPatch }}' - token: ${{ secrets.OMNISHARP_BOT_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} commit: ${{ github.base_ref }} From b2e3241e42f121eaf8990a065eb0cc14cf5d8d73 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 20:41:42 +0000 Subject: [PATCH 156/647] Update dependency Microsoft.NET.Test.Sdk to v17.7.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 201d01aac..a3b0e8285 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From c52832e98740edf3854ed3cc0e159b83fe114bd9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 22:09:23 +0000 Subject: [PATCH 157/647] Update dependency Newtonsoft.Json to v13.0.3 --- Directory.Packages.props | 2 +- benchmarks/Pipeline/Pipeline.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a3b0e8285..60f4d5fb7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,7 +35,7 @@ - + diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index dd0656d2e..1012208df 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -7,7 +7,7 @@ - + From 5786aab892b3c8af6a8661b0441af5b00552630b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 22:08:52 +0000 Subject: [PATCH 158/647] Update verify --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a3b0e8285..44f0365fe 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,8 +40,8 @@ - - + + From 1bca9d50f2f8477cb8a136a5744dcd3e59644dfa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 09:23:47 +0000 Subject: [PATCH 159/647] Update dependency XunitXml.TestLogger to v3.1.17 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 44f0365fe..526a8641d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -46,7 +46,7 @@ - + From c376dcb352ac0cde53930acc507f022c00617758 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:14:21 +0000 Subject: [PATCH 160/647] Update dependency Nerdbank.Streams to v2.10.69 --- Directory.Packages.props | 2 +- benchmarks/Pipeline/Pipeline.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 44f0365fe..d195b6f32 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index dd0656d2e..5d136c884 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -9,7 +9,7 @@ - + From 7363bfd9b7d9e93bbcb16afdada0753f78c6d8a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:14:28 +0000 Subject: [PATCH 161/647] Update dependency Snapper to v2.4.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 44f0365fe..ac27292a7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -55,7 +55,7 @@ - + From 7112899acfdbe361f2168dbd384daae526220c6c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:15:15 +0000 Subject: [PATCH 162/647] Update dependency Microsoft.Reactive.Testing to v6 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 44f0365fe..73f8731f2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -52,7 +52,7 @@ - + From 3c4448eb9dedd5c996d1d32d4b112e6bb8856352 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 20 Sep 2023 07:34:38 -0700 Subject: [PATCH 163/647] Pass serializer when calling ToObject --- .../Features/Document/CompletionFeature.cs | 2 +- .../Features/Document/InlayHintFeature.cs | 4 ++-- .../Features/Document/InlineValueFeature.cs | 8 ++++---- src/Protocol/Models/RangeOrEditRange.cs | 4 ++-- .../Converters/CommandOrCodeActionConverter.cs | 4 ++-- .../Converters/GlobPatternConverter.cs | 2 +- .../LocationOrFileLocationConverter.cs | 4 ++-- .../LocationOrLocationLinkConverter.cs | 4 ++-- .../RangeOrPlaceholderRangeConverter.cs | 6 +++--- .../SemanticTokensFullOrDeltaConverter.cs | 4 ++-- ...ticTokensFullOrDeltaPartialResultConverter.cs | 4 ++-- ...SymbolInformationOrDocumentSymbolConverter.cs | 4 ++-- .../Converters/TextEditConverter.cs | 4 ++-- .../TextEditOrInsertReplaceEditConverter.cs | 4 ++-- .../Converters/ValueTupleContractResolver.cs | 2 +- .../WorkspaceEditDocumentChangeConverter.cs | 8 ++++---- .../Converters/WorkspaceFolderOrUriConverter.cs | 4 ++-- src/Server/LanguageServer.cs | 2 +- test/Generation.Tests/LspFeatureTests.cs | 2 +- test/Lsp.Integration.Tests/ExtensionTests.cs | 16 +++++++++++----- 20 files changed, 49 insertions(+), 43 deletions(-) diff --git a/src/Protocol/Features/Document/CompletionFeature.cs b/src/Protocol/Features/Document/CompletionFeature.cs index d3e2a8246..23b23698d 100644 --- a/src/Protocol/Features/Document/CompletionFeature.cs +++ b/src/Protocol/Features/Document/CompletionFeature.cs @@ -509,7 +509,7 @@ public override void WriteJson(JsonWriter writer, CompletionList? value, JsonSer var items = result["items"].ToObject>(serializer); return new CompletionList(items, result["isIncomplete"]?.Value() ?? false) { - ItemDefaults = result["itemDefaults"]?.ToObject() + ItemDefaults = result["itemDefaults"]?.ToObject(serializer) }; } diff --git a/src/Protocol/Features/Document/InlayHintFeature.cs b/src/Protocol/Features/Document/InlayHintFeature.cs index 4fcb3544f..9747c018f 100644 --- a/src/Protocol/Features/Document/InlayHintFeature.cs +++ b/src/Protocol/Features/Document/InlayHintFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.Diagnostics; using MediatR; using Newtonsoft.Json; @@ -231,7 +231,7 @@ public override StringOrInlayHintLabelParts ReadJson( if (reader.TokenType == JsonToken.StartArray) { var result = JArray.Load(reader); - return new StringOrInlayHintLabelParts(result.ToObject>()); + return new StringOrInlayHintLabelParts(result.ToObject>(serializer)); } if (reader.TokenType == JsonToken.String) diff --git a/src/Protocol/Features/Document/InlineValueFeature.cs b/src/Protocol/Features/Document/InlineValueFeature.cs index 769806c78..0e014b027 100644 --- a/src/Protocol/Features/Document/InlineValueFeature.cs +++ b/src/Protocol/Features/Document/InlineValueFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Diagnostics; +using System.Diagnostics; using MediatR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -98,7 +98,7 @@ public override InlineValueBase ReadJson( { return new InlineValueText() { - Range = result["range"]!.ToObject()!, + Range = result["range"]!.ToObject(serializer)!, Text = result["text"]!.Value()! }; } @@ -107,7 +107,7 @@ public override InlineValueBase ReadJson( { return new InlineValueVariableLookup() { - Range = result["range"].ToObject()!, + Range = result["range"].ToObject(serializer)!, VariableName = result["variableName"]!.Value()!, CaseSensitiveLookup = result["caseSensitiveLookup"]?.Value() ?? false, }; @@ -115,7 +115,7 @@ public override InlineValueBase ReadJson( return new InlineValueEvaluatableExpression() { - Range = result["range"].ToObject()!, + Range = result["range"].ToObject(serializer)!, Expression = result["expression"]?.Value() }; } diff --git a/src/Protocol/Models/RangeOrEditRange.cs b/src/Protocol/Models/RangeOrEditRange.cs index 3f8dbcb5c..575ed6aa5 100644 --- a/src/Protocol/Models/RangeOrEditRange.cs +++ b/src/Protocol/Models/RangeOrEditRange.cs @@ -46,10 +46,10 @@ public override RangeOrEditRange ReadJson( var obj = JObject.Load(reader); if (obj.ContainsKey("insert")) { - return new RangeOrEditRange(obj.ToObject()); + return new RangeOrEditRange(obj.ToObject(serializer)); } - return new RangeOrEditRange(obj.ToObject()); + return new RangeOrEditRange(obj.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs b/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs index 078523c58..fc280f683 100644 --- a/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs +++ b/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs @@ -31,10 +31,10 @@ public override CommandOrCodeAction ReadJson(JsonReader reader, Type objectType, var command = result["command"]; if (command?.Type == JTokenType.String) { - return new CommandOrCodeAction(result.ToObject()); + return new CommandOrCodeAction(result.ToObject(serializer)); } - return new CommandOrCodeAction(result.ToObject()); + return new CommandOrCodeAction(result.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/GlobPatternConverter.cs b/src/Protocol/Serialization/Converters/GlobPatternConverter.cs index 8b05f1b5b..4a046fdea 100644 --- a/src/Protocol/Serialization/Converters/GlobPatternConverter.cs +++ b/src/Protocol/Serialization/Converters/GlobPatternConverter.cs @@ -29,7 +29,7 @@ public override GlobPattern ReadJson( if (reader.TokenType == JsonToken.StartObject) { - return new GlobPattern(JObject.Load(reader).ToObject()); + return new GlobPattern(JObject.Load(reader).ToObject(serializer)); } return new GlobPattern(""); diff --git a/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs b/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs index 01112e26a..806958524 100644 --- a/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs +++ b/src/Protocol/Serialization/Converters/LocationOrFileLocationConverter.cs @@ -19,10 +19,10 @@ public override LocationOrFileLocation ReadJson(JsonReader reader, Type objectTy var obj = JObject.Load(reader); if (obj.ContainsKey("range")) { - return new LocationOrFileLocation(obj.ToObject()); + return new LocationOrFileLocation(obj.ToObject(serializer)); } - return new LocationOrFileLocation(obj.ToObject()); + return new LocationOrFileLocation(obj.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/LocationOrLocationLinkConverter.cs b/src/Protocol/Serialization/Converters/LocationOrLocationLinkConverter.cs index 73dce0794..94b6fe911 100644 --- a/src/Protocol/Serialization/Converters/LocationOrLocationLinkConverter.cs +++ b/src/Protocol/Serialization/Converters/LocationOrLocationLinkConverter.cs @@ -20,10 +20,10 @@ public override LocationOrLocationLink ReadJson(JsonReader reader, Type objectTy var obj = JObject.Load(reader); if (obj.ContainsKey("uri")) { - return new LocationOrLocationLink(obj.ToObject()); + return new LocationOrLocationLink(obj.ToObject(serializer)); } - return new LocationOrLocationLink(obj.ToObject()); + return new LocationOrLocationLink(obj.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs b/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs index ff641aa77..ece6400fc 100644 --- a/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs +++ b/src/Protocol/Serialization/Converters/RangeOrPlaceholderRangeConverter.cs @@ -36,13 +36,13 @@ public override void WriteJson(JsonWriter writer, RangeOrPlaceholderRange? value { var obj = (JToken.ReadFrom(reader) as JObject)!; return obj.ContainsKey("placeholder") - ? new RangeOrPlaceholderRange(obj.ToObject()) + ? new RangeOrPlaceholderRange(obj.ToObject(serializer)) : obj.ContainsKey("defaultBehavior") ? new RangeOrPlaceholderRange( - obj.ToObject() + obj.ToObject(serializer) ) : new RangeOrPlaceholderRange( - obj.ToObject() + obj.ToObject(serializer) ); } diff --git a/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaConverter.cs b/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaConverter.cs index ac1aaf56f..4f0293439 100644 --- a/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaConverter.cs +++ b/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaConverter.cs @@ -30,10 +30,10 @@ public override SemanticTokensFullOrDelta ReadJson( var obj = JObject.Load(reader); if (obj.ContainsKey("data")) { - return new SemanticTokensFullOrDelta(obj.ToObject()); + return new SemanticTokensFullOrDelta(obj.ToObject(serializer)); } - return new SemanticTokensFullOrDelta(obj.ToObject()); + return new SemanticTokensFullOrDelta(obj.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaPartialResultConverter.cs b/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaPartialResultConverter.cs index 5da50c4e7..a32fed57a 100644 --- a/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaPartialResultConverter.cs +++ b/src/Protocol/Serialization/Converters/SemanticTokensFullOrDeltaPartialResultConverter.cs @@ -30,10 +30,10 @@ public override SemanticTokensFullOrDeltaPartialResult ReadJson( var obj = JObject.Load(reader); if (obj.ContainsKey("data")) { - return new SemanticTokensFullOrDeltaPartialResult(obj.ToObject()); + return new SemanticTokensFullOrDeltaPartialResult(obj.ToObject(serializer)); } - return new SemanticTokensFullOrDeltaPartialResult(obj.ToObject()); + return new SemanticTokensFullOrDeltaPartialResult(obj.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/SymbolInformationOrDocumentSymbolConverter.cs b/src/Protocol/Serialization/Converters/SymbolInformationOrDocumentSymbolConverter.cs index 7c813c962..a1c5ebfab 100644 --- a/src/Protocol/Serialization/Converters/SymbolInformationOrDocumentSymbolConverter.cs +++ b/src/Protocol/Serialization/Converters/SymbolInformationOrDocumentSymbolConverter.cs @@ -32,10 +32,10 @@ public override SymbolInformationOrDocumentSymbol ReadJson( // SymbolInformation has property location, DocumentSymbol does not. if (result["location"] != null) { - return new SymbolInformationOrDocumentSymbol(result.ToObject()); + return new SymbolInformationOrDocumentSymbol(result.ToObject(serializer)); } - return new SymbolInformationOrDocumentSymbol(result.ToObject()); + return new SymbolInformationOrDocumentSymbol(result.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/TextEditConverter.cs b/src/Protocol/Serialization/Converters/TextEditConverter.cs index 69929db95..5c180881a 100644 --- a/src/Protocol/Serialization/Converters/TextEditConverter.cs +++ b/src/Protocol/Serialization/Converters/TextEditConverter.cs @@ -31,7 +31,7 @@ public override TextEdit ReadJson(JsonReader reader, Type objectType, TextEdit e if (result["annotationId"] is { Type: JTokenType.String } annotation) { edit = new AnnotatedTextEdit() { - AnnotationId = annotation.ToObject() + AnnotationId = annotation.ToObject(serializer) }; } else @@ -41,7 +41,7 @@ public override TextEdit ReadJson(JsonReader reader, Type objectType, TextEdit e if (result["range"] is { Type: JTokenType.Object } range) { - edit = edit with { Range = range.ToObject()}; + edit = edit with { Range = range.ToObject(serializer)}; } if (result["newText"] is { Type: JTokenType.String } newText) diff --git a/src/Protocol/Serialization/Converters/TextEditOrInsertReplaceEditConverter.cs b/src/Protocol/Serialization/Converters/TextEditOrInsertReplaceEditConverter.cs index eaf924c05..249ec65d8 100644 --- a/src/Protocol/Serialization/Converters/TextEditOrInsertReplaceEditConverter.cs +++ b/src/Protocol/Serialization/Converters/TextEditOrInsertReplaceEditConverter.cs @@ -31,10 +31,10 @@ public override TextEditOrInsertReplaceEdit ReadJson(JsonReader reader, Type obj var command = result["insert"]; if (command?.Type == JTokenType.String) { - return new TextEditOrInsertReplaceEdit(result.ToObject()); + return new TextEditOrInsertReplaceEdit(result.ToObject(serializer)); } - return new TextEditOrInsertReplaceEdit(result.ToObject()); + return new TextEditOrInsertReplaceEdit(result.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/ValueTupleContractResolver.cs b/src/Protocol/Serialization/Converters/ValueTupleContractResolver.cs index 9df92004d..10323ab25 100644 --- a/src/Protocol/Serialization/Converters/ValueTupleContractResolver.cs +++ b/src/Protocol/Serialization/Converters/ValueTupleContractResolver.cs @@ -11,7 +11,7 @@ internal class ValueTupleContractResolver : JsonConverter<(T1, T2)> public override (T1, T2) ReadJson(JsonReader reader, Type objectType, (T1, T2) existingValue, bool hasExistingValue, JsonSerializer serializer) { var a = JArray.Load(reader); - return ( a.ToObject(), a.ToObject() ); + return ( a.ToObject(serializer), a.ToObject(serializer) ); } } } diff --git a/src/Protocol/Serialization/Converters/WorkspaceEditDocumentChangeConverter.cs b/src/Protocol/Serialization/Converters/WorkspaceEditDocumentChangeConverter.cs index c247adef3..ffb55b30e 100644 --- a/src/Protocol/Serialization/Converters/WorkspaceEditDocumentChangeConverter.cs +++ b/src/Protocol/Serialization/Converters/WorkspaceEditDocumentChangeConverter.cs @@ -26,17 +26,17 @@ public override WorkspaceEditDocumentChange ReadJson( switch (kind) { case "create": - return new WorkspaceEditDocumentChange(obj.ToObject()); + return new WorkspaceEditDocumentChange(obj.ToObject(serializer)); case "rename": - return new WorkspaceEditDocumentChange(obj.ToObject()); + return new WorkspaceEditDocumentChange(obj.ToObject(serializer)); case "delete": - return new WorkspaceEditDocumentChange(obj.ToObject()); + return new WorkspaceEditDocumentChange(obj.ToObject(serializer)); default: throw new NotSupportedException("Object with " + kind + " is not supported"); } } - return new WorkspaceEditDocumentChange(obj.ToObject()); + return new WorkspaceEditDocumentChange(obj.ToObject(serializer)); } public override bool CanRead => true; diff --git a/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs b/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs index 9e9ab992c..ee1facb2f 100644 --- a/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs +++ b/src/Protocol/Serialization/Converters/WorkspaceFolderOrUriConverter.cs @@ -32,10 +32,10 @@ public override WorkspaceFolderOrUri ReadJson( var obj = JObject.Load(reader); if (obj.ContainsKey("name")) { - return new WorkspaceFolderOrUri(obj.ToObject()); + return new WorkspaceFolderOrUri(obj.ToObject(serializer)); } - return new WorkspaceFolderOrUri(obj.ToObject()); + return new WorkspaceFolderOrUri(obj.ToObject(serializer)); } return new WorkspaceFolderOrUri(""); diff --git a/src/Server/LanguageServer.cs b/src/Server/LanguageServer.cs index 987229e84..1f6edb6c1 100644 --- a/src/Server/LanguageServer.cs +++ b/src/Server/LanguageServer.cs @@ -419,7 +419,7 @@ out GeneralClientCapabilities generalCapabilities { if (request.Capabilities.SelectToken(group.Key) is JObject capabilityData) { - var capability = capabilityData.ToObject(capabilityType) as ICapability; + var capability = capabilityData.ToObject(capabilityType, _serializer.JsonSerializer) as ICapability; _supportedCapabilities.Add(capability!); } } diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 50c7541a5..00b584610 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -358,7 +358,7 @@ public override StringOrOutlayHintLabelParts ReadJson( if (reader.TokenType == JsonToken.StartArray) { var result = JArray.Load(reader); - return new StringOrOutlayHintLabelParts(result.ToObject>()); + return new StringOrOutlayHintLabelParts(result.ToObject>(serializer)); } if (reader.TokenType == JsonToken.String) diff --git a/test/Lsp.Integration.Tests/ExtensionTests.cs b/test/Lsp.Integration.Tests/ExtensionTests.cs index 5c67a0b61..fe607fba5 100644 --- a/test/Lsp.Integration.Tests/ExtensionTests.cs +++ b/test/Lsp.Integration.Tests/ExtensionTests.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; using NSubstitute; +using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Testing; using OmniSharp.Extensions.LanguageProtocol.Testing; using OmniSharp.Extensions.LanguageServer.Client; @@ -67,12 +68,14 @@ public async Task Should_Support_Custom_Capabilities() ); { - var capability = client.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"].ToObject(); + var capability = client.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"] + .ToObject(client.Services.GetRequiredService().JsonSerializer); capability.Property.Should().Be("Abcd"); } { - var capability = server.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"].ToObject(); + var capability = server.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"] + .ToObject(server.Services.GetRequiredService().JsonSerializer); capability.Property.Should().Be("Abcd"); } @@ -127,7 +130,8 @@ public async Task Should_Support_Custom_Capabilities_Using_Json() ); { - var capability = server.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"].ToObject(); + var capability = server.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"] + .ToObject(server.Services.GetRequiredService().JsonSerializer); capability.Property.Should().Be("Abcd"); } @@ -175,14 +179,16 @@ public async Task Should_Support_Custom_Static_Options() ); { - var capability = server.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"].ToObject(); + var capability = server.ClientSettings.Capabilities!.Workspace!.ExtensionData["unitTests"] + .ToObject(server.Services.GetRequiredService().JsonSerializer); capability.Property.Should().Be("Abcd"); } { server.ServerSettings.Capabilities.ExtensionData["unitTestDiscovery"].Should().NotBeNull(); server.ServerSettings.Capabilities.ExtensionData["unitTestDiscovery"] - .ToObject().SupportsDebugging.Should().BeTrue(); + .ToObject(server.Services.GetRequiredService().JsonSerializer) + .SupportsDebugging.Should().BeTrue(); } { From 17851aef80c76f038bf78930315d8a4da1fc6bcd Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 20 Sep 2023 07:35:56 -0700 Subject: [PATCH 164/647] Fix up registration options and capabilities --- .../ITextDocumentClientCapabilities.cs | 6 +-- .../TextDocumentClientCapabilities.cs | 6 +-- .../Capabilities/WorkspaceEditCapability.cs | 2 +- .../Features/Document/DiagnosticsFeature.cs | 2 +- .../Features/Document/InlayHintFeature.cs | 40 ++++++++++++++++--- .../Features/Document/InlineValueFeature.cs | 15 ++++--- .../Document/SemanticTokensFeature.cs | 13 +++--- .../DidChangeConfigurationFeature.cs | 2 +- .../Workspace/DidChangeWatchedFilesFeature.cs | 2 +- .../Workspace/ExecuteCommandFeature.cs | 2 +- .../Workspace/WorkspaceSymbolsFeature.cs | 2 +- src/Protocol/WorkspaceNames.cs | 1 + ...ource.00AssemblyCapabilityKeys.verified.cs | 2 +- 13 files changed, 67 insertions(+), 28 deletions(-) diff --git a/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs b/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs index fb7104c29..27efadef3 100644 --- a/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/ITextDocumentClientCapabilities.cs @@ -159,20 +159,20 @@ public interface ITextDocumentClientCapabilities : ICapabilitiesBase /// /// @since 3.17.0 /// - Supports InlineValue { get; set; } + Supports InlineValue { get; set; } /// /// Capability specific to the `textDocument/inlayHint` request. /// /// @since 3.17.0 /// - Supports InlayHint { get; set; } + Supports InlayHint { get; set; } /// /// Capability specific to the diagnostic pull model. /// /// @since 3.17.0 /// - Supports Diagnostic { get; set; } + Supports Diagnostic { get; set; } } } diff --git a/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs b/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs index c8b70d5d5..202983903 100644 --- a/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs +++ b/src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs @@ -159,20 +159,20 @@ public class TextDocumentClientCapabilities : CapabilitiesBase, ITextDocumentCli /// /// @since 3.17.0 /// - public Supports InlineValue { get; set; } + public Supports InlineValue { get; set; } /// /// Capability specific to the `textDocument/inlayHint` request. /// /// @since 3.17.0 /// - public Supports InlayHint { get; set; } + public Supports InlayHint { get; set; } /// /// Capability specific to the diagnostic pull model. /// /// @since 3.17.0 /// - public Supports Diagnostic { get; set; } + public Supports Diagnostic { get; set; } } } diff --git a/src/Protocol/Client/Capabilities/WorkspaceEditCapability.cs b/src/Protocol/Client/Capabilities/WorkspaceEditCapability.cs index a6e4ccc85..78028f9e2 100644 --- a/src/Protocol/Client/Capabilities/WorkspaceEditCapability.cs +++ b/src/Protocol/Client/Capabilities/WorkspaceEditCapability.cs @@ -3,7 +3,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.WorkspaceEdit))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.WorkspaceEdit))] public class WorkspaceEditCapability : ICapability { /// diff --git a/src/Protocol/Features/Document/DiagnosticsFeature.cs b/src/Protocol/Features/Document/DiagnosticsFeature.cs index bf7cce533..1a79b7a70 100644 --- a/src/Protocol/Features/Document/DiagnosticsFeature.cs +++ b/src/Protocol/Features/Document/DiagnosticsFeature.cs @@ -467,7 +467,7 @@ internal WorkspaceDiagnosticReportPartialResult(WorkspaceDiagnosticReport partia [GenerateRegistrationOptions(nameof(ServerCapabilities.DiagnosticProvider))] [RegistrationName(TextDocumentNames.Diagnostics)] - public partial class DiagnosticsRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + public partial class DiagnosticsRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions { /// /// An optional identifier under which the diagnostics are diff --git a/src/Protocol/Features/Document/InlayHintFeature.cs b/src/Protocol/Features/Document/InlayHintFeature.cs index 9747c018f..ef8168687 100644 --- a/src/Protocol/Features/Document/InlayHintFeature.cs +++ b/src/Protocol/Features/Document/InlayHintFeature.cs @@ -1,4 +1,4 @@ -using System.Collections.ObjectModel; +ο»Ώusing System.Collections.ObjectModel; using System.Diagnostics; using MediatR; using Newtonsoft.Json; @@ -12,6 +12,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters; +using OmniSharp.Extensions.LanguageServer.Protocol.Server; using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities; // ReSharper disable once CheckNamespace @@ -26,7 +27,7 @@ namespace Models GenerateHandlerMethods, GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) ] - [RegistrationOptions(typeof(InlayHintRegistrationOptions)), Capability(typeof(InlayHintWorkspaceClientCapabilities))] + [RegistrationOptions(typeof(InlayHintRegistrationOptions)), Capability(typeof(InlayHintClientCapabilities))] [Resolver(typeof(InlayHint))] public partial record InlayHintParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, IRequest @@ -55,7 +56,7 @@ public partial record InlayHintParams : ITextDocumentIdentifierParams, IWorkDone [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [GenerateTypedData] [GenerateContainer] - [Capability(typeof(InlayHintWorkspaceClientCapabilities))] + [Capability(typeof(InlayHintClientCapabilities))] public partial record InlayHint : ICanBeResolved, IRequest, IDoesNotParticipateInRegistration { /// @@ -265,10 +266,18 @@ public enum InlayHintKind Parameter = 2 } + [Parallel] + [Method(WorkspaceNames.InlayHintRefresh, Direction.ServerToClient)] + [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] + [GenerateHandlerMethods] + [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] + [Capability(typeof(InlayHintWorkspaceClientCapabilities))] + public partial record InlayHintRefreshParams : IRequest; + [GenerateRegistrationOptions(nameof(ServerCapabilities.InlayHintProvider))] [RegistrationOptionsConverter(typeof(InlayHintRegistrationOptionsConverter))] [RegistrationName(TextDocumentNames.InlayHint)] - public partial class InlayHintRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + public partial class InlayHintRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions { /// /// The server provides support to resolve additional @@ -301,7 +310,7 @@ public override StaticOptions Convert(InlayHintRegistrationOptions source) namespace Client.Capabilities { [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.InlayHint))] - public partial class InlayHintWorkspaceClientCapabilities : DynamicCapability + public partial class InlayHintClientCapabilities : DynamicCapability { /// /// Indicates which properties a client can resolve lazily on a inlay @@ -322,6 +331,27 @@ public class InlayHintCapabilityResolveSupport /// public Container Properties { get; set; } } + + /// + /// Client workspace capabilities specific to inlay hints. + /// + /// @since 3.17.0. + /// + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.SemanticTokens))] + public class InlayHintWorkspaceClientCapabilities : ICapability + { + /// + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// inlay hints currently shown. It should be used with absolute care and + /// is useful for situation where a server for example detects a project wide + /// change that requires such a calculation. + /// + [Optional] + public bool RefreshSupport { get; set; } + } } namespace Document diff --git a/src/Protocol/Features/Document/InlineValueFeature.cs b/src/Protocol/Features/Document/InlineValueFeature.cs index 0e014b027..b904f531c 100644 --- a/src/Protocol/Features/Document/InlineValueFeature.cs +++ b/src/Protocol/Features/Document/InlineValueFeature.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +ο»Ώusing System.Diagnostics; using MediatR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -25,7 +25,7 @@ namespace Models GenerateHandlerMethods, GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient)) ] - [RegistrationOptions(typeof(InlineValueRegistrationOptions)), Capability(typeof(InlineValueWorkspaceClientCapabilities))] + [RegistrationOptions(typeof(InlineValueRegistrationOptions)), Capability(typeof(InlineValueClientCapabilities))] public partial record InlineValueParams : ITextDocumentIdentifierParams, IWorkDoneProgressParams, IRequest?> { @@ -69,7 +69,7 @@ public partial record InlineValueContext [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] - [Capability(typeof(CodeLensWorkspaceClientCapabilities))] + [Capability(typeof(InlineValueWorkspaceClientCapabilities))] public partial record InlineValueRefreshParams : IRequest; [JsonConverter(typeof(Converter))] @@ -179,7 +179,7 @@ public partial record InlineValueEvaluatableExpression : InlineValueBase [GenerateRegistrationOptions(nameof(ServerCapabilities.InlineValueProvider))] [RegistrationName(TextDocumentNames.InlineValue)] - public partial class InlineValueRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions + public partial class InlineValueRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions, IStaticRegistrationOptions { } } @@ -190,12 +190,17 @@ namespace Server.Capabilities namespace Client.Capabilities { + [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.InlineValue))] + public partial class InlineValueClientCapabilities : DynamicCapability + { + } + /// /// Client workspace capabilities specific to inline values. /// /// @since 3.17.0 /// - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.InlineValue))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.InlineValue))] public partial class InlineValueWorkspaceClientCapabilities : ICapability { /// diff --git a/src/Protocol/Features/Document/SemanticTokensFeature.cs b/src/Protocol/Features/Document/SemanticTokensFeature.cs index cd9d56358..dc651b2ed 100644 --- a/src/Protocol/Features/Document/SemanticTokensFeature.cs +++ b/src/Protocol/Features/Document/SemanticTokensFeature.cs @@ -790,14 +790,17 @@ public partial class SemanticTokensCapabilityRequestFull /// /// @since 3.16.0. /// - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.SemanticTokens))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.SemanticTokens))] public class SemanticTokensWorkspaceCapability : ICapability { /// - /// Whether the client implementation supports a refresh request send from - /// the server to the client. This is useful if a server detects a project - /// wide configuration change which requires a re-calculation of all semantic - /// tokens provided by the server issuing the request. + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// semantic tokens currently shown. It should be used with absolute care + /// and is useful for situation where a server for example detect a project + /// wide change that requires such a calculation. /// [Optional] public bool RefreshSupport { get; set; } diff --git a/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs b/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs index 2011eadf7..83468c6b1 100644 --- a/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs +++ b/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs @@ -26,7 +26,7 @@ public partial record DidChangeConfigurationParams : IRequest namespace Client.Capabilities { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Configuration))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Configuration))] public partial class DidChangeConfigurationCapability : DynamicCapability { } diff --git a/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs b/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs index fe48f3cef..7e02f041f 100644 --- a/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs +++ b/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs @@ -36,7 +36,7 @@ public partial class DidChangeWatchedFilesRegistrationOptions namespace Client.Capabilities { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.DidChangeWatchedFiles))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.DidChangeWatchedFiles))] public partial class DidChangeWatchedFilesCapability : DynamicCapability { /// diff --git a/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs b/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs index cadf26083..1b69c1085 100644 --- a/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs +++ b/src/Protocol/Features/Workspace/ExecuteCommandFeature.cs @@ -107,7 +107,7 @@ public override StaticOptions Convert(ExecuteCommandRegistrationOptions source) namespace Client.Capabilities { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.ExecuteCommand))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.ExecuteCommand))] public class ExecuteCommandCapability : DynamicCapability { } diff --git a/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs b/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs index 7626390d5..62baefaa4 100644 --- a/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs +++ b/src/Protocol/Features/Workspace/WorkspaceSymbolsFeature.cs @@ -187,7 +187,7 @@ public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) namespace Client.Capabilities { - [CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] + [CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Symbol))] public partial class WorkspaceSymbolCapability : DynamicCapability // { /// diff --git a/src/Protocol/WorkspaceNames.cs b/src/Protocol/WorkspaceNames.cs index 598adb7bf..4c757b513 100644 --- a/src/Protocol/WorkspaceNames.cs +++ b/src/Protocol/WorkspaceNames.cs @@ -22,5 +22,6 @@ public static class WorkspaceNames public const string InlineValueRefresh = "workspace/inlineValue/refresh"; public const string DiagnosticRefresh = "workspace/diagnostic/refresh"; public const string Diagnostics = "workspace/diagnostic"; + public const string InlayHintRefresh = "workspace/inlayHint/refresh"; } } diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs index 52a6b6c98..cb652ae8f 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs @@ -13,4 +13,4 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using System.Diagnostics; -[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.Symbol))] \ No newline at end of file +[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Symbol))] From 381075f8aa959a85c0701376e4008c61c5241b87 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 20 Sep 2023 09:09:02 -0700 Subject: [PATCH 165/647] Fix up milestone actions --- .github/workflows/close-milestone.yml | 2 ++ .github/workflows/update-milestone.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 5bdb84908..517ea4b09 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -14,6 +14,8 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-dotnet@v3 + - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0.10.2 with: diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index f881a2ada..91e88e42f 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -18,6 +18,8 @@ jobs: ref: ${{ github.sha }} fetch-depth: 0 + - uses: actions/setup-dotnet@v3 + - name: Fetch all history for all tags and branches run: git fetch --prune From 1fa313053e92d59c08797363b054d9a791d23099 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 20 Sep 2023 13:31:59 -0700 Subject: [PATCH 166/647] Update to latest release of GitReleaseManager --- .github/workflows/close-milestone.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 517ea4b09..9a821f9f8 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -24,7 +24,7 @@ jobs: - name: Install GitReleaseManager uses: gittools/actions/gitreleasemanager/setup@v0.10.2 with: - versionSpec: '0.11.x' + versionSpec: '0.15.x' - name: Use GitVersion id: gitversion diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 91e88e42f..da8b696fa 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -33,7 +33,7 @@ jobs: if: ${{ github.event.action == 'opened' }} uses: gittools/actions/gitreleasemanager/setup@v0.10.2 with: - versionSpec: '0.11.x' + versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} From c6cc335371077d1e5d637fb09be8d26330073211 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:38:45 +0000 Subject: [PATCH 167/647] Update dependency @prettier/plugin-xml to v3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c539d8869..35567f117 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "@prettier/plugin-xml": "1.2.0", + "@prettier/plugin-xml": "3.2.1", "husky": "8.0.3", "lint-staged": "12.3.4", "prettier": "2.5.1" From cb6f4ba00c2b061218196bd213ee1a8d67491787 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:39:05 +0000 Subject: [PATCH 168/647] Update dependency lint-staged to v14 --- package-lock.json | 989 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 499 insertions(+), 492 deletions(-) diff --git a/package-lock.json b/package-lock.json index cdc9d7595..bc9704403 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,721 +1,728 @@ { + "name": "csharp-language-server-protocol", + "lockfileVersion": 3, "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@prettier/plugin-xml": { + "packages": { + "": { + "devDependencies": { + "@prettier/plugin-xml": "1.2.0", + "husky": "8.0.3", + "lint-staged": "14.0.1", + "prettier": "2.5.1" + } + }, + "node_modules/@prettier/plugin-xml": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-1.2.0.tgz", "integrity": "sha512-bFvVAZKs59XNmntYjyefn3K4TBykS6E+d6ZW8IcylAs88ZO+TzLhp0dPpi0VKfPzq1Nb+kpDnPRTiwb4zY6NgA==", "dev": true, - "requires": { + "dependencies": { "@xml-tools/parser": "^1.0.11", "prettier": ">=2.3" } }, - "@xml-tools/parser": { + "node_modules/@xml-tools/parser": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.11.tgz", "integrity": "sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==", "dev": true, - "requires": { + "dependencies": { "chevrotain": "7.1.1" } }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/ansi-escapes": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, - "requires": { - "type-fest": "^0.21.3" + "dependencies": { + "type-fest": "^1.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "ansi-regex": { + "node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - }, - "ansi-styles": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, - "braces": { + "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "requires": { + "dependencies": { "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "chevrotain": { + "node_modules/chevrotain": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-7.1.1.tgz", "integrity": "sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==", "dev": true, - "requires": { + "dependencies": { "regexp-to-ast": "0.5.0" } }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, - "requires": { - "restore-cursor": "^3.1.0" + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "cli-truncate": { + "node_modules/cli-truncate": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, - "requires": { + "dependencies": { "slice-ansi": "^5.0.0", "string-width": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, - "colorette": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true - }, - "commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true + "node_modules/commander": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "dev": true, + "engines": { + "node": ">=16" + } }, - "cross-spawn": { + "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, - "requires": { + "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "requires": { + "dependencies": { "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "eastasianwidth": { + "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "emoji-regex": { + "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", "dev": true, - "requires": { + "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "fill-range": { + "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, - "requires": { + "dependencies": { "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "get-stream": { + "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true + "node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "dev": true, + "engines": { + "node": ">=14.18.0" + } }, - "husky": { + "node_modules/husky": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } }, - "is-fullwidth-code-point": { + "node_modules/is-fullwidth-code-point": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "is-number": { + "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.12.0" + } }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "isexe": { + "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "lilconfig": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", - "integrity": "sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==", - "dev": true + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } }, - "lint-staged": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.3.4.tgz", - "integrity": "sha512-yv/iK4WwZ7/v0GtVkNb3R82pdL9M+ScpIbJLJNyCXkJ1FGaXvRCOg/SeL59SZtPpqZhE7BD6kPKFLIDUhDx2/w==", + "node_modules/lint-staged": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-14.0.1.tgz", + "integrity": "sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==", "dev": true, - "requires": { + "dependencies": { + "chalk": "5.3.0", + "commander": "11.0.0", + "debug": "4.3.4", + "execa": "7.2.0", + "lilconfig": "2.1.0", + "listr2": "6.6.1", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.1" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/listr2": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", + "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", + "dev": true, + "dependencies": { "cli-truncate": "^3.1.0", - "colorette": "^2.0.16", - "commander": "^8.3.0", - "debug": "^4.3.3", - "execa": "^5.1.1", - "lilconfig": "2.0.4", - "listr2": "^4.0.1", - "micromatch": "^4.0.4", - "normalize-path": "^3.0.0", - "object-inspect": "^1.12.0", - "string-argv": "^0.3.1", - "supports-color": "^9.2.1", - "yaml": "^1.10.2" - } - }, - "listr2": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-4.0.4.tgz", - "integrity": "sha512-vJOm5KD6uZXjSsrwajr+mNacIjf87gWvlBEltPWLbTkslUscWAzquyK4xfe9Zd4RDgO5nnwFyV06FC+uVR+5mg==", - "dev": true, - "requires": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^5.0.1", "rfdc": "^1.3.0", - "rxjs": "^7.5.4", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" + "wrap-ansi": "^8.1.0" }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "requires": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + }, + "peerDependenciesMeta": { + "enquirer": { + "optional": true } } }, - "log-update": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", - "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "node_modules/log-update": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, - "requires": { - "ansi-escapes": "^4.3.0", - "cli-cursor": "^3.1.0", - "slice-ansi": "^4.0.0", - "wrap-ansi": "^6.2.0" - }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - } + "ansi-escapes": "^5.0.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^5.0.0", + "strip-ansi": "^7.0.1", + "wrap-ansi": "^8.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "merge-stream": { + "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" } }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "ms": { + "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "requires": { - "path-key": "^3.0.0" + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", - "dev": true - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "requires": { - "mimic-fn": "^2.1.0" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "requires": { - "aggregate-error": "^3.0.0" + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "path-key": { + "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } }, - "picomatch": { + "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } }, - "prettier": { + "node_modules/prettier": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", - "dev": true + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } }, - "regexp-to-ast": { + "node_modules/regexp-to-ast": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, - "requires": { + "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "rfdc": { + "node_modules/rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", "dev": true }, - "rxjs": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.4.tgz", - "integrity": "sha512-h5M3Hk78r6wAheJF0a5YahB1yRQKCsZ4MsGdZ5O9ETbVtjPcScGfrMmoOq7EBsCRzd4BDkvDJ7ogP8Sz5tTFiQ==", - "dev": true, - "requires": { - "tslib": "^2.1.0" - } - }, - "shebang-command": { + "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "requires": { + "dependencies": { "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "shebang-regex": { + "node_modules/shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } }, - "signal-exit": { + "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "slice-ansi": { + "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, - "requires": { + "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "string-argv": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", - "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", - "dev": true + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } }, - "string-width": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz", - "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==", + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "requires": { + "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, - "requires": { + "dependencies": { "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "supports-color": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.1.tgz", - "integrity": "sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "to-regex-range": { + "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "requires": { + "dependencies": { "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", - "dev": true - }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true + "node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "which": { + "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "requires": { + "dependencies": { "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true + "node_modules/yaml": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "dev": true, + "engines": { + "node": ">= 14" + } } } } diff --git a/package.json b/package.json index c539d8869..aeaf045e1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "1.2.0", "husky": "8.0.3", - "lint-staged": "12.3.4", + "lint-staged": "14.0.1", "prettier": "2.5.1" }, "scripts": { From e2642b6f3c1678fdb930303145e03cd1de611d11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:42:25 +0000 Subject: [PATCH 169/647] Bump semver from 5.7.1 to 5.7.2 in /vscode-testextension Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- vscode-testextension/package-lock.json | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 771cab997..2944db463 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -282,10 +282,12 @@ "dev": true }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "requires": { + "lru-cache": "^6.0.0" + } }, "source-map": { "version": "0.6.1", @@ -331,6 +333,14 @@ "semver": "^5.4.1", "source-map-support": "^0.5.0", "vscode-test": "^0.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } } }, "vscode-jsonrpc": { @@ -348,14 +358,6 @@ "vscode-languageserver-protocol": "3.16.0" }, "dependencies": { - "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "requires": { - "lru-cache": "^6.0.0" - } - }, "vscode-jsonrpc": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", From f8b0558b4ee72203b92f3d8056b29a1428ab282c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 23:58:01 +0000 Subject: [PATCH 170/647] Update dependency prettier to v3 --- package-lock.json | 15 +++++++++------ package.json | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc9704403..8cd3b660c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "1.2.0", "husky": "8.0.3", "lint-staged": "14.0.1", - "prettier": "2.5.1" + "prettier": "3.0.3" } }, "node_modules/@prettier/plugin-xml": { @@ -500,15 +500,18 @@ } }, "node_modules/prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/regexp-to-ast": { diff --git a/package.json b/package.json index aeaf045e1..e9945ebd8 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "1.2.0", "husky": "8.0.3", "lint-staged": "14.0.1", - "prettier": "2.5.1" + "prettier": "3.0.3" }, "scripts": { "prepare": "husky install" From 01ff00f527bfce37e27234ddb40368eeac51551f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 21 Sep 2023 08:01:29 -0700 Subject: [PATCH 171/647] Update xunit to 2.5.1 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index be82495f8..b65cce003 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From cd281adaa17c75d22b7b82328e34baa6bbd6705f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:25:46 +0000 Subject: [PATCH 172/647] Update dependency vscode-languageclient to v9 --- vscode-testextension/package-lock.json | 527 +++++++++++++++---------- vscode-testextension/package.json | 2 +- 2 files changed, 324 insertions(+), 205 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 2944db463..187588279 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1,221 +1,287 @@ { "name": "language-client-example", "version": "0.0.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@tootallnate/once": { + "packages": { + "": { + "name": "language-client-example", + "version": "0.0.1", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "vscode-languageclient": "^9.0.0", + "vscode-languageserver-protocol": "^3.16.0-next.6" + }, + "devDependencies": { + "@types/mocha": "10.0.1", + "@types/node": "14.0.25", + "typescript": "3.9.10", + "vscode": "1.1.37" + }, + "engines": { + "vscode": "^1.8.0" + } + }, + "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true + "dev": true, + "engines": { + "node": ">= 6" + } }, - "@types/mocha": { + "node_modules/@types/mocha": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", "dev": true }, - "@types/node": { + "node_modules/@types/node": { "version": "14.0.25", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.25.tgz", "integrity": "sha512-okMqUHqrMlGOxfDZliX1yFX5MV6qcd5PpRz96XYtjkM0Ws/hwg23FMUqt6pETrVRZS+EKUB5HY19mmo54EuQbA==", "dev": true }, - "agent-base": { + "node_modules/agent-base": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", "dev": true, - "requires": { + "dependencies": { "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" } }, - "balanced-match": { + "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { + "dev": true, + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "browser-stdout": { + "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { + "node_modules/buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "commander": { + "node_modules/commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, - "debug": { + "node_modules/debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "dev": true, - "requires": { + "dependencies": { "ms": "^2.1.1" } }, - "diff": { + "node_modules/diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.3.1" + } }, - "es6-promise": { + "node_modules/es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", "dev": true }, - "es6-promisify": { + "node_modules/es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, - "requires": { + "dependencies": { "es6-promise": "^4.0.3" } }, - "escape-string-regexp": { + "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8.0" + } }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "glob": { + "node_modules/glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, - "requires": { + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "growl": { + "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true + "dev": true, + "engines": { + "node": ">=4.x" + } }, - "has-flag": { + "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "he": { + "node_modules/he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true + "dev": true, + "bin": { + "he": "bin/he" + } }, - "http-proxy-agent": { + "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dev": true, - "requires": { + "dependencies": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "https-proxy-agent": { + "node_modules/https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", "dev": true, - "requires": { + "dependencies": { "agent-base": "6", "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "requires": { + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "lru-cache": { + "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { + "dependencies": { "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, - "minimatch": { + "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { + "dev": true, + "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "minimist": { + "node_modules/minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "mkdirp": { + "node_modules/mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "dev": true, - "requires": { + "dependencies": { "minimist": "0.0.8" + }, + "bin": { + "mkdirp": "bin/cmd.js" } }, - "mocha": { + "node_modules/mocha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, - "requires": { + "dependencies": { "browser-stdout": "1.3.1", "commander": "2.15.1", "debug": "3.1.0", @@ -228,104 +294,135 @@ "mkdirp": "0.5.1", "supports-color": "5.4.0" }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/mocha/node_modules/debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "ms": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "requires": { + "dependencies": { "wrappy": "1" } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "semver": { + "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { + "dependencies": { "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "source-map": { + "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "source-map-support": { + "node_modules/source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, - "requires": { + "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "supports-color": { + "node_modules/supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, - "requires": { + "dependencies": { "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "typescript": { + "node_modules/typescript": { "version": "3.9.10", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } }, - "vscode": { + "node_modules/vscode": { "version": "1.1.37", "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.37.tgz", "integrity": "sha512-vJNj6IlN7IJPdMavlQa1KoFB3Ihn06q1AiN3ZFI/HfzPNzbKZWPPuiU+XkpNOfGU5k15m4r80nxNPlM7wcc0wg==", + "deprecated": "This package is deprecated in favor of @types/vscode and vscode-test. For more information please read: https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest", "dev": true, - "requires": { + "dependencies": { "glob": "^7.1.2", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", @@ -334,128 +431,150 @@ "source-map-support": "^0.5.0", "vscode-test": "^0.4.1" }, + "bin": { + "vscode-install": "bin/install" + }, + "engines": { + "node": ">=8.9.3" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.0.tgz", + "integrity": "sha512-EXP4vhSlEj0DtyxrcWVp5aiFrY0WczKSnKSyrMmSbU7qhASPhM+pfcUzY/z8TQCfOhKvq39fidbdTbq9LnBi7g==", + "dependencies": { + "minimatch": "^5.1.0", + "semver": "^7.3.7", + "vscode-languageserver-protocol": "3.17.4" + }, + "engines": { + "vscode": "^1.82.0" + } + }, + "node_modules/vscode-languageclient/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dependencies": { - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - } - } - }, - "vscode-jsonrpc": { - "version": "6.0.0-next.4", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.4.tgz", - "integrity": "sha512-nIXUeSMKfqvqSG75s1JuUy0UgjE3d0NERjGz7AUGDFXX0/roVUEbaio5VBdus30nty8v0FCf/6MbCSrH5RybcQ==" - }, - "vscode-languageclient": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", - "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", - "requires": { - "minimatch": "^3.0.4", - "semver": "^7.3.4", - "vscode-languageserver-protocol": "3.16.0" + "balanced-match": "^1.0.0" + } + }, + "node_modules/vscode-languageclient/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" }, + "engines": { + "node": ">=10" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4.tgz", + "integrity": "sha512-IpaHLPft+UBWf4dOIH15YEgydTbXGz52EMU2h16SfFpYu/yOQt3pY14049mtpJu+4CBHn+hq7S67e7O0AwpRqQ==", "dependencies": { - "vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" - }, - "vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "requires": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" - } - } - }, - "vscode-languageserver-protocol": { - "version": "3.16.0-next.6", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.6.tgz", - "integrity": "sha512-tW8LMFBBr6WJ33mzYAjiLTu/4tch9nvJ+rBhUNzJ8X1zNR39vj8CV3FsnrxzAqvOB+qBWEOQa0tjupW1mNo2GQ==", - "requires": { - "vscode-jsonrpc": "6.0.0-next.4", - "vscode-languageserver-types": "3.16.0-next.3" - } - }, - "vscode-languageserver-types": { - "version": "3.16.0-next.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.3.tgz", - "integrity": "sha512-s/z5ZqSe7VpoXJ6JQcvwRiPPA3nG0nAcJ/HH03zoU6QaFfnkcgPK+HshC3WKPPnC2G08xA0iRB6h7kmyBB5Adg==" - }, - "vscode-test": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.4" + } + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4.tgz", + "integrity": "sha512-9YXi5pA3XF2V+NUQg6g+lulNS0ncRCKASYdK3Cs7kiH9sVFXWq27prjkC/B8M/xJLRPPRSPCHVMuBTgRNFh2sQ==" + }, + "node_modules/vscode-test": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz", "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==", + "deprecated": "This package has been renamed to @vscode/test-electron, please update to the new name", "dev": true, - "requires": { + "dependencies": { "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.1" }, + "engines": { + "node": ">=8.9.3" + } + }, + "node_modules/vscode-test/node_modules/agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "dependencies": { + "es6-promisify": "^5.0.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/vscode-test/node_modules/debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/vscode-test/node_modules/http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "dependencies": { + "agent-base": "4", + "debug": "3.1.0" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/vscode-test/node_modules/https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "dev": true, "dependencies": { - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "dev": true, - "requires": { - "agent-base": "4", - "debug": "3.1.0" - } - }, - "https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dev": true, - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "wrappy": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/vscode-test/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/vscode/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "yallist": { + "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 17f0075e1..dbce032f1 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -52,7 +52,7 @@ "vscode": "1.1.37" }, "dependencies": { - "vscode-languageclient": "^7.0.0-next.8", + "vscode-languageclient": "^9.0.0", "vscode-languageserver-protocol": "^3.16.0-next.6" } } From 339cdc236ffe546378a35ddd1cdcae920cc9999d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:30:55 +0000 Subject: [PATCH 173/647] Update dependency nuke.globaltool to v7 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4521f34db..3426dac24 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "6.3.0", + "version": "7.0.5", "commands": [ "nuke" ] From 26fa61d3d2f4ef8441bd7ba9f6000f12306994f4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:56:04 +0000 Subject: [PATCH 174/647] Update dotnet monorepo [minor/patch] --- Directory.Packages.props | 4 ++-- Directory.Packages.supports.props | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 565312ec3..5954e80c6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -30,11 +30,11 @@ - + - + diff --git a/Directory.Packages.supports.props b/Directory.Packages.supports.props index 665086a69..bcf19562f 100644 --- a/Directory.Packages.supports.props +++ b/Directory.Packages.supports.props @@ -4,12 +4,12 @@ Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net472'" > - - - - - - - + + + + + + + From 4b21ce787616e8adc9e7f51838beb97c9c2d927d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:57:20 +0000 Subject: [PATCH 175/647] Update dependency @types/node to v14.18.62 --- vscode-testextension/package-lock.json | 8 ++++---- vscode-testextension/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 187588279..f0d63804e 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "14.0.25", + "@types/node": "14.18.62", "typescript": "3.9.10", "vscode": "1.1.37" }, @@ -39,9 +39,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.0.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.25.tgz", - "integrity": "sha512-okMqUHqrMlGOxfDZliX1yFX5MV6qcd5PpRz96XYtjkM0Ws/hwg23FMUqt6pETrVRZS+EKUB5HY19mmo54EuQbA==", + "version": "14.18.62", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.62.tgz", + "integrity": "sha512-53Fhb08qfKwSNCIUtysIqw0ye+v1d5QCdL2kl8liKQFlOZTAo+nEYr/FztzMaHBFwB5H0ugF0PF0gmtojaNNiQ==", "dev": true }, "node_modules/agent-base": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index dbce032f1..dc34b9b43 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -47,7 +47,7 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "14.0.25", + "@types/node": "14.18.62", "typescript": "3.9.10", "vscode": "1.1.37" }, From 9f2b8496ba2c20cc572cb6a360c344c271d61a06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:40:01 +0000 Subject: [PATCH 176/647] Update dependency @types/node to v18 --- vscode-testextension/package-lock.json | 8 ++++---- vscode-testextension/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f0d63804e..c54f9ee45 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "14.18.62", + "@types/node": "18.17.18", "typescript": "3.9.10", "vscode": "1.1.37" }, @@ -39,9 +39,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.18.62", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.62.tgz", - "integrity": "sha512-53Fhb08qfKwSNCIUtysIqw0ye+v1d5QCdL2kl8liKQFlOZTAo+nEYr/FztzMaHBFwB5H0ugF0PF0gmtojaNNiQ==", + "version": "18.17.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.18.tgz", + "integrity": "sha512-/4QOuy3ZpV7Ya1GTRz5CYSz3DgkKpyUptXuQ5PPce7uuyJAOR7r9FhkmxJfvcNUXyklbC63a+YvB3jxy7s9ngw==", "dev": true }, "node_modules/agent-base": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index dc34b9b43..94d6d3634 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -47,7 +47,7 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "14.18.62", + "@types/node": "18.17.18", "typescript": "3.9.10", "vscode": "1.1.37" }, From ae7913db242a9312480b98f31af724cc77df5dbd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:47:05 +0000 Subject: [PATCH 177/647] Update dependency @prettier/plugin-xml to v3 --- package-lock.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8cd3b660c..13079217b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,20 +5,22 @@ "packages": { "": { "devDependencies": { - "@prettier/plugin-xml": "1.2.0", + "@prettier/plugin-xml": "3.2.1", "husky": "8.0.3", "lint-staged": "14.0.1", "prettier": "3.0.3" } }, "node_modules/@prettier/plugin-xml": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-1.2.0.tgz", - "integrity": "sha512-bFvVAZKs59XNmntYjyefn3K4TBykS6E+d6ZW8IcylAs88ZO+TzLhp0dPpi0VKfPzq1Nb+kpDnPRTiwb4zY6NgA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.2.1.tgz", + "integrity": "sha512-DvwnQPf8FsczapBVDm54IhR+Pryt3DbPZSNtUb9gOuFtgoUUPbPN69f3nQBMF5BEqh4ZjZjTaHBmsVno3UnAXQ==", "dev": true, "dependencies": { - "@xml-tools/parser": "^1.0.11", - "prettier": ">=2.3" + "@xml-tools/parser": "^1.0.11" + }, + "peerDependencies": { + "prettier": "^3.0.0" } }, "node_modules/@xml-tools/parser": { From f800bc262b03d708e6f713de355c51f55b30f0e6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:05:48 +0000 Subject: [PATCH 178/647] Update Rocket Surgery Other --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 808cf3c09..a7eb0942b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + @@ -24,7 +24,7 @@ - + From 6fbf4a7647f778f089d572dc945e182869a5060f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 21 Sep 2023 12:00:37 -0700 Subject: [PATCH 179/647] Fix up warnings in nuke .build --- .build/Build.cs | 10 ++++------ .build/Configuration.cs | 6 ++++-- .build/Solution.cs | 9 ++++----- .nuke/build.schema.json | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.build/Build.cs b/.build/Build.cs index 51e58f460..86b7c5abc 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -8,15 +8,16 @@ using Nuke.Common.Tools.MSBuild; using Rocket.Surgery.Nuke.DotNetCore; +namespace Build; + [PublicAPI] -[CheckBuildProjectConfigurations] [UnsetVisualStudioEnvironmentVariables] [PackageIcon("http://www.omnisharp.net/images/logo.png")] [EnsureReadmeIsUpdated] [DotNetVerbosityMapping] [MSBuildVerbosityMapping] [NuGetVerbosityMapping] -public partial class Solution : NukeBuild, +public sealed partial class Solution : NukeBuild, ICanRestoreWithDotNetCore, ICanBuildWithDotNetCore, ICanTestWithDotNetCore, @@ -36,10 +37,7 @@ public partial class Solution : NukeBuild, /// - Microsoft VisualStudio https://nuke.build/visualstudio /// - Microsoft VSCode https://nuke.build/vscode /// - public static int Main() - { - return Execute(x => x.Default); - } + public static int Main() => Execute(x => x.Default); [OptionalGitRepository] public GitRepository? GitRepository { get; } diff --git a/.build/Configuration.cs b/.build/Configuration.cs index 57e9a8bf8..324bc331a 100644 --- a/.build/Configuration.cs +++ b/.build/Configuration.cs @@ -1,11 +1,13 @@ ο»Ώusing System.ComponentModel; using Nuke.Common.Tooling; +namespace Build; + [TypeConverter(typeof(TypeConverter))] public class Configuration : Enumeration { - public static readonly Configuration Debug = new Configuration { Value = nameof(Debug) }; - public static readonly Configuration Release = new Configuration { Value = nameof(Release) }; + public static Configuration Debug => new() { Value = nameof(Debug) }; + public static Configuration Release => new() { Value = nameof(Release) }; public static implicit operator string(Configuration configuration) => configuration.Value; } diff --git a/.build/Solution.cs b/.build/Solution.cs index a3e9826d8..3a21d42aa 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -1,15 +1,14 @@ -using System.Collections.Generic; -using System.Linq; using Nuke.Common.CI.GitHubActions; using Nuke.Common.CI.GitHubActions.Configuration; using Rocket.Surgery.Nuke.ContinuousIntegration; using Rocket.Surgery.Nuke.DotNetCore; using Rocket.Surgery.Nuke.GithubActions; +namespace Build; internal class LocalConstants { - public static string[] PathsIgnore = + public static string[] PathsIgnore => new[] { ".codecov.yml", ".editorconfig", @@ -37,7 +36,7 @@ internal class LocalConstants GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, AutoGenerate = false, - On = new[] { GitHubActionsTrigger.Push }, + On = new[] { RocketSurgeonGitHubActionsTrigger.Push }, OnPushTags = new[] { "v*" }, OnPushBranches = new[] { "master", "main", "next" }, OnPullRequestBranches = new[] { "master", "main", "next" }, @@ -49,7 +48,7 @@ internal class LocalConstants GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest, AutoGenerate = false, - On = new[] { GitHubActionsTrigger.Push }, + On = new[] { RocketSurgeonGitHubActionsTrigger.Push }, OnPushTags = new[] { "v*" }, OnPushBranches = new[] { "master", "main", "next" }, OnPullRequestBranches = new[] { "master", "main", "next" }, diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 470cfeef1..6b089e946 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Build Schema", "$ref": "#/definitions/build", + "title": "Build Schema", "definitions": { "build": { "type": "object", @@ -155,4 +155,4 @@ } } } -} \ No newline at end of file +} From 8401b1a440a1f5b36c26a43b70acd828b2f91d5c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Sep 2023 18:08:11 +0000 Subject: [PATCH 180/647] Update actions/checkout action to v4.1.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21e4d9c20..c0a419e91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 9a821f9f8..2435df458 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index e313cf318..c41c06b78 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 6b8e1de71..430ccc8ac 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index da8b696fa..5084da4e7 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 with: ref: ${{ github.sha }} fetch-depth: 0 From 4e48a525a52f565c727cc1d71c9d1eb50f4ba7fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 23 Sep 2023 21:57:02 +0000 Subject: [PATCH 181/647] Update dependency @types/node to v18.17.19 --- vscode-testextension/package-lock.json | 8 ++++---- vscode-testextension/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index c54f9ee45..42436af92 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "18.17.18", + "@types/node": "18.17.19", "typescript": "3.9.10", "vscode": "1.1.37" }, @@ -39,9 +39,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.17.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.18.tgz", - "integrity": "sha512-/4QOuy3ZpV7Ya1GTRz5CYSz3DgkKpyUptXuQ5PPce7uuyJAOR7r9FhkmxJfvcNUXyklbC63a+YvB3jxy7s9ngw==", + "version": "18.17.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", + "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", "dev": true }, "node_modules/agent-base": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 94d6d3634..c078c746c 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -47,7 +47,7 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "18.17.18", + "@types/node": "18.17.19", "typescript": "3.9.10", "vscode": "1.1.37" }, From ddd1bdf1ba5ce0bf02b98e530a8c266e22e32ae0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Sep 2023 00:14:14 +0000 Subject: [PATCH 182/647] Update dependency typescript to v5 --- vscode-testextension/package-lock.json | 10 +++++----- vscode-testextension/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 42436af92..6e7c82490 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -16,7 +16,7 @@ "devDependencies": { "@types/mocha": "10.0.1", "@types/node": "18.17.19", - "typescript": "3.9.10", + "typescript": "5.2.2", "vscode": "1.1.37" }, "engines": { @@ -404,16 +404,16 @@ } }, "node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/vscode": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index c078c746c..b15ccb811 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -48,7 +48,7 @@ "devDependencies": { "@types/mocha": "10.0.1", "@types/node": "18.17.19", - "typescript": "3.9.10", + "typescript": "5.2.2", "vscode": "1.1.37" }, "dependencies": { From f1e899f1451306b4112e1013be9f445b82c64476 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:35:28 +0200 Subject: [PATCH 183/647] Update verify (major) --- Directory.Packages.props | 6 +-- test/Generation.Tests/ModuleInitializer.cs | 9 ++-- ...rties#Test0_DeclarationParams.verified.cs} | 0 ...tring#Test0_ThreadEventReason.verified.cs} | 0 ...s#AssemblyRegistrationOptions.verified.cs} | 0 ...CodeActionRegistrationOptions.verified.cs} | 0 ...s#AssemblyRegistrationOptions.verified.cs} | 0 ...CodeActionRegistrationOptions.verified.cs} | 0 ...s#AssemblyRegistrationOptions.verified.cs} | 0 ...paceSymbolRegistrationOptions.verified.cs} | 0 ...e#AssemblyRegistrationOptions.verified.cs} | 0 ...paceSymbolRegistrationOptions.verified.cs} | 0 ...ation#AssemblyJsonRpcHandlers.verified.cs} | 0 ...ostic_If_Missing_Information.verified.txt} | 6 +-- ...quests#AttachRequestArguments.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...llable#LaunchRequestArguments.verified.cs} | 0 ..._Types#AttachRequestArguments.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...ponses#AttachRequestArguments.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...Names#AssemblyJsonRpcHandlers.verified.cs} | 0 ...uageProtocolInitializeHandler.verified.cs} | 2 +- ...e_Types#ExecuteCommandParams1.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...s#Test0_ExecuteCommandParams1.verified.cs} | 0 ...ndler#AssemblyJsonRpcHandlers.verified.cs} | 0 ...sHandler#ICapabilitiesHandler.verified.cs} | 0 ...ndler#AssemblyJsonRpcHandlers.verified.cs} | 0 ...IDidChangeTextDocumentHandler.verified.cs} | 0 ...rection_DidChangeTextHandler.verified.txt} | 3 +- ...ndler#AssemblyJsonRpcHandlers.verified.cs} | 0 ...tion_ExitHandler#IExitHandler.verified.cs} | 0 ...Infers_Direction_ExitHandler.verified.txt} | 3 +- ...ndler#AssemblyJsonRpcHandlers.verified.cs} | 0 ...eHandler#IFoldingRangeHandler.verified.cs} | 0 ...ndler#AssemblyJsonRpcHandlers.verified.cs} | 0 ...ions_ExitHandler#IExitHandler.verified.cs} | 0 ...uests#AssemblyJsonRpcHandlers.verified.cs} | 0 ...g_Requests#IDefinitionHandler.verified.cs} | 0 ...ction#AssemblyJsonRpcHandlers.verified.cs} | 0 ..._Direction#IDefinitionHandler.verified.cs} | 0 ...equests_And_Infers_Direction.verified.txt} | 3 +- ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...s_Type_As_Source#RenameParams.verified.cs} | 0 ...nsions#AssemblyCapabilityKeys.verified.cs} | 0 ...s#AssemblyRegistrationOptions.verified.cs} | 0 ...sions#DiscoverUnitTestsParams.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ..._Language_Extensions#UnitTest.verified.cs} | 0 ...s#UnitTestRegistrationOptions.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ..._Return#RegistrationContainer.verified.cs} | 0 ...ask_Return#RegistrationParams.verified.cs} | 0 ...y_Hint#AssemblyCapabilityKeys.verified.cs} | 0 ...t#AssemblyRegistrationOptions.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...upports_Inlay_Hint#OutlayHint.verified.cs} | 0 ...nlay_Hint#OutlayHintContainer.verified.cs} | 0 ...s_Inlay_Hint#OutlayHintParams.verified.cs} | 0 ...OutlayHintRegistrationOptions.verified.cs} | 0 ...y_Hint#Test0_OutlayHintParams.verified.cs} | 0 ...ay_Hint#Test0_OutlayHintTyped.verified.cs} | 0 ...Hint.02Test0_OutlayHintParams1.verified.cs | 0 ...neratedAssemblyJsonRpcHandlers.verified.cs | 0 ...pports_Inlay_Hint.04OutlayHint.verified.cs | 0 ..._Inlay_Hint.05OutlayHintParams.verified.cs | 0 ...Inlay_Hint.06OutlayHintParams1.verified.cs | 0 ....07AssemblyRegistrationOptions.verified.cs | 0 ...8OutlayHintRegistrationOptions.verified.cs | 0 ...lay_Hint.09OutlayHintContainer.verified.cs | 0 ...y_Hint.10Test0_OutlayHintTyped.verified.cs | 0 ...d_Data#AssemblyCapabilityKeys.verified.cs} | 0 ...a#AssemblyRegistrationOptions.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...arams_With_Typed_Data#SubLens.verified.cs} | 0 ...h_Typed_Data#SubLensContainer.verified.cs} | 0 ...With_Typed_Data#SubLensParams.verified.cs} | 0 ...ped_Data#SubLensRefreshParams.verified.cs} | 0 ...ta#SubLensRegistrationOptions.verified.cs} | 0 ...yped_Data#Test0_SubLensParams.verified.cs} | 0 ...Typed_Data#Test0_SubLensTyped.verified.cs} | 0 ...Source#AssemblyCapabilityKeys.verified.cs} | 2 +- ...e#AssemblyRegistrationOptions.verified.cs} | 0 ...eratedAssemblyJsonRpcHandlers.verified.cs} | 0 ...ource#SymbolInformationParams.verified.cs} | 0 ...Test0_SymbolInformationParams.verified.cs} | 0 ...e#Test0_WorkspaceSymbolParams.verified.cs} | 0 ...ype_As_Source#WorkspaceSymbol.verified.cs} | 0 ..._Source#WorkspaceSymbolParams.verified.cs} | 0 ...paceSymbolRegistrationOptions.verified.cs} | 0 ...d_Container#CodeLensContainer.verified.cs} | 0 ...solved_Data#CodeLensContainer.verified.cs} | 0 ...lved_Data#Test0_CodeLensTyped.verified.cs} | 0 ..._Typed_ICanBeResolved_Data.00.received.txt | 17 ------- ...neratedAssemblyJsonRpcHandlers.received.cs | 4 -- ...ata.02PublishDiagnosticsParams.received.cs | 49 ------------------- test/TestingUtils/TestingUtils.csproj | 4 +- 99 files changed, 16 insertions(+), 92 deletions(-) rename test/Generation.Tests/snapshots/{AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs => AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties#Test0_DeclarationParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs => EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs => GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt => JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt} (90%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs => JsonRpcGenerationTests.Supports_Allow_Derived_Requests#AttachRequestArguments.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Allow_Derived_Requests#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs => JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable#LaunchRequestArguments.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs => JsonRpcGenerationTests.Supports_Allow_Generic_Types#AttachRequestArguments.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Allow_Generic_Types#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs => JsonRpcGenerationTests.Supports_Allows_Nullable_Responses#AttachRequestArguments.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Allows_Nullable_Responses#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Custom_Method_Names#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs => JsonRpcGenerationTests.Supports_Custom_Method_Names#ILanguageProtocolInitializeHandler.verified.cs} (99%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs => JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#ExecuteCommandParams1.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs => JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#Test0_ExecuteCommandParams1.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler#ICapabilitiesHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler#IDidChangeTextDocumentHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt} (89%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler#IExitHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt} (89%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler#IFoldingRangeHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler#IExitHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Requests#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Requests#IDefinitionHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction#AssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs => JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction#IDefinitionHandler.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt => JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt} (89%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs => JsonRpcGenerationTests.Supports_Params_Type_As_Source#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs => JsonRpcGenerationTests.Supports_Params_Type_As_Source#RenameParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs => LspFeatureTests.Supports_Generating_Custom_Language_Extensions#AssemblyCapabilityKeys.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs => LspFeatureTests.Supports_Generating_Custom_Language_Extensions#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs => LspFeatureTests.Supports_Generating_Custom_Language_Extensions#DiscoverUnitTestsParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs => LspFeatureTests.Supports_Generating_Custom_Language_Extensions#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs => LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTest.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs => LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs => LspFeatureTests.Supports_Generating_Void_Task_Return#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs => LspFeatureTests.Supports_Generating_Void_Task_Return#RegistrationContainer.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs => LspFeatureTests.Supports_Generating_Void_Task_Return#RegistrationParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs => LspFeatureTests.Supports_Inlay_Hint#AssemblyCapabilityKeys.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs => LspFeatureTests.Supports_Inlay_Hint#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs => LspFeatureTests.Supports_Inlay_Hint#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs => LspFeatureTests.Supports_Inlay_Hint#OutlayHint.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs => LspFeatureTests.Supports_Inlay_Hint#OutlayHintContainer.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs => LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs => LspFeatureTests.Supports_Inlay_Hint#OutlayHintRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs => LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs => LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs} (100%) delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02Test0_OutlayHintParams1.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03GeneratedAssemblyJsonRpcHandlers.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHint.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05OutlayHintParams.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintParams1.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07AssemblyRegistrationOptions.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08OutlayHintRegistrationOptions.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.09OutlayHintContainer.verified.cs delete mode 100644 test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.10Test0_OutlayHintTyped.verified.cs rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#AssemblyCapabilityKeys.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLens.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensContainer.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensRefreshParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs => LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#AssemblyCapabilityKeys.verified.cs} (97%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#AssemblyRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#GeneratedAssemblyJsonRpcHandlers.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#SymbolInformationParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#Test0_SymbolInformationParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#Test0_WorkspaceSymbolParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbol.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbolParams.verified.cs} (100%) rename test/Generation.Tests/snapshots/{LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs => LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbolRegistrationOptions.verified.cs} (100%) rename test/Generation.Tests/snapshots/{TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs => TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container#CodeLensContainer.verified.cs} (100%) rename test/Generation.Tests/snapshots/{TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs => TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#CodeLensContainer.verified.cs} (100%) rename test/Generation.Tests/snapshots/{TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs => TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs} (100%) delete mode 100644 test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt delete mode 100644 test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs delete mode 100644 test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index a7eb0942b..fd2492e5b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,8 +40,8 @@ - - + + @@ -62,4 +62,4 @@ - + \ No newline at end of file diff --git a/test/Generation.Tests/ModuleInitializer.cs b/test/Generation.Tests/ModuleInitializer.cs index 67d97e1a7..4ac0b1f2a 100644 --- a/test/Generation.Tests/ModuleInitializer.cs +++ b/test/Generation.Tests/ModuleInitializer.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using DiffEngine; using Microsoft.CodeAnalysis; @@ -7,12 +7,11 @@ public static class ModuleInitializer [ModuleInitializer] public static void Init() { - VerifySourceGenerators.Enable(); + VerifySourceGenerators.Initialize(); VerifierSettings.AddExtraSettings( - settings => { settings.Converters.Add(new SyntaxTreeConverter()); } - ); + settings => settings.Converters.Add(new SyntaxTreeConverter())); DiffRunner.Disabled = true; - VerifierSettings.DerivePathInfo( + DerivePathInfo( static (sourceFile, directory, type, method) => { static string GetTypeName(Type type) => type.IsNested ? $"{type.ReflectedType!.Name}.{type.Name}" : type.Name; diff --git a/test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs b/test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties#Test0_DeclarationParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties.verified.cs rename to test/Generation.Tests/snapshots/AutoImplementParamsGeneratorTests.Auto_Magically_Implements_Properties#Test0_DeclarationParams.verified.cs diff --git a/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString.verified.cs rename to test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.00AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options.01CodeActionRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.00AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters.01CodeActionRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.00AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options.01WorkspaceSymbolRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.00AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface.01WorkspaceSymbolRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.01AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt similarity index 90% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt index d9ba20eca..7ed864e4c 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.00.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt @@ -10,8 +10,7 @@ HelpLink: , MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., Message: Could not infer the request router(s) to use, please specify the target interface(s)., - Category: JsonRPC, - CustomTags: [] + Category: JsonRPC }, { Id: JRPC1003, @@ -23,8 +22,7 @@ HelpLink: , MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., Message: Could not infer the request router(s) to use, please specify the target interface(s)., - Category: JsonRPC, - CustomTags: [] + Category: JsonRPC } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests#AttachRequestArguments.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.00AttachRequestArguments.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests#AttachRequestArguments.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests.01GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.00GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable#LaunchRequestArguments.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable.01LaunchRequestArguments.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Derived_Requests_Nullable#LaunchRequestArguments.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types#AttachRequestArguments.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.00AttachRequestArguments.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types#AttachRequestArguments.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types.01GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allow_Generic_Types#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses#AttachRequestArguments.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.00AttachRequestArguments.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses#AttachRequestArguments.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses.01GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Allows_Nullable_Responses#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.00AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names#ILanguageProtocolInitializeHandler.verified.cs similarity index 99% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names#ILanguageProtocolInitializeHandler.verified.cs index 9baa8fc4c..fd9218d16 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names.01ILanguageProtocolInitializeHandler.verified.cs +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Custom_Method_Names#ILanguageProtocolInitializeHandler.verified.cs @@ -29,4 +29,4 @@ public static partial class LanguageProtocolInitializeExtensions public static Task RequestLanguageProtocolInitialize(this ITextDocumentLanguageClient mediator, InitializeParams request, CancellationToken cancellationToken = default) => mediator.SendRequest(request, cancellationToken); } #nullable restore -} +} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#ExecuteCommandParams1.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.01ExecuteCommandParams1.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#ExecuteCommandParams1.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.02GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#Test0_ExecuteCommandParams1.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types.00Test0_ExecuteCommandParams1.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Generic_Response_Types#Test0_ExecuteCommandParams1.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.00AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler#ICapabilitiesHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler.01ICapabilitiesHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_CapabilitiesHandler#ICapabilitiesHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.01AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler#IDidChangeTextDocumentHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.02IDidChangeTextDocumentHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler#IDidChangeTextDocumentHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt similarity index 89% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt index a8e983cca..c06cef434 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.00.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt @@ -10,8 +10,7 @@ HelpLink: , MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., Message: No Response Router Provided for handler {0}, defaulting to {1}., - Category: JsonRPC, - CustomTags: [] + Category: JsonRPC } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.01AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler#IExitHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.02IExitHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler#IExitHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt similarity index 89% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt index 4b754600e..ac9e982e1 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.00.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt @@ -10,8 +10,7 @@ HelpLink: , MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., Message: No Response Router Provided for handler {0}, defaulting to {1}., - Category: JsonRPC, - CustomTags: [] + Category: JsonRPC } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.00AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler#IFoldingRangeHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler.01IFoldingRangeHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_FoldingRangeHandler#IFoldingRangeHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.00AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler#IExitHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler.01IExitHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_ExitHandler#IExitHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.00AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests#IDefinitionHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests.01IDefinitionHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests#IDefinitionHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction#AssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.01AssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction#AssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction#IDefinitionHandler.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.02IDefinitionHandler.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction#IDefinitionHandler.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt similarity index 89% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt index a88f4f32a..c442e1600 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.00.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt @@ -10,8 +10,7 @@ HelpLink: , MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., Message: No Response Router Provided for handler {0}, defaulting to {1}., - Category: JsonRPC, - CustomTags: [] + Category: JsonRPC } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.00GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source#RenameParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source.01RenameParams.verified.cs rename to test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Params_Type_As_Source#RenameParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#AssemblyCapabilityKeys.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.00AssemblyCapabilityKeys.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#AssemblyCapabilityKeys.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.04AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#DiscoverUnitTestsParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.01DiscoverUnitTestsParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#DiscoverUnitTestsParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.02GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTest.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.03UnitTest.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTest.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions.05UnitTestRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.00GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return#RegistrationContainer.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.02RegistrationContainer.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return#RegistrationContainer.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return#RegistrationParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return.01RegistrationParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Void_Task_Return#RegistrationParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#AssemblyCapabilityKeys.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.00AssemblyCapabilityKeys.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#AssemblyCapabilityKeys.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHint.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03OutlayHint.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHint.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintContainer.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07OutlayHintContainer.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintContainer.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHintParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.01Test0_OutlayHintParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08Test0_OutlayHintTyped.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02Test0_OutlayHintParams1.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.02Test0_OutlayHintParams1.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.03GeneratedAssemblyJsonRpcHandlers.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHint.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.04OutlayHint.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.05OutlayHintParams.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintParams1.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.06OutlayHintParams1.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.07AssemblyRegistrationOptions.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08OutlayHintRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.08OutlayHintRegistrationOptions.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.09OutlayHintContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.09OutlayHintContainer.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.10Test0_OutlayHintTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint.10Test0_OutlayHintTyped.verified.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#AssemblyCapabilityKeys.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.00AssemblyCapabilityKeys.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#AssemblyCapabilityKeys.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.06AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.02GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLens.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.03SubLens.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLens.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensContainer.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.08SubLensContainer.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensContainer.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.04SubLensParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensRefreshParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.05SubLensRefreshParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensRefreshParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.07SubLensRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.01Test0_SubLensParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data.09Test0_SubLensTyped.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#AssemblyCapabilityKeys.verified.cs similarity index 97% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#AssemblyCapabilityKeys.verified.cs index cb652ae8f..61f956aa0 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#AssemblyCapabilityKeys.verified.cs @@ -13,4 +13,4 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Workspace; using System.Diagnostics; -[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Symbol))] +[assembly: AssemblyCapabilityKey(typeof(OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.WorkspaceSymbolCapability), nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Symbol))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#AssemblyRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.07AssemblyRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#AssemblyRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#GeneratedAssemblyJsonRpcHandlers.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.03GeneratedAssemblyJsonRpcHandlers.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#GeneratedAssemblyJsonRpcHandlers.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#SymbolInformationParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#SymbolInformationParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#Test0_SymbolInformationParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#Test0_SymbolInformationParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#Test0_WorkspaceSymbolParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#Test0_WorkspaceSymbolParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbol.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbol.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbolParams.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbolParams.verified.cs diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbolRegistrationOptions.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs rename to test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source#WorkspaceSymbolRegistrationOptions.verified.cs diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container#CodeLensContainer.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container.verified.cs rename to test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_Container#CodeLensContainer.verified.cs diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#CodeLensContainer.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00CodeLensContainer.verified.cs rename to test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#CodeLensContainer.verified.cs diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs similarity index 100% rename from test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01Test0_CodeLensTyped.verified.cs rename to test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs diff --git a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt deleted file mode 100644 index 0f206832a..000000000 --- a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.00.received.txt +++ /dev/null @@ -1,17 +0,0 @@ -ο»Ώ{ - Diagnostics: [ - { - Id: JRPC1003, - Title: Cannot infer request router(s), - Severity: Error, - WarningLevel: 0, - Location: Test0.cs: (16,4)-(16,26), - Description: , - HelpLink: , - MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., - Message: Could not infer the request router(s) to use, please specify the target interface(s)., - Category: JsonRPC, - CustomTags: [] - } - ] -} \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs deleted file mode 100644 index 30d33a7db..000000000 --- a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.01GeneratedAssemblyJsonRpcHandlers.received.cs +++ /dev/null @@ -1,4 +0,0 @@ -ο»Ώ//HintName: GeneratedAssemblyJsonRpcHandlers.cs -using OmniSharp.Extensions.JsonRpc; - -[assembly: AssemblyJsonRpcHandlers(typeof(Test.Document.IPublishDiagnosticsHandler))] \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs b/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs deleted file mode 100644 index 7acaed031..000000000 --- a/test/Generation.Tests/snapshots/TypedParamsTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data.02PublishDiagnosticsParams.received.cs +++ /dev/null @@ -1,49 +0,0 @@ -ο»Ώ//HintName: PublishDiagnosticsParams.cs -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using OmniSharp.Extensions.DebugAdapter.Protocol; -using OmniSharp.Extensions.DebugAdapter.Protocol.Events; -using OmniSharp.Extensions.DebugAdapter.Protocol.Models; -using OmniSharp.Extensions.DebugAdapter.Protocol.Requests; -using OmniSharp.Extensions.JsonRpc; -using OmniSharp.Extensions.JsonRpc.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol; -using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; -using OmniSharp.Extensions.LanguageServer.Protocol.Generation; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Protocol.Serialization; -using OmniSharp.Extensions.LanguageServer.Protocol.Server; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Test.Document; -using Test.Models; - -#nullable enable -namespace Test.Document -{ - [Parallel, Method(TextDocumentNames.PublishDiagnostics, Direction.ServerToClient)] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public partial interface IPublishDiagnosticsHandler : IJsonRpcNotificationHandler, ICapability - { - } - - [System.Runtime.CompilerServices.CompilerGeneratedAttribute, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute] - abstract public partial class PublishDiagnosticsHandlerBase : AbstractHandlers.NotificationCapability, IPublishDiagnosticsHandler - { - } -} -#nullable restore - -namespace Test.Document -{ -#nullable enable - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute, System.Runtime.CompilerServices.CompilerGeneratedAttribute] - public static partial class PublishDiagnosticsExtensions - { - public static void PublishDiagnostics(this ITextDocumentLanguageServer mediator, PublishDiagnosticsParams request) => mediator.SendNotification(request); - public static void PublishDiagnostics(this ILanguageServer mediator, PublishDiagnosticsParams request) => mediator.SendNotification(request); - } -#nullable restore -} \ No newline at end of file diff --git a/test/TestingUtils/TestingUtils.csproj b/test/TestingUtils/TestingUtils.csproj index 5f9c8393f..3e420f82f 100644 --- a/test/TestingUtils/TestingUtils.csproj +++ b/test/TestingUtils/TestingUtils.csproj @@ -1,7 +1,7 @@ - +ο»Ώ - netstandard2.0;netstandard2.1;net6.0 + net6.0 false From 3decd513a377a5c623b27f2ab94740feda41c44a Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sun, 24 Sep 2023 19:03:41 +0200 Subject: [PATCH 184/647] Update dotnet monorepo --- Directory.Packages.props | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a7eb0942b..f979beae1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,13 +28,13 @@ - - - - - - - + + + + + + + @@ -50,8 +50,8 @@ - - + + From 3f33e82524b68edc34e57896c0f31345afc8b969 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 01:45:40 +0000 Subject: [PATCH 185/647] Update dependency nuke.globaltool to v7.0.6 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3426dac24..51d2c15cf 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "7.0.5", + "version": "7.0.6", "commands": [ "nuke" ] From 9d94bbc601ba954788d9fb3f056c36cf08cee150 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:11:27 +0000 Subject: [PATCH 186/647] Update dependency Verify.Xunit to v21.2.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index aa2d7d22a..23f1e51b6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 675f8d17dbfc23cd642c54123837de6f6d608903 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:26:06 +0000 Subject: [PATCH 187/647] Update jetbrains to v2023.2.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 51d2c15cf..29b0b7f6c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.2.1", + "version": "2023.2.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 23f1e51b6..f8c546bf5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 8a75bcd83742f3cbcd1b39ce9b7f49d7221e44d7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:58:24 +0000 Subject: [PATCH 188/647] Update dependency vscode-languageclient to v9.0.1 --- vscode-testextension/package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 42436af92..86f751296 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -447,13 +447,13 @@ } }, "node_modules/vscode-languageclient": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.0.tgz", - "integrity": "sha512-EXP4vhSlEj0DtyxrcWVp5aiFrY0WczKSnKSyrMmSbU7qhASPhM+pfcUzY/z8TQCfOhKvq39fidbdTbq9LnBi7g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz", + "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==", "dependencies": { "minimatch": "^5.1.0", "semver": "^7.3.7", - "vscode-languageserver-protocol": "3.17.4" + "vscode-languageserver-protocol": "3.17.5" }, "engines": { "vscode": "^1.82.0" @@ -479,18 +479,18 @@ } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4.tgz", - "integrity": "sha512-IpaHLPft+UBWf4dOIH15YEgydTbXGz52EMU2h16SfFpYu/yOQt3pY14049mtpJu+4CBHn+hq7S67e7O0AwpRqQ==", + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", "dependencies": { "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.4" + "vscode-languageserver-types": "3.17.5" } }, "node_modules/vscode-languageserver-types": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4.tgz", - "integrity": "sha512-9YXi5pA3XF2V+NUQg6g+lulNS0ncRCKASYdK3Cs7kiH9sVFXWq27prjkC/B8M/xJLRPPRSPCHVMuBTgRNFh2sQ==" + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, "node_modules/vscode-test": { "version": "0.4.3", From 004a154744fc39877ee70e5b6476a94a12848b9d Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Wed, 27 Sep 2023 19:35:52 +0200 Subject: [PATCH 189/647] Update dependency Microsoft.CodeAnalysis.CSharp.Workspaces to v4.7.0 --- Directory.Packages.props | 2 +- ...String#Test0_ThreadEventReason.verified.cs | 7 ++- ...#CodeActionRegistrationOptions.verified.cs | 8 ++- ...#CodeActionRegistrationOptions.verified.cs | 1 + ...spaceSymbolRegistrationOptions.verified.cs | 5 +- ...spaceSymbolRegistrationOptions.verified.cs | 5 +- ...ns#UnitTestRegistrationOptions.verified.cs | 6 ++- ...ts_Inlay_Hint#OutlayHintParams.verified.cs | 1 + ...lay_Hint#Test0_OutlayHintTyped.verified.cs | 53 ++++++++++++++++--- ..._With_Typed_Data#SubLensParams.verified.cs | 2 + ..._Typed_Data#Test0_SubLensTyped.verified.cs | 32 ++++++++--- ...olved_Data#Test0_CodeLensTyped.verified.cs | 31 ++++++++--- 12 files changed, 127 insertions(+), 26 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f8c546bf5..7caf215b7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + diff --git a/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs index 106762da2..fec5dd6d5 100644 --- a/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs +++ b/test/Generation.Tests/snapshots/EnumLikeStringGeneratorTests.Auto_Magically_Implements_IEnumLikeString#Test0_ThreadEventReason.verified.cs @@ -17,9 +17,14 @@ namespace Test { private static readonly Lazy> _defaults = new Lazy>(() => { - return new ThreadEventReason[]{Started, Exited}; + return new ThreadEventReason[] + { + Started, + Exited + }; }); public static IEnumerable Defaults => _defaults.Value; + private readonly string _value; public ThreadEventReason(string type) => _value = type; public static implicit operator ThreadEventReason(string kind) => new ThreadEventReason(kind); diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs index 62d94c13b..afa450986 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options#CodeActionRegistrationOptions.verified.cs @@ -36,7 +36,12 @@ public CodeActionRegistrationOptionsConverter() public override StaticOptions Convert(CodeActionRegistrationOptions source) { - return new StaticOptions{CodeActionKinds = source.CodeActionKinds, ResolveProvider = source.ResolveProvider, WorkDoneProgress = source.WorkDoneProgress}; + return new StaticOptions + { + CodeActionKinds = source.CodeActionKinds, + ResolveProvider = source.ResolveProvider, + WorkDoneProgress = source.WorkDoneProgress + }; } } @@ -51,6 +56,7 @@ public partial class StaticOptions : OmniSharp.Extensions.LanguageServer.Protoco /// [Optional] public Container? CodeActionKinds { get; set; } = new Container(); + /// /// The server provides support to resolve additional /// information for a code action. diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs index 5a0e34232..f3c8c9084 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_Registration_Options_With_Converters#CodeActionRegistrationOptions.verified.cs @@ -38,6 +38,7 @@ public partial class StaticOptions : IWorkDoneProgressOptions /// [Optional] public Container? CodeActionKinds { get; set; } = new Container(); + /// /// The server provides support to resolve additional /// information for a code action. diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs index 95ed84ad2..dc8ea90ec 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options#WorkspaceSymbolRegistrationOptions.verified.cs @@ -22,7 +22,10 @@ public WorkspaceSymbolRegistrationOptionsConverter() public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) { - return new StaticOptions{WorkDoneProgress = source.WorkDoneProgress}; + return new StaticOptions + { + WorkDoneProgress = source.WorkDoneProgress + }; } } diff --git a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs index 6d824bc71..f883cebb1 100644 --- a/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs +++ b/test/Generation.Tests/snapshots/GeneratedRegistrationOptionsTests.Supports_Generating_Strongly_Typed_WorkDone_Registration_Options_Interface#WorkspaceSymbolRegistrationOptions.verified.cs @@ -23,7 +23,10 @@ public WorkspaceSymbolRegistrationOptionsConverter() public override StaticOptions Convert(WorkspaceSymbolRegistrationOptions source) { - return new StaticOptions{WorkDoneProgress = source.WorkDoneProgress}; + return new StaticOptions + { + WorkDoneProgress = source.WorkDoneProgress + }; } } diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs index 5604552b9..81be6f002 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Generating_Custom_Language_Extensions#UnitTestRegistrationOptions.verified.cs @@ -29,7 +29,11 @@ public UnitTestRegistrationOptionsConverter() public override StaticOptions Convert(UnitTestRegistrationOptions source) { - return new StaticOptions{SupportsDebugging = source.SupportsDebugging, WorkDoneProgress = source.WorkDoneProgress}; + return new StaticOptions + { + SupportsDebugging = source.SupportsDebugging, + WorkDoneProgress = source.WorkDoneProgress + }; } } diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs index 81e903049..89d72c0a9 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#OutlayHintParams.verified.cs @@ -50,6 +50,7 @@ protected OutlayHintsHandlerBase() : this(Guid.NewGuid()) private readonly Guid _id; Guid ICanBeIdentifiedHandler.Id => _id; + public abstract Task Handle(OutlayHint request, CancellationToken cancellationToken); } diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs index 7adc1f307..76f208225 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Inlay_Hint#Test0_OutlayHintTyped.verified.cs @@ -28,7 +28,17 @@ public partial record OutlayHint public OutlayHint WithData(TData data) where TData : class?, IHandlerIdentity? { - return new OutlayHint{Position = Position, Label = Label, Kind = Kind, TextEdits = TextEdits, Tooltip = Tooltip, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, Data = data}; + return new OutlayHint + { + Position = Position, + Label = Label, + Kind = Kind, + TextEdits = TextEdits, + Tooltip = Tooltip, + PaddingLeft = PaddingLeft, + PaddingRight = PaddingRight, + Data = data + }; } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] @@ -59,7 +69,6 @@ public partial record OutlayHint : ICanBeResolved where T : class?, IHandlerI /// The position of this hint. /// public Position Position { get; init; } - /// /// The label of this hint. A human readable string or an array of /// OutlayHintLabelPart label parts. @@ -67,7 +76,6 @@ public partial record OutlayHint : ICanBeResolved where T : class?, IHandlerI /// *Note* that neither the string nor the label part can be empty. /// public StringOrOutlayHintLabelParts Label { get; init; } - /// /// The kind of this hint. Can be omitted in which case the client /// should fall back to a reasonable default. @@ -122,23 +130,52 @@ public partial record OutlayHint : ICanBeResolved where T : class?, IHandlerI /// [Optional] public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } - private string DebuggerDisplay => ToString(); + public OutlayHint WithData(TData data) where TData : class?, IHandlerIdentity? { - return new OutlayHint{Position = Position, Label = Label, Kind = Kind, TextEdits = TextEdits, Tooltip = Tooltip, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, Data = data}; + return new OutlayHint + { + Position = Position, + Label = Label, + Kind = Kind, + TextEdits = TextEdits, + Tooltip = Tooltip, + PaddingLeft = PaddingLeft, + PaddingRight = PaddingRight, + Data = data + }; } JToken? ICanBeResolved.Data { get; init; } - private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } - public static implicit operator OutlayHint(OutlayHint value) => new OutlayHint{Position = value.Position, Label = value.Label, Kind = value.Kind, TextEdits = value.TextEdits, Tooltip = value.Tooltip, PaddingLeft = value.PaddingLeft, PaddingRight = value.PaddingRight, JData = value.Data}; + public static implicit operator OutlayHint(OutlayHint value) => new OutlayHint + { + Position = value.Position, + Label = value.Label, + Kind = value.Kind, + TextEdits = value.TextEdits, + Tooltip = value.Tooltip, + PaddingLeft = value.PaddingLeft, + PaddingRight = value.PaddingRight, + JData = value.Data + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("value")] public static implicit operator OutlayHint? (OutlayHint? value) => value switch { - not null => new OutlayHint{Position = value.Position, Label = value.Label, Kind = value.Kind, TextEdits = value.TextEdits, Tooltip = value.Tooltip, PaddingLeft = value.PaddingLeft, PaddingRight = value.PaddingRight, Data = value.JData}, + not null => new OutlayHint + { + Position = value.Position, + Label = value.Label, + Kind = value.Kind, + TextEdits = value.TextEdits, + Tooltip = value.Tooltip, + PaddingLeft = value.PaddingLeft, + PaddingRight = value.PaddingRight, + Data = value.JData + }, _ => null }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs index 083023a2d..09e82fb86 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#SubLensParams.verified.cs @@ -50,6 +50,7 @@ protected SubLensHandlerBase() : this(Guid.NewGuid()) private readonly Guid _id; Guid ICanBeIdentifiedHandler.Id => _id; + public abstract Task Handle(SubLens request, CancellationToken cancellationToken); } @@ -84,6 +85,7 @@ protected SubLensPartialHandlerBase(IProgressManager progressManager) : this(Gui private readonly Guid _id; Guid ICanBeIdentifiedHandler.Id => _id; + public abstract Task Handle(SubLens request, CancellationToken cancellationToken); } diff --git a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs index 19c4b8d68..02c7889dc 100644 --- a/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs +++ b/test/Generation.Tests/snapshots/LspFeatureTests.Supports_Nullable_Params_With_Typed_Data#Test0_SubLensTyped.verified.cs @@ -26,7 +26,12 @@ public partial record SubLens public SubLens WithData(TData data) where TData : class?, IHandlerIdentity? { - return new SubLens{Range = Range, Command = Command, Data = data}; + return new SubLens + { + Range = Range, + Command = Command, + Data = data + }; } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] @@ -59,6 +64,7 @@ public partial record SubLens : ICanBeResolved where T : class?, IHandlerIden /// The range in which this code lens is valid. Should only span a single line. /// public Range Range { get; init; } = null !; + /// /// The command this code lens represents. /// @@ -71,8 +77,8 @@ public partial record SubLens : ICanBeResolved where T : class?, IHandlerIden /// [Optional] public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } - private string DebuggerDisplay => $"{Range}{(Command != null ? $" {Command}" : "")}"; + /// public override string ToString() { @@ -82,18 +88,32 @@ public override string ToString() public SubLens WithData(TData data) where TData : class?, IHandlerIdentity? { - return new SubLens{Range = Range, Command = Command, Data = data}; + return new SubLens + { + Range = Range, + Command = Command, + Data = data + }; } JToken? ICanBeResolved.Data { get; init; } - private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } - public static implicit operator SubLens(SubLens value) => new SubLens{Range = value.Range, Command = value.Command, JData = value.Data}; + public static implicit operator SubLens(SubLens value) => new SubLens + { + Range = value.Range, + Command = value.Command, + JData = value.Data + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("value")] public static implicit operator SubLens? (SubLens? value) => value switch { - not null => new SubLens{Range = value.Range, Command = value.Command, Data = value.JData}, + not null => new SubLens + { + Range = value.Range, + Command = value.Command, + Data = value.JData + }, _ => null }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] diff --git a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs index be79042af..0eb386f4c 100644 --- a/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs +++ b/test/Generation.Tests/snapshots/TypedCanBeResolvedTests.Supports_Generating_Strongly_Typed_ICanBeResolved_Data#Test0_CodeLensTyped.verified.cs @@ -27,7 +27,12 @@ public partial record CodeLens public CodeLens WithData(TData data) where TData : class?, IHandlerIdentity? { - return new CodeLens{Range = Range, Command = Command, Data = data}; + return new CodeLens + { + Range = Range, + Command = Command, + Data = data + }; } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] @@ -64,24 +69,38 @@ public partial record CodeLens : ICanBeResolved where T : class?, IHandlerIde /// [Optional] public T Data { get => this.GetRawData()!; init => this.SetRawData(value); } - private string DebuggerDisplay => $"{Range}{(Command != null ? $" {Command}" : "")}"; + public override string ToString() => DebuggerDisplay; public CodeLens WithData(TData data) where TData : class?, IHandlerIdentity? { - return new CodeLens{Range = Range, Command = Command, Data = data}; + return new CodeLens + { + Range = Range, + Command = Command, + Data = data + }; } JToken? ICanBeResolved.Data { get; init; } - private JToken? JData { get => this.GetRawData(); init => this.SetRawData(value); } - public static implicit operator CodeLens(CodeLens value) => new CodeLens{Range = value.Range, Command = value.Command, JData = value.Data}; + public static implicit operator CodeLens(CodeLens value) => new CodeLens + { + Range = value.Range, + Command = value.Command, + JData = value.Data + }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("value")] public static implicit operator CodeLens? (CodeLens? value) => value switch { - not null => new CodeLens{Range = value.Range, Command = value.Command, Data = value.JData}, + not null => new CodeLens + { + Range = value.Range, + Command = value.Command, + Data = value.JData + }, _ => null }; [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("item")] From ff33a43acf4d52f006d98d1bf43e8479c4aace2e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:04:04 +0000 Subject: [PATCH 190/647] Update dependency @types/mocha to v10.0.2 --- vscode-testextension/package-lock.json | 8 ++++---- vscode-testextension/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 86f751296..f41c7a15a 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -14,7 +14,7 @@ "vscode-languageserver-protocol": "^3.16.0-next.6" }, "devDependencies": { - "@types/mocha": "10.0.1", + "@types/mocha": "10.0.2", "@types/node": "18.17.19", "typescript": "3.9.10", "vscode": "1.1.37" @@ -33,9 +33,9 @@ } }, "node_modules/@types/mocha": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", - "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.2.tgz", + "integrity": "sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w==", "dev": true }, "node_modules/@types/node": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index c078c746c..e81b3af83 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -46,7 +46,7 @@ "postinstall": "node ./node_modules/vscode/bin/install" }, "devDependencies": { - "@types/mocha": "10.0.1", + "@types/mocha": "10.0.2", "@types/node": "18.17.19", "typescript": "3.9.10", "vscode": "1.1.37" From 494f816d64d4da56b4fcc00ed6f256df2a8dfa5e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 03:33:55 +0000 Subject: [PATCH 191/647] Update dependency Verify.Xunit to v21.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 19f466958..93570b14d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 458b6996181030e652eaf394b78aca47c9f09f69 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Thu, 28 Sep 2023 21:15:12 +0200 Subject: [PATCH 192/647] Update dependency typescript to v5 --- vscode-testextension/package-lock.json | 149 ++++++++++++++----------- vscode-testextension/package.json | 2 +- vscode-testextension/src/extension.ts | 18 +-- 3 files changed, 95 insertions(+), 74 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f41c7a15a..5721dcf31 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -16,7 +16,7 @@ "devDependencies": { "@types/mocha": "10.0.2", "@types/node": "18.17.19", - "typescript": "3.9.10", + "typescript": "5.2.2", "vscode": "1.1.37" }, "engines": { @@ -45,9 +45,9 @@ "dev": true }, "node_modules/agent-base": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", - "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "dependencies": { "debug": "4" @@ -57,9 +57,9 @@ } }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -78,9 +78,9 @@ "dev": true }, "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "node_modules/commander": { @@ -92,17 +92,24 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/diff": { @@ -123,7 +130,7 @@ "node_modules/es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", "dev": true, "dependencies": { "es6-promise": "^4.0.3" @@ -132,7 +139,7 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -141,19 +148,19 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -176,7 +183,7 @@ "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -185,7 +192,7 @@ "node_modules/he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "integrity": "sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==", "dev": true, "bin": { "he": "bin/he" @@ -206,9 +213,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { "agent-base": "6", @@ -221,7 +228,7 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", @@ -246,9 +253,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -260,13 +267,13 @@ "node_modules/minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", "dev": true }, "node_modules/mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "dev": true, "dependencies": { @@ -328,10 +335,22 @@ "node": "*" } }, + "node_modules/mocha/node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/mocha/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "node_modules/ms": { @@ -343,7 +362,7 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" @@ -352,24 +371,19 @@ "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "semver": "bin/semver" } }, "node_modules/source-map": { @@ -382,9 +396,9 @@ } }, "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", @@ -404,16 +418,16 @@ } }, "node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/vscode": { @@ -478,6 +492,20 @@ "node": ">=10" } }, + "node_modules/vscode-languageclient/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/vscode-languageserver-protocol": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", @@ -556,22 +584,13 @@ "node_modules/vscode-test/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/vscode/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/yallist": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index e81b3af83..5bbf2a31b 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -48,7 +48,7 @@ "devDependencies": { "@types/mocha": "10.0.2", "@types/node": "18.17.19", - "typescript": "3.9.10", + "typescript": "5.2.2", "vscode": "1.1.37" }, "dependencies": { diff --git a/vscode-testextension/src/extension.ts b/vscode-testextension/src/extension.ts index 722980405..b0c06c168 100644 --- a/vscode-testextension/src/extension.ts +++ b/vscode-testextension/src/extension.ts @@ -17,11 +17,13 @@ import { InitializeParams, StreamInfo, createServerPipeTransport, + Trace } from "vscode-languageclient/node"; -import { Trace, createClientPipeTransport } from "vscode-jsonrpc/node"; import { createConnection } from "net"; -export function activate(context: ExtensionContext) { +let client: LanguageClient; + +export async function activate(context: ExtensionContext) { // The server is implemented in node let serverExe = "dotnet"; @@ -81,12 +83,12 @@ export function activate(context: ExtensionContext) { }; // Create the language client and start the client. - const client = new LanguageClient("languageServerExample", "Language Server Example", serverOptions, clientOptions); + client = new LanguageClient("languageServerExample", "Language Server Example", serverOptions, clientOptions); client.registerProposedFeatures(); - client.trace = Trace.Verbose; - let disposable = client.start(); + client.setTrace(Trace.Verbose); + await client.start(); +} - // Push the disposable to the context's subscriptions so that the - // client can be deactivated on extension deactivation - context.subscriptions.push(disposable); +export function deactivate() { + return client.stop(); } From 5a1b60de54b74adf6e68d39537ed47a7d6e082ed Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Thu, 28 Sep 2023 23:30:26 +0200 Subject: [PATCH 193/647] Update dependency vscode to v1.82.0 --- vscode-testextension/.gitignore | 4 +- vscode-testextension/.vscode/launch.json | 2 +- vscode-testextension/package-lock.json | 1040 ++++++++++++++--- vscode-testextension/package.json | 24 +- vscode-testextension/src/extension.ts | 4 +- vscode-testextension/test/extension.test.ts | 22 - vscode-testextension/test/index.ts | 22 - vscode-testextension/test/runTest.ts | 23 + .../test/suite/extension.test.ts | 15 + vscode-testextension/test/suite/index.ts | 37 + vscode-testextension/tsconfig.json | 4 +- 11 files changed, 943 insertions(+), 254 deletions(-) delete mode 100644 vscode-testextension/test/extension.test.ts delete mode 100644 vscode-testextension/test/index.ts create mode 100644 vscode-testextension/test/runTest.ts create mode 100644 vscode-testextension/test/suite/extension.test.ts create mode 100644 vscode-testextension/test/suite/index.ts diff --git a/vscode-testextension/.gitignore b/vscode-testextension/.gitignore index 6343560cd..455c87496 100644 --- a/vscode-testextension/.gitignore +++ b/vscode-testextension/.gitignore @@ -1,3 +1,3 @@ out -server -node_modules \ No newline at end of file +node_modules +.vscode-test/ \ No newline at end of file diff --git a/vscode-testextension/.vscode/launch.json b/vscode-testextension/.vscode/launch.json index d1e53d6c7..2a898e3cb 100644 --- a/vscode-testextension/.vscode/launch.json +++ b/vscode-testextension/.vscode/launch.json @@ -25,7 +25,7 @@ "args": [ "--disable-extensions", "--extensionDevelopmentPath=${workspaceRoot}", - "--extensionTestsPath=${workspaceRoot}/out/test" + "--extensionTestsPath=${workspaceRoot}/out/test/suite/index" ], "stopOnEntry": false, "sourceMaps": true, diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 5721dcf31..111470168 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -7,20 +7,24 @@ "": { "name": "language-client-example", "version": "0.0.1", - "hasInstallScript": true, "license": "MIT", "dependencies": { - "vscode-languageclient": "^9.0.0", + "vscode-languageclient": "^9.0.1", "vscode-languageserver-protocol": "^3.16.0-next.6" }, "devDependencies": { - "@types/mocha": "10.0.2", - "@types/node": "18.17.19", - "typescript": "5.2.2", - "vscode": "1.1.37" + "@types/glob": "^7.2.0", + "@types/mocha": "^10.0.2", + "@types/node": "^18.18.0", + "@types/vscode": "^1.82.0", + "@vscode/test-electron": "^2.3.4", + "glob": "^7.2.3", + "mocha": "^10.2.0", + "source-map-support": "^0.5.21", + "typescript": "^5.2.2" }, "engines": { - "vscode": "^1.8.0" + "vscode": "^1.82.0" } }, "node_modules/@tootallnate/once": { @@ -32,6 +36,22 @@ "node": ">= 6" } }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, "node_modules/@types/mocha": { "version": "10.0.2", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.2.tgz", @@ -39,11 +59,32 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.17.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", - "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", + "version": "18.18.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.0.tgz", + "integrity": "sha512-3xA4X31gHT1F1l38ATDIL9GpRLdwVhnEFC8Uikv5ZLlXATwrCYyPq7ZWHxzxc3J/30SUiwiYT+bQe0/XvKlWbw==", "dev": true }, + "node_modules/@types/vscode": { + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", + "dev": true + }, + "node_modules/@vscode/test-electron": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.4.tgz", + "integrity": "sha512-eWzIqXMhvlcoXfEFNWrVu/yYT5w6De+WZXR/bafUQhAp8+8GkQo95Oe14phwiRUPv8L+geAKl/QM2+PoT3YW3g==", + "dev": true, + "dependencies": { + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "jszip": "^3.10.1", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -56,11 +97,72 @@ "node": ">= 6.0.0" } }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -71,6 +173,18 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -83,10 +197,100 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/concat-map": { @@ -95,6 +299,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -112,37 +322,89 @@ } } }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" } }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, - "dependencies": { - "es6-promise": "^4.0.3" + "engines": { + "node": ">=6" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, "engines": { - "node": ">=0.8.0" + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" } }, "node_modules/fs.realpath": { @@ -151,6 +413,29 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -171,28 +456,31 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, "engines": { - "node": ">=4.x" + "node": ">= 6" } }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, "bin": { "he": "bin/he" @@ -225,6 +513,12 @@ "node": ">= 6" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -241,6 +535,148 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -264,64 +700,50 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", - "dev": true - }, - "node_modules/mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", - "dev": true, - "dependencies": { - "minimist": "0.0.8" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "dependencies": { + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/mocha/node_modules/debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "dependencies": { - "ms": "2.0.0" + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -333,12 +755,15 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -347,10 +772,31 @@ "node": "*" } }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/mocha/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/ms": { @@ -359,6 +805,27 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -368,6 +835,51 @@ "wrappy": "1" } }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -377,15 +889,104 @@ "node": ">=0.10.0" } }, - "node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -405,16 +1006,78 @@ "source-map": "^0.6.0" } }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, "node_modules/typescript": { @@ -430,27 +1093,11 @@ "node": ">=14.17" } }, - "node_modules/vscode": { - "version": "1.1.37", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.37.tgz", - "integrity": "sha512-vJNj6IlN7IJPdMavlQa1KoFB3Ihn06q1AiN3ZFI/HfzPNzbKZWPPuiU+XkpNOfGU5k15m4r80nxNPlM7wcc0wg==", - "deprecated": "This package is deprecated in favor of @types/vscode and vscode-test. For more information please read: https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest", - "dev": true, - "dependencies": { - "glob": "^7.1.2", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "mocha": "^5.2.0", - "semver": "^5.4.1", - "source-map-support": "^0.5.0", - "vscode-test": "^0.4.1" - }, - "bin": { - "vscode-install": "bin/install" - }, - "engines": { - "node": ">=8.9.3" - } + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", @@ -492,20 +1139,6 @@ "node": ">=10" } }, - "node_modules/vscode-languageclient/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/vscode-languageserver-protocol": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", @@ -520,83 +1153,102 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, - "node_modules/vscode-test": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz", - "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==", - "deprecated": "This package has been renamed to @vscode/test-electron, please update to the new name", + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=8.9.3" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/vscode-test/node_modules/agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "dependencies": { - "es6-promisify": "^5.0.0" - }, "engines": { - "node": ">= 4.0.0" + "node": ">=10" } }, - "node_modules/vscode-test/node_modules/debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "ms": "2.0.0" + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" } }, - "node_modules/vscode-test/node_modules/http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, - "dependencies": { - "agent-base": "4", - "debug": "3.1.0" - }, "engines": { - "node": ">= 4.5.0" + "node": ">=10" } }, - "node_modules/vscode-test/node_modules/https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "engines": { - "node": ">= 4.5.0" + "node": ">=10" } }, - "node_modules/vscode-test/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 5bbf2a31b..4a7299bef 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -6,7 +6,7 @@ "version": "0.0.1", "publisher": "vscode", "engines": { - "vscode": "^1.8.0" + "vscode": "^1.82.0" }, "categories": [ "Other" @@ -40,19 +40,25 @@ } }, "scripts": { - "vscode:prepublish": "tsc -p ./", + "vscode:prepublish": "npm run compile", "compile": "tsc -p ./", - "update-vscode": "node ./node_modules/vscode/bin/install", - "postinstall": "node ./node_modules/vscode/bin/install" + "watch": "tsc -watch -p ./", + "pretest": "npm run compile", + "test": "node ./out/test/runTest.js" }, "devDependencies": { - "@types/mocha": "10.0.2", - "@types/node": "18.17.19", - "typescript": "5.2.2", - "vscode": "1.1.37" + "@types/glob": "^7.2.0", + "@types/mocha": "^10.0.2", + "@types/node": "^18.18.0", + "@types/vscode": "^1.82.0", + "@vscode/test-electron": "^2.3.4", + "glob": "^7.2.3", + "mocha": "^10.2.0", + "source-map-support": "^0.5.21", + "typescript": "^5.2.2" }, "dependencies": { - "vscode-languageclient": "^9.0.0", + "vscode-languageclient": "^9.0.1", "vscode-languageserver-protocol": "^3.16.0-next.6" } } diff --git a/vscode-testextension/src/extension.ts b/vscode-testextension/src/extension.ts index b0c06c168..72d2e32ec 100644 --- a/vscode-testextension/src/extension.ts +++ b/vscode-testextension/src/extension.ts @@ -38,13 +38,13 @@ export async function activate(context: ExtensionContext) { // run: { command: serverExe, args: ['-lsp', '-d'] }, run: { command: serverExe, - args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/netcoreapp3.1/win7-x64/SampleServer.dll"], + args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net6.0/win7-x64/SampleServer.dll"], transport: TransportKind.pipe, }, // debug: { command: serverExe, args: ['-lsp', '-d'] } debug: { command: serverExe, - args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/netcoreapp3.1/win7-x64/SampleServer.dll"], + args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net6.0/win7-x64/SampleServer.dll"], transport: TransportKind.pipe, runtime: "", }, diff --git a/vscode-testextension/test/extension.test.ts b/vscode-testextension/test/extension.test.ts deleted file mode 100644 index cf47b2c33..000000000 --- a/vscode-testextension/test/extension.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -// -// Note: This example test is leveraging the Mocha test framework. -// Please refer to their documentation on https://mochajs.org/ for help. -// - -// The module 'assert' provides assertion methods from node -import * as assert from 'assert'; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -import * as vscode from 'vscode'; -import * as myExtension from '../src/extension'; - -// Defines a Mocha test suite to group tests of similar kind together -suite("Extension Tests", () => { - - // Defines a Mocha unit test - test("Something 1", () => { - assert.equal(-1, [1, 2, 3].indexOf(5)); - assert.equal(-1, [1, 2, 3].indexOf(0)); - }); -}); \ No newline at end of file diff --git a/vscode-testextension/test/index.ts b/vscode-testextension/test/index.ts deleted file mode 100644 index e3cebd0d1..000000000 --- a/vscode-testextension/test/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -// -// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING -// -// This file is providing the test runner to use when running extension tests. -// By default the test runner in use is Mocha based. -// -// You can provide your own test runner if you want to override it by exporting -// a function run(testRoot: string, clb: (error:Error) => void) that the extension -// host can call to run the tests. The test runner is expected to use console.log -// to report the results back to the caller. When the tests are finished, return -// a possible error to the callback or null if none. - -var testRunner = require('vscode/lib/testrunner'); - -// You can directly control Mocha options by uncommenting the following lines -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ - ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true // colored output from test results -}); - -module.exports = testRunner; \ No newline at end of file diff --git a/vscode-testextension/test/runTest.ts b/vscode-testextension/test/runTest.ts new file mode 100644 index 000000000..c70caa8f0 --- /dev/null +++ b/vscode-testextension/test/runTest.ts @@ -0,0 +1,23 @@ +import * as path from 'path'; + +import { runTests } from '@vscode/test-electron'; + +async function main() { + try { + // The folder containing the Extension Manifest package.json + // Passed to `--extensionDevelopmentPath` + const extensionDevelopmentPath = path.resolve(__dirname, '../../'); + + // The path to the extension test script + // Passed to --extensionTestsPath + const extensionTestsPath = path.resolve(__dirname, './suite/index'); + + // Download VS Code, unzip it and run the integration test + await runTests({ extensionDevelopmentPath, extensionTestsPath }); + } catch (err) { + console.error('Failed to run tests'); + process.exit(1); + } +} + +main(); \ No newline at end of file diff --git a/vscode-testextension/test/suite/extension.test.ts b/vscode-testextension/test/suite/extension.test.ts new file mode 100644 index 000000000..a4b50bcf1 --- /dev/null +++ b/vscode-testextension/test/suite/extension.test.ts @@ -0,0 +1,15 @@ +import * as assert from 'assert'; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from 'vscode'; +// import * as myExtension from '../../extension'; + +suite('Extension Test Suite', () => { + vscode.window.showInformationMessage('Start all tests.'); + + test('Sample test', () => { + assert.strictEqual([1, 2, 3].indexOf(5), -1); + assert.strictEqual([1, 2, 3].indexOf(0), -1); + }); +}); \ No newline at end of file diff --git a/vscode-testextension/test/suite/index.ts b/vscode-testextension/test/suite/index.ts new file mode 100644 index 000000000..0df46c060 --- /dev/null +++ b/vscode-testextension/test/suite/index.ts @@ -0,0 +1,37 @@ +import * as path from 'path'; +import * as Mocha from 'mocha'; +import * as glob from 'glob'; + +export function run(): Promise { + // Create the mocha test + const mocha = new Mocha({ + ui: 'tdd' + }); + + const testsRoot = path.resolve(__dirname, '..'); + + return new Promise((c, e) => { + glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { + if (err) { + return e(err); + } + + // Add files to the test suite + files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + + try { + // Run the mocha test + mocha.run(failures => { + if (failures > 0) { + e(new Error(`${failures} tests failed.`)); + } else { + c(); + } + }); + } catch (err) { + console.error(err); + e(err); + } + }); + }); +} \ No newline at end of file diff --git a/vscode-testextension/tsconfig.json b/vscode-testextension/tsconfig.json index e8ded494b..f8c288e00 100644 --- a/vscode-testextension/tsconfig.json +++ b/vscode-testextension/tsconfig.json @@ -4,9 +4,9 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "out", - "lib": ["es2016"], + "lib": ["es2020"], "sourceMap": true, "skipLibCheck": true }, - "exclude": ["node_modules", "server"] + "exclude": ["node_modules", ".vscode-test"] } From 0c0383d0736cb1c0917a38354deb771cfd420d4d Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Fri, 29 Sep 2023 01:06:07 +0200 Subject: [PATCH 194/647] Update npm dependencies to latest versions --- vscode-testextension/package-lock.json | 65 +++++++++++--------------- vscode-testextension/package.json | 6 +-- 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 111470168..21e67354b 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -10,15 +10,15 @@ "license": "MIT", "dependencies": { "vscode-languageclient": "^9.0.1", - "vscode-languageserver-protocol": "^3.16.0-next.6" + "vscode-languageserver-protocol": "^3.17.5" }, "devDependencies": { - "@types/glob": "^7.2.0", + "@types/glob": "^8.1.0", "@types/mocha": "^10.0.2", "@types/node": "^18.18.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", - "glob": "^7.2.3", + "glob": "^8.1.0", "mocha": "^10.2.0", "source-map-support": "^0.5.21", "typescript": "^5.2.2" @@ -37,12 +37,12 @@ } }, "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==", "dev": true, "dependencies": { - "@types/minimatch": "*", + "@types/minimatch": "^5.1.2", "@types/node": "*" } }, @@ -437,20 +437,19 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -689,15 +688,22 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" + } + }, + "node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/mocha": { @@ -1120,25 +1126,6 @@ "vscode": "^1.82.0" } }, - "node_modules/vscode-languageclient/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/vscode-languageclient/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/vscode-languageserver-protocol": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 4a7299bef..7d74d6529 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -47,18 +47,18 @@ "test": "node ./out/test/runTest.js" }, "devDependencies": { - "@types/glob": "^7.2.0", + "@types/glob": "^8.1.0", "@types/mocha": "^10.0.2", "@types/node": "^18.18.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", - "glob": "^7.2.3", + "glob": "^8.1.0", "mocha": "^10.2.0", "source-map-support": "^0.5.21", "typescript": "^5.2.2" }, "dependencies": { "vscode-languageclient": "^9.0.1", - "vscode-languageserver-protocol": "^3.16.0-next.6" + "vscode-languageserver-protocol": "^3.17.5" } } From b2c9529322a1d5173e793d49ec132c1d04c980ef Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 30 Sep 2023 15:06:56 +0200 Subject: [PATCH 195/647] Update dependency glob to v10 --- vscode-testextension/package-lock.json | 358 ++++++++++++++++++++++- vscode-testextension/package.json | 4 +- vscode-testextension/test/suite/index.ts | 36 +-- 3 files changed, 360 insertions(+), 38 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 21e67354b..32b58bf83 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -15,10 +15,10 @@ "devDependencies": { "@types/glob": "^8.1.0", "@types/mocha": "^10.0.2", - "@types/node": "^18.18.0", + "@types/node": "^20.8.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", - "glob": "^8.1.0", + "glob": "^10.3.10", "mocha": "^10.2.0", "source-map-support": "^0.5.21", "typescript": "^5.2.2" @@ -27,6 +27,112 @@ "vscode": "^1.82.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -59,9 +165,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.18.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.0.tgz", - "integrity": "sha512-3xA4X31gHT1F1l38ATDIL9GpRLdwVhnEFC8Uikv5ZLlXATwrCYyPq7ZWHxzxc3J/30SUiwiYT+bQe0/XvKlWbw==", + "version": "20.8.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz", + "integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==", "dev": true }, "node_modules/@types/vscode": { @@ -305,6 +411,20 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -343,6 +463,12 @@ "node": ">=0.3.1" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -407,6 +533,22 @@ "flat": "cli.js" } }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -437,19 +579,22 @@ } }, "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -467,6 +612,30 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -612,6 +781,30 @@ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -706,6 +899,15 @@ "balanced-match": "^1.0.0" } }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -895,6 +1097,40 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -993,6 +1229,39 @@ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1035,6 +1304,21 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1047,6 +1331,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -1140,6 +1437,21 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -1163,6 +1475,24 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 7d74d6529..4fc42ed8d 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -49,10 +49,10 @@ "devDependencies": { "@types/glob": "^8.1.0", "@types/mocha": "^10.0.2", - "@types/node": "^18.18.0", + "@types/node": "^20.8.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", - "glob": "^8.1.0", + "glob": "^10.3.10", "mocha": "^10.2.0", "source-map-support": "^0.5.21", "typescript": "^5.2.2" diff --git a/vscode-testextension/test/suite/index.ts b/vscode-testextension/test/suite/index.ts index 0df46c060..b1db95629 100644 --- a/vscode-testextension/test/suite/index.ts +++ b/vscode-testextension/test/suite/index.ts @@ -1,8 +1,8 @@ import * as path from 'path'; import * as Mocha from 'mocha'; -import * as glob from 'glob'; +import { glob } from 'glob'; -export function run(): Promise { +export async function run(): Promise { // Create the mocha test const mocha = new Mocha({ ui: 'tdd' @@ -10,28 +10,20 @@ export function run(): Promise { const testsRoot = path.resolve(__dirname, '..'); - return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { - if (err) { - return e(err); - } + var files = await glob('**/**.test.js', { cwd: testsRoot }); - // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + // Add files to the test suite + files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); - try { - // Run the mocha test - mocha.run(failures => { - if (failures > 0) { - e(new Error(`${failures} tests failed.`)); - } else { - c(); - } - }); - } catch (err) { - console.error(err); - e(err); + try { + // Run the mocha test + mocha.run(failures => { + if (failures > 0) { + throw new Error(`${failures} tests failed.`); } }); - }); + } catch (err) { + console.error(err); + throw err; + } } \ No newline at end of file From 7023c31e257c1d03a89977840fa142ce479619ab Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:26:30 +0200 Subject: [PATCH 196/647] Regenerate ci github workflows from Nuke build --- .build/Build.cs | 2 + .build/Configuration.cs | 4 +- .build/Solution.cs | 116 ++++---------------------------- .github/workflows/ci-ignore.yml | 2 +- .github/workflows/ci.yml | 29 ++++---- .nuke/build.schema.json | 6 ++ 6 files changed, 39 insertions(+), 120 deletions(-) diff --git a/.build/Build.cs b/.build/Build.cs index 86b7c5abc..e35ee98f1 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -17,6 +17,7 @@ namespace Build; [DotNetVerbosityMapping] [MSBuildVerbosityMapping] [NuGetVerbosityMapping] +[LocalBuildConventions] public sealed partial class Solution : NukeBuild, ICanRestoreWithDotNetCore, ICanBuildWithDotNetCore, @@ -28,6 +29,7 @@ public sealed partial class Solution : NukeBuild, IGenerateCodeCoverageReport, IGenerateCodeCoverageSummary, IGenerateCodeCoverageBadges, + IGenerateDocFx, IHaveConfiguration { /// diff --git a/.build/Configuration.cs b/.build/Configuration.cs index 324bc331a..6f2fcceaf 100644 --- a/.build/Configuration.cs +++ b/.build/Configuration.cs @@ -6,8 +6,8 @@ namespace Build; [TypeConverter(typeof(TypeConverter))] public class Configuration : Enumeration { - public static Configuration Debug => new() { Value = nameof(Debug) }; - public static Configuration Release => new() { Value = nameof(Release) }; + public static Configuration Debug = new() { Value = nameof(Debug) }; + public static Configuration Release = new() { Value = nameof(Release) }; public static implicit operator string(Configuration configuration) => configuration.Value; } diff --git a/.build/Solution.cs b/.build/Solution.cs index 3a21d42aa..00877d256 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -70,18 +70,15 @@ internal class LocalConstants [PrintCIEnvironment] [UploadLogs] [TitleEvents] +[ContinuousIntegrationConventions] public partial class Solution { public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware( RocketSurgeonGitHubActionsConfiguration configuration ) { - foreach (var item in configuration.DetailedTriggers.OfType()) - { - item.IncludePaths = LocalConstants.PathsIgnore; - } + configuration.IncludeRepositoryConfigurationFiles(); - configuration.Jobs.RemoveAt(1); ( (RocketSurgeonsGithubActionsJob)configuration.Jobs[0] ).Steps = new List { new RunStep("N/A") @@ -97,104 +94,17 @@ public static RocketSurgeonGitHubActionsConfiguration CiMiddleware( RocketSurgeonGitHubActionsConfiguration configuration ) { - foreach (var item in configuration.DetailedTriggers.OfType()) - { - item.ExcludePaths = LocalConstants.PathsIgnore; - } - - var buildJob = configuration.Jobs.OfType().First(z => z.Name == "Build"); - buildJob.FailFast = false; - var checkoutStep = buildJob.Steps.OfType().Single(); - // For fetch all - checkoutStep.FetchDepth = 0; - buildJob.Environment["NUGET_PACKAGES"] = "${{ github.workspace }}/.nuget/packages"; - buildJob.Steps.InsertRange( - buildJob.Steps.IndexOf(checkoutStep) + 1, - new BaseGitHubActionsStep[] - { - new RunStep("Fetch all history for all tags and branches") - { - Run = "git fetch --prune" - }, - new UsingStep("NuGet Cache") - { - Uses = "actions/cache@v2", - With = - { - ["path"] = "${{ github.workspace }}/.nuget/packages", - // keep in mind using central package versioning here - ["key"] = - "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}", - ["restore-keys"] = @"| - ${{ runner.os }}-nuget-" - } - }, - new SetupDotNetStep("Use .NET Core 3.1 SDK") - { - DotNetVersion = "3.1.x" - }, - new SetupDotNetStep("Use .NET Core 7.0 SDK") - { - DotNetVersion = "7.0.x" - }, - } - ); - - buildJob.Steps.Add( - new UsingStep("Publish Coverage") - { - Uses = "codecov/codecov-action@v1", - With = new Dictionary - { - ["name"] = "actions-${{ matrix.os }}", - } - } - ); - - buildJob.Steps.Add( - new UploadArtifactStep("Publish logs") - { - Name = "logs", - Path = "artifacts/logs/", - If = "always()" - } - ); - - buildJob.Steps.Add( - new UploadArtifactStep("Publish coverage data") - { - Name = "coverage", - Path = "coverage/", - If = "always()" - } - ); - - buildJob.Steps.Add( - new UploadArtifactStep("Publish test data") - { - Name = "test data", - Path = "artifacts/test/", - If = "always()" - } - ); - - buildJob.Steps.Add( - new UploadArtifactStep("Publish NuGet Packages") - { - Name = "nuget", - Path = "artifacts/nuget/", - If = "always()" - } - ); - - buildJob.Steps.Add( - new UploadArtifactStep("Publish Docs") - { - Name = "docs", - Path = "artifacts/docs/", - If = "always()" - } - ); + configuration + .ExcludeRepositoryConfigurationFiles() + .AddNugetPublish() + .Jobs.OfType() + .First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase)) + .ConfigureStep(step => step.FetchDepth = 0) + .UseDotNetSdks("3.1", "7.0") + .AddNuGetCache() + .PublishLogs() + .PublishArtifacts() + .FailFast = false; return configuration; } diff --git a/.github/workflows/ci-ignore.yml b/.github/workflows/ci-ignore.yml index a5c03cbb6..9f2bff03f 100644 --- a/.github/workflows/ci-ignore.yml +++ b/.github/workflows/ci-ignore.yml @@ -69,7 +69,7 @@ on: - '.github/renovate.json' jobs: - Build: + build: strategy: matrix: os: [windows-latest, ubuntu-latest] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0a419e91..1041e266b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,13 +69,13 @@ on: - '.github/renovate.json' jobs: - Build: + build: env: NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages' strategy: fail-fast: false matrix: - os: [macOS-latest, windows-latest, ubuntu-latest] + os: [macos-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -83,9 +83,6 @@ jobs: with: clean: 'false' fetch-depth: '0' - - name: Fetch all history for all tags and branches - run: | - git fetch --prune - name: NuGet Cache uses: actions/cache@v3 with: @@ -105,18 +102,29 @@ jobs: run: | dotnet tool restore - name: 🎁 Restore + id: restore run: | dotnet nuke Restore --skip - name: βš™ Build + id: build run: | dotnet nuke Build --skip - name: 🚦 Test + id: test run: | dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip - name: πŸ“¦ Pack + id: pack run: | dotnet nuke Pack --skip + - name: 🏺 Publish coverage data + if: always() + uses: actions/upload-artifact@v3 + with: + name: 'coverage' + path: 'coverage/' - name: 🐿 Publish Coverage + if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]') uses: codecov/codecov-action@v4.0.0-beta.2 with: name: 'actions-${{ matrix.os }}' @@ -126,12 +134,6 @@ jobs: with: name: 'logs' path: 'artifacts/logs/' - - name: 🏺 Publish coverage data - if: always() - uses: actions/upload-artifact@v3 - with: - name: 'coverage' - path: 'coverage/' - name: 🏺 Publish test data if: always() uses: actions/upload-artifact@v3 @@ -144,8 +146,7 @@ jobs: with: name: 'nuget' path: 'artifacts/nuget/' - - name: 🏺 Publish Docs - if: always() + - name: 🏺 Publish Documentation uses: actions/upload-artifact@v3 with: name: 'docs' @@ -153,7 +154,7 @@ jobs: Publish: needs: - Build + uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.3 secrets: RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}' RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}' - uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.3 diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 6b089e946..57832ac84 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -74,6 +74,10 @@ "type": "string", "description": "Root directory during build execution" }, + "Serve": { + "type": "boolean", + "description": "serve the docs" + }, "Skip": { "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", @@ -84,6 +88,7 @@ "BuildVersion", "Clean", "CoreBuild", + "CoreDocs", "CorePack", "CoreRestore", "CoreTest", @@ -120,6 +125,7 @@ "BuildVersion", "Clean", "CoreBuild", + "CoreDocs", "CorePack", "CoreRestore", "CoreTest", From 13ddb074bbbc6f2c8d28b8a1fc6bca2b195927dd Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:51:13 +0200 Subject: [PATCH 197/647] Add npm to CI build --- .build/Build.cs | 19 ++++++++++++++++++- .github/workflows/ci.yml | 8 ++++++++ .nuke/build.schema.json | 4 ++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.build/Build.cs b/.build/Build.cs index e35ee98f1..f9368d479 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -3,9 +3,11 @@ using Nuke.Common.Execution; using Nuke.Common.Git; using Nuke.Common.IO; +using Nuke.Common.Tooling; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.MSBuild; +using Nuke.Common.Tools.Npm; using Rocket.Surgery.Nuke.DotNetCore; namespace Build; @@ -47,7 +49,8 @@ public sealed partial class Solution : NukeBuild, .DependsOn(Restore) .DependsOn(Build) .DependsOn(Test) - .DependsOn(Pack); + .DependsOn(Pack) + .DependsOn(TestVscodeTestExtension); public Target Build => _ => _.Inherit(x => x.CoreBuild); @@ -61,6 +64,18 @@ public sealed partial class Solution : NukeBuild, public Target Test => _ => _.Inherit(x => x.CoreTest); + public Target NpmInstall => _ => _ + .Executes(() => + NpmTasks.NpmCi(s => s + .SetProcessWorkingDirectory(VscodeTestExtensionProjectDirectory))); + + public Target TestVscodeTestExtension => _ => _ + .DependsOn(NpmInstall) + .Executes(() => + NpmTasks.NpmRun(s => s + .SetProcessWorkingDirectory(VscodeTestExtensionProjectDirectory) + .SetCommand("test"))); + public Target BuildVersion => _ => _.Inherit(x => x.BuildVersion) .Before(Default) .Before(Clean); @@ -68,4 +83,6 @@ public sealed partial class Solution : NukeBuild, [Parameter("Configuration to build")] public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release; AbsolutePath ICanUpdateReadme.ReadmeFilePath => RootDirectory / "README.md"; + + private const string VscodeTestExtensionProjectDirectory = "vscode-testextension"; } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1041e266b..7a9b69e5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,6 +113,14 @@ jobs: id: test run: | dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip + - name: Npm Install + id: npmInstall + run: | + dotnet nuke NpmInstall --skip + - name: 🚦 Test Vscode Test Extension + id: testVscodeTestExtension + run: | + dotnet nuke TestVscodeTestExtension --skip - name: πŸ“¦ Pack id: pack run: | diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 57832ac84..e18c1f5f0 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -103,9 +103,11 @@ "GenerateCodeCoverageReportCobertura", "GenerateCodeCoverageSummary", "GenerateReadme", + "NpmInstall", "Pack", "Restore", "Test", + "TestVscodeTestExtension", "Trigger_Code_Coverage_Reports", "TriggerCodeCoverageReports" ] @@ -140,9 +142,11 @@ "GenerateCodeCoverageReportCobertura", "GenerateCodeCoverageSummary", "GenerateReadme", + "NpmInstall", "Pack", "Restore", "Test", + "TestVscodeTestExtension", "Trigger_Code_Coverage_Reports", "TriggerCodeCoverageReports" ] From 10f5e47cd24692bea7f2e66043d58f95f1ba2bf9 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:55:51 +0200 Subject: [PATCH 198/647] Use temporary shorter path for vscode user data dir --- vscode-testextension/package-lock.json | 69 ++++++++++++++++++++++++++ vscode-testextension/package.json | 1 + vscode-testextension/test/runTest.ts | 20 +++++++- 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 32b58bf83..4f5fe8deb 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -21,6 +21,7 @@ "glob": "^10.3.10", "mocha": "^10.2.0", "source-map-support": "^0.5.21", + "tmp-promise": "^3.0.3", "typescript": "^5.2.2" }, "engines": { @@ -1194,6 +1195,53 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -1371,6 +1419,27 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "dependencies": { + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" + } + }, + "node_modules/tmp-promise": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", + "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", + "dev": true, + "dependencies": { + "tmp": "^0.2.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 4fc42ed8d..4f17df07a 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -55,6 +55,7 @@ "glob": "^10.3.10", "mocha": "^10.2.0", "source-map-support": "^0.5.21", + "tmp-promise": "^3.0.3", "typescript": "^5.2.2" }, "dependencies": { diff --git a/vscode-testextension/test/runTest.ts b/vscode-testextension/test/runTest.ts index c70caa8f0..be768ad87 100644 --- a/vscode-testextension/test/runTest.ts +++ b/vscode-testextension/test/runTest.ts @@ -1,4 +1,5 @@ import * as path from 'path'; +import * as tmp from 'tmp-promise'; import { runTests } from '@vscode/test-electron'; @@ -12,10 +13,25 @@ async function main() { // Passed to --extensionTestsPath const extensionTestsPath = path.resolve(__dirname, './suite/index'); - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); + // The path to the user data directory used by vscode + // As the default one is too long (> 103 characters) on some CI setups, forcing it to a temporary and hopefully shorter one. + const userDataDir = await tmp.dir({ unsafeCleanup: true }); + + try { + // Download VS Code, unzip it and run the integration test + await runTests({ + extensionDevelopmentPath, + extensionTestsPath, + launchArgs: ["--user-data-dir", userDataDir.path] + }); + } + finally + { + await userDataDir.cleanup(); + } } catch (err) { console.error('Failed to run tests'); + console.error(err); process.exit(1); } } From 478973917438f5266e07ade5cd38e905e6b13b87 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 03:18:04 +0000 Subject: [PATCH 199/647] Update dependency Nerdbank.Streams to v2.10.72 --- Directory.Packages.props | 2 +- benchmarks/Pipeline/Pipeline.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 93570b14d..975b26ddf 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index d11467700..adf070329 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -9,7 +9,7 @@ - + From cd644b296847a04402bcf55ad8c7838019f29728 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 06:38:16 +0000 Subject: [PATCH 200/647] Update dependency @types/node to v20.8.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 32b58bf83..3cd69ee09 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -165,9 +165,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz", - "integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==", + "version": "20.8.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", + "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==", "dev": true }, "node_modules/@types/vscode": { From a6082db1b19436194bbf4f6b11b0630246638f38 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Tue, 3 Oct 2023 01:16:52 +0200 Subject: [PATCH 201/647] Run npm test in headless mode --- .build/Build.cs | 5 ++--- .build/Solution.cs | 22 ++++++++++++++++++++++ .github/workflows/ci.yml | 18 ++++++++++-------- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/.build/Build.cs b/.build/Build.cs index f9368d479..fe12092ef 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -49,8 +49,7 @@ public sealed partial class Solution : NukeBuild, .DependsOn(Restore) .DependsOn(Build) .DependsOn(Test) - .DependsOn(Pack) - .DependsOn(TestVscodeTestExtension); + .DependsOn(Pack); public Target Build => _ => _.Inherit(x => x.CoreBuild); @@ -69,7 +68,7 @@ public sealed partial class Solution : NukeBuild, NpmTasks.NpmCi(s => s .SetProcessWorkingDirectory(VscodeTestExtensionProjectDirectory))); - public Target TestVscodeTestExtension => _ => _ + public Target TestVscodeExtension => _ => _ .DependsOn(NpmInstall) .Executes(() => NpmTasks.NpmRun(s => s diff --git a/.build/Solution.cs b/.build/Solution.cs index 00877d256..a1132e6cf 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -102,6 +102,7 @@ RocketSurgeonGitHubActionsConfiguration configuration .ConfigureStep(step => step.FetchDepth = 0) .UseDotNetSdks("3.1", "7.0") .AddNuGetCache() + .AddVscodeExtensionTests() .PublishLogs() .PublishArtifacts() .FailFast = false; @@ -109,3 +110,24 @@ RocketSurgeonGitHubActionsConfiguration configuration return configuration; } } + +public static class Extensions +{ + public static RocketSurgeonsGithubActionsJob AddVscodeExtensionTests(this RocketSurgeonsGithubActionsJob job) + { + return job + .AddStep(new RunStep("Npm install") { + Run = string.Join(Environment.NewLine, [ + "cd vscode-testextension", + "npm ci", + "cd .." + ]) + }) + .AddStep(new UsingStep("Vscode extension tests") { + Uses = "coactions/setup-xvfb@v1", + With = { + ["run"] = "npm run test", + ["working-directory"] = "vscode-testextension" + }}); + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a9b69e5b..3b281d9ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,18 +113,20 @@ jobs: id: test run: | dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip - - name: Npm Install - id: npmInstall - run: | - dotnet nuke NpmInstall --skip - - name: 🚦 Test Vscode Test Extension - id: testVscodeTestExtension - run: | - dotnet nuke TestVscodeTestExtension --skip - name: πŸ“¦ Pack id: pack run: | dotnet nuke Pack --skip + - name: Npm install + run: | + cd vscode-testextension + npm ci + cd .. + - name: 🚦 Vscode extension tests + uses: coactions/setup-xvfb@v1 + with: + run: 'npm run test' + working-directory: 'vscode-testextension' - name: 🏺 Publish coverage data if: always() uses: actions/upload-artifact@v3 From 1184d10fc6603b3de63a4eb2ff91e94b2e9126e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 04:23:37 +0000 Subject: [PATCH 202/647] Update dependency Verify.Xunit to v22 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 975b26ddf..df6dd933b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From a62692828644bfe31471623b3acb96dd822c9bc0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 06:44:32 +0000 Subject: [PATCH 203/647] Update dependency @vscode/test-electron to v2.3.5 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 163f72a82..2d1a9d949 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -178,9 +178,9 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.4.tgz", - "integrity": "sha512-eWzIqXMhvlcoXfEFNWrVu/yYT5w6De+WZXR/bafUQhAp8+8GkQo95Oe14phwiRUPv8L+geAKl/QM2+PoT3YW3g==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.5.tgz", + "integrity": "sha512-lAW7nQ0HuPqJnGJrtCzEKZCICtRizeP6qNanyCrjmdCOAAWjX3ixiG8RVPwqsYPQBWLPgYuE12qQlwXsOR/2fQ==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", From a758a92baf251e931c2f38cf57b47ff3b3d741dd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:10:35 +0000 Subject: [PATCH 204/647] Update dependency BenchmarkDotNet to v0.13.9 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index adf070329..d1ea04f8e 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From c2c8c3fe1640c573bcdb1c7d972edb219afb92b9 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Thu, 5 Oct 2023 21:14:12 +0200 Subject: [PATCH 205/647] Update verify --- Directory.Packages.props | 4 ++-- ...ould_Report_Diagnostic_If_Missing_Information.verified.txt | 4 ---- ...ons_And_Infers_Direction_DidChangeTextHandler.verified.txt | 2 -- ...otifications_And_Infers_Direction_ExitHandler.verified.txt | 2 -- ...orts_Generating_Requests_And_Infers_Direction.verified.txt | 2 -- 5 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index df6dd933b..55c10b4c4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,8 +40,8 @@ - - + + diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt index 7ed864e4c..3a81787e4 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt @@ -6,8 +6,6 @@ Severity: Error, WarningLevel: 0, Location: Test0.cs: (15,66)-(15,88), - Description: , - HelpLink: , MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., Message: Could not infer the request router(s) to use, please specify the target interface(s)., Category: JsonRPC @@ -18,8 +16,6 @@ Severity: Error, WarningLevel: 0, Location: Test0.cs: (15,90)-(15,112), - Description: , - HelpLink: , MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., Message: Could not infer the request router(s) to use, please specify the target interface(s)., Category: JsonRPC diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt index c06cef434..64ea0be1b 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt @@ -6,8 +6,6 @@ Severity: Info, WarningLevel: 1, Location: Test0.cs: (17,21)-(17,50), - Description: , - HelpLink: , MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., Message: No Response Router Provided for handler {0}, defaulting to {1}., Category: JsonRPC diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt index ac9e982e1..03ae9d9ee 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt @@ -6,8 +6,6 @@ Severity: Info, WarningLevel: 1, Location: Test0.cs: (16,21)-(16,33), - Description: , - HelpLink: , MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., Message: No Response Router Provided for handler {0}, defaulting to {1}., Category: JsonRPC diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt index c442e1600..e7f3821c1 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt @@ -6,8 +6,6 @@ Severity: Info, WarningLevel: 1, Location: Test0.cs: (17,21)-(17,39), - Description: , - HelpLink: , MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., Message: No Response Router Provided for handler {0}, defaulting to {1}., Category: JsonRPC From 32ac8881d230d7fcab301ff3a3ffc6af6e9e2035 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 07:37:47 +0000 Subject: [PATCH 206/647] Update reportgenerator to v5.1.26 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 29b0b7f6c..7e7918e98 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.25", + "version": "5.1.26", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index df6dd933b..08d668dae 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 141e6f44858968fc3abdda594f860844fe2b3211 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 01:52:09 +0000 Subject: [PATCH 207/647] Update dependency @types/node to v20.8.3 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 2d1a9d949..3ce0d97b5 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", - "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==", + "version": "20.8.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.3.tgz", + "integrity": "sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==", "dev": true }, "node_modules/@types/vscode": { From a3416b4c895084b96b359a0cde041e0976d7809d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:36:58 +0000 Subject: [PATCH 208/647] Update dependency dotnet-sdk to v7.0.402 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 9bb9f62b0..75540657a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.401", + "version": "7.0.402", "rollForward": "latestMinor" } } \ No newline at end of file From 8ac3cc30f35922cc47026f829c643546796f3ed4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 16:56:06 +0000 Subject: [PATCH 209/647] Update dependency Rocket.Surgery.Nuke to v1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c2cfe7a05..287ebebe8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From 044adfec279181ae0c7755857c7bcbc377d1eecb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:05:11 +0000 Subject: [PATCH 210/647] Update dependency Verify.Xunit to v22.1.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 287ebebe8..d9ea5f60f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 561392d0853e6a8ed757a8d9d28611d832210b7b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:05:05 +0000 Subject: [PATCH 211/647] Update dependency @types/node to v20.8.4 --- vscode-testextension/package-lock.json | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3ce0d97b5..73295538d 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,10 +166,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.3.tgz", - "integrity": "sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==", - "dev": true + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dev": true, + "dependencies": { + "undici-types": "~5.25.1" + } }, "node_modules/@types/vscode": { "version": "1.82.0", @@ -1465,6 +1468,12 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "dev": true + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", From cd1659147814bd0ae383d6a54fbf57c4127bc8d9 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:16:25 +0200 Subject: [PATCH 212/647] Use new WorkingDirectory property for RunStep --- .build/Build.cs | 2 +- .build/Solution.cs | 12 +++++------- .github/workflows/ci.yml | 3 +-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.build/Build.cs b/.build/Build.cs index fe12092ef..8097b5d06 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -83,5 +83,5 @@ public sealed partial class Solution : NukeBuild, AbsolutePath ICanUpdateReadme.ReadmeFilePath => RootDirectory / "README.md"; - private const string VscodeTestExtensionProjectDirectory = "vscode-testextension"; + internal const string VscodeTestExtensionProjectDirectory = "vscode-testextension"; } diff --git a/.build/Solution.cs b/.build/Solution.cs index a1132e6cf..bec19e2e8 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -117,17 +117,15 @@ public static RocketSurgeonsGithubActionsJob AddVscodeExtensionTests(this Rocket { return job .AddStep(new RunStep("Npm install") { - Run = string.Join(Environment.NewLine, [ - "cd vscode-testextension", - "npm ci", - "cd .." - ]) + Run = "npm ci", + WorkingDirectory = Solution.VscodeTestExtensionProjectDirectory }) .AddStep(new UsingStep("Vscode extension tests") { Uses = "coactions/setup-xvfb@v1", With = { ["run"] = "npm run test", - ["working-directory"] = "vscode-testextension" - }}); + ["working-directory"] = Solution.VscodeTestExtensionProjectDirectory + } + }); } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b281d9ce..c8e1940f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,10 +118,9 @@ jobs: run: | dotnet nuke Pack --skip - name: Npm install + working-directory: vscode-testextension run: | - cd vscode-testextension npm ci - cd .. - name: 🚦 Vscode extension tests uses: coactions/setup-xvfb@v1 with: From 09d173e9bc28bc3911f2c4c4bf02cf55bbe8a8d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 02:00:35 +0000 Subject: [PATCH 213/647] Update dependency @types/node to v20.8.6 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 73295538d..0b6853348 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", - "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "version": "20.8.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", + "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", "dev": true, "dependencies": { "undici-types": "~5.25.1" From e580ecfe8cd2046ad2bdad43930366a3e3bdfc12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 04:58:58 +0000 Subject: [PATCH 214/647] Update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d9ea5f60f..384d06f0b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From 61522a2c63ffa0a114468afd4af9b864f891c617 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:54:56 +0000 Subject: [PATCH 215/647] Update dependency xunit to v2.5.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 384d06f0b..b52df7c1a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From 672a5ef14190b9f5b356ca261482d4f964034b6b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:47:39 +0000 Subject: [PATCH 216/647] Update dependency DryIoc.Internal to v5.4.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b52df7c1a..c8e4bd249 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -60,6 +60,6 @@ - + \ No newline at end of file From dea4f0fa93d08f32b835ce6f578324faeb80686d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:47:30 +0000 Subject: [PATCH 217/647] Update actions/checkout action to v4.1.1 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b281d9ce..6ce75aa9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 2435df458..6b0a186e4 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index c41c06b78..a40efdd4f 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 430ccc8ac..0e253fb21 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 5084da4e7..667080585 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 with: ref: ${{ github.sha }} fetch-depth: 0 From 10b0bd3d5ee39a713e7b0030883237a9451a9535 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:36:26 +0000 Subject: [PATCH 218/647] Update dependency @types/mocha to v10.0.3 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 0b6853348..16938de8d 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -160,9 +160,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.2.tgz", - "integrity": "sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.3.tgz", + "integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==", "dev": true }, "node_modules/@types/node": { From cd1d2d202992cef9932d3847a9e1978543da7b03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:21:31 +0000 Subject: [PATCH 219/647] Update dependency @types/node to v20.8.7 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 16938de8d..d3fd8e08c 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", - "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", + "version": "20.8.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.7.tgz", + "integrity": "sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==", "dev": true, "dependencies": { "undici-types": "~5.25.1" From b330ee22f7b955a25f2aa17cec9c921a5df5d261 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:21:38 +0000 Subject: [PATCH 220/647] Update dependency Verify.Xunit to v22.1.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b52df7c1a..bb590309d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From f0cb2655173478bb7eff42f77f9553ddcdc4f000 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 18:18:18 +0000 Subject: [PATCH 221/647] Update dependency @types/vscode to v1.83.1 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index d3fd8e08c..6ab63fabf 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,9 +175,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.82.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", - "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", + "version": "1.83.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.83.1.tgz", + "integrity": "sha512-BHu51NaNKOtDf3BOonY3sKFFmZKEpRkzqkZVpSYxowLbs5JqjOQemYFob7Gs5rpxE5tiGhfpnMpcdF/oKrLg4w==", "dev": true }, "node_modules/@vscode/test-electron": { From 86dc4ac3db664b3973eda6525f681e23c62bc85a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 22:07:57 +0000 Subject: [PATCH 222/647] Update dependency Rocket.Surgery.Nuke to v1.7.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index bb590309d..89368e67f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From adbfe192d7c7e073b2555f8916748c61c88baadb Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:30:54 +0200 Subject: [PATCH 223/647] Use new HeadlessRunStep --- .build/Solution.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.build/Solution.cs b/.build/Solution.cs index bec19e2e8..eec2c6977 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -120,12 +120,9 @@ public static RocketSurgeonsGithubActionsJob AddVscodeExtensionTests(this Rocket Run = "npm ci", WorkingDirectory = Solution.VscodeTestExtensionProjectDirectory }) - .AddStep(new UsingStep("Vscode extension tests") { - Uses = "coactions/setup-xvfb@v1", - With = { - ["run"] = "npm run test", - ["working-directory"] = Solution.VscodeTestExtensionProjectDirectory - } + .AddStep(new HeadlessRunStep("Vscode extension tests") { + Run = "npm run test", + WorkingDirectory = Solution.VscodeTestExtensionProjectDirectory }); } } From bfe4199a597840f073765344bb79ab5e8295aab9 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:53:20 +0200 Subject: [PATCH 224/647] Fix NotebookSelector type --- .../Features/Document/NotebookDocumentSyncFeature.cs | 6 +++--- src/Server/Matchers/NotebookDocumentMatcher.cs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs index ac8383d8d..6d4fd2430 100644 --- a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; @@ -734,7 +734,7 @@ public interface INotebookDocumentRegistrationOptions : IRegistrationOptions /// /// The notebooks to be synced /// - NotebookSelector NotebookSelector { get; set; } + Container NotebookSelector { get; set; } } /// @@ -761,7 +761,7 @@ public partial class NotebookDocumentSyncOptions : INotebookDocumentRegistration /// value is provided it matches against the /// notebook type. '*' matches every notebook. /// - public NotebookSelector NotebookSelector { get; set; } + public Container NotebookSelector { get; set; } /// /// Whether save notification should be forwarded to diff --git a/src/Server/Matchers/NotebookDocumentMatcher.cs b/src/Server/Matchers/NotebookDocumentMatcher.cs index 62235e9c3..900831963 100644 --- a/src/Server/Matchers/NotebookDocumentMatcher.cs +++ b/src/Server/Matchers/NotebookDocumentMatcher.cs @@ -101,14 +101,15 @@ private IEnumerable GetHandler(IEnumerable s.IsMatch(attributes)); + _logger.LogTrace("Document Selector {NotebookDocumentSelector}", selector?.ToString()); + if (registrationOptions?.NotebookSelector is null || selector is not null) { _logger.LogTrace( "Handler Selected: {Handler} {Id} via {NotebookDocumentSelector} (targeting {HandlerInterface})", descriptor.ImplementationType.FullName, descriptor.Handler is ICanBeIdentifiedHandler h ? h.Id.ToString() : string.Empty, - registrationOptions?.NotebookSelector?.ToString(), + selector?.ToString(), descriptor.HandlerType.FullName ); yield return descriptor; From eb064226d0524e2d019875a6cb3325695cb56a05 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:58:00 +0200 Subject: [PATCH 225/647] Fix RenameFiles workspace operations --- .../Features/FileOperationsFeature.cs | 36 ++++++++++++++++--- .../FileOperationTests.cs | 10 ++++-- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/Protocol/Features/FileOperationsFeature.cs b/src/Protocol/Features/FileOperationsFeature.cs index 158e0a40e..3fafcfe12 100644 --- a/src/Protocol/Features/FileOperationsFeature.cs +++ b/src/Protocol/Features/FileOperationsFeature.cs @@ -83,7 +83,7 @@ public partial record FileCreate : FileOperationItem; [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(DidRenameFileRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidRenameFileParams : FileOperationParams, IRequest + public partial record DidRenameFileParams : RenameFileOperationParams, IRequest { public static implicit operator WillRenameFileParams(DidRenameFileParams @params) { @@ -99,7 +99,7 @@ public static implicit operator WillRenameFileParams(DidRenameFileParams @params [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(WillRenameFileRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record WillRenameFileParams : FileOperationParams, IRequest + public partial record WillRenameFileParams : RenameFileOperationParams, IRequest { public static implicit operator DidRenameFileParams(WillRenameFileParams @params) { @@ -107,8 +107,36 @@ public static implicit operator DidRenameFileParams(WillRenameFileParams @params } } - /// - public partial record FileRename : FileOperationItem; + /// + /// The parameters sent in notifications/requests for user-initiated renames + /// of files. + /// + /// @since 3.16.0 + /// + public abstract record RenameFileOperationParams + { + /// + /// An array of all files/folders renamed in this operation. + /// When a folder is renamed, only the folder will be included, and not its children. + /// + public Container Files { get; init; } = null!; + } + + /// + /// Represents information on a file/folder rename. + /// + public partial record FileRename + { + /// + /// A file:// URI for the original location of the file/folder being renamed. + /// + public Uri OldUri { get; init; } = null!; + + /// + /// A file:// URI for the new location of the file/folder being renamed. + /// + public Uri NewUri { get; init; } = null!; + } /// [Parallel] diff --git a/test/Lsp.Integration.Tests/FileOperationTests.cs b/test/Lsp.Integration.Tests/FileOperationTests.cs index 94f8851de..079c0f6d8 100644 --- a/test/Lsp.Integration.Tests/FileOperationTests.cs +++ b/test/Lsp.Integration.Tests/FileOperationTests.cs @@ -94,13 +94,19 @@ public async Task Should_Handle_FileRename() await client.RequestWillRenameFile( new WillRenameFileParams { - Files = Container.From(new FileRename { Uri = new Uri("file://asdf") }) + Files = Container.From(new FileRename { + OldUri = new Uri("file://asdf"), + NewUri = new Uri("file://zxcv"), + }) } ); client.DidRenameFile( new DidRenameFileParams { - Files = Container.From(new FileRename { Uri = new Uri("file://asdf") }) + Files = Container.From(new FileRename { + OldUri = new Uri("file://asdf"), + NewUri = new Uri("file://zxcv") + }) } ); From fee79278ae4c82947fabb9ed6f8765fdb135aae4 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:12:04 +0200 Subject: [PATCH 226/647] Fix plural form for all FileOperations --- .../Features/FileOperationsFeature.cs | 76 +++++++++---------- ...erationTests.cs => FileOperationsTests.cs} | 58 +++++++------- 2 files changed, 67 insertions(+), 67 deletions(-) rename test/Lsp.Integration.Tests/{FileOperationTests.cs => FileOperationsTests.cs} (77%) diff --git a/src/Protocol/Features/FileOperationsFeature.cs b/src/Protocol/Features/FileOperationsFeature.cs index 3fafcfe12..ed64a6cab 100644 --- a/src/Protocol/Features/FileOperationsFeature.cs +++ b/src/Protocol/Features/FileOperationsFeature.cs @@ -20,7 +20,7 @@ namespace Models /// /// @since 3.16.0 /// - public abstract record FileOperationParams + public abstract record FileOperationsParams where T : FileOperationItem { /// @@ -40,33 +40,33 @@ public abstract record FileOperationItem public Uri Uri { get; init; } = null!; } - /// + /// [Parallel] [Method(WorkspaceNames.DidCreateFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(DidCreateFileRegistrationOptions))] + [RegistrationOptions(typeof(DidCreateFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidCreateFileParams : FileOperationParams, IRequest + public partial record DidCreateFilesParams : FileOperationsParams, IRequest { - public static implicit operator WillCreateFileParams(DidCreateFileParams @params) + public static implicit operator WillCreateFilesParams(DidCreateFilesParams @params) { return new() { Files = @params.Files }; } } - /// + /// [Parallel] [Method(WorkspaceNames.WillCreateFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WillCreateFileRegistrationOptions))] + [RegistrationOptions(typeof(WillCreateFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record WillCreateFileParams : FileOperationParams, IRequest + public partial record WillCreateFilesParams : FileOperationsParams, IRequest { - public static implicit operator DidCreateFileParams(WillCreateFileParams @params) + public static implicit operator DidCreateFilesParams(WillCreateFilesParams @params) { return new() { Files = @params.Files }; } @@ -75,33 +75,33 @@ public static implicit operator DidCreateFileParams(WillCreateFileParams @params /// public partial record FileCreate : FileOperationItem; - /// + /// [Parallel] [Method(WorkspaceNames.DidRenameFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(DidRenameFileRegistrationOptions))] + [RegistrationOptions(typeof(DidRenameFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidRenameFileParams : RenameFileOperationParams, IRequest + public partial record DidRenameFilesParams : RenameFilesOperationParams, IRequest { - public static implicit operator WillRenameFileParams(DidRenameFileParams @params) + public static implicit operator WillRenameFilesParams(DidRenameFilesParams @params) { return new() { Files = @params.Files }; } } - /// + /// [Parallel] [Method(WorkspaceNames.WillRenameFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WillRenameFileRegistrationOptions))] + [RegistrationOptions(typeof(WillRenameFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record WillRenameFileParams : RenameFileOperationParams, IRequest + public partial record WillRenameFilesParams : RenameFilesOperationParams, IRequest { - public static implicit operator DidRenameFileParams(WillRenameFileParams @params) + public static implicit operator DidRenameFilesParams(WillRenameFilesParams @params) { return new() { Files = @params.Files }; } @@ -113,7 +113,7 @@ public static implicit operator DidRenameFileParams(WillRenameFileParams @params /// /// @since 3.16.0 /// - public abstract record RenameFileOperationParams + public abstract record RenameFilesOperationParams { /// /// An array of all files/folders renamed in this operation. @@ -138,33 +138,33 @@ public partial record FileRename public Uri NewUri { get; init; } = null!; } - /// + /// [Parallel] [Method(WorkspaceNames.DidDeleteFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(DidDeleteFileRegistrationOptions))] + [RegistrationOptions(typeof(DidDeleteFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidDeleteFileParams : FileOperationParams, IRequest + public partial record DidDeleteFilesParams : FileOperationsParams, IRequest { - public static implicit operator WillDeleteFileParams(DidDeleteFileParams @params) + public static implicit operator WillDeleteFilesParams(DidDeleteFilesParams @params) { return new() { Files = @params.Files }; } } - /// + /// [Parallel] [Method(WorkspaceNames.WillDeleteFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] - [RegistrationOptions(typeof(WillDeleteFileRegistrationOptions))] + [RegistrationOptions(typeof(WillDeleteFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record WillDeleteFileParams : FileOperationParams, IRequest + public partial record WillDeleteFilesParams : FileOperationsParams, IRequest { - public static implicit operator DidDeleteFileParams(WillDeleteFileParams @params) + public static implicit operator DidDeleteFilesParams(WillDeleteFilesParams @params) { return new() { Files = @params.Files }; } @@ -179,7 +179,7 @@ public partial record FileDelete : FileOperationItem; nameof(FileOperationsWorkspaceServerCapabilities.WillCreate) )] [RegistrationName(WorkspaceNames.WillCreateFiles)] - public partial class WillCreateFileRegistrationOptions : IFileOperationRegistrationOptions + public partial class WillCreateFilesRegistrationOptions : IFileOperationRegistrationOptions { /// /// The actual filters. @@ -193,7 +193,7 @@ public partial class WillCreateFileRegistrationOptions : IFileOperationRegistrat nameof(FileOperationsWorkspaceServerCapabilities.DidCreate) )] [RegistrationName(WorkspaceNames.DidCreateFiles)] - public partial class DidCreateFileRegistrationOptions : IFileOperationRegistrationOptions + public partial class DidCreateFilesRegistrationOptions : IFileOperationRegistrationOptions { /// /// The actual filters. @@ -207,7 +207,7 @@ public partial class DidCreateFileRegistrationOptions : IFileOperationRegistrati nameof(FileOperationsWorkspaceServerCapabilities.WillRename) )] [RegistrationName(WorkspaceNames.WillRenameFiles)] - public partial class WillRenameFileRegistrationOptions : IFileOperationRegistrationOptions + public partial class WillRenameFilesRegistrationOptions : IFileOperationRegistrationOptions { /// /// The actual filters. @@ -221,7 +221,7 @@ public partial class WillRenameFileRegistrationOptions : IFileOperationRegistrat nameof(FileOperationsWorkspaceServerCapabilities.DidRename) )] [RegistrationName(WorkspaceNames.DidRenameFiles)] - public partial class DidRenameFileRegistrationOptions : IFileOperationRegistrationOptions + public partial class DidRenameFilesRegistrationOptions : IFileOperationRegistrationOptions { /// /// The actual filters. @@ -235,7 +235,7 @@ public partial class DidRenameFileRegistrationOptions : IFileOperationRegistrati nameof(FileOperationsWorkspaceServerCapabilities.WillDelete) )] [RegistrationName(WorkspaceNames.WillDeleteFiles)] - public partial class WillDeleteFileRegistrationOptions : IFileOperationRegistrationOptions + public partial class WillDeleteFilesRegistrationOptions : IFileOperationRegistrationOptions { /// /// The actual filters. @@ -249,7 +249,7 @@ public partial class WillDeleteFileRegistrationOptions : IFileOperationRegistrat nameof(FileOperationsWorkspaceServerCapabilities.DidDelete) )] [RegistrationName(WorkspaceNames.DidDeleteFiles)] - public partial class DidDeleteFileRegistrationOptions : IFileOperationRegistrationOptions + public partial class DidDeleteFilesRegistrationOptions : IFileOperationRegistrationOptions { /// /// The actual filters. @@ -363,37 +363,37 @@ public class FileOperationsWorkspaceServerCapabilities /// The client has support for sending didCreateFiles notifications. /// [Optional] - public DidCreateFileRegistrationOptions.StaticOptions? DidCreate { get; set; } + public DidCreateFilesRegistrationOptions.StaticOptions? DidCreate { get; set; } /// /// The client has support for sending willCreateFiles requests. /// [Optional] - public WillCreateFileRegistrationOptions.StaticOptions? WillCreate { get; set; } + public WillCreateFilesRegistrationOptions.StaticOptions? WillCreate { get; set; } /// /// The client has support for sending didRenameFiles notifications. /// [Optional] - public DidRenameFileRegistrationOptions.StaticOptions? DidRename { get; set; } + public DidRenameFilesRegistrationOptions.StaticOptions? DidRename { get; set; } /// /// The client has support for sending willRenameFiles requests. /// [Optional] - public WillRenameFileRegistrationOptions.StaticOptions? WillRename { get; set; } + public WillRenameFilesRegistrationOptions.StaticOptions? WillRename { get; set; } /// /// The client has support for sending didDeleteFiles notifications. /// [Optional] - public DidDeleteFileRegistrationOptions.StaticOptions? DidDelete { get; set; } + public DidDeleteFilesRegistrationOptions.StaticOptions? DidDelete { get; set; } /// /// The client has support for sending willDeleteFiles requests. /// [Optional] - public WillDeleteFileRegistrationOptions.StaticOptions? WillDelete { get; set; } + public WillDeleteFilesRegistrationOptions.StaticOptions? WillDelete { get; set; } } } diff --git a/test/Lsp.Integration.Tests/FileOperationTests.cs b/test/Lsp.Integration.Tests/FileOperationsTests.cs similarity index 77% rename from test/Lsp.Integration.Tests/FileOperationTests.cs rename to test/Lsp.Integration.Tests/FileOperationsTests.cs index 079c0f6d8..b86c2ba0a 100644 --- a/test/Lsp.Integration.Tests/FileOperationTests.cs +++ b/test/Lsp.Integration.Tests/FileOperationsTests.cs @@ -17,24 +17,24 @@ namespace Lsp.Integration.Tests { - public class FileOperationTests : LanguageProtocolTestBase + public class FileOperationsTests : LanguageProtocolTestBase { - private readonly Action _didCreateFileHandler = Substitute.For>(); + private readonly Action _didCreateFileHandler = Substitute.For>(); - private readonly Func> _willCreateFileHandler = - Substitute.For>>(); + private readonly Func> _willCreateFileHandler = + Substitute.For>>(); - private readonly Action _didRenameFileHandler = Substitute.For>(); + private readonly Action _didRenameFileHandler = Substitute.For>(); - private readonly Func> _willRenameFileHandler = - Substitute.For>>(); + private readonly Func> _willRenameFileHandler = + Substitute.For>>(); - private readonly Action _didDeleteFileHandler = Substitute.For>(); + private readonly Action _didDeleteFileHandler = Substitute.For>(); - private readonly Func> _willDeleteFileHandler = - Substitute.For>>(); + private readonly Func> _willDeleteFileHandler = + Substitute.For>>(); - public FileOperationTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) + public FileOperationsTests(ITestOutputHelper outputHelper) : base(new JsonRpcTestOptions().ConfigureForXUnit(outputHelper, LogEventLevel.Verbose)) { } @@ -43,14 +43,14 @@ public async Task Should_Handle_FileCreate() { var (client, server) = await Initialize(Configure, Configure); - await client.RequestWillCreateFile( - new WillCreateFileParams + await client.RequestWillCreateFiles( + new WillCreateFilesParams { Files = Container.From(new FileCreate { Uri = new Uri("file://asdf") }) } ); - client.DidCreateFile( - new DidCreateFileParams + client.DidCreateFiles( + new DidCreateFilesParams { Files = Container.From(new FileCreate { Uri = new Uri("file://asdf") }) } @@ -91,8 +91,8 @@ public async Task Should_Handle_FileRename() { var (client, server) = await Initialize(Configure, Configure); - await client.RequestWillRenameFile( - new WillRenameFileParams + await client.RequestWillRenameFiles( + new WillRenameFilesParams { Files = Container.From(new FileRename { OldUri = new Uri("file://asdf"), @@ -100,8 +100,8 @@ await client.RequestWillRenameFile( }) } ); - client.DidRenameFile( - new DidRenameFileParams + client.DidRenameFiles( + new DidRenameFilesParams { Files = Container.From(new FileRename { OldUri = new Uri("file://asdf"), @@ -145,14 +145,14 @@ public async Task Should_Handle_FileDelete() { var (client, server) = await Initialize(Configure, Configure); - await client.RequestWillDeleteFile( - new WillDeleteFileParams + await client.RequestWillDeleteFiles( + new WillDeleteFilesParams { Files = Container.From(new FileDelete { Uri = new Uri("file://asdf") }) } ); - client.DidDeleteFile( - new DidDeleteFileParams + client.DidDeleteFiles( + new DidDeleteFilesParams { Files = Container.From(new FileDelete { Uri = new Uri("file://asdf") }) } @@ -219,12 +219,12 @@ private void Configure(LanguageServerOptions options) } } ); - options.OnDidCreateFile(_didCreateFileHandler, (capability, capabilities) => new() { Filters = filters }); - options.OnWillCreateFile(_willCreateFileHandler, (capability, capabilities) => new() { Filters = filters }); - options.OnDidRenameFile(_didRenameFileHandler, (capability, capabilities) => new() { Filters = filters }); - options.OnWillRenameFile(_willRenameFileHandler, (capability, capabilities) => new() { Filters = filters }); - options.OnDidDeleteFile(_didDeleteFileHandler, (capability, capabilities) => new() { Filters = filters }); - options.OnWillDeleteFile(_willDeleteFileHandler, (capability, capabilities) => new() { Filters = filters }); + options.OnDidCreateFiles(_didCreateFileHandler, (capability, capabilities) => new() { Filters = filters }); + options.OnWillCreateFiles(_willCreateFileHandler, (capability, capabilities) => new() { Filters = filters }); + options.OnDidRenameFiles(_didRenameFileHandler, (capability, capabilities) => new() { Filters = filters }); + options.OnWillRenameFiles(_willRenameFileHandler, (capability, capabilities) => new() { Filters = filters }); + options.OnDidDeleteFiles(_didDeleteFileHandler, (capability, capabilities) => new() { Filters = filters }); + options.OnWillDeleteFiles(_willDeleteFileHandler, (capability, capabilities) => new() { Filters = filters }); } } } From 51c11f9915748648f7069c653f2867f9cfc7c2fc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 01:37:52 +0000 Subject: [PATCH 227/647] Update dependency @types/node to v20.8.8 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 6ab63fabf..bb41b2e9d 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.7.tgz", - "integrity": "sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==", + "version": "20.8.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.8.tgz", + "integrity": "sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==", "dev": true, "dependencies": { "undici-types": "~5.25.1" From 96c06d33c5ccd2592e77de0dfb0562e8a3f5ce4e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 20:38:09 +0000 Subject: [PATCH 228/647] Update dependency @vscode/test-electron to v2.3.6 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index bb41b2e9d..bf5b1ad38 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -181,9 +181,9 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.5.tgz", - "integrity": "sha512-lAW7nQ0HuPqJnGJrtCzEKZCICtRizeP6qNanyCrjmdCOAAWjX3ixiG8RVPwqsYPQBWLPgYuE12qQlwXsOR/2fQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.6.tgz", + "integrity": "sha512-M31xGH0RgqNU6CZ4/9g39oUMJ99nLzfjA+4UbtIQ6TcXQ6+2qkjOOxedmPBDDCg26/3Al5ubjY80hIoaMwKYSw==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", From 5dab2b6b74599214ccebfe51a6ea6a8fa45865a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:30:16 +0000 Subject: [PATCH 229/647] Update dependency dotnet-sdk to v7.0.403 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 75540657a..f7d18f6e5 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.402", + "version": "7.0.403", "rollForward": "latestMinor" } } \ No newline at end of file From 3ba26f9fdeba6c981e6552f28a1170660843cec2 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 25 Oct 2023 11:15:34 -0700 Subject: [PATCH 230/647] The Reuse.Transient property was unused and misleading See https://github.com/dadhi/DryIoc/issues/486 --- src/JsonRpc/JsonRpcServerContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonRpc/JsonRpcServerContainer.cs b/src/JsonRpc/JsonRpcServerContainer.cs index ccc645e85..5ac29f682 100644 --- a/src/JsonRpc/JsonRpcServerContainer.cs +++ b/src/JsonRpc/JsonRpcServerContainer.cs @@ -37,7 +37,7 @@ public static IContainer Create(IServiceProvider? outerServiceProvider) rules => rules.WithUnknownServiceResolvers( request => { var value = outerServiceProvider.GetService(request.ServiceType); - return value == null ? null : (Factory) InstanceFactory.Of(value, Reuse.Transient); + return value == null ? null : (Factory) InstanceFactory.Of(value); } ) ); From 5032437a93fabe5f2abd22f12e5a2e321526c6e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 18:10:31 +0000 Subject: [PATCH 231/647] Update dependency @types/node to v20.8.9 --- vscode-testextension/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index bf5b1ad38..de4a1bb45 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,12 +166,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.8.tgz", - "integrity": "sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==", + "version": "20.8.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz", + "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==", "dev": true, "dependencies": { - "undici-types": "~5.25.1" + "undici-types": "~5.26.4" } }, "node_modules/@types/vscode": { @@ -1469,9 +1469,9 @@ } }, "node_modules/undici-types": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", - "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, "node_modules/util-deprecate": { From c88deb99fee1d73f45f651dc019d894a4072ee23 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:01:37 +0000 Subject: [PATCH 232/647] Update dependency lint-staged to v15 --- package-lock.json | 86 +++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13079217b..223398209 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.1", "husky": "8.0.3", - "lint-staged": "14.0.1", + "lint-staged": "15.0.2", "prettier": "3.0.3" } }, @@ -142,9 +142,9 @@ "dev": true }, "node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true, "engines": { "node": ">=16" @@ -200,28 +200,40 @@ "dev": true }, "node_modules/execa": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", - "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" }, "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + "node": ">=16.17" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/execa/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -235,24 +247,24 @@ } }, "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, "engines": { - "node": ">=10" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/human-signals": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", - "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, "engines": { - "node": ">=14.18.0" + "node": ">=16.17.0" } }, "node_modules/husky": { @@ -319,36 +331,36 @@ } }, "node_modules/lint-staged": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-14.0.1.tgz", - "integrity": "sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==", + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.0.2.tgz", + "integrity": "sha512-vnEy7pFTHyVuDmCAIFKR5QDO8XLVlPFQQyujQ/STOxe40ICWqJ6knS2wSJ/ffX/Lw0rz83luRDh+ET7toN+rOw==", "dev": true, "dependencies": { "chalk": "5.3.0", - "commander": "11.0.0", + "commander": "11.1.0", "debug": "4.3.4", - "execa": "7.2.0", + "execa": "8.0.1", "lilconfig": "2.1.0", - "listr2": "6.6.1", + "listr2": "7.0.2", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", - "yaml": "2.3.1" + "yaml": "2.3.3" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": ">=18.12.0" }, "funding": { "url": "https://opencollective.com/lint-staged" } }, "node_modules/listr2": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", - "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", + "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", "dev": true, "dependencies": { "cli-truncate": "^3.1.0", @@ -360,14 +372,6 @@ }, "engines": { "node": ">=16.0.0" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } } }, "node_modules/log-update": { @@ -721,9 +725,9 @@ } }, "node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", + "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index bf8185995..b5bf8089d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.1", "husky": "8.0.3", - "lint-staged": "14.0.1", + "lint-staged": "15.0.2", "prettier": "3.0.3" }, "scripts": { From a66a86a37be59e5da6309128e4cd7d8b3ac8af5e Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 26 Oct 2023 10:45:33 -0700 Subject: [PATCH 233/647] Add macos to ci-ignore matrix --- .github/workflows/ci-ignore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-ignore.yml b/.github/workflows/ci-ignore.yml index 9f2bff03f..1826f2ffc 100644 --- a/.github/workflows/ci-ignore.yml +++ b/.github/workflows/ci-ignore.yml @@ -72,7 +72,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, ubuntu-latest] + os: [macos-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: N/A From 793e66d77c87185d4b9cc1fce1ab40b37cbb58b3 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 26 Oct 2023 10:54:25 -0700 Subject: [PATCH 234/647] Add missing using directive --- src/JsonRpc/InputHandler.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/JsonRpc/InputHandler.cs b/src/JsonRpc/InputHandler.cs index 2a16adcbe..cf733ebd0 100644 --- a/src/JsonRpc/InputHandler.cs +++ b/src/JsonRpc/InputHandler.cs @@ -4,6 +4,7 @@ using System.IO; using System.IO.Pipelines; using System.Linq; +using System.Net.Sockets; using System.Reactive; using System.Reactive.Concurrency; using System.Reactive.Disposables; @@ -145,16 +146,13 @@ public void Start() await ProcessInputStream(_stopProcessing.Token).ConfigureAwait(false); } catch (IOException e) + when (e.InnerException is SocketException { SocketErrorCode: SocketError.ConnectionReset }) { - if (e.InnerException is SocketException se && se.SocketErrorCode == SocketError.ConnectionReset) - _logger.LogInformation(e, "Connection reset by client."); - else - throw; - + _logger.LogInformation(e, "Connection reset by client."); } catch (Exception e) { - _logger.LogCritical(e, "Unhandled exception"); + _logger.LogCritical(e, "Unhandled exception."); } } ).Subscribe(_inputActive) From 3876e2dea4c4284569ed88effbcc6dae5037a456 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 26 Oct 2023 13:28:30 -0700 Subject: [PATCH 235/647] Update Mediatr to 9.0.0 Versions 10.x-11.x dropped netstandard2.0 support. Version 12.x requries some deep changes due to how IRequest was redefined. --- Directory.Packages.props | 24 ++++++++++++------------ Directory.Packages.supports.props | 12 +++++------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index db5181cd2..aa14453e5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,17 +9,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -53,7 +53,7 @@ - + diff --git a/Directory.Packages.supports.props b/Directory.Packages.supports.props index bcf19562f..d354840f4 100644 --- a/Directory.Packages.supports.props +++ b/Directory.Packages.supports.props @@ -1,15 +1,13 @@ - - - + + + - - + + From b1eb6351285f0487262ceba3e83b070b4da0b985 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:55:49 +0000 Subject: [PATCH 236/647] Update dependency @prettier/plugin-xml to v3.2.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 223398209..d47cd0b34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "devDependencies": { - "@prettier/plugin-xml": "3.2.1", + "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.0.2", "prettier": "3.0.3" } }, "node_modules/@prettier/plugin-xml": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.2.1.tgz", - "integrity": "sha512-DvwnQPf8FsczapBVDm54IhR+Pryt3DbPZSNtUb9gOuFtgoUUPbPN69f3nQBMF5BEqh4ZjZjTaHBmsVno3UnAXQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.2.2.tgz", + "integrity": "sha512-SoE70SQF1AKIvK7LVK80JcdAe6wrDcbodFFjcoqb1FkOqV0G0oSlgAFDwoRXPqkUE5p/YF2nGsnUbnfm6471sw==", "dev": true, "dependencies": { "@xml-tools/parser": "^1.0.11" diff --git a/package.json b/package.json index b5bf8089d..819da529d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "@prettier/plugin-xml": "3.2.1", + "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.0.2", "prettier": "3.0.3" From 4772c6dd728b89dedac8cc434aa6fc6c77ae07f8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 21:42:57 +0000 Subject: [PATCH 237/647] Update dependency Rocket.Surgery.Nuke to v1.7.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index aa14453e5..49d0050bd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From 7418880a37722d33b6fdab07e044919c543eb5bb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:55:37 +0000 Subject: [PATCH 238/647] Update dependency @types/node to v20.8.10 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index de4a1bb45..30a5142a7 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz", - "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==", + "version": "20.8.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", + "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 68b99517137929bf2691d8fad49c67b873249e03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 00:01:52 +0000 Subject: [PATCH 239/647] Update dependency xunit to v2.6.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 49d0050bd..a8e695300 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From b63e26d9c94c13b20f3f4a943f5ef9eda43db83d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 00:59:41 +0000 Subject: [PATCH 240/647] Update dependency @types/vscode to v1.83.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 30a5142a7..727aa204a 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,9 +175,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.83.1", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.83.1.tgz", - "integrity": "sha512-BHu51NaNKOtDf3BOonY3sKFFmZKEpRkzqkZVpSYxowLbs5JqjOQemYFob7Gs5rpxE5tiGhfpnMpcdF/oKrLg4w==", + "version": "1.83.2", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.83.2.tgz", + "integrity": "sha512-qIN48iXkJi2eVyd9HB+TSYBssz7/EgSYw4IeoMNL9sJCao6qOVSXJR4z0HohV+Mvoiib1/rpK5hqoJ2Ua0N/+w==", "dev": true }, "node_modules/@vscode/test-electron": { From 066d382763c81d65d8e7c6455d853a67e3469e90 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 03:29:30 +0000 Subject: [PATCH 241/647] Update dependency BenchmarkDotNet to v0.13.10 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index d1ea04f8e..bb2d4fa64 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From dc0715c1314e646891f162003e9bc4e0a9ae706a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:55:25 +0000 Subject: [PATCH 242/647] Update jetbrains to v2023.2.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7e7918e98..492778cea 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.2.2", + "version": "2023.2.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index a8e695300..b9872f361 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 16a8a72cb8968e8c9f5fcfbb42cd7bf70ba4ddd4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:12:46 +0000 Subject: [PATCH 243/647] Update dependency xunit to v2.6.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b9872f361..80da42b25 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From 8f371118a60261d5cc19cd19e13b98a29873a64b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 19:28:25 +0000 Subject: [PATCH 244/647] Update dependency @types/vscode to v1.84.1 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 727aa204a..f507c111c 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,9 +175,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.83.2", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.83.2.tgz", - "integrity": "sha512-qIN48iXkJi2eVyd9HB+TSYBssz7/EgSYw4IeoMNL9sJCao6qOVSXJR4z0HohV+Mvoiib1/rpK5hqoJ2Ua0N/+w==", + "version": "1.84.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.84.1.tgz", + "integrity": "sha512-DB10vBRLEPA/us7p3gQilU2Tq5HDu6JWTyCpD9qtb7MKWIvJS5In9HU3YgVGCXf/miwHJiY62aXwjtUSMpT8HA==", "dev": true }, "node_modules/@vscode/test-electron": { From 6f939acd307462a4a3065f3c4e07e39d85047da6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:46:50 +0000 Subject: [PATCH 245/647] Update dependency @types/node to v20.9.0 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 727aa204a..ef8bd6a70 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", - "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From ae638f00edb8c1ca4cb6c0fb5622f25eb541598c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:12:39 +0000 Subject: [PATCH 246/647] Update dependency Verify.Xunit to v22.2.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 80da42b25..448a19eaa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 8e2f93c8719600db3794b54d4341e019997bdc3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:13:55 +0000 Subject: [PATCH 247/647] Update dependency Microsoft.NET.Test.Sdk to v17.8.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 448a19eaa..2ccea19f2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From 47b87f036f8ebe7e1f8d8c282c6ced4bf431424c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:13:49 +0000 Subject: [PATCH 248/647] Update dependency @types/mocha to v10.0.4 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 727aa204a..4f85b11f5 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -160,9 +160,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.3.tgz", - "integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.4.tgz", + "integrity": "sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w==", "dev": true }, "node_modules/@types/node": { From af625f16f1131aa9e06428731d774a39ef94471a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 15:32:31 +0000 Subject: [PATCH 249/647] Update dependency lint-staged to v15.1.0 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d47cd0b34..18633160e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.0.2", + "lint-staged": "15.1.0", "prettier": "3.0.3" } }, @@ -331,9 +331,9 @@ } }, "node_modules/lint-staged": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.0.2.tgz", - "integrity": "sha512-vnEy7pFTHyVuDmCAIFKR5QDO8XLVlPFQQyujQ/STOxe40ICWqJ6knS2wSJ/ffX/Lw0rz83luRDh+ET7toN+rOw==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.1.0.tgz", + "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", "dev": true, "dependencies": { "chalk": "5.3.0", @@ -345,7 +345,7 @@ "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", - "yaml": "2.3.3" + "yaml": "2.3.4" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -725,9 +725,9 @@ } }, "node_modules/yaml": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", - "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index 819da529d..0acf1f8b6 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.0.2", + "lint-staged": "15.1.0", "prettier": "3.0.3" }, "scripts": { From 7835366587643165cbc484686b16396170a169b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 22:20:10 +0000 Subject: [PATCH 250/647] Update dependency Rocket.Surgery.Nuke to v1.7.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2ccea19f2..0f8664549 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -24,7 +24,7 @@ - + From d91c19908d037e1246c45c8b5b0d475c7742e618 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 01:36:52 +0000 Subject: [PATCH 251/647] Update dependency DryIoc.Internal to v5.4.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0f8664549..7d5082bb1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -60,6 +60,6 @@ - + \ No newline at end of file From f0ccf1735a0f34ab8576e05a4b963b1052a773ac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:30:36 +0000 Subject: [PATCH 252/647] Update dependency prettier to v3.1.0 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18633160e..c627d6ffd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.1.0", - "prettier": "3.0.3" + "prettier": "3.1.0" } }, "node_modules/@prettier/plugin-xml": { @@ -506,9 +506,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index 0acf1f8b6..411b5d889 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.1.0", - "prettier": "3.0.3" + "prettier": "3.1.0" }, "scripts": { "prepare": "husky install" From 5a42576a6f4654648607eba93d01921cb04b217d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 14:08:02 +0000 Subject: [PATCH 253/647] Update dependency Verify.Xunit to v22.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7d5082bb1..e580571c4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From c815b6aed0cb26f4c7b01c2ce3323453e5f27557 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 21:05:30 +0000 Subject: [PATCH 254/647] Update Rocket Surgery Other --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e580571c4..6bae66128 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + @@ -24,7 +24,7 @@ - + From cc796f4f21f9c8f528701d4c05159b135b26e440 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:29:09 +0000 Subject: [PATCH 255/647] Update dependency Serilog.Extensions.Logging to v8 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6bae66128..33d3b16cb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From 80e1e9b6c7351a9025456d13c3ac988a50764c73 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:29:04 +0000 Subject: [PATCH 256/647] Update reportgenerator to v5.2.0 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 492778cea..dc4374f1a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.1.26", + "version": "5.2.0", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 6bae66128..17788ab86 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 23dd78cbb93c9331de48091bb85e5b9459a1c157 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 07:45:13 +0000 Subject: [PATCH 257/647] Update dependency Verify.Xunit to v22.4.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 17788ab86..e3349e960 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From e0d004dce98f743b0f4a736af9c629bfc79a438a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:02:35 +0000 Subject: [PATCH 258/647] Update dependency dotnet-sdk to v7.0.404 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index f7d18f6e5..cdece362d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.403", + "version": "7.0.404", "rollForward": "latestMinor" } } \ No newline at end of file From e9781f05b96f47d45d1a3b7d4db8436717116ece Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 21:32:10 +0000 Subject: [PATCH 259/647] Update dependency dotnet-sdk to v8 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index cdece362d..989a69caf 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.404", + "version": "8.0.100", "rollForward": "latestMinor" } } \ No newline at end of file From 48f8a553a283fd276079352b074db9801b2a001a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:09:41 +0000 Subject: [PATCH 260/647] Update dependency Verify.Xunit to v22.5.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e3349e960..eaff53458 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 976ce07c4d17863facc93b0bc364cf7df147d65b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 21:34:10 +0000 Subject: [PATCH 261/647] Update dependency @types/node to v20.9.1 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 1277d4256..1a5e7301a 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", - "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "version": "20.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.1.tgz", + "integrity": "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 9c3bba1eeaa56a72c568f9dfd5327ed402977918 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:40:51 +0000 Subject: [PATCH 262/647] Update Rocket Surgery Other to v1.1.5 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index eaff53458..05a24a226 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + From 7abd78cc5a16c95df4cab049325f67acff085312 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 02:14:47 +0000 Subject: [PATCH 263/647] Update dependency Microsoft.SourceLink.GitHub to v8 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 05a24a226..9c31ff7e6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ $(BaseIntermediateOutputPath)\GeneratedFiles - + From 191d26b8c2cce8a1c110d796d34abac11668dd06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:33:55 +0000 Subject: [PATCH 264/647] Update dependency @types/node to v20.9.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 1a5e7301a..f5573c3b3 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.1.tgz", - "integrity": "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA==", + "version": "20.9.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.2.tgz", + "integrity": "sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From ab6e519ce22104a2f7f9c8573b0d14671b020608 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:34:03 +0000 Subject: [PATCH 265/647] Update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 05a24a226..74eca1937 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From 6837d3b4b88ef95075eda411c97d6d652491e512 Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Sun, 19 Nov 2023 20:42:34 +1100 Subject: [PATCH 266/647] fix: add ICapability to ShowMessageRequestClientCapabilities. Fixes #1117 --- src/Protocol/Features/Window/ShowMessageRequestFeature.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/Features/Window/ShowMessageRequestFeature.cs b/src/Protocol/Features/Window/ShowMessageRequestFeature.cs index d68c6aa64..6e7ab8f01 100644 --- a/src/Protocol/Features/Window/ShowMessageRequestFeature.cs +++ b/src/Protocol/Features/Window/ShowMessageRequestFeature.cs @@ -75,7 +75,7 @@ namespace Client.Capabilities /// @since 3.16.0 /// [CapabilityKey(nameof(ClientCapabilities.Window), nameof(WindowClientCapabilities.ShowMessage))] - public class ShowMessageRequestClientCapabilities + public class ShowMessageRequestClientCapabilities : ICapability { /// /// Capabilities specific to the `MessageActionItem` type. From 9b008c74e280497e5476418d92e517c488439ef5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:49:15 +0000 Subject: [PATCH 267/647] chore(deps): update dependency typescript to v5.3.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f5573c3b3..2861a42cf 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1456,9 +1456,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", "dev": true, "bin": { "tsc": "bin/tsc", From 9f94bc0c773836c2d101509336b7a0605818b86d Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 20 Nov 2023 13:35:17 -0800 Subject: [PATCH 268/647] Install .NET 8 SDK in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ab57a507..66610cefa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: - name: πŸ”¨ Use .NET Core 7.0 SDK uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: 🎁 dotnet tool restore run: | dotnet tool restore From fa06c6761b56e15d0438c2dfa833d650b485ba2a Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 20 Nov 2023 14:31:14 -0800 Subject: [PATCH 269/647] Upgrade Microsoft.Extensions.* to 8.0.0 --- Directory.Packages.props | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 33d3b16cb..5112ca835 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,13 +28,13 @@ - - - - - - - + + + + + + + From e7460d5d0451c5fc97a602ed68892056b51df3d9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 00:48:08 +0000 Subject: [PATCH 270/647] chore(deps): update dependency @types/mocha to v10.0.5 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 2861a42cf..b1a68a74f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -160,9 +160,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.4.tgz", - "integrity": "sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w==", + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.5.tgz", + "integrity": "sha512-JUI82qwkRhYJYesuKSeFy46fKbhLaV9RU1gAh2PHmyoEECvlTf5UYeIivYlMszp1WT2CwJ4ziC3zoxsodhsGwg==", "dev": true }, "node_modules/@types/node": { From 74fc5893bfe1a092d26c91efc291944e7c7697db Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 03:15:52 +0000 Subject: [PATCH 271/647] chore(deps): update dependency @types/vscode to v1.84.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index b1a68a74f..876886608 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,9 +175,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.84.1", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.84.1.tgz", - "integrity": "sha512-DB10vBRLEPA/us7p3gQilU2Tq5HDu6JWTyCpD9qtb7MKWIvJS5In9HU3YgVGCXf/miwHJiY62aXwjtUSMpT8HA==", + "version": "1.84.2", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.84.2.tgz", + "integrity": "sha512-LCe1FvCDMJKkPdLVGYhP0HRJ1PDop2gRVm/zFHiOKwYLBRS7vEV3uOOUId4HMV+L1IxqyS+IZXMmlSMRbZGIAw==", "dev": true }, "node_modules/@vscode/test-electron": { From 9e01e79af6ebfea516ba5ffa9bff5507a34681f8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 03:15:36 +0000 Subject: [PATCH 272/647] chore(deps): update dependency @types/node to v20.9.3 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 876886608..fd444211a 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.2.tgz", - "integrity": "sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==", + "version": "20.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.3.tgz", + "integrity": "sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 2830e67eb397f3957457cacbc0d608eb55ba599a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 04:10:49 +0000 Subject: [PATCH 273/647] chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to v4.8.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0d3ae0bc9..1e611e274 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + From 2a53f57931cdd9881295c93a3841a24efc3aa13b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 04:10:41 +0000 Subject: [PATCH 274/647] chore(deps): update dependency @types/node to v20.9.4 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index fd444211a..5be6010fc 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.3.tgz", - "integrity": "sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==", + "version": "20.9.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.4.tgz", + "integrity": "sha512-wmyg8HUhcn6ACjsn8oKYjkN/zUzQeNtMy44weTJSM6p4MMzEOuKbA3OjJ267uPCOW7Xex9dyrNTful8XTQYoDA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From e7a74030a6730cf88a1cb5b6381a4ec8ff4fd68b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 04:10:27 +0000 Subject: [PATCH 275/647] chore(deps): update dependency @types/mocha to v10.0.6 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 5be6010fc..c75d44ed6 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -160,9 +160,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.5.tgz", - "integrity": "sha512-JUI82qwkRhYJYesuKSeFy46fKbhLaV9RU1gAh2PHmyoEECvlTf5UYeIivYlMszp1WT2CwJ4ziC3zoxsodhsGwg==", + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", "dev": true }, "node_modules/@types/node": { From dae397522e6ea4bcf425eacc9ae3e7dea39775a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:53:11 +0000 Subject: [PATCH 276/647] chore(deps): update dependency @vscode/test-electron to v2.3.7 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index c75d44ed6..cfeb9ea1f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -181,9 +181,9 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.6.tgz", - "integrity": "sha512-M31xGH0RgqNU6CZ4/9g39oUMJ99nLzfjA+4UbtIQ6TcXQ6+2qkjOOxedmPBDDCg26/3Al5ubjY80hIoaMwKYSw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.7.tgz", + "integrity": "sha512-KVQCCNfkzi3fIPLK8nIP/5Ao6ExiH+b/DkE5ywpCPXItKNgrPh92qKRIxa2oPFBUkl7807mAoQ9jakNOoQ1oDA==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", From 12634d56adc03e765632142f9680575f562feeb4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:05:21 +0000 Subject: [PATCH 277/647] chore(deps): update dependency @vscode/test-electron to v2.3.8 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index cfeb9ea1f..f474aad7e 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -181,9 +181,9 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.7.tgz", - "integrity": "sha512-KVQCCNfkzi3fIPLK8nIP/5Ao6ExiH+b/DkE5ywpCPXItKNgrPh92qKRIxa2oPFBUkl7807mAoQ9jakNOoQ1oDA==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.8.tgz", + "integrity": "sha512-b4aZZsBKtMGdDljAsOPObnAi7+VWIaYl3ylCz1jTs+oV6BZ4TNHcVNC3xUn0azPeszBmwSBDQYfFESIaUQnrOg==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", From f047d7845314eb8b0f863bdca91e9ba9476425c5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:25:22 +0000 Subject: [PATCH 278/647] chore(deps): update dependency verify.xunit to v22.6.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0d3ae0bc9..6a1a8124f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 8988c0e5bb7453e3b61f6e2c4ada4ecc373e99ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 23:54:51 +0000 Subject: [PATCH 279/647] chore(deps): update dependency @types/node to v20.10.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f474aad7e..7a0b7e681 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.4.tgz", - "integrity": "sha512-wmyg8HUhcn6ACjsn8oKYjkN/zUzQeNtMy44weTJSM6p4MMzEOuKbA3OjJ267uPCOW7Xex9dyrNTful8XTQYoDA==", + "version": "20.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.2.tgz", + "integrity": "sha512-37MXfxkb0vuIlRKHNxwCkb60PNBpR94u4efQuN4JgIAm66zfCDXGSAFCef9XUWFovX2R1ok6Z7MHhtdVXXkkIw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 9a2a85669897c5e35b212950c295e7fdb99a6a51 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:29:59 +0000 Subject: [PATCH 280/647] chore(deps): update dependency lint-staged to v15.2.0 --- package-lock.json | 161 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 100 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index c627d6ffd..9ba3e83c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.1.0", + "lint-staged": "15.2.0", "prettier": "3.1.0" } }, @@ -33,15 +33,15 @@ } }, "node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, "dependencies": { - "type-fest": "^1.0.2" + "type-fest": "^3.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -120,16 +120,16 @@ } }, "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", "dev": true, "dependencies": { "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" + "string-width": "^7.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -181,16 +181,10 @@ } } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, "node_modules/eventemitter3": { @@ -246,6 +240,18 @@ "node": ">=8" } }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-stream": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", @@ -322,26 +328,26 @@ "dev": true }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lint-staged": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.1.0.tgz", - "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.0.tgz", + "integrity": "sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==", "dev": true, "dependencies": { "chalk": "5.3.0", "commander": "11.1.0", "debug": "4.3.4", "execa": "8.0.1", - "lilconfig": "2.1.0", - "listr2": "7.0.2", + "lilconfig": "3.0.0", + "listr2": "8.0.0", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", @@ -358,41 +364,72 @@ } }, "node_modules/listr2": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", - "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.0.tgz", + "integrity": "sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==", "dev": true, "dependencies": { - "cli-truncate": "^3.1.0", + "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", + "log-update": "^6.0.0", "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" + "wrap-ansi": "^9.0.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", + "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", "dev": true, "dependencies": { - "ansi-escapes": "^5.0.0", + "ansi-escapes": "^6.2.0", "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -625,17 +662,17 @@ } }, "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.0.0.tgz", + "integrity": "sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -681,12 +718,12 @@ } }, "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -708,17 +745,17 @@ } }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "dev": true, "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" diff --git a/package.json b/package.json index 411b5d889..929b253f5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.1.0", + "lint-staged": "15.2.0", "prettier": "3.1.0" }, "scripts": { From 39564b39c993d97bb295f8fb98afca38d93d088c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:29:44 +0000 Subject: [PATCH 281/647] chore(deps): update dependency @types/node to v20.10.3 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 7a0b7e681..38c758cbd 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.2.tgz", - "integrity": "sha512-37MXfxkb0vuIlRKHNxwCkb60PNBpR94u4efQuN4JgIAm66zfCDXGSAFCef9XUWFovX2R1ok6Z7MHhtdVXXkkIw==", + "version": "20.10.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", + "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From fec20107f56b186aa1b35a88547c0d145544892a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 01:11:21 +0000 Subject: [PATCH 282/647] chore(deps): update dependency verify.xunit to v22.6.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6a1a8124f..1e5a55968 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 3913cc957b39cf7326abbff118fbe809a818de2a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 05:32:48 +0000 Subject: [PATCH 283/647] chore(deps): update dependency verify.xunit to v22.7.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1e5a55968..8d574d312 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From ea78dda3be738513d462cfb8953f64f24e90b327 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 13:15:05 +0000 Subject: [PATCH 284/647] chore(deps): update dependency verify.xunit to v22.7.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8d574d312..6ac6e305d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 36449b03633d73d74cf7c0eceac24065e5c75879 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:39:23 +0000 Subject: [PATCH 285/647] chore(deps): update github actions to v4 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66610cefa..c7391716b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,11 +91,11 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v3.2.0 + uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 7.0 SDK - uses: actions/setup-dotnet@v3.2.0 + uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: '8.0.x' - name: 🎁 dotnet tool restore diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 6b0a186e4..4939b9aac 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0.10.2 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index a40efdd4f..7e0c3cb93 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -21,7 +21,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 - name: Fetch all history for all tags and branches run: git fetch --prune diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 667080585..2e3447680 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.sha }} fetch-depth: 0 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 - name: Fetch all history for all tags and branches run: git fetch --prune From 5926b2744cae95084a05ae0339de9fdfb2bf8414 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 15:08:37 +0000 Subject: [PATCH 286/647] chore(deps): update jetbrains to v2023.3.0 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index dc4374f1a..775d1572d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.2.3", + "version": "2023.3.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 6ac6e305d..76797d134 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 058d14c0d3d7c19084406e3f326628dd28f184d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 21:46:39 +0000 Subject: [PATCH 287/647] chore(deps): update dependency typescript to v5.3.3 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 38c758cbd..4a09466be 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1456,9 +1456,9 @@ } }, "node_modules/typescript": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", - "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", From a81aaf2d37ff4846b527d7f5f64f32a618956622 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 23:37:55 +0000 Subject: [PATCH 288/647] chore(deps): update dependency benchmarkdotnet to v0.13.11 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index bb2d4fa64..0da7285aa 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From db5230a68e990b31dbfcd11481a1924dd75be4ab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:48:51 +0000 Subject: [PATCH 289/647] chore(deps): update dependency verify.xunit to v22.8.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 518f34a60..ecc97c051 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From fe619337157aa1502303addb2b12c9f24140d5bb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 00:05:08 +0000 Subject: [PATCH 290/647] chore(deps): update dependency @types/vscode to v1.85.0 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 4a09466be..c21a40520 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,9 +175,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.84.2", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.84.2.tgz", - "integrity": "sha512-LCe1FvCDMJKkPdLVGYhP0HRJ1PDop2gRVm/zFHiOKwYLBRS7vEV3uOOUId4HMV+L1IxqyS+IZXMmlSMRbZGIAw==", + "version": "1.85.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.85.0.tgz", + "integrity": "sha512-CF/RBon/GXwdfmnjZj0WTUMZN5H6YITOfBCP4iEZlOtVQXuzw6t7Le7+cR+7JzdMrnlm7Mfp49Oj2TuSXIWo3g==", "dev": true }, "node_modules/@vscode/test-electron": { From 1b7748e3cc2692ee66d6eab665b357dd0ba38f30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 03:46:47 +0000 Subject: [PATCH 291/647] chore(deps): update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ecc97c051..9882be138 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From d70a1cc9422d12e3d3e6bd654434a77e82deb8e2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 08:00:24 +0000 Subject: [PATCH 292/647] chore(deps): update dependency @types/node to v20.10.4 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 4a09466be..52feae4a1 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", - "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", + "version": "20.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", + "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 22519a7eefff19b3e07c9a11e37ab22d846d4d06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 10 Dec 2023 09:18:44 +0000 Subject: [PATCH 293/647] chore(deps): update dependency prettier to v3.1.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ba3e83c7..bca958012 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.2.0", - "prettier": "3.1.0" + "prettier": "3.1.1" } }, "node_modules/@prettier/plugin-xml": { @@ -543,9 +543,9 @@ } }, "node_modules/prettier": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", - "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index 929b253f5..b080f5cae 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.2.0", - "prettier": "3.1.0" + "prettier": "3.1.1" }, "scripts": { "prepare": "husky install" From 494442982ef2b9e8b39bf46702f1336a9938139b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 04:40:44 +0000 Subject: [PATCH 294/647] chore(deps): update dependency bogus to v35 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9882be138..fdc2ed8e5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From c4941a4d650a98e57a414c97784626c4797999a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:17:24 +0000 Subject: [PATCH 295/647] chore(deps): update jetbrains to v2023.3.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 775d1572d..5933ff6b5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.3.0", + "version": "2023.3.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index fdc2ed8e5..06cce8832 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 06f5ce41c111a7b7f1db130c9fa33b862ad4f00b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:58:10 +0000 Subject: [PATCH 296/647] chore(deps): update jetbrains to v2023.3.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5933ff6b5..fc9c360e9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.3.1", + "version": "2023.3.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 06cce8832..e25f2bf64 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 922a9eea6965a5d6345ac27496c95c4fd5bcb2c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 12:27:26 +0000 Subject: [PATCH 297/647] chore(deps): update dependency verify.xunit to v22.9.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e25f2bf64..4aef62c4a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From aa5aeb436c18eb5562cabdc5c05b3d74b0001d8c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:41:30 +0000 Subject: [PATCH 298/647] chore(deps): update dependency verify.xunit to v22.10.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4aef62c4a..a2338d256 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 810a2a338ac05dbfe084b293a0d47269333f6f55 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 19:03:31 +0000 Subject: [PATCH 299/647] chore(deps): update dependency @types/node to v20.10.5 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 52feae4a1..2ffa96f51 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", - "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "version": "20.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", + "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 6ed9016d9bfefe6f3ec43b672b503fb1b2502dfd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 21:16:13 +0000 Subject: [PATCH 300/647] chore(deps): update dependency bogus to v35.2.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a2338d256..94e640297 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 8c13eb7ba1284cc4a92a07eabb4eb62e236a9671 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 01:22:23 +0000 Subject: [PATCH 301/647] chore(deps): update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 94e640297..a687c1209 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From a5ba34be5045d42944f199df9c6a7b1b9e5d379b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 03:28:20 +0000 Subject: [PATCH 302/647] chore(deps): update dependency verify.xunit to v22.10.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a687c1209..dfb6e23af 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 643cdf9b2449751427416717e57496afba0ed4c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 12:48:01 +0000 Subject: [PATCH 303/647] chore(deps): update dependency verify.xunit to v22.11.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index dfb6e23af..278bbd0e7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 93690a17cd03e898d22ee7702bb01b32567b03e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Dec 2023 01:36:27 +0000 Subject: [PATCH 304/647] chore(deps): update dependency verify.xunit to v22.11.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 278bbd0e7..5f23358c9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 86572075ddefb8690c3973ecbf191db4d2035b3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 31 Dec 2023 03:37:37 +0000 Subject: [PATCH 305/647] chore(deps): update dependency snapper to v2.4.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5f23358c9..7c5b4b4fa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -55,7 +55,7 @@ - + From 83d1f3f337259fbb14ec00a0be3a14ce37d912fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 31 Dec 2023 06:50:51 +0000 Subject: [PATCH 306/647] chore(deps): update dependency @types/node to v20.10.6 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 2ffa96f51..da475ce0a 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", - "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From 5de8fb9c8075d5f25f33dfb95f80d20d02993062 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 00:13:45 +0000 Subject: [PATCH 307/647] chore(deps): update dependency bogus to v35.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7c5b4b4fa..5962a23b5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 5a1574badec1be3ba8ac54994ae6773f9b7f89af Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 03:53:50 +0000 Subject: [PATCH 308/647] chore(deps): update dependency verify.xunit to v22.11.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5962a23b5..50b61d4af 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 917c25c84a7df3c2783e270916d86d41187573e6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 07:38:01 +0000 Subject: [PATCH 309/647] chore(deps): update dependency xunit to v2.6.5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 50b61d4af..af72f2647 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From 14f22e15bd20a17d34fb766fcd3bba5d26621e67 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 07:05:32 +0000 Subject: [PATCH 310/647] chore(deps): update dependency verify.xunit to v22.11.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index af72f2647..18bb87e2e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 60998c7de881e5807011bb5c4df02bc30d8b70bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 09:39:31 +0000 Subject: [PATCH 311/647] chore(deps): update dependency benchmarkdotnet to v0.13.12 --- benchmarks/Pipeline/Pipeline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 0da7285aa..116262bc1 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -8,7 +8,7 @@ - + From dad97a84ee8af1421a53cb02d94d0d429ff9dff3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 17:12:44 +0000 Subject: [PATCH 312/647] chore(deps): update dependency @types/node to v20.10.8 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f37e71ee2..2f9d24dba 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", - "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "version": "20.10.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.8.tgz", + "integrity": "sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From eb0792d1e64c28357bb1195fac66149b5e7383b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:37:18 +0000 Subject: [PATCH 313/647] chore(deps): update dotnet monorepo [minor/patch] to v8.0.1 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 18bb87e2e..9484e8bb5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -31,8 +31,8 @@ - - + + From 7d72af7df1511ad483be695fbfb3688a6a6b0f76 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 03:58:35 +0000 Subject: [PATCH 314/647] chore(deps): update dependency verify.xunit to v22.11.5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9484e8bb5..ad270f42c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 9de140913924a031eb414abf6846702984e40d15 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 03:58:28 +0000 Subject: [PATCH 315/647] chore(deps): update dependency dotnet-sdk to v8.0.101 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 989a69caf..a93054a45 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.101", "rollForward": "latestMinor" } } \ No newline at end of file From 0d12afdf47286b1c0b32aee1f81146ae4cd22906 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 10:21:23 +0000 Subject: [PATCH 316/647] chore(deps): update dependency bogus to v35.3.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ad270f42c..5221417c2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From b638b93f5f8366092477602315ffca137914d273 Mon Sep 17 00:00:00 2001 From: Seonghyeon Cho Date: Sun, 14 Jan 2024 02:14:34 +0900 Subject: [PATCH 317/647] Fix github actions badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 540a477d6..c47b1b6e0 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ This project is supported by the [.NET Foundation](http://www.dotnetfoundation.o [azurepipelines-history]: https://dev.azure.com/omnisharp/Builds/_build?definitionId=1&branchName=master [azurepipelines-history-badge]: https://buildstats.info/azurepipelines/chart/omnisharp/Builds/1?includeBuildsFromPullRequest=false "Azure Pipelines History" [github]: https://github.com/OmniSharp/csharp-language-server-protocol/actions?query=workflow%3Aci -[github-badge]: https://img.shields.io/github/workflow/status/OmniSharp/csharp-language-server-protocol/ci.svg?label=github&logo=github&color=b845fc&logoColor=b845fc&style=flat "GitHub Actions Status" +[github-badge]: https://img.shields.io/github/actions/workflow/status/OmniSharp/csharp-language-server-protocol/ci.yml?label=github&logo=github&color=b845fc&logoColor=b845fc&style=flat "GitHub Actions Status" [github-history-badge]: https://buildstats.info/github/chart/OmniSharp/csharp-language-server-protocol?includeBuildsFromPullRequest=false "GitHub Actions History" [nuget-hefb6om79mfg]: https://www.nuget.org/packages/OmniSharp.Extensions.DebugAdapter/ [nuget-version-hefb6om79mfg-badge]: https://img.shields.io/nuget/v/OmniSharp.Extensions.DebugAdapter.svg?color=004880&logo=nuget&style=flat-square "NuGet Version" From c805a03185252353046968a87369198f0b41aa07 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 14 Jan 2024 00:10:51 +0000 Subject: [PATCH 318/647] chore(deps): update dependency bogus to v35.3.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5221417c2..05b21ab65 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From b90079c9a16d9d834900636299819ad3fa8efab6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 14 Jan 2024 19:48:20 +0000 Subject: [PATCH 319/647] chore(deps): update dependency bogus to v35.4.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 05b21ab65..2325e2f21 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 66c88efe595c172e39199ef7baea36a6d8cbb550 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:54:20 +0000 Subject: [PATCH 320/647] chore(deps): update dependency nuke.globaltool to v8 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index fc9c360e9..b010b78cc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "7.0.6", + "version": "8.0.0", "commands": [ "nuke" ] From 3e34b1bd67a27897878a539135af726cda0a9d1c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:58:29 +0000 Subject: [PATCH 321/647] chore(deps): update jetbrains to v2023.3.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index fc9c360e9..2893ecff1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.3.2", + "version": "2023.3.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 2325e2f21..e1917e8a2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 69a26ccdc428255177c6b3d95210bc05db4b2017 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 21:40:28 +0000 Subject: [PATCH 322/647] chore(deps): update dependency xunit to v2.6.6 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e1917e8a2..e51283a95 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From 3c57ebe24e393c27a15cea7b0937c589b85573aa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:57:32 +0000 Subject: [PATCH 323/647] chore(deps): update dependency @vscode/test-electron to v2.3.9 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 2f9d24dba..3c9701d84 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -181,9 +181,9 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.8.tgz", - "integrity": "sha512-b4aZZsBKtMGdDljAsOPObnAi7+VWIaYl3ylCz1jTs+oV6BZ4TNHcVNC3xUn0azPeszBmwSBDQYfFESIaUQnrOg==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", + "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", From fe96f909864f3a3aeb2618c6fc6731b6607ce46d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:42:55 +0000 Subject: [PATCH 324/647] chore(deps): update dependency lint-staged to v15.2.1 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index bca958012..a318ca008 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.2.0", + "lint-staged": "15.2.1", "prettier": "3.1.1" } }, @@ -337,9 +337,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.0.tgz", - "integrity": "sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==", + "version": "15.2.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.1.tgz", + "integrity": "sha512-dhwAPnM85VdshybV9FWI/9ghTvMLoQLEXgVMx+ua2DN7mdfzd/tRfoU2yhMcBac0RHkofoxdnnJUokr8s4zKmQ==", "dev": true, "dependencies": { "chalk": "5.3.0", @@ -347,7 +347,7 @@ "debug": "4.3.4", "execa": "8.0.1", "lilconfig": "3.0.0", - "listr2": "8.0.0", + "listr2": "8.0.1", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", @@ -364,9 +364,9 @@ } }, "node_modules/listr2": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.0.tgz", - "integrity": "sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", + "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", diff --git a/package.json b/package.json index b080f5cae..caee9614a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.2.0", + "lint-staged": "15.2.1", "prettier": "3.1.1" }, "scripts": { From 12bb002fd4093445d5ab6374d6e7cff72a8d1c8d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:05:15 +0000 Subject: [PATCH 325/647] chore(deps): update dependency lint-staged to v15.2.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index a318ca008..2ee15717c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.2.1", + "lint-staged": "15.2.2", "prettier": "3.1.1" } }, @@ -337,9 +337,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.1.tgz", - "integrity": "sha512-dhwAPnM85VdshybV9FWI/9ghTvMLoQLEXgVMx+ua2DN7mdfzd/tRfoU2yhMcBac0RHkofoxdnnJUokr8s4zKmQ==", + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", + "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", "dev": true, "dependencies": { "chalk": "5.3.0", diff --git a/package.json b/package.json index caee9614a..109cd705e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", - "lint-staged": "15.2.1", + "lint-staged": "15.2.2", "prettier": "3.1.1" }, "scripts": { From 54941a7cd2b81663d2c89fec237f326089aa6d32 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:03:57 +0000 Subject: [PATCH 326/647] chore(deps): update dependency prettier to v3.2.5 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2ee15717c..bd4a3353a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.2.2", - "prettier": "3.1.1" + "prettier": "3.2.5" } }, "node_modules/@prettier/plugin-xml": { @@ -543,9 +543,9 @@ } }, "node_modules/prettier": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", - "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index 109cd705e..4b9aa6919 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.2.2", "husky": "8.0.3", "lint-staged": "15.2.2", - "prettier": "3.1.1" + "prettier": "3.2.5" }, "scripts": { "prepare": "husky install" From b80adc8b68e5b778de08f8bf7677f0d46f89824d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:03:38 +0000 Subject: [PATCH 327/647] chore(deps): update reportgenerator to v5.2.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2893ecff1..d9dd9a7c5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.2.0", + "version": "5.2.1", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index e51283a95..5e827a7c9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 7ebad8e8be4deb7bec2e7c7bcb40db13d9e05082 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:01:16 +0000 Subject: [PATCH 328/647] chore(deps): update gittools/actions action to v0.11.0 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 4939b9aac..f04fbe2e2 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.2 + uses: gittools/actions/gitversion/setup@v0.11.0 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.10.2 + uses: gittools/actions/gitreleasemanager/setup@v0.11.0 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.2 + uses: gittools/actions/gitversion/execute@v0.11.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 7e0c3cb93..f44a15ac8 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.2 + uses: gittools/actions/gitversion/setup@v0.11.0 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.2 + uses: gittools/actions/gitversion/execute@v0.11.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 2e3447680..2dc807781 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.10.2 + uses: gittools/actions/gitversion/setup@v0.11.0 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.10.2 + uses: gittools/actions/gitreleasemanager/setup@v0.11.0 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.2 + uses: gittools/actions/gitversion/execute@v0.11.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 22e3470fe898af1d0a32cc522e35b3e0e2e1e5be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:35:33 +0000 Subject: [PATCH 329/647] chore(deps): update dependency microsoft.net.test.sdk to v17.9.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5e827a7c9..efe5ada2c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From 8ac5cf75e07d3d8ad4da48321e8bf1a102e23aa8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 Feb 2024 07:46:54 +0000 Subject: [PATCH 330/647] chore(deps): update dependency xunitxml.testlogger to v3.1.20 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index efe5ada2c..3a5d8194d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -46,7 +46,7 @@ - + From fe4dd597743419e3dfd9ca4ff3c6aa61608415b2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 07:35:13 +0000 Subject: [PATCH 331/647] chore(deps): update dependency dotnet-sdk to v8.0.200 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index a93054a45..dba63d31b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.101", + "version": "8.0.200", "rollForward": "latestMinor" } } \ No newline at end of file From 7feae00dd58136d5065d39b58c061caaaaaa1988 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:55:11 +0000 Subject: [PATCH 332/647] chore(deps): update dependency microsoft.extensions.options to v8.0.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3a5d8194d..68321572c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -32,7 +32,7 @@ - + From 46bd1eeab7f35d8c587f3b97eebab0d9181c38da Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 07:49:45 +0000 Subject: [PATCH 333/647] chore(deps): update dependency dotnet-sdk to v8.0.201 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index dba63d31b..58009ec08 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.200", + "version": "8.0.201", "rollForward": "latestMinor" } } \ No newline at end of file From ca9d62956d0505e3203c30641356de1a08981f76 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:59:20 +0000 Subject: [PATCH 334/647] chore(deps): update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 68321572c..d411456ba 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From 9933a4b13ed5445a01b86e064825bffc40250635 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 17 Feb 2024 21:06:53 +0000 Subject: [PATCH 335/647] chore(deps): update alexwilson/enable-github-automerge-action action to v1.1.0 --- .github/workflows/dependabot-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml index 5da81288a..4c013e417 100644 --- a/.github/workflows/dependabot-merge.yml +++ b/.github/workflows/dependabot-merge.yml @@ -40,7 +40,7 @@ jobs: contains(github.event.pull_request.labels.*.name, ':shipit: merge') || contains(github.event.pull_request.labels.*.name, 'javascript') || contains(github.event.pull_request.labels.*.name, 'github-actions') - uses: alexwilson/enable-github-automerge-action@1.0.0 + uses: alexwilson/enable-github-automerge-action@1.1.0 continue-on-error: true with: github-token: '${{ secrets.OMNISHARP_BOT_TOKEN }}' From e8ff9955403969bda4c284ef6c0d7192d3f97ac3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 00:49:13 +0000 Subject: [PATCH 336/647] chore(deps): update github actions --- .github/workflows/ci.yml | 2 +- .github/workflows/dependabot-merge.yml | 2 +- .github/workflows/publish-nuget.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7391716b..c132dcd09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: clean: 'false' fetch-depth: '0' - name: NuGet Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: '${{ github.workspace }}/.nuget/packages' key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}" diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml index 4c013e417..7cf7303fe 100644 --- a/.github/workflows/dependabot-merge.yml +++ b/.github/workflows/dependabot-merge.yml @@ -40,7 +40,7 @@ jobs: contains(github.event.pull_request.labels.*.name, ':shipit: merge') || contains(github.event.pull_request.labels.*.name, 'javascript') || contains(github.event.pull_request.labels.*.name, 'github-actions') - uses: alexwilson/enable-github-automerge-action@1.1.0 + uses: alexwilson/enable-github-automerge-action@2.0.0 continue-on-error: true with: github-token: '${{ secrets.OMNISHARP_BOT_TOKEN }}' diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 586ed7dd5..4aae24726 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -19,7 +19,7 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: nuget/setup-nuget@v1 + - uses: nuget/setup-nuget@v2 with: nuget-version: '5.x' From bdfb87b44f5a2c02f1434ec0cd5012953d7bd268 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 24 Feb 2024 21:52:24 +0000 Subject: [PATCH 337/647] chore(deps): update reportgenerator to v5.2.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index d9dd9a7c5..8530747de 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.2.1", + "version": "5.2.2", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index d411456ba..9383160a2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 2579944a9ab1525eed87701480b81ba9999e3b15 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:19:38 +0000 Subject: [PATCH 338/647] chore(deps): update coverlet to v6.0.1 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9383160a2..b1259b67a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,8 +47,8 @@ - - + + From 4bcc94d730cff8ccede281849461b6ff1cf60a7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 02:03:58 +0000 Subject: [PATCH 339/647] chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to v4.9.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b1259b67a..4714c5740 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + From c96c95b909c520d4a9cd3ed26d603308605a140e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 13:52:00 +0000 Subject: [PATCH 340/647] chore(deps): update gittools/actions action to v0.12.1 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index f04fbe2e2..c56faab08 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.11.0 + uses: gittools/actions/gitversion/setup@v0.12.1 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.11.0 + uses: gittools/actions/gitreleasemanager/setup@v0.12.1 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.11.0 + uses: gittools/actions/gitversion/execute@v0.12.1 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index f44a15ac8..0f27ad2ee 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.11.0 + uses: gittools/actions/gitversion/setup@v0.12.1 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.11.0 + uses: gittools/actions/gitversion/execute@v0.12.1 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 2dc807781..d9429de92 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.11.0 + uses: gittools/actions/gitversion/setup@v0.12.1 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.11.0 + uses: gittools/actions/gitreleasemanager/setup@v0.12.1 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.11.0 + uses: gittools/actions/gitversion/execute@v0.12.1 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 88783f4142476c407ee9af72b24be8803fdbf868 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 04:19:23 +0000 Subject: [PATCH 341/647] chore(deps): update gittools/actions action to v0.13.2 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index c56faab08..55801cc34 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.12.1 + uses: gittools/actions/gitversion/setup@v0.13.2 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.12.1 + uses: gittools/actions/gitreleasemanager/setup@v0.13.2 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.12.1 + uses: gittools/actions/gitversion/execute@v0.13.2 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 0f27ad2ee..3ad6ed0e7 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.12.1 + uses: gittools/actions/gitversion/setup@v0.13.2 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.12.1 + uses: gittools/actions/gitversion/execute@v0.13.2 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index d9429de92..f728b21b3 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.12.1 + uses: gittools/actions/gitversion/setup@v0.13.2 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.12.1 + uses: gittools/actions/gitreleasemanager/setup@v0.13.2 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.12.1 + uses: gittools/actions/gitversion/execute@v0.13.2 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From b4f51173b463e8ec4b648a107f15d5fa140797c4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 07:24:50 +0000 Subject: [PATCH 342/647] chore(deps): update dependency bogus to v35.4.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b1259b67a..4f0576738 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 7b159c6238fee0f59673676db3df1d206577843d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:48:50 +0000 Subject: [PATCH 343/647] chore(deps): update gittools/actions action to v0.13.3 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 55801cc34..d77e369be 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.2 + uses: gittools/actions/gitversion/setup@v0.13.3 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.13.2 + uses: gittools/actions/gitreleasemanager/setup@v0.13.3 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.2 + uses: gittools/actions/gitversion/execute@v0.13.3 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 3ad6ed0e7..5b37c7561 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.2 + uses: gittools/actions/gitversion/setup@v0.13.3 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.2 + uses: gittools/actions/gitversion/execute@v0.13.3 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index f728b21b3..23642e668 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.13.2 + uses: gittools/actions/gitversion/setup@v0.13.3 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.13.2 + uses: gittools/actions/gitreleasemanager/setup@v0.13.3 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.2 + uses: gittools/actions/gitversion/execute@v0.13.3 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 9a82e527a126c1db1f78034da0691696a156728b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 21:20:22 +0000 Subject: [PATCH 344/647] chore(deps): update gittools/actions action to v0.13.4 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index d77e369be..791bfd56c 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.3 + uses: gittools/actions/gitversion/setup@v0.13.4 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.13.3 + uses: gittools/actions/gitreleasemanager/setup@v0.13.4 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.3 + uses: gittools/actions/gitversion/execute@v0.13.4 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 5b37c7561..eeabac27e 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.3 + uses: gittools/actions/gitversion/setup@v0.13.4 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.3 + uses: gittools/actions/gitversion/execute@v0.13.4 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 23642e668..6f4c6b411 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.13.3 + uses: gittools/actions/gitversion/setup@v0.13.4 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.13.3 + uses: gittools/actions/gitreleasemanager/setup@v0.13.4 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.3 + uses: gittools/actions/gitversion/execute@v0.13.4 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From ee6c6c9fec965d189f40470cb473475d0a1753e6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 21:24:27 +0000 Subject: [PATCH 345/647] chore(deps): update dependency bogus to v35.5.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4f0576738..94b2df6f3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 645531fd6afe7adc8b8f3aef026b9f2bb2e8b0ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 02:38:43 +0000 Subject: [PATCH 346/647] chore(deps): update gittools/actions action to v0.13.6 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 791bfd56c..3b7540b5c 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.4 + uses: gittools/actions/gitversion/setup@v0.13.6 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.13.4 + uses: gittools/actions/gitreleasemanager/setup@v0.13.6 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.4 + uses: gittools/actions/gitversion/execute@v0.13.6 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index eeabac27e..18692d3ea 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.4 + uses: gittools/actions/gitversion/setup@v0.13.6 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.4 + uses: gittools/actions/gitversion/execute@v0.13.6 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 6f4c6b411..a972906c8 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.13.4 + uses: gittools/actions/gitversion/setup@v0.13.6 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.13.4 + uses: gittools/actions/gitreleasemanager/setup@v0.13.6 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.4 + uses: gittools/actions/gitversion/execute@v0.13.6 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From bbacbeb4391368ee10c313880539af66c4fb8b9b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:35:25 +0000 Subject: [PATCH 347/647] chore(deps): update actions/checkout action to v4.1.2 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c132dcd09..ccfe0c3e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.2 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 3b7540b5c..6329c9df5 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.2 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 18692d3ea..2782ac8ff 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.2 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 0e253fb21..e0c90f6fc 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.2 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index a972906c8..ff1cbd375 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.2 with: ref: ${{ github.sha }} fetch-depth: 0 From 52a95bd2ae843fe6fcd567f492c8134dab96d2b0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:30:08 +0000 Subject: [PATCH 348/647] chore(deps): update gittools/actions action to v1 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 6329c9df5..d6dc57c1d 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.6 + uses: gittools/actions/gitversion/setup@v1.1.0 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.13.6 + uses: gittools/actions/gitreleasemanager/setup@v1.1.0 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.6 + uses: gittools/actions/gitversion/execute@v1.1.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 2782ac8ff..dd3ee199d 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.13.6 + uses: gittools/actions/gitversion/setup@v1.1.0 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.6 + uses: gittools/actions/gitversion/execute@v1.1.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index ff1cbd375..f440989d1 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v0.13.6 + uses: gittools/actions/gitversion/setup@v1.1.0 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v0.13.6 + uses: gittools/actions/gitreleasemanager/setup@v1.1.0 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.13.6 + uses: gittools/actions/gitversion/execute@v1.1.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From e9fc2b2ec35b92594f3b4cc9169c5df35cc962f7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 00:19:04 +0000 Subject: [PATCH 349/647] chore(deps): update gittools/actions action to v1.1.1 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index d6dc57c1d..8869345fd 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.1.0 + uses: gittools/actions/gitversion/setup@v1.1.1 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v1.1.0 + uses: gittools/actions/gitreleasemanager/setup@v1.1.1 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.1.0 + uses: gittools/actions/gitversion/execute@v1.1.1 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index dd3ee199d..341afe57c 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.1.0 + uses: gittools/actions/gitversion/setup@v1.1.1 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.1.0 + uses: gittools/actions/gitversion/execute@v1.1.1 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index f440989d1..97987f204 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v1.1.0 + uses: gittools/actions/gitversion/setup@v1.1.1 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v1.1.0 + uses: gittools/actions/gitreleasemanager/setup@v1.1.1 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v1.1.0 + uses: gittools/actions/gitversion/execute@v1.1.1 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 88f0379d156600cecc2d090b75c9eefff962c815 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 00:18:58 +0000 Subject: [PATCH 350/647] chore(deps): update coverlet to v6.0.2 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 94b2df6f3..5542ab27c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,8 +47,8 @@ - - + + From 13289c7a4a15a794ce7db8d4b24e216149c84b1a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 04:38:09 +0000 Subject: [PATCH 351/647] chore(deps): update jetbrains to v2023.3.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8530747de..ee6d799af 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.3.3", + "version": "2023.3.4", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 5542ab27c..c02b3976a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From a2bd02e02b4fcbedc0f443eb786b7e14b2497207 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:15:55 +0000 Subject: [PATCH 352/647] chore(deps): update reportgenerator to v5.2.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ee6d799af..ab64193f5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.2.2", + "version": "5.2.3", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index c02b3976a..2240f8f13 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 92d3f270da79d1f5418c13ca35f6cd9a38530210 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 01:46:15 +0000 Subject: [PATCH 353/647] chore(deps): update dependency dotnet-sdk to v8.0.202 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 58009ec08..82dd9d3bd 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.201", + "version": "8.0.202", "rollForward": "latestMinor" } } \ No newline at end of file From 848ef2baa5b1533f48510554ecf1f37c40cf0fbd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:24:38 +0000 Subject: [PATCH 354/647] chore(deps): update reportgenerator to v5.2.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ab64193f5..23834cff0 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.2.3", + "version": "5.2.4", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 2240f8f13..121c8fd10 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 482a83404a07cbc2d1fd60265e2645e3b402ffa0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 17:42:11 +0000 Subject: [PATCH 355/647] chore(deps): update dependency glob to v10.3.12 --- vscode-testextension/package-lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3c9701d84..aec152453 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -583,16 +583,16 @@ } }, "node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", + "jackspeak": "^2.3.6", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -1111,12 +1111,12 @@ } }, "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "dev": true, "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { @@ -1127,9 +1127,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "dev": true, "engines": { "node": "14 || >=16.14" From ed11d63b5e843f98b331e766d4527de0623a7f4f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 18:34:43 +0000 Subject: [PATCH 356/647] chore(deps): update dependency dotnet-sdk to v8.0.203 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 82dd9d3bd..ccbaf063b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.202", + "version": "8.0.203", "rollForward": "latestMinor" } } \ No newline at end of file From aa8f5bd42c2e980db9356eb62e3898e8ae6c8d40 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 30 Mar 2024 14:34:08 +0000 Subject: [PATCH 357/647] chore(deps): update dependency @prettier/plugin-xml to v3.4.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2ee15717c..a3bb4dc2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "devDependencies": { - "@prettier/plugin-xml": "3.2.2", + "@prettier/plugin-xml": "3.4.1", "husky": "8.0.3", "lint-staged": "15.2.2", "prettier": "3.1.1" } }, "node_modules/@prettier/plugin-xml": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.2.2.tgz", - "integrity": "sha512-SoE70SQF1AKIvK7LVK80JcdAe6wrDcbodFFjcoqb1FkOqV0G0oSlgAFDwoRXPqkUE5p/YF2nGsnUbnfm6471sw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.4.1.tgz", + "integrity": "sha512-Uf/6/+9ez6z/IvZErgobZ2G9n1ybxF5BhCd7eMcKqfoWuOzzNUxBipNo3QAP8kRC1VD18TIo84no7LhqtyDcTg==", "dev": true, "dependencies": { "@xml-tools/parser": "^1.0.11" diff --git a/package.json b/package.json index 109cd705e..fa6874e97 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "@prettier/plugin-xml": "3.2.2", + "@prettier/plugin-xml": "3.4.1", "husky": "8.0.3", "lint-staged": "15.2.2", "prettier": "3.1.1" From ca8a2d2bb073c300e872cbdce425e5b350c25657 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 15:03:41 +0000 Subject: [PATCH 358/647] chore(deps): update jetbrains to v2024 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 23834cff0..6de2e8150 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2023.3.4", + "version": "2024.1.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 121c8fd10..01667c21e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 7bdc44e144fd00d3c3e107510a6628ffb02794ef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:31:38 +0000 Subject: [PATCH 359/647] chore(deps): update dependency dotnet-sdk to v8.0.204 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index ccbaf063b..c87dd8a25 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.203", + "version": "8.0.204", "rollForward": "latestMinor" } } \ No newline at end of file From b73894ad90489f59f42a69d74ba8fdbd1e3503e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 00:32:27 +0000 Subject: [PATCH 360/647] chore(deps): update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 01667c21e..92467ee2f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From 519e0c2ebf73516918d042365b93fe67a5951a5c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:11:05 +0000 Subject: [PATCH 361/647] chore(deps): update jetbrains to v2024.1.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6de2e8150..84ea49a84 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.1.0", + "version": "2024.1.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 92467ee2f..d898e55a4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From ed6d08660f1dd9a91a34c99624d01077c1b7dd0d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 07:26:43 +0000 Subject: [PATCH 362/647] chore(deps): update dependency @types/vscode to v1.88.0 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index aec152453..dae13a14b 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,9 +175,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.85.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.85.0.tgz", - "integrity": "sha512-CF/RBon/GXwdfmnjZj0WTUMZN5H6YITOfBCP4iEZlOtVQXuzw6t7Le7+cR+7JzdMrnlm7Mfp49Oj2TuSXIWo3g==", + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.88.0.tgz", + "integrity": "sha512-rWY+Bs6j/f1lvr8jqZTyp5arRMfovdxolcqGi+//+cPDOh8SBvzXH90e7BiSXct5HJ9HGW6jATchbRTpTJpEkw==", "dev": true }, "node_modules/@vscode/test-electron": { From 7300c768b11b16707ffd673338b1f9018496a12b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 07:26:53 +0000 Subject: [PATCH 363/647] chore(deps): update dependency mocha to v10.4.0 --- vscode-testextension/package-lock.json | 68 +++++++------------------- 1 file changed, 19 insertions(+), 49 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index aec152453..099a61768 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -913,9 +913,9 @@ } }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", @@ -925,13 +925,12 @@ "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.2.0", + "glob": "8.1.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -946,44 +945,36 @@ }, "engines": { "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/mocha/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/mocha/node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -996,15 +987,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -1017,18 +999,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", From 66beb9602b31006e108dfca817c30df71fe0b719 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 07:27:04 +0000 Subject: [PATCH 364/647] chore(deps): update dependency typescript to v5.4.5 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index aec152453..cefb8923f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1456,9 +1456,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", From 7dfa2994a24cee307ca8e8390a2816a1bbb31e14 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:47:10 +0000 Subject: [PATCH 365/647] chore(deps): update actions/checkout action to v4.1.3 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccfe0c3e2..65bda64d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 8869345fd..e5a3e67ff 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 341afe57c..447f07c25 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index e0c90f6fc..9506a56f5 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 97987f204..c2aa326ac 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: ref: ${{ github.sha }} fetch-depth: 0 From 7fa91afafa71b6e34d1d5e8b0710eb5b0778cf65 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:06:12 +0000 Subject: [PATCH 366/647] chore(deps): update reportgenerator to v5.2.5 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 84ea49a84..695c38c53 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.2.4", + "version": "5.2.5", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index d898e55a4..a05574ab0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 4f7e23bbc73ff067e2bcca8eb3c971e34325dc63 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 04:12:56 +0000 Subject: [PATCH 367/647] chore(deps): update dependency husky to v9 --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3bb4dc2e..eecaf00f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "devDependencies": { "@prettier/plugin-xml": "3.4.1", - "husky": "8.0.3", + "husky": "9.0.11", "lint-staged": "15.2.2", "prettier": "3.1.1" } @@ -274,15 +274,15 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.mjs" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" diff --git a/package.json b/package.json index fa6874e97..46ac5a654 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "devDependencies": { "@prettier/plugin-xml": "3.4.1", - "husky": "8.0.3", + "husky": "9.0.11", "lint-staged": "15.2.2", "prettier": "3.1.1" }, From fa3905172175a8cfb1c796787168f5803333e615 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:36:31 +0000 Subject: [PATCH 368/647] chore(deps): update dependency @types/node to v20.12.7 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index e45e8b84d..5b5edf384 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.8.tgz", - "integrity": "sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA==", + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" From d1a2fcb12396e40f1b4edbf4ab1fec3d92eb3f2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:04:50 +0000 Subject: [PATCH 369/647] chore(deps): update actions/checkout action to v4.1.4 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65bda64d4..7403b71ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.4 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index e5a3e67ff..e4cf695a0 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.4 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 447f07c25..202efbd9c 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.4 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9506a56f5..efdb21079 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.4 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index c2aa326ac..be1db4ed0 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.4 with: ref: ${{ github.sha }} fetch-depth: 0 From 732b0861dccc8261a03fd21e7be94c27a4d92bc3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 05:17:53 +0000 Subject: [PATCH 370/647] chore(deps): update dependency lint-staged to v15.2.4 --- package-lock.json | 104 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 62 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4cd1e911..4dfd7ed6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.2", + "lint-staged": "15.2.4", "prettier": "3.2.5" } }, @@ -72,12 +72,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -142,12 +143,13 @@ "dev": true }, "node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/cross-spawn": { @@ -229,10 +231,11 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -305,6 +308,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -328,30 +332,35 @@ "dev": true }, "node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", + "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lint-staged": { - "version": "15.2.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", - "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.4.tgz", + "integrity": "sha512-3F9KRQIS2fVDGtCkBp4Bx0jswjX7zUcKx6OF0ZeY1prksUyKPRIIUqZhIUYAstJfvj6i48VFs4dwVIbCYwvTYQ==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "5.3.0", - "commander": "11.1.0", + "commander": "12.1.0", "debug": "4.3.4", "execa": "8.0.1", - "lilconfig": "3.0.0", - "listr2": "8.0.1", - "micromatch": "4.0.5", + "lilconfig": "3.1.1", + "listr2": "8.2.1", + "micromatch": "4.0.6", "pidtree": "0.6.0", "string-argv": "0.3.2", - "yaml": "2.3.4" + "yaml": "2.4.2" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -364,16 +373,17 @@ } }, "node_modules/listr2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", - "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.1.tgz", + "integrity": "sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==", "dev": true, + "license": "MIT", "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", "log-update": "^6.0.0", - "rfdc": "^1.3.0", + "rfdc": "^1.3.1", "wrap-ansi": "^9.0.0" }, "engines": { @@ -437,13 +447,14 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.6.tgz", + "integrity": "sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "braces": "^3.0.3", + "picomatch": "^4.0.2" }, "engines": { "node": ">=8.6" @@ -519,12 +530,13 @@ } }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -604,10 +616,11 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "dev": true, + "license": "MIT" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -710,6 +723,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -762,10 +776,14 @@ } }, "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index 0a7d0652a..e2bb60916 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.2", + "lint-staged": "15.2.4", "prettier": "3.2.5" }, "scripts": { From f007153dddc51ad302353d31dc899d953f337003 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 12:16:51 +0000 Subject: [PATCH 371/647] chore(deps): update dependency lint-staged to v15.2.5 --- package-lock.json | 44 ++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4dfd7ed6f..400e69bce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.4", + "lint-staged": "15.2.5", "prettier": "3.2.5" } }, @@ -345,22 +345,22 @@ } }, "node_modules/lint-staged": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.4.tgz", - "integrity": "sha512-3F9KRQIS2fVDGtCkBp4Bx0jswjX7zUcKx6OF0ZeY1prksUyKPRIIUqZhIUYAstJfvj6i48VFs4dwVIbCYwvTYQ==", + "version": "15.2.5", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.5.tgz", + "integrity": "sha512-j+DfX7W9YUvdzEZl3Rk47FhDF6xwDBV5wwsCPw6BwWZVPYJemusQmvb9bRsW23Sqsaa+vRloAWogbK4BUuU2zA==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "5.3.0", - "commander": "12.1.0", - "debug": "4.3.4", - "execa": "8.0.1", - "lilconfig": "3.1.1", - "listr2": "8.2.1", - "micromatch": "4.0.6", - "pidtree": "0.6.0", - "string-argv": "0.3.2", - "yaml": "2.4.2" + "chalk": "~5.3.0", + "commander": "~12.1.0", + "debug": "~4.3.4", + "execa": "~8.0.1", + "lilconfig": "~3.1.1", + "listr2": "~8.2.1", + "micromatch": "~4.0.7", + "pidtree": "~0.6.0", + "string-argv": "~0.3.2", + "yaml": "~2.4.2" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -447,14 +447,14 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.6.tgz", - "integrity": "sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", - "picomatch": "^4.0.2" + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -530,13 +530,13 @@ } }, "node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" diff --git a/package.json b/package.json index e2bb60916..6ada5c81d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.4", + "lint-staged": "15.2.5", "prettier": "3.2.5" }, "scripts": { From d0a86a0d3f430750965da6f42d8b2e0e50c6a96d Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Mon, 27 May 2024 23:14:09 +0200 Subject: [PATCH 372/647] Support net8.0 TFM --- .build/.build.csproj | 3 ++- .build/Solution.cs | 2 +- .github/workflows/ci.yml | 6 +++++- benchmarks/Pipeline/Pipeline.csproj | 2 +- global.json | 2 +- sample/SampleServer/SampleServer.csproj | 4 ++-- src/Client/Client.csproj | 2 +- src/Dap.Client/Dap.Client.csproj | 2 +- src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj | 2 +- src/Dap.Protocol/Dap.Protocol.csproj | 2 +- src/Dap.Server/Dap.Server.csproj | 2 +- src/Dap.Shared/Dap.Shared.csproj | 2 +- src/Dap.Testing/Dap.Testing.csproj | 2 +- src/JsonRpc.Testing/JsonRpc.Testing.csproj | 2 +- src/JsonRpc/JsonRpc.csproj | 2 +- src/Protocol.Proposals/Protocol.Proposals.csproj | 2 +- src/Protocol/Protocol.csproj | 2 +- src/Server/Server.csproj | 2 +- src/Shared/Shared.csproj | 2 +- src/Testing/Testing.csproj | 2 +- test/Client.Tests/Client.Tests.csproj | 2 +- test/Dap.Tests/Dap.Tests.csproj | 4 ++-- test/Generation.Tests/Generation.Tests.csproj | 2 +- test/JsonRpc.Tests/JsonRpc.Tests.csproj | 2 +- test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj | 2 +- test/Lsp.Tests/Lsp.Tests.csproj | 2 +- test/TestingUtils/TestingUtils.csproj | 2 +- vscode-testextension/src/extension.ts | 4 ++-- 28 files changed, 36 insertions(+), 31 deletions(-) diff --git a/.build/.build.csproj b/.build/.build.csproj index b158ccf34..859c216f5 100644 --- a/.build/.build.csproj +++ b/.build/.build.csproj @@ -2,12 +2,13 @@ Exe - net6.0 + net8.0 false False CS0649;CS0169 1 + true diff --git a/.build/Solution.cs b/.build/Solution.cs index eec2c6977..12dc1eb4b 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -100,7 +100,7 @@ RocketSurgeonGitHubActionsConfiguration configuration .Jobs.OfType() .First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase)) .ConfigureStep(step => step.FetchDepth = 0) - .UseDotNetSdks("3.1", "7.0") + .UseDotNetSdks("3.1", "6.0", "8.0") .AddNuGetCache() .AddVscodeExtensionTests() .PublishLogs() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7403b71ee..e96472f2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,11 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: '3.1.x' - - name: πŸ”¨ Use .NET Core 7.0 SDK + - name: πŸ”¨ Use .NET Core 6.0 SDK + uses: actions/setup-dotnet@v4.0.0 + with: + dotnet-version: '6.0.x' + - name: πŸ”¨ Use .NET Core 8.0 SDK uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: '8.0.x' diff --git a/benchmarks/Pipeline/Pipeline.csproj b/benchmarks/Pipeline/Pipeline.csproj index 116262bc1..0c559dd2c 100644 --- a/benchmarks/Pipeline/Pipeline.csproj +++ b/benchmarks/Pipeline/Pipeline.csproj @@ -1,7 +1,7 @@ - net472;netcoreapp3.1;net6.0 + net472;netcoreapp3.1;net6.0;net8.0< Exe false diff --git a/global.json b/global.json index c87dd8a25..8d0a1c0ac 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.204", + "version": "8.0.300", "rollForward": "latestMinor" } } \ No newline at end of file diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index 0300dcca5..3ccd54cf0 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -3,8 +3,8 @@ Exe false - net6.0 - win7-x64 + net8.0 + win-x64 latest diff --git a/src/Client/Client.csproj b/src/Client/Client.csproj index ebf3ae955..ccd049942 100644 --- a/src/Client/Client.csproj +++ b/src/Client/Client.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.LanguageClient OmniSharp.Extensions.LanguageServer.Client diff --git a/src/Dap.Client/Dap.Client.csproj b/src/Dap.Client/Dap.Client.csproj index 8997ffd64..c06983a14 100644 --- a/src/Dap.Client/Dap.Client.csproj +++ b/src/Dap.Client/Dap.Client.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Client OmniSharp.Extensions.DebugAdapter.Client diff --git a/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj b/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj index e03805d19..81dde6036 100644 --- a/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj +++ b/src/Dap.Protocol.Proposals/Dap.Protocol.Proposals.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Proposals OmniSharp.Extensions.DebugAdapter.Protocol diff --git a/src/Dap.Protocol/Dap.Protocol.csproj b/src/Dap.Protocol/Dap.Protocol.csproj index 52c4b5467..091aff8e0 100644 --- a/src/Dap.Protocol/Dap.Protocol.csproj +++ b/src/Dap.Protocol/Dap.Protocol.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.DebugAdapter OmniSharp.Extensions.DebugAdapter.Protocol diff --git a/src/Dap.Server/Dap.Server.csproj b/src/Dap.Server/Dap.Server.csproj index c3d82e895..767ab0412 100644 --- a/src/Dap.Server/Dap.Server.csproj +++ b/src/Dap.Server/Dap.Server.csproj @@ -1,7 +1,7 @@ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Server OmniSharp.Extensions.DebugAdapter.Server diff --git a/src/Dap.Shared/Dap.Shared.csproj b/src/Dap.Shared/Dap.Shared.csproj index cabed9b52..0114080b8 100644 --- a/src/Dap.Shared/Dap.Shared.csproj +++ b/src/Dap.Shared/Dap.Shared.csproj @@ -1,7 +1,7 @@ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Shared OmniSharp.Extensions.DebugAdapter.Shared diff --git a/src/Dap.Testing/Dap.Testing.csproj b/src/Dap.Testing/Dap.Testing.csproj index dec248cdd..315e99a5d 100644 --- a/src/Dap.Testing/Dap.Testing.csproj +++ b/src/Dap.Testing/Dap.Testing.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.DebugAdapter.Testing OmniSharp.Extensions.DebugAdapter.Testing diff --git a/src/JsonRpc.Testing/JsonRpc.Testing.csproj b/src/JsonRpc.Testing/JsonRpc.Testing.csproj index d02e92518..9684fe254 100644 --- a/src/JsonRpc.Testing/JsonRpc.Testing.csproj +++ b/src/JsonRpc.Testing/JsonRpc.Testing.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.JsonRpc.Testing OmniSharp.Extensions.JsonRpc.Testing diff --git a/src/JsonRpc/JsonRpc.csproj b/src/JsonRpc/JsonRpc.csproj index efa5b2beb..4cb657da7 100644 --- a/src/JsonRpc/JsonRpc.csproj +++ b/src/JsonRpc/JsonRpc.csproj @@ -1,6 +1,6 @@ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.JsonRpc OmniSharp.Extensions.JsonRpc diff --git a/src/Protocol.Proposals/Protocol.Proposals.csproj b/src/Protocol.Proposals/Protocol.Proposals.csproj index 2e61bfaed..d56f5894f 100644 --- a/src/Protocol.Proposals/Protocol.Proposals.csproj +++ b/src/Protocol.Proposals/Protocol.Proposals.csproj @@ -1,6 +1,6 @@ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.LanguageProtocol.Proposals OmniSharp.Extensions.LanguageServer.Protocol diff --git a/src/Protocol/Protocol.csproj b/src/Protocol/Protocol.csproj index df8c95b85..643f3c301 100644 --- a/src/Protocol/Protocol.csproj +++ b/src/Protocol/Protocol.csproj @@ -1,6 +1,6 @@ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.LanguageProtocol OmniSharp.Extensions.LanguageServer.Protocol diff --git a/src/Server/Server.csproj b/src/Server/Server.csproj index f4e4483d4..f48ab4a52 100644 --- a/src/Server/Server.csproj +++ b/src/Server/Server.csproj @@ -1,6 +1,6 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.LanguageServer OmniSharp.Extensions.LanguageServer.Server diff --git a/src/Shared/Shared.csproj b/src/Shared/Shared.csproj index b42aa76a1..c7d7d66ca 100644 --- a/src/Shared/Shared.csproj +++ b/src/Shared/Shared.csproj @@ -1,6 +1,6 @@ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.LanguageServer.Shared OmniSharp.Extensions.LanguageServer.Shared diff --git a/src/Testing/Testing.csproj b/src/Testing/Testing.csproj index 4ce49a710..d1964f10d 100644 --- a/src/Testing/Testing.csproj +++ b/src/Testing/Testing.csproj @@ -1,7 +1,7 @@ ο»Ώ - netstandard2.1;netstandard2.0;net6.0 + netstandard2.1;netstandard2.0;net6.0;net8.0 AnyCPU OmniSharp.Extensions.LanguageProtocol.Testing OmniSharp.Extensions.LanguageProtocol.Testing diff --git a/test/Client.Tests/Client.Tests.csproj b/test/Client.Tests/Client.Tests.csproj index 190ea9ba0..384c2bfaf 100644 --- a/test/Client.Tests/Client.Tests.csproj +++ b/test/Client.Tests/Client.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 OmniSharp.Extensions.LanguageClient.Tests OmniSharp.Extensions.LanguageServer.Client.Tests diff --git a/test/Dap.Tests/Dap.Tests.csproj b/test/Dap.Tests/Dap.Tests.csproj index 68e5f8284..b3f146430 100644 --- a/test/Dap.Tests/Dap.Tests.csproj +++ b/test/Dap.Tests/Dap.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0 + net8.0 true AnyCPU @@ -16,6 +16,6 @@ - + diff --git a/test/Generation.Tests/Generation.Tests.csproj b/test/Generation.Tests/Generation.Tests.csproj index 4af9af6e5..19309997c 100644 --- a/test/Generation.Tests/Generation.Tests.csproj +++ b/test/Generation.Tests/Generation.Tests.csproj @@ -1,6 +1,6 @@ - net6.0 + net8.0 true AnyCPU diff --git a/test/JsonRpc.Tests/JsonRpc.Tests.csproj b/test/JsonRpc.Tests/JsonRpc.Tests.csproj index 315c78b25..0aab74f9e 100644 --- a/test/JsonRpc.Tests/JsonRpc.Tests.csproj +++ b/test/JsonRpc.Tests/JsonRpc.Tests.csproj @@ -1,6 +1,6 @@ - net6.0 + net8.0 true AnyCPU diff --git a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj index f60a716fd..a1f40f08e 100644 --- a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj +++ b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0 + net8.0 true AnyCPU diff --git a/test/Lsp.Tests/Lsp.Tests.csproj b/test/Lsp.Tests/Lsp.Tests.csproj index 4d655de2e..105dbb540 100644 --- a/test/Lsp.Tests/Lsp.Tests.csproj +++ b/test/Lsp.Tests/Lsp.Tests.csproj @@ -1,6 +1,6 @@ ο»Ώ - net6.0 + net8.0 true AnyCPU diff --git a/test/TestingUtils/TestingUtils.csproj b/test/TestingUtils/TestingUtils.csproj index 3e420f82f..e8296c701 100644 --- a/test/TestingUtils/TestingUtils.csproj +++ b/test/TestingUtils/TestingUtils.csproj @@ -1,7 +1,7 @@ ο»Ώ - net6.0 + net8.0 false diff --git a/vscode-testextension/src/extension.ts b/vscode-testextension/src/extension.ts index 72d2e32ec..1459c2a20 100644 --- a/vscode-testextension/src/extension.ts +++ b/vscode-testextension/src/extension.ts @@ -38,13 +38,13 @@ export async function activate(context: ExtensionContext) { // run: { command: serverExe, args: ['-lsp', '-d'] }, run: { command: serverExe, - args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net6.0/win7-x64/SampleServer.dll"], + args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net8.0/win-x64/SampleServer.dll"], transport: TransportKind.pipe, }, // debug: { command: serverExe, args: ['-lsp', '-d'] } debug: { command: serverExe, - args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net6.0/win7-x64/SampleServer.dll"], + args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net8.0/win-x64/SampleServer.dll"], transport: TransportKind.pipe, runtime: "", }, From c7be7a7e16947e6a202c4085fdcf1775a428c7f3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:15:01 +0000 Subject: [PATCH 373/647] chore(deps): update dependency @vscode/test-electron to v2.3.10 --- vscode-testextension/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 5b5edf384..cb86b6a64 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -181,10 +181,11 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", - "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.10.tgz", + "integrity": "sha512-FxMqrvUm6a8S5tP4CymNJ40e6kD+wUTWTc6K32U629yrCCa+kl/rmpkC2gKpN4F4zjg1r+0Hnk9sl0+N2atsYA==", "dev": true, + "license": "MIT", "dependencies": { "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", From f5ebe9b1de564408ec044cd89bbac7a9625a4893 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:15:12 +0000 Subject: [PATCH 374/647] chore(deps): update dependency microsoft.reactive.testing to v6.0.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4e1f52680..613a952d7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -52,7 +52,7 @@ - + From cb502c1a681842a2776028bd1370fb243f3664bb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:15:07 +0000 Subject: [PATCH 375/647] chore(deps): update dependency bogus to v35.5.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 613a952d7..4f38f6fde 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 3516af1706abe263d753928f45ae1632f6cf85c5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:14:54 +0000 Subject: [PATCH 376/647] chore(deps): update dependency @types/node to v20.12.12 --- vscode-testextension/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index cb86b6a64..7a5b0f45f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,10 +166,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", - "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } From f12b77360a45e63cbd10aeeb19b761dc70b61778 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:14:31 +0000 Subject: [PATCH 377/647] chore(deps): update actions/checkout action to v4.1.6 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e96472f2e..809c3dc10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.4 + uses: actions/checkout@v4.1.6 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index e4cf695a0..7a5f2fec8 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.4 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 202efbd9c..46f2df2e9 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.4 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index efdb21079..0890f736d 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.4 + uses: actions/checkout@v4.1.6 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index be1db4ed0..74dd19d40 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.4 + uses: actions/checkout@v4.1.6 with: ref: ${{ github.sha }} fetch-depth: 0 From f75221e45faeba68c0145eed4ab38d82265e9f23 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:15:17 +0000 Subject: [PATCH 378/647] chore(deps): update dependency system.reactive to v6.0.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4f38f6fde..ce03fb73d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -49,7 +49,7 @@ - + From 6cb0ae8933b35e357af0abb7ffa37bcf1aab6599 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:15:29 +0000 Subject: [PATCH 379/647] chore(deps): update dependency microsoft.net.test.sdk to v17.10.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ce03fb73d..9ca191edd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From f1549aa5c99629415c5ae6c289824d514f776c16 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 22:15:23 +0000 Subject: [PATCH 380/647] chore(deps): update jetbrains to v2024.1.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4d15c0f0a..d095a243b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.1.1", + "version": "2024.1.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 9ca191edd..67f5ea512 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 128644506dae342d1678f17c52b227494012f984 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 00:02:48 +0000 Subject: [PATCH 381/647] chore(deps): update reportgenerator to v5.3.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index d095a243b..2e0449fac 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.2.5", + "version": "5.3.4", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 67f5ea512..197e69887 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 3148c391fd66111026cff8eb1cc8d4eca62a70eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 00:02:54 +0000 Subject: [PATCH 382/647] chore(deps): update xunit to v2.8.1 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 197e69887..655840a3f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From 6bf8ab92668a9a626be9bedb665d90f70dd10744 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 18:58:00 +0000 Subject: [PATCH 383/647] chore(deps): update dependency @vscode/test-electron to v2.4.0 --- vscode-testextension/package-lock.json | 401 +++++++++++++++++++++---- 1 file changed, 350 insertions(+), 51 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 7a5b0f45f..1b0b731ac 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -134,15 +134,6 @@ "node": ">=14" } }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", @@ -182,31 +173,33 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.10", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.10.tgz", - "integrity": "sha512-FxMqrvUm6a8S5tP4CymNJ40e6kD+wUTWTc6K32U629yrCCa+kl/rmpkC2gKpN4F4zjg1r+0Hnk9sl0+N2atsYA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.0.tgz", + "integrity": "sha512-yojuDFEjohx6Jb+x949JRNtSn6Wk2FAh4MldLE3ck9cfvCqzwxF32QsNy1T9Oe4oT+ZfFcg0uPUCajJzOmPlTA==", "dev": true, "license": "MIT", "dependencies": { - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.4", "jszip": "^3.10.1", - "semver": "^7.5.2" + "ora": "^7.0.1", + "semver": "^7.6.2" }, "engines": { "node": ">=16" } }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dev": true, + "license": "MIT", "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ansi-colors": { @@ -266,6 +259,27 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -275,6 +289,33 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -303,6 +344,31 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -376,6 +442,35 @@ "fsevents": "~2.3.2" } }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -661,32 +756,54 @@ } }, "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, + "license": "MIT", "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, + "license": "MIT", "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/immediate": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", @@ -751,6 +868,19 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -875,15 +1005,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=6" } }, "node_modules/minimatch": { @@ -1019,6 +1148,143 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.9.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.3.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "string-width": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", + "dev": true, + "license": "MIT" + }, + "node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1170,6 +1436,30 @@ "node": ">=0.10.0" } }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1224,12 +1514,10 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1304,6 +1592,22 @@ "source-map": "^0.6.0" } }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -1558,11 +1862,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", From 00d6e745a9299236a8544b487fccd87067d61adb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 18:57:50 +0000 Subject: [PATCH 384/647] chore(deps): update dependency @types/node to v20.12.13 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 7a5b0f45f..2cf616e82 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -166,9 +166,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", - "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "version": "20.12.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.13.tgz", + "integrity": "sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==", "dev": true, "license": "MIT", "dependencies": { From 53ca665727fd546eee7244393c6ad925cb0d74fb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 21:08:24 +0000 Subject: [PATCH 385/647] chore(deps): update dependency dotnet-sdk to v8.0.301 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 8d0a1c0ac..efa332c34 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.300", + "version": "8.0.301", "rollForward": "latestMinor" } } \ No newline at end of file From d6bdc8feab498b0ed05e1030196475f8c31d2b0f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 09:49:37 +0000 Subject: [PATCH 386/647] chore(deps): update reportgenerator to v5.3.5 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2e0449fac..aabf5b1e9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.4", + "version": "5.3.5", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 655840a3f..bb5dba29c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 3053d9f7e1b0cfa82eca71662606308e5decb9a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:05:17 +0000 Subject: [PATCH 387/647] chore(deps): update dependency prettier to v3.3.0 --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 400e69bce..2dd5eeb92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.5", - "prettier": "3.2.5" + "prettier": "3.3.0" } }, "node_modules/@prettier/plugin-xml": { @@ -555,10 +555,11 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz", + "integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index 6ada5c81d..a79aa0a87 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.5", - "prettier": "3.2.5" + "prettier": "3.3.0" }, "scripts": { "prepare": "husky install" From 1c6bba59fcbcde810df0b5f8ac1e5c443c33197a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:06:00 +0000 Subject: [PATCH 388/647] chore(deps): update reportgenerator to v5.3.6 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index aabf5b1e9..0b54cc931 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.5", + "version": "5.3.6", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index bb5dba29c..ea2df1acc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From a65e325e3817695b26184fe4bbbb1fa859ee4ee5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 07:52:34 +0000 Subject: [PATCH 389/647] chore(deps): update dependency @types/node to v20.14.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index c2990c56c..143f947ef 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -157,9 +157,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.13.tgz", - "integrity": "sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==", + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, "license": "MIT", "dependencies": { From fad68e399957fb0ef5d3854cd884d9c2e4366820 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:20:35 +0000 Subject: [PATCH 390/647] chore(deps): update dependency prettier to v3.3.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2dd5eeb92..971f951f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.5", - "prettier": "3.3.0" + "prettier": "3.3.1" } }, "node_modules/@prettier/plugin-xml": { @@ -555,9 +555,9 @@ } }, "node_modules/prettier": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz", - "integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index a79aa0a87..25e5ec218 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.5", - "prettier": "3.3.0" + "prettier": "3.3.1" }, "scripts": { "prepare": "husky install" From 2701d5ee8908dcc0ff891da456f2f22c220ec7e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 01:15:45 +0000 Subject: [PATCH 391/647] chore(deps): update dependency @types/vscode to v1.90.0 --- vscode-testextension/package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index c2990c56c..446a5787c 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -167,10 +167,11 @@ } }, "node_modules/@types/vscode": { - "version": "1.88.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.88.0.tgz", - "integrity": "sha512-rWY+Bs6j/f1lvr8jqZTyp5arRMfovdxolcqGi+//+cPDOh8SBvzXH90e7BiSXct5HJ9HGW6jATchbRTpTJpEkw==", - "dev": true + "version": "1.90.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.90.0.tgz", + "integrity": "sha512-oT+ZJL7qHS9Z8bs0+WKf/kQ27qWYR3trsXpq46YDjFqBsMLG4ygGGjPaJ2tyrH0wJzjOEmDyg9PDJBBhWg9pkQ==", + "dev": true, + "license": "MIT" }, "node_modules/@vscode/test-electron": { "version": "2.4.0", From 8ad4003b9e825276acf2164da1872131ba67bb9a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 22:00:17 +0000 Subject: [PATCH 392/647] chore(deps): update jetbrains to v2024.1.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 0b54cc931..2c3bb3fd1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.1.2", + "version": "2024.1.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index ea2df1acc..11b74211c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From fc994213727b4b9fe3b2f095857e484dd590f0c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:43:29 +0000 Subject: [PATCH 393/647] chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to v4.10.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 11b74211c..f58c74ab0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + From 7897315f48bafe21609ec1900c197b7ca8f7fcaa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 07:03:28 +0000 Subject: [PATCH 394/647] chore(deps): update dependency prettier to v3.3.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 971f951f9..d8512102b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.5", - "prettier": "3.3.1" + "prettier": "3.3.2" } }, "node_modules/@prettier/plugin-xml": { @@ -555,9 +555,9 @@ } }, "node_modules/prettier": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", - "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 25e5ec218..0ad1097c8 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.5", - "prettier": "3.3.1" + "prettier": "3.3.2" }, "scripts": { "prepare": "husky install" From bcf9108b5fd7688949d37e181cf62218b12d1eab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 07:04:22 +0000 Subject: [PATCH 395/647] Bump braces from 3.0.2 to 3.0.3 in /vscode-testextension Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- vscode-testextension/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index c2990c56c..d57ab5f41 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -327,12 +327,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -598,9 +598,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" From 335bf4aa1efc30bd9aa4af48a18b0391a0f89ad1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:45:22 +0000 Subject: [PATCH 396/647] chore(deps): update dependency lint-staged to v15.2.6 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8512102b..368ebc3e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.5", + "lint-staged": "15.2.6", "prettier": "3.3.2" } }, @@ -345,9 +345,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.5", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.5.tgz", - "integrity": "sha512-j+DfX7W9YUvdzEZl3Rk47FhDF6xwDBV5wwsCPw6BwWZVPYJemusQmvb9bRsW23Sqsaa+vRloAWogbK4BUuU2zA==", + "version": "15.2.6", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.6.tgz", + "integrity": "sha512-M/3PdijFXT/A5lnbSK3EQNLbIIrkE00JZaD39r7t4kfFOqT1Ly9LgSZSMMtvQ3p2/C8Nyj/ou0vkNHmEwqoB8g==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 0ad1097c8..cd053465b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.5", + "lint-staged": "15.2.6", "prettier": "3.3.2" }, "scripts": { From 782c61d11dea1127fd8d236d1519bd68c37a547b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:13:56 +0000 Subject: [PATCH 397/647] chore(deps): update dependency lint-staged to v15.2.7 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 368ebc3e5..62b3e5bfa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.6", + "lint-staged": "15.2.7", "prettier": "3.3.2" } }, @@ -345,9 +345,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.6", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.6.tgz", - "integrity": "sha512-M/3PdijFXT/A5lnbSK3EQNLbIIrkE00JZaD39r7t4kfFOqT1Ly9LgSZSMMtvQ3p2/C8Nyj/ou0vkNHmEwqoB8g==", + "version": "15.2.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.7.tgz", + "integrity": "sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index cd053465b..1e9c57e80 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.6", + "lint-staged": "15.2.7", "prettier": "3.3.2" }, "scripts": { From bd0519866718523756c30c0a172550381c389107 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:13:30 +0000 Subject: [PATCH 398/647] chore(deps): update actions/checkout action to v4.1.7 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 809c3dc10..63a79390c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 7a5f2fec8..af50b37eb 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 46f2df2e9..f2c77a004 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 0890f736d..59c56698b 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 74dd19d40..86cf7b921 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: ref: ${{ github.sha }} fetch-depth: 0 From 5f5e707d03bd2ec2238bdb18dd0c4f00d984f692 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 00:25:43 +0000 Subject: [PATCH 399/647] chore(deps): update dependency nerdbank.streams to v2.11.74 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f58c74ab0..56d6ad7d4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + From 6b658186ec20a704dc0a6961885fba9e5d079b2f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:42:08 +0000 Subject: [PATCH 400/647] chore(deps): update dependency serilog.sinks.debug to v3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f58c74ab0..bcd2e06df 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,7 +12,7 @@ - + From f5c073186989d71f40b65157ee6522a4592efd17 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 07:12:41 +0000 Subject: [PATCH 401/647] chore(deps): update dependency @types/node to v20.14.5 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 73f2b8084..3769dfe82 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -157,9 +157,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", - "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "version": "20.14.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.5.tgz", + "integrity": "sha512-aoRR+fJkZT2l0aGOJhuA8frnCSoNX6W7U2mpNq63+BxBIj5BQFt8rHy627kijCmm63ijdSdwvGgpUsU6MBsZZA==", "dev": true, "license": "MIT", "dependencies": { From d991a1b15960a5955fcff16bb98c435d18bb1793 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:53:53 +0000 Subject: [PATCH 402/647] chore(deps): update dependency @types/node to v20.14.7 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3769dfe82..0aafacdd7 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -157,9 +157,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.5.tgz", - "integrity": "sha512-aoRR+fJkZT2l0aGOJhuA8frnCSoNX6W7U2mpNq63+BxBIj5BQFt8rHy627kijCmm63ijdSdwvGgpUsU6MBsZZA==", + "version": "20.14.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.7.tgz", + "integrity": "sha512-uTr2m2IbJJucF3KUxgnGOZvYbN0QgkGyWxG6973HCpMYFy2KfcgYuIwkJQMQkt1VbBMlvWRbpshFTLxnxCZjKQ==", "dev": true, "license": "MIT", "dependencies": { From 7a8c0c83c8cfa3d020afb831c897f6b17a89c37c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 02:22:03 +0000 Subject: [PATCH 403/647] chore(deps): update dependency dotnet-sdk to v8.0.302 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index efa332c34..47f27c3bd 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.301", + "version": "8.0.302", "rollForward": "latestMinor" } } \ No newline at end of file From 61c81f3a2fc77d3fae3f90f4ba5d1e4db46c859d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Jun 2024 10:40:00 +0000 Subject: [PATCH 404/647] chore(deps): update dependency @types/node to v20.14.8 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 0aafacdd7..d34f29031 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -157,9 +157,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.7.tgz", - "integrity": "sha512-uTr2m2IbJJucF3KUxgnGOZvYbN0QgkGyWxG6973HCpMYFy2KfcgYuIwkJQMQkt1VbBMlvWRbpshFTLxnxCZjKQ==", + "version": "20.14.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", + "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", "dev": true, "license": "MIT", "dependencies": { From f46a6979dac42fe64cfa8579d4103eac5bfe6678 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:03:03 +0000 Subject: [PATCH 405/647] chore(deps): update dependency @types/mocha to v10.0.7 --- vscode-testextension/package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index d34f29031..55245f945 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -151,10 +151,11 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", - "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", - "dev": true + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", + "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==", + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "20.14.8", From 4c562b5a01be5f1d78f36f394e6e7e61be798884 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:05:54 +0000 Subject: [PATCH 406/647] chore(deps): update dependency verify.xunit to v25 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f58c74ab0..f69c8eb38 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 60f36c1fd0408fa547908414d77f3b0d4c3e4eba Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:07:51 +0200 Subject: [PATCH 407/647] Remove obsolete UsesVerify test class attributes --- test/Generation.Tests/AutoImplementParamsGeneratorTests.cs | 1 - test/Generation.Tests/EnumLikeStringGeneratorTests.cs | 1 - test/Generation.Tests/GeneratedRegistrationOptionsTests.cs | 1 - test/Generation.Tests/JsonRpcGenerationTests.cs | 1 - test/Generation.Tests/LspFeatureTests.cs | 1 - test/Generation.Tests/TypedCanBeResolvedTests.cs | 1 - 6 files changed, 6 deletions(-) diff --git a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs index 03653d58b..b4a5dfd5e 100644 --- a/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs +++ b/test/Generation.Tests/AutoImplementParamsGeneratorTests.cs @@ -4,7 +4,6 @@ namespace Generation.Tests { - [UsesVerify] public class AutoImplementParamsGeneratorTests { [Fact] diff --git a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs index 1bad0d8cd..c092ee8d9 100644 --- a/test/Generation.Tests/EnumLikeStringGeneratorTests.cs +++ b/test/Generation.Tests/EnumLikeStringGeneratorTests.cs @@ -4,7 +4,6 @@ namespace Generation.Tests { - [UsesVerify] public class EnumLikeStringGeneratorTests { [Fact] diff --git a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs index 2a4e132f8..f86652347 100644 --- a/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs +++ b/test/Generation.Tests/GeneratedRegistrationOptionsTests.cs @@ -4,7 +4,6 @@ namespace Generation.Tests { - [UsesVerify] public class GeneratedRegistrationOptionsTests { [Fact] diff --git a/test/Generation.Tests/JsonRpcGenerationTests.cs b/test/Generation.Tests/JsonRpcGenerationTests.cs index 614fd3cdf..4333085db 100644 --- a/test/Generation.Tests/JsonRpcGenerationTests.cs +++ b/test/Generation.Tests/JsonRpcGenerationTests.cs @@ -7,7 +7,6 @@ namespace Generation.Tests { - [UsesVerify] public class JsonRpcGenerationTests { [Fact] diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 00b584610..7dd0834d9 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -4,7 +4,6 @@ namespace Generation.Tests { - [UsesVerify] public class LspFeatureTests { // [Fact(Skip = "for testing"] diff --git a/test/Generation.Tests/TypedCanBeResolvedTests.cs b/test/Generation.Tests/TypedCanBeResolvedTests.cs index 2d0f91e00..c5af9ea5a 100644 --- a/test/Generation.Tests/TypedCanBeResolvedTests.cs +++ b/test/Generation.Tests/TypedCanBeResolvedTests.cs @@ -4,7 +4,6 @@ namespace Generation.Tests { - [UsesVerify] public class TypedCanBeResolvedTests { [Fact] From 436b6a139d0a3394ec232d1756b04458eb0a10ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:33:46 +0000 Subject: [PATCH 408/647] chore(deps): update jetbrains to v2024.1.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2c3bb3fd1..1a09a1810 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.1.3", + "version": "2024.1.4", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index f58c74ab0..9dba8fdbd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 530a71879e4fb962078a8712f7f682e946f3cfc3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 23:00:27 +0000 Subject: [PATCH 409/647] chore(deps): update dependency @types/node to v20.14.9 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 55245f945..9debf8a85 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", - "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dev": true, "license": "MIT", "dependencies": { From b28660ac2f61f34b7da7c139dd2392832456a951 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 01:32:07 +0000 Subject: [PATCH 410/647] chore(deps): update dependency mocha to v10.5.2 --- vscode-testextension/package-lock.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 9debf8a85..da6197776 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1045,14 +1045,15 @@ } }, "node_modules/mocha": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", - "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", + "version": "10.5.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.5.2.tgz", + "integrity": "sha512-9btlN3JKCefPf+vKd/kcKz2SXxi12z6JswkGfaAF0saQvnsqLJk504ZmbxhSoENge08E9dsymozKgFMTl5PQsA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.3", + "chokidar": "^3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", @@ -1084,6 +1085,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1092,7 +1094,9 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1112,6 +1116,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1123,7 +1128,8 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ms": { "version": "2.1.2", From a9688416c957caf26645621712333614901bb68f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 05:53:49 +0000 Subject: [PATCH 411/647] chore(deps): update dependency verify.xunit to v25.0.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 771178f53..2f338695d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 028bb5faf6a0f1c8bc9d007a7076aae5f96be5cf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:36:16 +0000 Subject: [PATCH 412/647] chore(deps): update dependency serilog.sinks.file to v6 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b68b20444..97fb8f7d7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -11,7 +11,7 @@ - + From e6774ef039ba323ef811cfdcfd535f7b03d99fba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:52:52 +0000 Subject: [PATCH 413/647] chore(deps): update reportgenerator to v5.3.7 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1a09a1810..9dde6f83a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.6", + "version": "5.3.7", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 97fb8f7d7..406515e21 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 0f10d8ba554e150cded5a96808102c7d5fc325d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 00:08:08 +0000 Subject: [PATCH 414/647] chore(deps): update dependency serilog.sinks.observable to v3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 406515e21..b83a59633 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -44,7 +44,7 @@ - + From 950a665f784abc80165795b0af617b134f000f58 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:41:12 +0000 Subject: [PATCH 415/647] chore(deps): update dependency verify.xunit to v25.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 406515e21..35ab9f8f7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 990f493acfa42a9dc73cab4fe906ac0db2597df9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:16:39 +0000 Subject: [PATCH 416/647] chore(deps): update actions/setup-dotnet action to v4.0.1 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63a79390c..e67e51177 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,15 +91,15 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '6.0.x' - name: πŸ”¨ Use .NET Core 8.0 SDK - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '8.0.x' - name: 🎁 dotnet tool restore From 46ca32b8b48e6e9e98f2889e209cfd2d3e8197dd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:39:16 +0000 Subject: [PATCH 417/647] chore(deps): update dependency @vscode/test-electron to v2.4.1 --- vscode-testextension/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 5d5d3b225..9b455c6c1 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -175,14 +175,14 @@ "license": "MIT" }, "node_modules/@vscode/test-electron": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.0.tgz", - "integrity": "sha512-yojuDFEjohx6Jb+x949JRNtSn6Wk2FAh4MldLE3ck9cfvCqzwxF32QsNy1T9Oe4oT+ZfFcg0uPUCajJzOmPlTA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.1.tgz", + "integrity": "sha512-Gc6EdaLANdktQ1t+zozoBVRynfIsMKMc94Svu1QreOBC8y76x4tvaK32TljrLi1LI2+PK58sDVbL7ALdqf3VRQ==", "dev": true, "license": "MIT", "dependencies": { "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.4", + "https-proxy-agent": "^7.0.5", "jszip": "^3.10.1", "ora": "^7.0.1", "semver": "^7.6.2" @@ -772,9 +772,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, "license": "MIT", "dependencies": { From 8a7681eb56ec56246a4763c973830d4d0ae07c64 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:39:39 +0000 Subject: [PATCH 418/647] chore(deps): update xunit --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 35ab9f8f7..c21d73d8d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From e23c3aa5e1dba484f5a2ad8559f04cb3f6a28593 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:39:21 +0000 Subject: [PATCH 419/647] chore(deps): update dependency microsoft.extensions.configuration.binder to v8.0.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c21d73d8d..b59c62dd8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -31,7 +31,7 @@ - + From 59c3c077911329b86bfea75b644648c90db1f416 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 01:57:36 +0000 Subject: [PATCH 420/647] chore(deps): update dependency dotnet-sdk to v8.0.303 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 47f27c3bd..65feccf51 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.302", + "version": "8.0.303", "rollForward": "latestMinor" } } \ No newline at end of file From 74aad399a0649e73078aafcbe963ef046d4cb9a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 03:56:29 +0000 Subject: [PATCH 421/647] chore(deps): update gittools/actions action to v1.2.0 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index af50b37eb..85828fb40 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.1.1 + uses: gittools/actions/gitversion/setup@v1.2.0 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v1.1.1 + uses: gittools/actions/gitreleasemanager/setup@v1.2.0 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.1.1 + uses: gittools/actions/gitversion/execute@v1.2.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index f2c77a004..f587e1b2e 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.1.1 + uses: gittools/actions/gitversion/setup@v1.2.0 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.1.1 + uses: gittools/actions/gitversion/execute@v1.2.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 86cf7b921..2ca0d2651 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v1.1.1 + uses: gittools/actions/gitversion/setup@v1.2.0 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v1.1.1 + uses: gittools/actions/gitreleasemanager/setup@v1.2.0 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v1.1.1 + uses: gittools/actions/gitversion/execute@v1.2.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From a72cf85c2477dc2a24b65f9b5cbfec3df02d3220 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 12:47:57 +0000 Subject: [PATCH 422/647] chore(deps): update dependency prettier to v3.3.3 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 62b3e5bfa..165552670 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.7", - "prettier": "3.3.2" + "prettier": "3.3.3" } }, "node_modules/@prettier/plugin-xml": { @@ -555,9 +555,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 1e9c57e80..1ee4655ca 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", "lint-staged": "15.2.7", - "prettier": "3.3.2" + "prettier": "3.3.3" }, "scripts": { "prepare": "husky install" From dc939c3bcfb9d05e97b8beb5af906a0611d87439 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:29:28 +0000 Subject: [PATCH 423/647] chore(deps): update dependency @types/node to v20.14.10 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 9b455c6c1..bda4d1027 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", - "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "dev": true, "license": "MIT", "dependencies": { From 154760adb4cf49b71dcbb909a9d293dddc36f348 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:29:33 +0000 Subject: [PATCH 424/647] chore(deps): update dependency verify.xunit to v25.3.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b59c62dd8..d81e1472b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 5ef3b90b0046638a5d0f3a57dab85a8c5f4bc108 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 23:04:02 +0000 Subject: [PATCH 425/647] chore(deps): update reportgenerator to v5.3.8 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9dde6f83a..70c7c9d0c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.7", + "version": "5.3.8", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index d81e1472b..ce30c4cf2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From a7acc6b92882a8344c7a81ced0ae6a1c1aebfcf2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:14:13 +0000 Subject: [PATCH 426/647] chore(deps): update dependency @types/node to v20.14.11 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index bda4d1027..c7e731efe 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", - "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "version": "20.14.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", + "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", "dev": true, "license": "MIT", "dependencies": { From 2e5b326ce3e3f86379d627aa45965eb85f4be617 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:00:54 +0000 Subject: [PATCH 427/647] chore(deps): update dependency bogus to v35.6.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ce30c4cf2..8d54a7362 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 7d1a67fdaef8b825209bf3ed6c5968f7d0f20627 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:42:32 +0000 Subject: [PATCH 428/647] chore(deps): update gittools/actions action to v2 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 85828fb40..d8d98de28 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.2.0 + uses: gittools/actions/gitversion/setup@v2.0.0 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v1.2.0 + uses: gittools/actions/gitreleasemanager/setup@v2.0.0 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.2.0 + uses: gittools/actions/gitversion/execute@v2.0.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index f587e1b2e..0cfeeafcb 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.2.0 + uses: gittools/actions/gitversion/setup@v2.0.0 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.2.0 + uses: gittools/actions/gitversion/execute@v2.0.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 2ca0d2651..4d0b18011 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v1.2.0 + uses: gittools/actions/gitversion/setup@v2.0.0 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v1.2.0 + uses: gittools/actions/gitreleasemanager/setup@v2.0.0 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v1.2.0 + uses: gittools/actions/gitversion/execute@v2.0.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 33d76f5b289b0854a84839b1a8cf52efbc7ccf8b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:23:43 +0000 Subject: [PATCH 429/647] chore(deps): update dependency verify.xunit to v26 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8d54a7362..da4b5879f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 0659d7ad0e10b81d1f278adb8b8c70e058063489 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:23:55 +0000 Subject: [PATCH 430/647] chore(deps): update gitversion to v6 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 70c7c9d0c..022f63735 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "5.12.0", + "version": "6.0.0", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index da4b5879f..9e43fc385 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 49fb42d891881b86d972774a91197f4eccb3944d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:18:35 +0000 Subject: [PATCH 431/647] chore(deps): update dependency verify.xunit to v26.0.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9e43fc385..460fba66d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 307dd824a9c422049ccf3414b7485b0eaffdeb7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:34:04 +0000 Subject: [PATCH 432/647] chore(deps): update gittools/actions action to v3 --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index d8d98de28..55e1bfd4a 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v2.0.0 + uses: gittools/actions/gitversion/setup@v3.0.0 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v2.0.0 + uses: gittools/actions/gitreleasemanager/setup@v3.0.0 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v2.0.0 + uses: gittools/actions/gitversion/execute@v3.0.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 0cfeeafcb..236a5a978 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v2.0.0 + uses: gittools/actions/gitversion/setup@v3.0.0 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v2.0.0 + uses: gittools/actions/gitversion/execute@v3.0.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 4d0b18011..f03a1e559 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v2.0.0 + uses: gittools/actions/gitversion/setup@v3.0.0 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v2.0.0 + uses: gittools/actions/gitreleasemanager/setup@v3.0.0 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v2.0.0 + uses: gittools/actions/gitversion/execute@v3.0.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 3750091bb78c60c863ffa9e8892acfc057323cfc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 18:45:00 +0000 Subject: [PATCH 433/647] chore(deps): update dependency @types/node to v20.14.12 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index c7e731efe..6feeb5c16 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", - "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "version": "20.14.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", + "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", "dev": true, "license": "MIT", "dependencies": { From 99416e5b9aa19f1c07aa28ffac3c53269cf4fea5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:23:36 +0000 Subject: [PATCH 434/647] chore(deps): update dependency verify.xunit to v26.1.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 460fba66d..c3e982329 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 2cca8f1642fd22c18f0ba5c6fafef07e9c9c9e03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jul 2024 06:53:37 +0000 Subject: [PATCH 435/647] chore(deps): update dependency verify.sourcegenerators to v2.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c3e982329..73a21427f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -41,7 +41,7 @@ - + From 11bdcc44a150b70e909fc83f6007c560235d89e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jul 2024 10:54:57 +0000 Subject: [PATCH 436/647] chore(deps): update dependency @types/node to v20.14.13 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 6feeb5c16..a0bd5871f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", - "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", + "version": "20.14.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.13.tgz", + "integrity": "sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==", "dev": true, "license": "MIT", "dependencies": { From a70af363921c076a65fb12030976a93435d42e34 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jul 2024 10:55:04 +0000 Subject: [PATCH 437/647] chore(deps): update dependency verify.xunit to v26.1.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 73a21427f..af248128d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 2980d4d6c9496037c3c5ce4702b59284efce6c4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jul 2024 12:37:25 +0000 Subject: [PATCH 438/647] chore(deps): update dependency xunitxml.testlogger to v4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index af248128d..9186253a5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -46,7 +46,7 @@ - + From 6d11533406123913597854b2fb7cc812a464f1be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:23:31 +0000 Subject: [PATCH 439/647] chore(deps): update dependency verify.xunit to v26.1.5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index af248128d..176fbca09 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From c5bd8739e01d1e34464c3a232eab709f8cc31db6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:50:34 +0000 Subject: [PATCH 440/647] chore(deps): update dependency @types/node to v20.14.14 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index a0bd5871f..37975a9a5 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.13.tgz", - "integrity": "sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==", + "version": "20.14.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.14.tgz", + "integrity": "sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==", "dev": true, "license": "MIT", "dependencies": { From 15d4c606fc90b0db5c66ef2ae81847640c12e523 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 10:24:10 +0000 Subject: [PATCH 441/647] chore(deps): update dependency lint-staged to v15.2.8 --- package-lock.json | 187 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 99 insertions(+), 90 deletions(-) diff --git a/package-lock.json b/package-lock.json index 165552670..fad6e4d49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.7", + "lint-staged": "15.2.8", "prettier": "3.3.3" } }, @@ -33,15 +33,16 @@ } }, "node_modules/ansi-escapes": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", - "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", "dev": true, + "license": "MIT", "dependencies": { - "type-fest": "^3.0.0" + "environment": "^1.0.0" }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -106,15 +107,16 @@ } }, "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", "dev": true, + "license": "MIT", "dependencies": { - "restore-cursor": "^4.0.0" + "restore-cursor": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -167,10 +169,11 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -189,6 +192,19 @@ "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", @@ -218,18 +234,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/execa/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -332,9 +336,9 @@ "dev": true }, "node_modules/lilconfig": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", - "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", "dev": true, "license": "MIT", "engines": { @@ -345,22 +349,22 @@ } }, "node_modules/lint-staged": { - "version": "15.2.7", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.7.tgz", - "integrity": "sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==", + "version": "15.2.8", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.8.tgz", + "integrity": "sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==", "dev": true, "license": "MIT", "dependencies": { "chalk": "~5.3.0", "commander": "~12.1.0", - "debug": "~4.3.4", + "debug": "~4.3.6", "execa": "~8.0.1", - "lilconfig": "~3.1.1", - "listr2": "~8.2.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", "micromatch": "~4.0.7", "pidtree": "~0.6.0", "string-argv": "~0.3.2", - "yaml": "~2.4.2" + "yaml": "~2.5.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -373,17 +377,17 @@ } }, "node_modules/listr2": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.1.tgz", - "integrity": "sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==", + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.4.tgz", + "integrity": "sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==", "dev": true, "license": "MIT", "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", - "log-update": "^6.0.0", - "rfdc": "^1.3.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", "wrap-ansi": "^9.0.0" }, "engines": { @@ -391,14 +395,15 @@ } }, "node_modules/log-update": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", - "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-escapes": "^6.2.0", - "cli-cursor": "^4.0.0", - "slice-ansi": "^7.0.0", + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", "strip-ansi": "^7.1.0", "wrap-ansi": "^9.0.0" }, @@ -414,6 +419,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", "dev": true, + "license": "MIT", "dependencies": { "get-east-asian-width": "^1.0.0" }, @@ -429,6 +435,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" @@ -472,6 +479,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -577,49 +597,42 @@ "dev": true }, "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", "dev": true, + "license": "MIT", "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/restore-cursor/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", "dev": true, + "license": "MIT", "dependencies": { - "mimic-fn": "^2.1.0" + "mimic-function": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true, "license": "MIT" }, @@ -645,10 +658,17 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/slice-ansi": { "version": "5.0.0", @@ -732,18 +752,6 @@ "node": ">=8.0" } }, - "node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -764,6 +772,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", @@ -777,9 +786,9 @@ } }, "node_modules/yaml": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", - "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 1ee4655ca..ec9370263 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.7", + "lint-staged": "15.2.8", "prettier": "3.3.3" }, "scripts": { From e1be521b7707091a1ab85bc98916989f1ea7d85c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 07:35:23 +0000 Subject: [PATCH 442/647] chore(deps): update dependency glob to v10.4.5 --- vscode-testextension/package-lock.json | 60 +++++++++++++++----------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 37975a9a5..828c00b6c 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -682,23 +682,22 @@ } }, "node_modules/glob": { - "version": "10.3.12", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", - "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.10.2" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -720,15 +719,17 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/glob/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -926,16 +927,14 @@ "dev": true }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -1037,10 +1036,11 @@ } }, "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } @@ -1323,6 +1323,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -1357,16 +1364,17 @@ } }, "node_modules/path-scurry": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", - "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" From 371dbb70630969657cf9b6511954e9aa0613ccfe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:23:59 +0000 Subject: [PATCH 443/647] chore(deps): update dependency glob to v11 --- vscode-testextension/package-lock.json | 65 ++++++++++++++------------ vscode-testextension/package.json | 2 +- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 828c00b6c..99d6a6c89 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -18,7 +18,7 @@ "@types/node": "^20.8.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", - "glob": "^10.3.10", + "glob": "^11.0.0", "mocha": "^10.2.0", "source-map-support": "^0.5.21", "tmp-promise": "^3.0.3", @@ -682,22 +682,25 @@ } }, "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, + "engines": { + "node": "20 || >=22" + }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -725,16 +728,16 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -927,14 +930,17 @@ "dev": true }, "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, + "engines": { + "node": "20 || >=22" + }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -1006,6 +1012,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lru-cache": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", + "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -1364,31 +1380,22 @@ } }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 4f17df07a..812027f0f 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -52,7 +52,7 @@ "@types/node": "^20.8.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", - "glob": "^10.3.10", + "glob": "^11.0.0", "mocha": "^10.2.0", "source-map-support": "^0.5.21", "tmp-promise": "^3.0.3", From 5521f60ae9e21a4104fed943916322af65ce9e22 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:23:27 +0000 Subject: [PATCH 444/647] chore(deps): update dependency verify.xunit to v26.1.6 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 176fbca09..d5b0d3685 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From fa9557b504f21d06d2567c3c1e7e8fe3638f8195 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:23:33 +0000 Subject: [PATCH 445/647] chore(deps): update gitversion to v6.0.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 022f63735..50803771c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "6.0.0", + "version": "6.0.1", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index d5b0d3685..d1e636d6f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From b8e1d84f862e2c5e6ce5758268387d0da73ec0ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:14:02 +0000 Subject: [PATCH 446/647] chore(deps): update jetbrains to v2024.1.5 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 50803771c..4bb6edf4f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.1.4", + "version": "2024.1.5", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index d1e636d6f..ac438798f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From a710ff3f6a0be9927219eccccf5367d9bb81e728 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 20:39:22 +0000 Subject: [PATCH 447/647] chore(deps): update dependency @types/node to v20.14.15 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 828c00b6c..ba35770c2 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.14.tgz", - "integrity": "sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==", + "version": "20.14.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.15.tgz", + "integrity": "sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==", "dev": true, "license": "MIT", "dependencies": { From ac2389e1eb966bafad4d4c025187aee352a541a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 10:25:31 +0000 Subject: [PATCH 448/647] chore(deps): update dependency verify.xunit to v26.2.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ac438798f..0afef4cae 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 0580619aedb661772e5237adbf6390c881574ae4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:54:54 +0000 Subject: [PATCH 449/647] chore(deps): update gitversion to v6.0.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4bb6edf4f..4376cc564 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "6.0.1", + "version": "6.0.2", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 0afef4cae..97fb3be63 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From c813a49c53ad5520c3cd516ec52cf76df1396d44 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 07:41:05 +0000 Subject: [PATCH 450/647] chore(deps): update dependency lint-staged to v15.2.9 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fad6e4d49..391ccc380 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.8", + "lint-staged": "15.2.9", "prettier": "3.3.3" } }, @@ -349,9 +349,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.8", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.8.tgz", - "integrity": "sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==", + "version": "15.2.9", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.9.tgz", + "integrity": "sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index ec9370263..1b7f02a39 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.8", + "lint-staged": "15.2.9", "prettier": "3.3.3" }, "scripts": { From 135bf49a4941fc2e8f1ae1d006a03b227cce47fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 06:24:17 +0000 Subject: [PATCH 451/647] chore(deps): update dependency dotnet-sdk to v8.0.401 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 65feccf51..04c1f50d7 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.303", + "version": "8.0.401", "rollForward": "latestMinor" } } \ No newline at end of file From 9f55d5d3c040eb977348f713ab001adda9e2c073 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:01:14 +0000 Subject: [PATCH 452/647] chore(deps): update jetbrains to v2024.2.0 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4376cc564..125aae982 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.1.5", + "version": "2024.2.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 97fb3be63..71f313bf9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 4d2ebd987333254dcdd21464e94c274802a64cb6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:26:51 +0000 Subject: [PATCH 453/647] chore(deps): update dependency microsoft.net.test.sdk to v17.11.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 71f313bf9..de995419f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From c9ffc9442b46ea26642c571052272c6fe13a71eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:26:43 +0000 Subject: [PATCH 454/647] chore(deps): update jetbrains to v2024.2.1 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 125aae982..781195304 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.0", + "version": "2024.2.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index de995419f..238ce84ef 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From a218449459899e69f66b4ac7048ba4c6556b295f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:20:33 +0000 Subject: [PATCH 455/647] chore(deps): update jetbrains to v2024.2.2 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 781195304..7b680cc85 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.1", + "version": "2024.2.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 238ce84ef..db55df8b2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 83dc8b258fcfaa3a98393cb8ceace38d9e523f28 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:31:16 +0000 Subject: [PATCH 456/647] chore(deps): update dependency nerdbank.streams to v2.11.79 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index db55df8b2..d4744f44b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + From ff5276c8f8b8f75a7fd6f17f161b2081f12a4a13 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 11:36:41 +0000 Subject: [PATCH 457/647] chore(deps): update dependency verify.sourcegenerators to v2.4.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d4744f44b..0a7f851f5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -41,7 +41,7 @@ - + From 71e02046f8b9de1691ee06cd370316a352ea492d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 06:59:13 +0000 Subject: [PATCH 458/647] chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to 4.11.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0a7f851f5..e11b5ca26 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + From 94639b09cf7e7e520d567ad236f1e6e37f75a49e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:52:01 +0000 Subject: [PATCH 459/647] chore(deps): update dependency verify.xunit to 26.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0a7f851f5..10c442ae0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 6c83b65f892ef67df800c1dc4dc22b59d0cbc095 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:56:15 +0000 Subject: [PATCH 460/647] chore(deps): update jetbrains to 2024.2.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7b680cc85..431f791ff 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.2", + "version": "2024.2.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 10c442ae0..fc9576def 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 790ac595c4c5763e576a0015a3e416e656ad01e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:10:16 +0000 Subject: [PATCH 461/647] chore(deps): update dependency lint-staged to v15.2.10 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 391ccc380..6c018e1c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.9", + "lint-staged": "15.2.10", "prettier": "3.3.3" } }, @@ -349,9 +349,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.9", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.9.tgz", - "integrity": "sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==", + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.10.tgz", + "integrity": "sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==", "dev": true, "license": "MIT", "dependencies": { @@ -361,7 +361,7 @@ "execa": "~8.0.1", "lilconfig": "~3.1.2", "listr2": "~8.2.4", - "micromatch": "~4.0.7", + "micromatch": "~4.0.8", "pidtree": "~0.6.0", "string-argv": "~0.3.2", "yaml": "~2.5.0" @@ -454,9 +454,9 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 1b7f02a39..a94877cbb 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.0.11", - "lint-staged": "15.2.9", + "lint-staged": "15.2.10", "prettier": "3.3.3" }, "scripts": { From 30374639f641078c404fdcc22116c0e4ad9907ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 04:58:40 +0000 Subject: [PATCH 462/647] chore(deps): update dependency verify.xunit to 26.3.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index fc9576def..394513b6c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 57ce350d66978f7343edce2f5f8e49c9e49d576c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:52:43 +0000 Subject: [PATCH 463/647] chore(deps): update dependency bogus to 35.6.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 394513b6c..869e7890b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 1b4e95d6bee92297756eddf4af6da967703d1763 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 23:12:17 +0000 Subject: [PATCH 464/647] chore(deps): update dependency @types/node to v20.16.5 --- vscode-testextension/package-lock.json | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index ba35770c2..294f28a4f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,13 +158,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.15.tgz", - "integrity": "sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==", + "version": "20.16.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", + "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/vscode": { @@ -1761,10 +1761,11 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" }, "node_modules/util-deprecate": { "version": "1.0.2", From 64ddecfdb29801df5e44b998f146300b698e7f5b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:31:33 +0000 Subject: [PATCH 465/647] chore(deps): update dependency microsoft.net.test.sdk to 17.11.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 869e7890b..2ea2efec6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From a0373a527ba015f0c6f8f4b2665caac98a8726e4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:08:40 +0000 Subject: [PATCH 466/647] chore(deps): update dependency verify.xunit to 26.4.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2ea2efec6..819b377ae 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From ef5b8b28105230cdf34cee62c448b344e2d7839c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:08:32 +0000 Subject: [PATCH 467/647] chore(deps): update reportgenerator to 5.3.9 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 431f791ff..ef671ab0e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.8", + "version": "5.3.9", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 819b377ae..c719f5eba 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 5f60479d3afc9a34b57c262ac721bc30336410f8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 03:32:16 +0000 Subject: [PATCH 468/647] chore(deps): update dependency verify.xunit to 26.4.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c719f5eba..92339a247 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 9452001ff85a9113d4999a083ce7b62c69ca9f27 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:47:12 +0000 Subject: [PATCH 469/647] chore(deps): update dependency fluentassertions to 6.12.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 92339a247..43ba10dc3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 39a4780a05c29854227e3f9c1a07c7bea4fd1ad2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:18:57 +0000 Subject: [PATCH 470/647] chore(deps): update dependency verify.xunit to 26.4.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 43ba10dc3..9e00e80c3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 3352cfdb7e4b0462bd96e34c6c4dc0eb2f896543 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:19:02 +0000 Subject: [PATCH 471/647] chore(deps): update jetbrains to 2024.2.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ef671ab0e..68ef64e5e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.3", + "version": "2024.2.4", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 9e00e80c3..3c50840d8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From d37f84f21f9166eb7f40bd8923cec3304cf3ffc1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 01:40:27 +0000 Subject: [PATCH 472/647] chore(deps): update dependency nuke.globaltool to 8.1.0 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 68ef64e5e..e6b61b12f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "8.0.0", + "version": "8.1.0", "commands": [ "nuke" ] From ad1661002e080665894e4caba9c9dc90995edf9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 03:12:51 +0000 Subject: [PATCH 473/647] chore(deps): update dependency verify.xunit to 26.4.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3c50840d8..aaa5c51de 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From ad60e5e693f7d9514d1802e292d157e37e086419 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:51:41 +0000 Subject: [PATCH 474/647] chore(deps): update verify --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index aaa5c51de..143a89b12 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,8 +40,8 @@ - - + + From 52f448b621347b903d3e645301b26e637871b465 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:22:35 +0000 Subject: [PATCH 475/647] chore(deps): update dependency husky to v9.1.6 --- package-lock.json | 11 ++++++----- package.json | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c018e1c9..0702419ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "devDependencies": { "@prettier/plugin-xml": "3.4.1", - "husky": "9.0.11", + "husky": "9.1.6", "lint-staged": "15.2.10", "prettier": "3.3.3" } @@ -281,12 +281,13 @@ } }, "node_modules/husky": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", - "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", + "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", "dev": true, + "license": "MIT", "bin": { - "husky": "bin.mjs" + "husky": "bin.js" }, "engines": { "node": ">=18" diff --git a/package.json b/package.json index a94877cbb..1ff2067a8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "devDependencies": { "@prettier/plugin-xml": "3.4.1", - "husky": "9.0.11", + "husky": "9.1.6", "lint-staged": "15.2.10", "prettier": "3.3.3" }, From 2a6b50dcc793f92a27e0af908c8a55e87b0e0b8f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 02:39:15 +0000 Subject: [PATCH 476/647] chore(deps): update dependency verify.sourcegenerators to 2.4.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c03bfe958..5dff729ae 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -41,7 +41,7 @@ - + From 72b2dd75da2c17fec089321346120e74cf199b1f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:39:29 +0000 Subject: [PATCH 477/647] chore(deps): update dependency verify.xunit to 26.4.5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5dff729ae..20ea51219 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 2359f0104ff079f51c71a7eb7ac634fb525bcb35 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:03:07 +0000 Subject: [PATCH 478/647] chore(deps): update dependency verify.xunit to 26.5.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 20ea51219..a670e10f0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 4c32070f9f1fb62ca2bb23390b3c35ef0afcc355 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:54:47 +0000 Subject: [PATCH 479/647] chore(deps): update jetbrains to 2024.2.5 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e6b61b12f..e651cf391 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.4", + "version": "2024.2.5", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index a670e10f0..2730e46f9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 18b643ad9c80c235f8eb000ab264a08dad20bb4e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:03:43 +0000 Subject: [PATCH 480/647] chore(deps): update dependency xunit to 2.9.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2730e46f9..ab35d2423 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From 58f1b674a69b8dfa0d92746c84466f3f0e822e01 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 21:53:33 +0000 Subject: [PATCH 481/647] chore(deps): update dependency @types/node to v20.16.6 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index e34928b30..3b810bc69 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", - "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", + "version": "20.16.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.6.tgz", + "integrity": "sha512-T7PpxM/6yeDE+AdlVysT62BX6/bECZOmQAgiFg5NoBd5MQheZ3tzal7f1wvzfiEcmrcJNRi2zRr2nY2zF+0uqw==", "dev": true, "license": "MIT", "dependencies": { From 08bed2de1d7df1b15b43339163f66f7fa40cc2b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:29:50 +0000 Subject: [PATCH 482/647] chore(deps): update dependency dotnet-sdk to v8.0.402 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 04c1f50d7..033e6125f 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.401", + "version": "8.0.402", "rollForward": "latestMinor" } } \ No newline at end of file From 86be908bc14b20c27fccce01d4b222d8c8e1c084 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:58:56 +0000 Subject: [PATCH 483/647] chore(deps): update dependency @types/node to v20.16.9 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3b810bc69..3b80be93f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.6.tgz", - "integrity": "sha512-T7PpxM/6yeDE+AdlVysT62BX6/bECZOmQAgiFg5NoBd5MQheZ3tzal7f1wvzfiEcmrcJNRi2zRr2nY2zF+0uqw==", + "version": "20.16.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.9.tgz", + "integrity": "sha512-rkvIVJxsOfBejxK7I0FO5sa2WxFmJCzoDwcd88+fq/CUfynNywTo/1/T6hyFz22CyztsnLS9nVlHOnTI36RH5w==", "dev": true, "license": "MIT", "dependencies": { From dc216cab63be384a256b78a97fb8e1dd30c3798b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 03:55:15 +0000 Subject: [PATCH 484/647] chore(deps): update actions/checkout action to v4.2.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e67e51177..590f451c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.0 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 55e1bfd4a..30347e6fe 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 236a5a978..7aa6635d0 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 59c56698b..624d70ff7 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.0 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index f03a1e559..bcfbd882b 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.0 with: ref: ${{ github.sha }} fetch-depth: 0 From e364795eeb41172d4cbeb6d83ac2b7ff2001e994 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 06:32:27 +0000 Subject: [PATCH 485/647] chore(deps): update dependency xunit to 2.9.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ab35d2423..9abae8394 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + From cf7513a5729e5fe8d6e137efd0c0596b0607dd0d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:30:35 +0000 Subject: [PATCH 486/647] chore(deps): update reportgenerator to 5.3.10 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e651cf391..54e2f0b7b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.9", + "version": "5.3.10", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 9abae8394..9a401ee83 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From cc79a7c3788ea0abcf83ff741de4ab6620c51474 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:48:18 +0000 Subject: [PATCH 487/647] chore(deps): update actions/checkout action to v4.2.1 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 590f451c8..de0e73508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.2.0 + uses: actions/checkout@v4.2.1 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 30347e6fe..c111cd2d9 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.0 + uses: actions/checkout@v4.2.1 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 7aa6635d0..dcfbce457 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.0 + uses: actions/checkout@v4.2.1 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 624d70ff7..25868bbea 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.0 + uses: actions/checkout@v4.2.1 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index bcfbd882b..4ece4bed5 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.0 + uses: actions/checkout@v4.2.1 with: ref: ${{ github.sha }} fetch-depth: 0 From a9dc85f8f863d2f69930d954864d195dc0382bf6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:10:21 +0000 Subject: [PATCH 488/647] chore(deps): update dependency @types/node to v20.16.10 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3b80be93f..ea7490c26 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.9.tgz", - "integrity": "sha512-rkvIVJxsOfBejxK7I0FO5sa2WxFmJCzoDwcd88+fq/CUfynNywTo/1/T6hyFz22CyztsnLS9nVlHOnTI36RH5w==", + "version": "20.16.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", + "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", "dev": true, "license": "MIT", "dependencies": { From f89259696d865afc32656ca3be1e6ab348daf73b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 02:00:52 +0000 Subject: [PATCH 489/647] chore(deps): update dependency nuke.globaltool to 8.1.1 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 54e2f0b7b..654af6bf1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "8.1.0", + "version": "8.1.1", "commands": [ "nuke" ] From 1e4d4253c91b6a4ab5ecfab29e522d4786c0ac82 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 02:00:46 +0000 Subject: [PATCH 490/647] chore(deps): update dependency @types/node to v20.16.11 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index ea7490c26..5b0576103 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", - "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", + "version": "20.16.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", + "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", "dev": true, "license": "MIT", "dependencies": { From 4a149c944a896b4eaa6b713caf6c21eb94d065dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:30:03 +0000 Subject: [PATCH 491/647] chore(deps): update dotnet monorepo [minor/patch] to 8.0.1 --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9a401ee83..a92bfa4ca 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,13 +28,13 @@ - - + + - + From 80ba50e5f1bb88640184340c28b8bccca7404150 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:55:57 +0000 Subject: [PATCH 492/647] chore(deps): update dependency dotnet-sdk to v8.0.403 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 033e6125f..872d8f86c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.402", + "version": "8.0.403", "rollForward": "latestMinor" } } \ No newline at end of file From 62574716ed57919b16e6de8389cf5218a0389b21 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:48:51 +0000 Subject: [PATCH 493/647] chore(deps): update reportgenerator to 5.3.11 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 654af6bf1..1dc99568d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.10", + "version": "5.3.11", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index a92bfa4ca..0ff6bd670 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From cc275085a3d06b8991464a185e319de42f099af0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:35:21 +0000 Subject: [PATCH 494/647] chore(deps): update jetbrains to 2024.2.6 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1dc99568d..a97f0953b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.5", + "version": "2024.2.6", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 0ff6bd670..103b4de2f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 100a399c2d503d3716858f27fae0e43196af5a8c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 01:40:21 +0000 Subject: [PATCH 495/647] chore(deps): update dependency nuke.globaltool to 8.1.2 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index a97f0953b..cf6f29d6c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "8.1.1", + "version": "8.1.2", "commands": [ "nuke" ] From e6d2b93f68631ca365a8d797dccfdba40426069b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:21:59 +0000 Subject: [PATCH 496/647] chore(deps): update gitversion to 6.0.3 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index cf6f29d6c..e26bc587a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "6.0.2", + "version": "6.0.3", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 103b4de2f..e82e85d93 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 852079acd95ec8ad93bb6b03816e46d74586c771 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 07:45:54 +0000 Subject: [PATCH 497/647] chore(deps): update dependency @types/node to v20.16.13 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 5b0576103..74764c08d 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", - "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", + "version": "20.16.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.13.tgz", + "integrity": "sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==", "dev": true, "license": "MIT", "dependencies": { From b92f254c9af90357cc475b4786035463e9605581 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 05:13:53 +0000 Subject: [PATCH 498/647] chore(deps): update dependency @types/node to v20.16.14 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 74764c08d..59006f208 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.13.tgz", - "integrity": "sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==", + "version": "20.16.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.14.tgz", + "integrity": "sha512-vtgGzjxLF7QT88qRHtXMzCWpAAmwonE7fwgVjFtXosUva2oSpnIEc3gNO9P7uIfOxKnii2f79/xtOnfreYtDaA==", "dev": true, "license": "MIT", "dependencies": { From 5ad1a7409a5f8c42fa9a60caaefbce07cf4842e7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 06:09:31 +0000 Subject: [PATCH 499/647] chore(deps): update dependency verify.xunit to v27 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e82e85d93..fca085f14 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 98b23346d41f1578f86816ae461c68687d967a1c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:03:08 +0000 Subject: [PATCH 500/647] chore(deps): update jetbrains to 2024.2.7 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e26bc587a..4e5c3de1c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.6", + "version": "2024.2.7", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index fca085f14..51daca6de 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From b8585fccb92429f089f9c58a4c05fac1748fe4e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:24:23 +0000 Subject: [PATCH 501/647] chore(deps): update dependency @types/node to v20.17.0 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 59006f208..61be6166b 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.14.tgz", - "integrity": "sha512-vtgGzjxLF7QT88qRHtXMzCWpAAmwonE7fwgVjFtXosUva2oSpnIEc3gNO9P7uIfOxKnii2f79/xtOnfreYtDaA==", + "version": "20.17.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.0.tgz", + "integrity": "sha512-a7zRo0f0eLo9K5X9Wp5cAqTUNGzuFLDG2R7C4HY2BhcMAsxgSPuRvAC1ZB6QkuUQXf0YZAgfOX2ZyrBa2n4nHQ==", "dev": true, "license": "MIT", "dependencies": { From c5bd10d147961f6cd873db54a31c579f30a5c9fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:24:07 +0000 Subject: [PATCH 502/647] chore(deps): update actions/checkout action to v4.2.2 --- .github/workflows/ci.yml | 2 +- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de0e73508..12d598b0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 with: clean: 'false' fetch-depth: '0' diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index c111cd2d9..182fb714b 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index dcfbce457..216361e96 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 25868bbea..18098416f 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 - name: Run Labeler if: success() diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 4ece4bed5..2cd289a34 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 with: ref: ${{ github.sha }} fetch-depth: 0 From b86362caed1ca714826bbbce2f53fd800fa89a06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:23:17 +0000 Subject: [PATCH 503/647] chore(deps): update dependency @types/node to v20.17.1 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 61be6166b..e6f717ecc 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.0.tgz", - "integrity": "sha512-a7zRo0f0eLo9K5X9Wp5cAqTUNGzuFLDG2R7C4HY2BhcMAsxgSPuRvAC1ZB6QkuUQXf0YZAgfOX2ZyrBa2n4nHQ==", + "version": "20.17.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.1.tgz", + "integrity": "sha512-j2VlPv1NnwPJbaCNv69FO/1z4lId0QmGvpT41YxitRtWlg96g/j8qcv2RKsLKe2F6OJgyXhupN1Xo17b2m139Q==", "dev": true, "license": "MIT", "dependencies": { From 472a294630453085ae50c84d9f5dc862c2383e9d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:22:07 +0000 Subject: [PATCH 504/647] chore(deps): update github actions --- .github/workflows/ci.yml | 6 +++--- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12d598b0d..c41fe3af3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,15 +91,15 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: '6.0.x' - name: πŸ”¨ Use .NET Core 8.0 SDK - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: '8.0.x' - name: 🎁 dotnet tool restore diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 18098416f..59cb233a8 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,7 +20,7 @@ jobs: - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v5.0.0 + uses: crazy-max/ghaction-github-labeler@v5.1.0 with: yaml-file: .github/labels.yml skip-delete: false From 383796ace918ff5b195b6ae9f7724142b4647eb7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:16:13 +0000 Subject: [PATCH 505/647] chore(deps): update dependency @types/node to v20.17.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index e6f717ecc..4d759c265 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.1.tgz", - "integrity": "sha512-j2VlPv1NnwPJbaCNv69FO/1z4lId0QmGvpT41YxitRtWlg96g/j8qcv2RKsLKe2F6OJgyXhupN1Xo17b2m139Q==", + "version": "20.17.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.2.tgz", + "integrity": "sha512-OOHK4sjXqkL7yQ7VEEHcf6+0jSvKjWqwnaCtY7AKD/VLEvRHMsxxu7eI8ErnjxHS8VwmekD4PeVCpu4qZEZSxg==", "dev": true, "license": "MIT", "dependencies": { From e81b9d16530f9c44a8dd072e8d4558fd4e0ba75d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:29:08 +0000 Subject: [PATCH 506/647] chore(deps): update dependency verify.xunit to v28 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 51daca6de..db25cbc68 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 693491024da0e4aa074bdc200427f8d063ed605b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 06:29:59 +0000 Subject: [PATCH 507/647] chore(deps): update dependency @types/node to v20.17.4 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 4d759c265..ce8ccf405 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.2.tgz", - "integrity": "sha512-OOHK4sjXqkL7yQ7VEEHcf6+0jSvKjWqwnaCtY7AKD/VLEvRHMsxxu7eI8ErnjxHS8VwmekD4PeVCpu4qZEZSxg==", + "version": "20.17.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.4.tgz", + "integrity": "sha512-Fi1Bj8qTJr4f1FDdHFR7oMlOawEYSzkHNdBJK+aRjcDDNHwEV3jPPjuZP2Lh2QNgXeqzM8Y+U6b6urKAog2rZw==", "dev": true, "license": "MIT", "dependencies": { From fa74c09341d8f132be48960142738785d407b665 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:11:09 +0000 Subject: [PATCH 508/647] chore(deps): update dependency nsubstitute to 5.3.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index db25cbc68..2c650763f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -42,7 +42,7 @@ - + From 04e98125255c9d3106fa001d5f422438523ecbba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:29:15 +0000 Subject: [PATCH 509/647] chore(deps): update dependency @types/node to v20.17.5 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index ce8ccf405..f40cc04f2 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.4.tgz", - "integrity": "sha512-Fi1Bj8qTJr4f1FDdHFR7oMlOawEYSzkHNdBJK+aRjcDDNHwEV3jPPjuZP2Lh2QNgXeqzM8Y+U6b6urKAog2rZw==", + "version": "20.17.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.5.tgz", + "integrity": "sha512-n8FYY/pRxu496441gIcAQFZPKXbhsd6VZygcq+PTSZ75eMh/Ke0hCAROdUa21qiFqKNsPPYic46yXDO1JGiPBQ==", "dev": true, "license": "MIT", "dependencies": { From 23831877f5a4f2744adafab7425cf5f068f419ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 23:09:25 +0000 Subject: [PATCH 510/647] chore(deps): update gitversion to 6.0.4 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4e5c3de1c..9f268a3b5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "6.0.3", + "version": "6.0.4", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 2c650763f..85e0178da 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 324ad4028883659828959b18dcee2b23d754c6aa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 3 Nov 2024 04:14:24 +0000 Subject: [PATCH 511/647] chore(deps): update dependency @types/node to v20.17.6 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f40cc04f2..55e0a6eed 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.5.tgz", - "integrity": "sha512-n8FYY/pRxu496441gIcAQFZPKXbhsd6VZygcq+PTSZ75eMh/Ke0hCAROdUa21qiFqKNsPPYic46yXDO1JGiPBQ==", + "version": "20.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", + "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", "dev": true, "license": "MIT", "dependencies": { From 1553d8d4379a677ed47991eb813912c3d0be9946 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:06:54 +0000 Subject: [PATCH 512/647] chore(deps): update dependency nuke.globaltool to 8.1.4 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9f268a3b5..55455ef8e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "8.1.2", + "version": "8.1.4", "commands": [ "nuke" ] From 1a6b909c43fbca425407aec839fec82457affdda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 02:25:25 +0000 Subject: [PATCH 513/647] chore(deps): update gitversion to 6.0.5 (#1392) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 55455ef8e..453286c11 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "6.0.4", + "version": "6.0.5", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 85e0178da..d58f6691e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 8807d7efcf6f59237ee5c4d8d73ab08855c6c565 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 05:31:21 +0000 Subject: [PATCH 514/647] chore(deps): update dependency fluentassertions to 6.12.2 (#1389) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d58f6691e..7797387e3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 60491d43780c79b4b96cf5ad6045c9fffb50ae11 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:41:32 +0000 Subject: [PATCH 515/647] chore(deps): update jetbrains to 2024.3.0 (#1393) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 453286c11..d7186b1e8 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.2.7", + "version": "2024.3.0", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 7797387e3..813f49184 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 4d0b9e0e582f6c6ba171f501a2ceaeb8736355a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 01:07:04 +0000 Subject: [PATCH 516/647] chore(deps): update gittools/actions action to v3.0.1 (#1397) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 182fb714b..af55e4a68 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.0 + uses: gittools/actions/gitversion/setup@v3.0.1 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.0.0 + uses: gittools/actions/gitreleasemanager/setup@v3.0.1 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.0 + uses: gittools/actions/gitversion/execute@v3.0.1 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 216361e96..eb99378ee 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.0 + uses: gittools/actions/gitversion/setup@v3.0.1 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.0 + uses: gittools/actions/gitversion/execute@v3.0.1 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 2cd289a34..0c1a65458 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.0.0 + uses: gittools/actions/gitversion/setup@v3.0.1 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.0.0 + uses: gittools/actions/gitreleasemanager/setup@v3.0.1 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.0 + uses: gittools/actions/gitversion/execute@v3.0.1 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 6488b0f8d5f186183431f3516324fcc8e4e69f69 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 05:05:44 +0000 Subject: [PATCH 517/647] chore(deps): update dependency dotnet-sdk to v8.0.404 (#1394) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 872d8f86c..b79ab6dbb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.403", + "version": "8.0.404", "rollForward": "latestMinor" } } \ No newline at end of file From 2e4e0506494db9c06f858eb51988217531daa228 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:38:04 +0000 Subject: [PATCH 518/647] chore(deps): update gittools/actions action to v3.0.2 (#1398) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index af55e4a68..30c3c76c1 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.1 + uses: gittools/actions/gitversion/setup@v3.0.2 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.0.1 + uses: gittools/actions/gitreleasemanager/setup@v3.0.2 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.1 + uses: gittools/actions/gitversion/execute@v3.0.2 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index eb99378ee..e6de489d4 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.1 + uses: gittools/actions/gitversion/setup@v3.0.2 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.1 + uses: gittools/actions/gitversion/execute@v3.0.2 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 0c1a65458..0ff313625 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.0.1 + uses: gittools/actions/gitversion/setup@v3.0.2 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.0.1 + uses: gittools/actions/gitreleasemanager/setup@v3.0.2 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.1 + uses: gittools/actions/gitversion/execute@v3.0.2 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From dd09c01ceba1b9cab4a23bb362ee4c5cce2ec259 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 20:28:03 +0000 Subject: [PATCH 519/647] chore(deps): update dependency husky to v9.1.7 (#1399) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0702419ca..1094421b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "devDependencies": { "@prettier/plugin-xml": "3.4.1", - "husky": "9.1.6", + "husky": "9.1.7", "lint-staged": "15.2.10", "prettier": "3.3.3" } @@ -281,9 +281,9 @@ } }, "node_modules/husky": { - "version": "9.1.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", - "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 1ff2067a8..4c6d6f456 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "devDependencies": { "@prettier/plugin-xml": "3.4.1", - "husky": "9.1.6", + "husky": "9.1.7", "lint-staged": "15.2.10", "prettier": "3.3.3" }, From 10611fb75d666ec091f50b6d8d05e086bc2e5ca0 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Mon, 18 Nov 2024 00:07:13 +0100 Subject: [PATCH 520/647] Use .NET SDK 9.0 --- .build/Solution.cs | 2 +- .github/workflows/ci.yml | 6 +++++- global.json | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.build/Solution.cs b/.build/Solution.cs index 12dc1eb4b..6bcbeab9a 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -100,7 +100,7 @@ RocketSurgeonGitHubActionsConfiguration configuration .Jobs.OfType() .First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase)) .ConfigureStep(step => step.FetchDepth = 0) - .UseDotNetSdks("3.1", "6.0", "8.0") + .UseDotNetSdks("3.1", "6.0", "8.0", "9.0") .AddNuGetCache() .AddVscodeExtensionTests() .PublishLogs() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c41fe3af3..1af649531 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,11 +97,15 @@ jobs: - name: πŸ”¨ Use .NET Core 6.0 SDK uses: actions/setup-dotnet@v4.1.0 with: - dotnet-version: '6.0.x' + dotnet-version: '6.0.x' - name: πŸ”¨ Use .NET Core 8.0 SDK uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: '8.0.x' + - name: πŸ”¨ Use .NET Core 9.0 SDK + uses: actions/setup-dotnet@v4.1.0 + with: + dotnet-version: '9.0.x' - name: 🎁 dotnet tool restore run: | dotnet tool restore diff --git a/global.json b/global.json index b79ab6dbb..2bc13e80a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.404", + "version": "9.0.100", "rollForward": "latestMinor" } -} \ No newline at end of file +} From 1245816f06b3acba78ce51abcad3ec57d1508d17 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 06:22:20 +0000 Subject: [PATCH 521/647] chore(deps): update reportgenerator to 5.4.1 (#1391) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index d7186b1e8..7f0de793c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.3.11", + "version": "5.4.1", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 813f49184..7de2378dd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From fedcd3c93a8ac7a3061a401597c6317ff5458c99 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:20:59 +0000 Subject: [PATCH 522/647] chore(deps): update dependency microsoft.net.test.sdk to 17.12.0 (#1400) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7de2378dd..aeade85e7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From 32d3e9a1d8b828b7035d5c67c49f57248be5b0ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:18:37 +0000 Subject: [PATCH 523/647] chore(deps): update dependency @types/node to v20.17.9 (#1403) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 55e0a6eed..9e3b69ad1 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", - "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", + "version": "20.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.9.tgz", + "integrity": "sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==", "dev": true, "license": "MIT", "dependencies": { From 7b77204305639fef4b3e5d21e9fc94c3dafd4a56 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 22:43:29 +0000 Subject: [PATCH 524/647] chore(deps): update dependency xunit.skippablefact to 1.5.23 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index aeade85e7..bf0775938 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -56,7 +56,7 @@ - + From bdf62f15a564feba11720ed884cfb54458da93c5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:10:09 +0000 Subject: [PATCH 525/647] chore(deps): update jetbrains to 2024.3.1 (#1412) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7f0de793c..1a7690d04 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.3.0", + "version": "2024.3.1", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index aeade85e7..f9aa93158 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From e20d06de4a50f47f69780c1d220873e3ff163df1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:28:51 +0000 Subject: [PATCH 526/647] chore(deps): update gittools/actions action to v3.0.4 (#1401) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 30c3c76c1..5000f4b93 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.2 + uses: gittools/actions/gitversion/setup@v3.0.4 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.0.2 + uses: gittools/actions/gitreleasemanager/setup@v3.0.4 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.2 + uses: gittools/actions/gitversion/execute@v3.0.4 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index e6de489d4..bf9fc720b 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.2 + uses: gittools/actions/gitversion/setup@v3.0.4 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.2 + uses: gittools/actions/gitversion/execute@v3.0.4 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 0ff313625..816fbbe9f 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.0.2 + uses: gittools/actions/gitversion/setup@v3.0.4 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.0.2 + uses: gittools/actions/gitreleasemanager/setup@v3.0.4 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.2 + uses: gittools/actions/gitversion/execute@v3.0.4 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From f029b0cd753f8aa8a8d9afc51d9f7ce2577309ba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:31:17 +0000 Subject: [PATCH 527/647] chore(deps): update dependency fluentassertions to v7 (#1406) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f9aa93158..aef20f185 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From b589ad2d90048bfa6bee1b1a0b0c18e6ffbce0f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:54:44 +0000 Subject: [PATCH 528/647] chore(deps): update dependency lint-staged to v15.2.11 (#1413) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 51 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1094421b2..fd19fdf89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", - "lint-staged": "15.2.10", + "lint-staged": "15.2.11", "prettier": "3.3.3" } }, @@ -169,13 +169,13 @@ } }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -337,9 +337,9 @@ "dev": true }, "node_modules/lilconfig": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", - "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "dev": true, "license": "MIT", "engines": { @@ -350,22 +350,22 @@ } }, "node_modules/lint-staged": { - "version": "15.2.10", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.10.tgz", - "integrity": "sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==", + "version": "15.2.11", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.11.tgz", + "integrity": "sha512-Ev6ivCTYRTGs9ychvpVw35m/bcNDuBN+mnTeObCL5h+boS5WzBEC6LHI4I9F/++sZm1m+J2LEiy0gxL/R9TBqQ==", "dev": true, "license": "MIT", "dependencies": { "chalk": "~5.3.0", "commander": "~12.1.0", - "debug": "~4.3.6", + "debug": "~4.4.0", "execa": "~8.0.1", - "lilconfig": "~3.1.2", - "listr2": "~8.2.4", + "lilconfig": "~3.1.3", + "listr2": "~8.2.5", "micromatch": "~4.0.8", "pidtree": "~0.6.0", "string-argv": "~0.3.2", - "yaml": "~2.5.0" + "yaml": "~2.6.1" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -378,9 +378,9 @@ } }, "node_modules/listr2": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.4.tgz", - "integrity": "sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", + "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", "dev": true, "license": "MIT", "dependencies": { @@ -494,10 +494,11 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, "node_modules/npm-run-path": { "version": "5.1.0", @@ -787,9 +788,9 @@ } }, "node_modules/yaml": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", - "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 4c6d6f456..14cc73cf2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", - "lint-staged": "15.2.10", + "lint-staged": "15.2.11", "prettier": "3.3.3" }, "scripts": { From 65110930c62da679a803422799d9d70aee085600 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:08:23 +0000 Subject: [PATCH 529/647] chore(deps): update gittools/actions action to v3.1.1 (#1414) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 5000f4b93..f08b6b6c2 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.4 + uses: gittools/actions/gitversion/setup@v3.1.1 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.0.4 + uses: gittools/actions/gitreleasemanager/setup@v3.1.1 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.4 + uses: gittools/actions/gitversion/execute@v3.1.1 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index bf9fc720b..699d3da93 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.0.4 + uses: gittools/actions/gitversion/setup@v3.1.1 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.4 + uses: gittools/actions/gitversion/execute@v3.1.1 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 816fbbe9f..74cfe08a2 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.0.4 + uses: gittools/actions/gitversion/setup@v3.1.1 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.0.4 + uses: gittools/actions/gitreleasemanager/setup@v3.1.1 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.0.4 + uses: gittools/actions/gitversion/execute@v3.1.1 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From ee99ddf2a243f35c0be04bc45c3b73b9e33a2c9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:59:41 +0000 Subject: [PATCH 530/647] chore(deps): update gitversion to 6.1.0 (#1411) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1a7690d04..88529115e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "gitversion.tool": { - "version": "6.0.5", + "version": "6.1.0", "commands": [ "dotnet-gitversion" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index aef20f185..a68696eeb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 8d346cda7915c332e7f64cb7e0b1eb6337d3cdfe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:17:11 +0000 Subject: [PATCH 531/647] chore(deps): update dependency @types/node to v20.17.10 (#1415) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 9e3b69ad1..08d87c40f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.9.tgz", - "integrity": "sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==", + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", "dev": true, "license": "MIT", "dependencies": { From ff6821c043503b48bfaa5624388c0b424d880c5f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:35:13 +0000 Subject: [PATCH 532/647] chore(deps): update jetbrains to 2024.3.2 (#1416) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 88529115e..e754c54cd 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.3.1", + "version": "2024.3.2", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index a68696eeb..2a4a07294 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 053f1358c584e5d635d444b6c1e2012b89faf599 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:37:27 +0000 Subject: [PATCH 533/647] chore(deps): update dependency serilog.sinks.xunit to 3.0.19 (#1417) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2a4a07294..9f896528b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -45,7 +45,7 @@ - + From b4d318435be08908598f992ff517faabf13b030b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 20:03:03 +0000 Subject: [PATCH 534/647] chore(deps): update dependency xunit.runner.visualstudio to v3 (#1418) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9f896528b..e5248363d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,7 +37,7 @@ - + From a312da9d575b67cb60259a6d5394eddce38e5f4f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 23:30:05 +0000 Subject: [PATCH 535/647] chore(deps): update reportgenerator to 5.4.2 (#1420) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e754c54cd..1b6945381 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.4.1", + "version": "5.4.2", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index e5248363d..c8114fb58 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From c94367a3600363ae471d88fe7352544813b448b6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 00:34:35 +0000 Subject: [PATCH 536/647] chore(deps): update coverlet to 6.0.3 (#1425) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c8114fb58..c699a784b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,8 +47,8 @@ - - + + From e76a7477c381116db56d7ae72dab7a2b65b16394 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 03:42:45 +0000 Subject: [PATCH 537/647] chore(deps): update actions/setup-dotnet action to v4.2.0 (#1422) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1af649531..c3223fff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,19 +91,19 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v4.1.0 + uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v4.1.0 + uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: '6.0.x' - name: πŸ”¨ Use .NET Core 8.0 SDK - uses: actions/setup-dotnet@v4.1.0 + uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: '8.0.x' - name: πŸ”¨ Use .NET Core 9.0 SDK - uses: actions/setup-dotnet@v4.1.0 + uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: '9.0.x' - name: 🎁 dotnet tool restore From d8fe9a77800872939251d0525deff87a1afb31ac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 03:43:04 +0000 Subject: [PATCH 538/647] chore(deps): update jetbrains to 2024.3.3 (#1421) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1b6945381..24fff02ad 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.3.2", + "version": "2024.3.3", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index c699a784b..8e311cc41 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 1d762e7aff34e0a55a46d07ed0b74875bfd8ab7b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:51:07 +0000 Subject: [PATCH 539/647] chore(deps): update reportgenerator to 5.4.3 (#1424) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 24fff02ad..7225046a0 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.4.2", + "version": "5.4.3", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 8e311cc41..cff9b86ac 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 7ee3469c5ff6fa82b53c94d81d28fe4d4635339e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:45:32 +0000 Subject: [PATCH 540/647] chore(deps): update dependency glob to v11.0.1 (#1428) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 08d87c40f..77f3e5256 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -682,9 +682,9 @@ } }, "node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", + "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", "dev": true, "license": "ISC", "dependencies": { From 0981badafdace64d042d55eebe9891649de11f71 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 04:54:45 +0000 Subject: [PATCH 541/647] chore(deps): update gittools/actions action to v3.1.2 (#1429) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index f08b6b6c2..46cb5cc2f 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.1 + uses: gittools/actions/gitversion/setup@v3.1.2 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.1.1 + uses: gittools/actions/gitreleasemanager/setup@v3.1.2 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.1 + uses: gittools/actions/gitversion/execute@v3.1.2 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 699d3da93..550c734bd 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.1 + uses: gittools/actions/gitversion/setup@v3.1.2 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.1 + uses: gittools/actions/gitversion/execute@v3.1.2 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 74cfe08a2..aaf4018c5 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.1.1 + uses: gittools/actions/gitversion/setup@v3.1.2 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.1.1 + uses: gittools/actions/gitreleasemanager/setup@v3.1.2 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.1 + uses: gittools/actions/gitversion/execute@v3.1.2 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From c3cfb93d6c881f734298c89566b9b0a437420f6e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:33:00 +0000 Subject: [PATCH 542/647] chore(deps): update dependency @types/node to v20.17.12 (#1426) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 77f3e5256..f7ed7667d 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", - "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "version": "20.17.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz", + "integrity": "sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw==", "dev": true, "license": "MIT", "dependencies": { From ce056c567e0e0b37a5ed0a2299fc925012026bda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:33:49 +0000 Subject: [PATCH 543/647] chore(deps): update xunit (#1427) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index cff9b86ac..8c318a7cf 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,8 +37,8 @@ - - + + From be4d0804568a58652b83fca6b4155abc7c224668 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:57:26 +0000 Subject: [PATCH 544/647] chore(deps): update dependency @types/node to v20.17.13 (#1431) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f7ed7667d..ae02af1a7 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz", - "integrity": "sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw==", + "version": "20.17.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.13.tgz", + "integrity": "sha512-RNf+4dEeV69PIvyp++4IKM2vnLXtmp/JovfeQm5P5+qpKb6wHoH7INywLdZ7z+gVX46kgBP/fwJJvZYaHxtdyw==", "dev": true, "license": "MIT", "dependencies": { From 945afd611d7474d8f30ce417d75762d85e9a8bc7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 02:29:17 +0000 Subject: [PATCH 545/647] chore(deps): update dotnet monorepo (#1409) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8c318a7cf..578dd66de 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + diff --git a/global.json b/global.json index 2bc13e80a..49cfff708 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "9.0.102", "rollForward": "latestMinor" } } From c0bc85a2b57557d5589cf6f1525c294805a81b03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 05:30:00 +0000 Subject: [PATCH 546/647] chore(deps): update dependency microsoft.codeanalysis.analyzers to 3.11.0 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 578dd66de..fa8c17e63 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -59,7 +59,7 @@ - + \ No newline at end of file From e32470ad798422d395bdf753c3a209b0f2c7a876 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 01:35:19 +0000 Subject: [PATCH 547/647] chore(deps): update dependency nuke.globaltool to v9 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7225046a0..6f4496d2c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "8.1.4", + "version": "9.0.4", "commands": [ "nuke" ] From 9f804e2b64a32f4d54f2be42e4a92ef9811f384f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:04:37 +0000 Subject: [PATCH 548/647] chore(deps): update dependency fluentassertions to 7.1.0 (#1433) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 578dd66de..b119165bd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From aa1c4ef2d615a241db976a5554bf17f45315a493 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 02:16:29 +0000 Subject: [PATCH 549/647] chore(deps): update coverlet to 6.0.4 (#1434) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b119165bd..c336c7068 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,8 +47,8 @@ - - + + From 4733f656c4e8cce5df3efd5669309ce6d07787a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 05:51:58 +0000 Subject: [PATCH 550/647] chore(deps): update dependency xunitxml.testlogger to v5 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c336c7068..f0974f5eb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -46,7 +46,7 @@ - + From 9c026e3b9ecd765c658017f629df3a1dd8417cfd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:26:08 +0000 Subject: [PATCH 551/647] chore(deps): update gittools/actions action to v3.1.10 (#1435) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 46cb5cc2f..6065159a4 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.2 + uses: gittools/actions/gitversion/setup@v3.1.10 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.1.2 + uses: gittools/actions/gitreleasemanager/setup@v3.1.10 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.2 + uses: gittools/actions/gitversion/execute@v3.1.10 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 550c734bd..8d0c0aebc 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.2 + uses: gittools/actions/gitversion/setup@v3.1.10 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.2 + uses: gittools/actions/gitversion/execute@v3.1.10 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index aaf4018c5..a4a9b563f 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.1.2 + uses: gittools/actions/gitversion/setup@v3.1.10 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.1.2 + uses: gittools/actions/gitreleasemanager/setup@v3.1.10 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.2 + uses: gittools/actions/gitversion/execute@v3.1.10 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From a39438183b5acb40e8ce7c1a5e57c71d0474434a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:18:53 +0000 Subject: [PATCH 552/647] chore(deps): update gittools/actions action to v3.1.11 (#1436) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 6065159a4..6d70c169f 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.10 + uses: gittools/actions/gitversion/setup@v3.1.11 with: versionSpec: '5.x' - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.1.10 + uses: gittools/actions/gitreleasemanager/setup@v3.1.11 with: versionSpec: '0.15.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.10 + uses: gittools/actions/gitversion/execute@v3.1.11 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 8d0c0aebc..1e083ade2 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,13 +27,13 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.10 + uses: gittools/actions/gitversion/setup@v3.1.11 with: versionSpec: '5.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.10 + uses: gittools/actions/gitversion/execute@v3.1.11 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index a4a9b563f..078e14e8f 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,20 +25,20 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.1.10 + uses: gittools/actions/gitversion/setup@v3.1.11 with: versionSpec: '5.x' - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.1.10 + uses: gittools/actions/gitreleasemanager/setup@v3.1.11 with: versionSpec: '0.15.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.10 + uses: gittools/actions/gitversion/execute@v3.1.11 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 078d5d72397a5e1796c60604c15c57c7c81f848a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 21:17:33 +0000 Subject: [PATCH 553/647] chore(deps): update dependency @types/node to v20.17.14 (#1432) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index ae02af1a7..bd2a43ab6 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.13.tgz", - "integrity": "sha512-RNf+4dEeV69PIvyp++4IKM2vnLXtmp/JovfeQm5P5+qpKb6wHoH7INywLdZ7z+gVX46kgBP/fwJJvZYaHxtdyw==", + "version": "20.17.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.14.tgz", + "integrity": "sha512-w6qdYetNL5KRBiSClK/KWai+2IMEJuAj+EujKCumalFOwXtvOXaEan9AuwcRID2IcOIAWSIfR495hBtgKlx2zg==", "dev": true, "license": "MIT", "dependencies": { From d1967dcf2bc54d57b9cd68f25d5eaf8895dc42ab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 09:29:51 +0000 Subject: [PATCH 554/647] chore(deps): update jetbrains to 2024.3.4 (#1438) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7225046a0..24362f175 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -33,7 +33,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.3.3", + "version": "2024.3.4", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index c336c7068..333ef3a46 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 64ca13105b8bd41919981fd2f8ba5b9615bd23db Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:01:49 +0000 Subject: [PATCH 555/647] chore(deps): update dependency @types/node to v20.17.16 (#1437) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index bd2a43ab6..4d41106b1 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.14.tgz", - "integrity": "sha512-w6qdYetNL5KRBiSClK/KWai+2IMEJuAj+EujKCumalFOwXtvOXaEan9AuwcRID2IcOIAWSIfR495hBtgKlx2zg==", + "version": "20.17.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.16.tgz", + "integrity": "sha512-vOTpLduLkZXePLxHiHsBLp98mHGnl8RptV4YAO3HfKO5UHjDvySGbxKtpYfy8Sx5+WKcgc45qNreJJRVM3L6mw==", "dev": true, "license": "MIT", "dependencies": { From 19230680291442fcb6f15ce59519f50d194adb6a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:47:03 +0000 Subject: [PATCH 556/647] chore(deps): update dependency @types/vscode to v1.96.0 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 4d41106b1..f884ca952 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -168,9 +168,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.90.0.tgz", - "integrity": "sha512-oT+ZJL7qHS9Z8bs0+WKf/kQ27qWYR3trsXpq46YDjFqBsMLG4ygGGjPaJ2tyrH0wJzjOEmDyg9PDJBBhWg9pkQ==", + "version": "1.96.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.96.0.tgz", + "integrity": "sha512-qvZbSZo+K4ZYmmDuaodMbAa67Pl6VDQzLKFka6rq+3WUTY4Kro7Bwoi0CuZLO/wema0ygcmpwow7zZfPJTs5jg==", "dev": true, "license": "MIT" }, From 1e19961f5f1774ee374ecd7f82e7f0fdac128699 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:47:11 +0000 Subject: [PATCH 557/647] chore(deps): update dependency mocha to v10.8.2 --- vscode-testextension/package-lock.json | 127 ++++++++++--------------- 1 file changed, 52 insertions(+), 75 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 4d41106b1..5d99294d1 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -151,9 +151,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", - "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true, "license": "MIT" }, @@ -205,10 +205,11 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -529,12 +530,13 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -558,10 +560,11 @@ } }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -1062,32 +1065,32 @@ } }, "node_modules/mocha": { - "version": "10.5.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.5.2.tgz", - "integrity": "sha512-9btlN3JKCefPf+vKd/kcKz2SXxi12z6JswkGfaAF0saQvnsqLJk504ZmbxhSoENge08E9dsymozKgFMTl5PQsA==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "license": "MIT", "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", "chokidar": "^3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", @@ -1097,16 +1100,6 @@ "node": ">= 14.0.0" } }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/mocha/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -1128,32 +1121,13 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mocha/node_modules/ms": { + "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1549,10 +1523,11 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } @@ -1831,10 +1806,11 @@ } }, "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", @@ -1905,10 +1881,11 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } From 3470d2182259b213271bbac4bf8295b18d76b961 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:47:18 +0000 Subject: [PATCH 558/647] chore(deps): update dependency typescript to v5.7.3 --- vscode-testextension/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 4d41106b1..88dd6e8f8 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1755,10 +1755,11 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" From aeb4743fc96dad157ec1200a47dcea4b10dc0895 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:04:57 +0000 Subject: [PATCH 559/647] chore(deps): update dependency lint-staged to v15.4.3 --- package-lock.json | 47 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd19fdf89..4b98ab66d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", - "lint-staged": "15.2.11", + "lint-staged": "15.4.3", "prettier": "3.3.3" } }, @@ -86,10 +86,11 @@ } }, "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", "dev": true, + "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -145,9 +146,9 @@ "dev": true }, "node_modules/commander": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", - "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", "dev": true, "license": "MIT", "engines": { @@ -350,22 +351,22 @@ } }, "node_modules/lint-staged": { - "version": "15.2.11", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.11.tgz", - "integrity": "sha512-Ev6ivCTYRTGs9ychvpVw35m/bcNDuBN+mnTeObCL5h+boS5WzBEC6LHI4I9F/++sZm1m+J2LEiy0gxL/R9TBqQ==", + "version": "15.4.3", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.4.3.tgz", + "integrity": "sha512-FoH1vOeouNh1pw+90S+cnuoFwRfUD9ijY2GKy5h7HS3OR7JVir2N2xrsa0+Twc1B7cW72L+88geG5cW4wIhn7g==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "~5.3.0", - "commander": "~12.1.0", - "debug": "~4.4.0", - "execa": "~8.0.1", - "lilconfig": "~3.1.3", - "listr2": "~8.2.5", - "micromatch": "~4.0.8", - "pidtree": "~0.6.0", - "string-argv": "~0.3.2", - "yaml": "~2.6.1" + "chalk": "^5.4.1", + "commander": "^13.1.0", + "debug": "^4.4.0", + "execa": "^8.0.1", + "lilconfig": "^3.1.3", + "listr2": "^8.2.5", + "micromatch": "^4.0.8", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.7.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -788,9 +789,9 @@ } }, "node_modules/yaml": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", - "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 14cc73cf2..c1f9ded0c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "devDependencies": { "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", - "lint-staged": "15.2.11", + "lint-staged": "15.4.3", "prettier": "3.3.3" }, "scripts": { From 46066b51ac735df9ca0f145cc8ca0bf98253f46e Mon Sep 17 00:00:00 2001 From: sheffer21 Date: Thu, 30 Jan 2025 00:59:07 +0200 Subject: [PATCH 560/647] Upgrade MediatR version to 12.4.1 --- Directory.Packages.props | 2 +- src/Dap.Protocol/AbstractHandlers.cs | 2 +- .../Feature/Events/BreakpointFeature.cs | 2 +- .../Feature/Events/CapabilitiesFeature.cs | 4 +-- .../Feature/Events/ContinuedFeature.cs | 4 +-- .../Feature/Events/ExitedFeature.cs | 4 +-- .../Feature/Events/InitializedFeature.cs | 4 +-- .../Feature/Events/InvalidatedFeature.cs | 4 +-- .../Feature/Events/LoadedSourceFeature.cs | 4 +-- .../Feature/Events/ModuleFeature.cs | 4 +-- .../Feature/Events/OutputFeature.cs | 4 +-- .../Feature/Events/ProcessFeature.cs | 4 +-- .../Feature/Events/ProgressFeature.cs | 8 +++--- .../Feature/Events/StoppedFeature.cs | 4 +-- .../Feature/Events/TerminatedFeature.cs | 4 +-- .../Feature/Events/ThreadFeature.cs | 4 +-- .../IDebugAdapterProtocolProxy.cs | 4 +-- src/Dap.Shared/DapResponseRouter.cs | 2 +- src/JsonRpc.Generators/Helpers.cs | 25 +++++++++++-------- src/JsonRpc.Testing/SettlePipeline.cs | 4 +-- src/JsonRpc/CancelParams.cs | 2 +- src/JsonRpc/DefaultJsonRpcServerFacade.cs | 4 +-- src/JsonRpc/DelegatingHandlers.cs | 6 ++--- src/JsonRpc/DelegatingNotification.cs | 2 +- src/JsonRpc/IJsonRpcHandler.cs | 4 +-- src/JsonRpc/IJsonRpcNotificationHandler.cs | 4 +-- src/JsonRpc/IJsonRpcRequestHandler.cs | 4 +-- src/JsonRpc/IResponseRouter.cs | 2 +- src/JsonRpc/JsonRpcServerBase.cs | 4 +-- ...sonRpcServerServiceCollectionExtensions.cs | 3 ++- src/JsonRpc/NoopResponseRouter.cs | 4 +-- src/JsonRpc/NotificationHandler.cs | 8 +++--- src/JsonRpc/RequestHandler.cs | 6 ++--- src/JsonRpc/RequestRouterBase.cs | 2 +- src/JsonRpc/ResponseRouter.cs | 2 +- src/Protocol/AbstractHandlers.Notification.cs | 8 +++--- .../WorkDone/LanguageClientWorkDoneManager.cs | 2 +- .../Features/Client/LogTraceFeature.cs | 2 +- .../Features/Document/CodeLensFeature.cs | 2 +- .../Features/Document/DiagnosticsFeature.cs | 4 +-- .../Features/Document/InlayHintFeature.cs | 4 +-- .../Features/Document/InlineValueFeature.cs | 4 +-- .../Document/NotebookDocumentSyncFeature.cs | 8 +++--- .../Document/PublishDiagnosticsFeature.cs | 2 +- .../Document/SemanticTokensFeature.cs | 4 +-- .../Document/TextDocumentSyncFeature.cs | 10 ++++---- .../Features/FileOperationsFeature.cs | 6 ++--- src/Protocol/Features/General/ExitFeature.cs | 2 +- .../Features/General/InitializedFeature.cs | 2 +- .../Features/General/ShutdownFeature.cs | 2 +- src/Protocol/Features/ProgressFeature.cs | 2 +- .../Features/Server/SetTraceFeature.cs | 2 +- .../Features/Window/LogMessageFeature.cs | 2 +- .../Features/Window/ShowMessageFeature.cs | 2 +- .../Features/Window/TelemetryEventFeature.cs | 2 +- .../Window/WorkDoneProgressFeature.cs | 4 +-- .../DidChangeConfigurationFeature.cs | 2 +- .../Workspace/DidChangeWatchedFilesFeature.cs | 2 +- .../Workspace/WorkspaceFoldersFeature.cs | 2 +- ...ProtocolDelegatingHandlers.Notification.cs | 6 ++--- ...guageProtocolDelegatingHandlers.Request.cs | 6 ++--- src/Protocol/LanguageProtocolProxy.cs | 4 +-- .../Pipelines/ResolveCommandPipeline.cs | 2 +- .../Pipelines/SemanticTokensDeltaPipeline.cs | 4 +-- .../Integration/RecursiveResolutionTests.cs | 6 ++--- test/Generation.Tests/LspFeatureTests.cs | 4 +-- test/JsonRpc.Tests/HandlerResolverTests.cs | 4 +-- .../MediatorTestsNotificationHandler.cs | 2 +- .../MediatorTestsNotificationHandlerOfT.cs | 2 +- .../MediatorTestsRequestHandlerOfTRequest.cs | 2 +- .../JsonRpc.Tests/RecursiveResolutionTests.cs | 6 ++--- test/JsonRpc.Tests/ResponseRouterTests.cs | 6 ++--- .../RecursiveResolutionTests.cs | 8 +++--- .../Matchers/ResolveCommandMatcherTests.cs | 8 +++--- 74 files changed, 156 insertions(+), 150 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index cff9b86ac..7b1702f75 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -53,7 +53,7 @@ - + diff --git a/src/Dap.Protocol/AbstractHandlers.cs b/src/Dap.Protocol/AbstractHandlers.cs index ab80046e9..ada21dc16 100644 --- a/src/Dap.Protocol/AbstractHandlers.cs +++ b/src/Dap.Protocol/AbstractHandlers.cs @@ -15,7 +15,7 @@ public abstract class Request : } public abstract class Notification : IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest { public abstract Task Handle(TParams request, CancellationToken cancellationToken); } diff --git a/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs b/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs index de76a5862..d8e2f1080 100644 --- a/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs +++ b/src/Dap.Protocol/Feature/Events/BreakpointFeature.cs @@ -83,7 +83,7 @@ namespace Events [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record BreakpointEvent : IRequest + public record BreakpointEvent : IRequest { /// /// The reason for the event. diff --git a/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs b/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs index 7d34b09b3..357935e27 100644 --- a/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs +++ b/src/Dap.Protocol/Feature/Events/CapabilitiesFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; @@ -238,7 +238,7 @@ namespace Events [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record CapabilitiesEvent : IRequest + public record CapabilitiesEvent : IRequest { /// /// The set of updated capabilities. diff --git a/src/Dap.Protocol/Feature/Events/ContinuedFeature.cs b/src/Dap.Protocol/Feature/Events/ContinuedFeature.cs index 9c562ecb0..daea5316b 100644 --- a/src/Dap.Protocol/Feature/Events/ContinuedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ContinuedFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -15,7 +15,7 @@ namespace Events GenerateHandlerMethods, GenerateRequestMethods ] - public record ContinuedEvent : IRequest + public record ContinuedEvent : IRequest { /// /// The thread which was continued. diff --git a/src/Dap.Protocol/Feature/Events/ExitedFeature.cs b/src/Dap.Protocol/Feature/Events/ExitedFeature.cs index 6473ee6fe..17f6d5c4e 100644 --- a/src/Dap.Protocol/Feature/Events/ExitedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ExitedFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -14,7 +14,7 @@ namespace Events GenerateHandlerMethods, GenerateRequestMethods ] - public record ExitedEvent : IRequest + public record ExitedEvent : IRequest { /// /// The exit code returned from the debuggee. diff --git a/src/Dap.Protocol/Feature/Events/InitializedFeature.cs b/src/Dap.Protocol/Feature/Events/InitializedFeature.cs index 35fa55a40..0817a3681 100644 --- a/src/Dap.Protocol/Feature/Events/InitializedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/InitializedFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -12,6 +12,6 @@ namespace Events [GenerateHandler(Name = "DebugAdapterInitialized")] [GenerateHandlerMethods] [GenerateRequestMethods] - public record InitializedEvent : IRequest; + public record InitializedEvent : IRequest; } } diff --git a/src/Dap.Protocol/Feature/Events/InvalidatedFeature.cs b/src/Dap.Protocol/Feature/Events/InvalidatedFeature.cs index 372f6e378..e6c1dc4ed 100644 --- a/src/Dap.Protocol/Feature/Events/InvalidatedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/InvalidatedFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; @@ -16,7 +16,7 @@ namespace Events GenerateHandlerMethods, GenerateRequestMethods ] - public record InvalidatedEvent : IRequest + public record InvalidatedEvent : IRequest { /// /// Optional set of logical areas that got invalidated. This property has a diff --git a/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs b/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs index f916d033d..889766f1c 100644 --- a/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs +++ b/src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -13,7 +13,7 @@ namespace Events [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record LoadedSourceEvent : IRequest + public record LoadedSourceEvent : IRequest { /// /// The reason for the event. diff --git a/src/Dap.Protocol/Feature/Events/ModuleFeature.cs b/src/Dap.Protocol/Feature/Events/ModuleFeature.cs index 828af7c13..891e80dbf 100644 --- a/src/Dap.Protocol/Feature/Events/ModuleFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ModuleFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -13,7 +13,7 @@ namespace Events [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record ModuleEvent : IRequest + public record ModuleEvent : IRequest { /// /// The reason for the event. diff --git a/src/Dap.Protocol/Feature/Events/OutputFeature.cs b/src/Dap.Protocol/Feature/Events/OutputFeature.cs index 0a5635579..da96154a6 100644 --- a/src/Dap.Protocol/Feature/Events/OutputFeature.cs +++ b/src/Dap.Protocol/Feature/Events/OutputFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; @@ -15,7 +15,7 @@ namespace Events [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record OutputEvent : IRequest + public record OutputEvent : IRequest { /// /// The output category. If not specified, 'console' is assumed. diff --git a/src/Dap.Protocol/Feature/Events/ProcessFeature.cs b/src/Dap.Protocol/Feature/Events/ProcessFeature.cs index fb5128ac6..a15ab73db 100644 --- a/src/Dap.Protocol/Feature/Events/ProcessFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ProcessFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -13,7 +13,7 @@ namespace Events [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record ProcessEvent : IRequest + public record ProcessEvent : IRequest { /// /// The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js. diff --git a/src/Dap.Protocol/Feature/Events/ProgressFeature.cs b/src/Dap.Protocol/Feature/Events/ProgressFeature.cs index aca27ceaf..5bcbc27c8 100644 --- a/src/Dap.Protocol/Feature/Events/ProgressFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ProgressFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Models; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; @@ -28,7 +28,7 @@ public abstract record ProgressEvent [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record ProgressStartEvent : ProgressEvent, IRequest + public record ProgressStartEvent : ProgressEvent, IRequest { /// /// Mandatory (short) title of the progress reporting. Shown in the UI to describe the long running operation. @@ -63,7 +63,7 @@ public record ProgressStartEvent : ProgressEvent, IRequest [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record ProgressUpdateEvent : ProgressEvent, IRequest + public record ProgressUpdateEvent : ProgressEvent, IRequest { /// /// Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown. @@ -77,6 +77,6 @@ public record ProgressUpdateEvent : ProgressEvent, IRequest [GenerateHandler] [GenerateHandlerMethods] [GenerateRequestMethods] - public record ProgressEndEvent : ProgressEvent, IRequest; + public record ProgressEndEvent : ProgressEvent, IRequest; } } diff --git a/src/Dap.Protocol/Feature/Events/StoppedFeature.cs b/src/Dap.Protocol/Feature/Events/StoppedFeature.cs index fbb5241b2..4582f7e82 100644 --- a/src/Dap.Protocol/Feature/Events/StoppedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/StoppedFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -15,7 +15,7 @@ namespace Events GenerateHandlerMethods, GenerateRequestMethods ] - public record StoppedEvent : IRequest + public record StoppedEvent : IRequest { /// /// The reason for the event. diff --git a/src/Dap.Protocol/Feature/Events/TerminatedFeature.cs b/src/Dap.Protocol/Feature/Events/TerminatedFeature.cs index 731f4bfaf..41f682563 100644 --- a/src/Dap.Protocol/Feature/Events/TerminatedFeature.cs +++ b/src/Dap.Protocol/Feature/Events/TerminatedFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OmniSharp.Extensions.DebugAdapter.Protocol.Serialization; @@ -17,7 +17,7 @@ namespace Events GenerateHandlerMethods, GenerateRequestMethods ] - public record TerminatedEvent : IRequest + public record TerminatedEvent : IRequest { /// /// A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session. diff --git a/src/Dap.Protocol/Feature/Events/ThreadFeature.cs b/src/Dap.Protocol/Feature/Events/ThreadFeature.cs index e31651a16..be6f55f17 100644 --- a/src/Dap.Protocol/Feature/Events/ThreadFeature.cs +++ b/src/Dap.Protocol/Feature/Events/ThreadFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.JsonRpc.Generation; @@ -14,7 +14,7 @@ namespace Events GenerateHandlerMethods, GenerateRequestMethods ] - public record ThreadEvent : IRequest + public record ThreadEvent : IRequest { /// /// The reason for the event. diff --git a/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs b/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs index 5d8f4921e..0eb31f5b7 100644 --- a/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs +++ b/src/Dap.Protocol/IDebugAdapterProtocolProxy.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -39,7 +39,7 @@ public void SendNotification(string method, T @params) _responseRouter.SendNotification(method, @params); } - public void SendNotification(IRequest request) + public void SendNotification(IRequest request) { _responseRouter.SendNotification(request); } diff --git a/src/Dap.Shared/DapResponseRouter.cs b/src/Dap.Shared/DapResponseRouter.cs index a41b86032..3c1bf3d41 100644 --- a/src/Dap.Shared/DapResponseRouter.cs +++ b/src/Dap.Shared/DapResponseRouter.cs @@ -49,7 +49,7 @@ public void SendNotification(string method, T @params) ); } - public void SendNotification(IRequest @params) + public void SendNotification(IRequest @params) { SendNotification(GetMethodName(@params.GetType()), @params); } diff --git a/src/JsonRpc.Generators/Helpers.cs b/src/JsonRpc.Generators/Helpers.cs index 7ce048f46..d4560ea34 100644 --- a/src/JsonRpc.Generators/Helpers.cs +++ b/src/JsonRpc.Generators/Helpers.cs @@ -17,9 +17,10 @@ public static bool IsNotification(TypeDeclarationSyntax symbol) => symbol.BaseList?.Types .Any( z => - z.Type is SimpleNameSyntax and ( - { Identifier: { Text: "IJsonRpcNotificationHandler" }, Arity: 0 or 1 } - or { Identifier: { Text: "IRequest" }, Arity: 0 } + z.Type is SimpleNameSyntax simpleNameSyntax && ( + (simpleNameSyntax.Identifier.Text == "IJsonRpcNotificationHandler" && (simpleNameSyntax.Arity == 0 || simpleNameSyntax.Arity == 1)) + || (simpleNameSyntax.Identifier.Text == "IRequest" && simpleNameSyntax.Arity == 0) + || (simpleNameSyntax.Identifier.Text == "IRequest" && simpleNameSyntax.Arity == 1 && IsUnitRequest(z.Type)) ) ) == true; @@ -27,16 +28,20 @@ public static bool IsRequest(TypeDeclarationSyntax symbol) => symbol.BaseList?.Types .Any( z => - z.Type is SimpleNameSyntax and ( - { Identifier: { Text: "IJsonRpcRequestHandler" }, Arity: 1 or 2 } - or { Identifier: { Text: "ICanBeResolvedHandler" }, Arity: 1 } - or { Identifier: { Text: "IPartialItemRequest" or "IPartialItemWithInitialValueRequest" }, Arity: 2 } - or { Identifier: { Text: "IPartialItemsRequest" or "IPartialItemsWithInitialValueRequest" }, Arity: 2 } - or { Identifier: { Text: "IRequest" }, Arity: 1 } - or { Identifier: { Text: "IJsonRpcRequest" }, Arity: 0 } + z.Type is SimpleNameSyntax simpleNameSyntax && ( + (simpleNameSyntax.Identifier.Text == "IJsonRpcRequestHandler" && (simpleNameSyntax.Arity is 1 or 2)) + || ( simpleNameSyntax.Identifier.Text == "ICanBeResolvedHandler" && simpleNameSyntax.Arity == 1 ) + || ( simpleNameSyntax.Identifier.Text is "IPartialItemRequest" or "IPartialItemWithInitialValueRequest" && simpleNameSyntax.Arity == 2 ) + || ( simpleNameSyntax.Identifier.Text is "IPartialItemsRequest" or "IPartialItemsWithInitialValueRequest" && simpleNameSyntax.Arity == 2 ) + || ( simpleNameSyntax.Identifier.Text == "IRequest" && simpleNameSyntax.Arity == 1 && !IsUnitRequest(simpleNameSyntax)) + || ( simpleNameSyntax.Identifier.Text == "IJsonRpcRequest" && simpleNameSyntax.Arity == 0 ) ) ) == true; + private static bool IsUnitRequest(TypeSyntax type) => + type is GenericNameSyntax gns && gns.Identifier.Text == "IRequest" && gns.TypeArgumentList.Arguments.Count == 1 && + gns.TypeArgumentList.Arguments[0] is SimpleNameSyntax sns && sns.Identifier.Text == "Unit"; + public static ExpressionSyntax GetJsonRpcMethodName(TypeDeclarationSyntax interfaceSyntax) { var methodAttribute = interfaceSyntax.AttributeLists diff --git a/src/JsonRpc.Testing/SettlePipeline.cs b/src/JsonRpc.Testing/SettlePipeline.cs index 2504578a2..7a32a3f1e 100644 --- a/src/JsonRpc.Testing/SettlePipeline.cs +++ b/src/JsonRpc.Testing/SettlePipeline.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Threading; +using System.Threading; using System.Threading.Tasks; using MediatR; @@ -11,7 +11,7 @@ public class SettlePipeline : IPipelineBehavior public SettlePipeline(IRequestSettler settler) => _settler = settler; - async Task IPipelineBehavior.Handle(T request, CancellationToken cancellationToken, RequestHandlerDelegate next) + async Task IPipelineBehavior.Handle(T request, RequestHandlerDelegate next, CancellationToken cancellationToken) { _settler.OnStartRequest(); try diff --git a/src/JsonRpc/CancelParams.cs b/src/JsonRpc/CancelParams.cs index 966dc8dcd..3c0f14a45 100644 --- a/src/JsonRpc/CancelParams.cs +++ b/src/JsonRpc/CancelParams.cs @@ -3,7 +3,7 @@ namespace OmniSharp.Extensions.JsonRpc { [Method(JsonRpcNames.CancelRequest)] - public partial class CancelParams : IRequest + public partial class CancelParams : IRequest { /// /// The request id to cancel. diff --git a/src/JsonRpc/DefaultJsonRpcServerFacade.cs b/src/JsonRpc/DefaultJsonRpcServerFacade.cs index 832446d68..81f6c0a27 100644 --- a/src/JsonRpc/DefaultJsonRpcServerFacade.cs +++ b/src/JsonRpc/DefaultJsonRpcServerFacade.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -30,7 +30,7 @@ public void SendNotification(string method, T @params) _responseRouter.SendNotification(method, @params); } - public void SendNotification(IRequest request) + public void SendNotification(IRequest request) { _responseRouter.SendNotification(request); } diff --git a/src/JsonRpc/DelegatingHandlers.cs b/src/JsonRpc/DelegatingHandlers.cs index aab304889..f410bbfdf 100644 --- a/src/JsonRpc/DelegatingHandlers.cs +++ b/src/JsonRpc/DelegatingHandlers.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Threading; using System.Threading.Tasks; using MediatR; @@ -22,7 +22,7 @@ Task IRequestHandler. public class Request : IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest { private readonly Func _handler; @@ -37,7 +37,7 @@ async Task IRequestHandler. } public class Notification : IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest { private readonly Func _handler; diff --git a/src/JsonRpc/DelegatingNotification.cs b/src/JsonRpc/DelegatingNotification.cs index 04a7b1cc4..37811c589 100644 --- a/src/JsonRpc/DelegatingNotification.cs +++ b/src/JsonRpc/DelegatingNotification.cs @@ -3,7 +3,7 @@ namespace OmniSharp.Extensions.JsonRpc { - public class DelegatingNotification : IRequest + public class DelegatingNotification : IRequest { public DelegatingNotification(object value) => Value = typeof(T) == typeof(Unit) || value is Unit ? new JObject() : JToken.FromObject(value); diff --git a/src/JsonRpc/IJsonRpcHandler.cs b/src/JsonRpc/IJsonRpcHandler.cs index d52448871..5d3d0b804 100644 --- a/src/JsonRpc/IJsonRpcHandler.cs +++ b/src/JsonRpc/IJsonRpcHandler.cs @@ -1,4 +1,4 @@ -ο»Ώusing MediatR; +using MediatR; namespace OmniSharp.Extensions.JsonRpc { @@ -12,7 +12,7 @@ public interface IJsonRpcHandler /// /// Marker interface for source generation to properly know that this IRequest is a real request and not a notification /// - public interface IJsonRpcRequest : IRequest + public interface IJsonRpcRequest : IRequest { } diff --git a/src/JsonRpc/IJsonRpcNotificationHandler.cs b/src/JsonRpc/IJsonRpcNotificationHandler.cs index b9331bb1b..51962ef0d 100644 --- a/src/JsonRpc/IJsonRpcNotificationHandler.cs +++ b/src/JsonRpc/IJsonRpcNotificationHandler.cs @@ -2,8 +2,8 @@ namespace OmniSharp.Extensions.JsonRpc { - public interface IJsonRpcNotificationHandler : IRequestHandler, IJsonRpcHandler - where TNotification : IRequest + public interface IJsonRpcNotificationHandler : IRequestHandler, IJsonRpcHandler + where TNotification : IRequest { } } diff --git a/src/JsonRpc/IJsonRpcRequestHandler.cs b/src/JsonRpc/IJsonRpcRequestHandler.cs index 59f4f3a46..e5fbabd4a 100644 --- a/src/JsonRpc/IJsonRpcRequestHandler.cs +++ b/src/JsonRpc/IJsonRpcRequestHandler.cs @@ -24,8 +24,8 @@ public interface IJsonRpcRequestHandler : IRequestHandle /// /// /// - public interface IJsonRpcRequestHandler : IRequestHandler, IJsonRpcHandler - where TRequest : IRequest + public interface IJsonRpcRequestHandler : IRequestHandler, IJsonRpcHandler + where TRequest : IRequest { } } diff --git a/src/JsonRpc/IResponseRouter.cs b/src/JsonRpc/IResponseRouter.cs index 6fa2ba15a..a66d1a6d1 100644 --- a/src/JsonRpc/IResponseRouter.cs +++ b/src/JsonRpc/IResponseRouter.cs @@ -10,7 +10,7 @@ public interface IResponseRouter { void SendNotification(string method); void SendNotification(string method, T @params); - void SendNotification(IRequest request); + void SendNotification(IRequest request); IResponseRouterReturns SendRequest(string method, T @params); IResponseRouterReturns SendRequest(string method); Task SendRequest(IRequest request, CancellationToken cancellationToken); diff --git a/src/JsonRpc/JsonRpcServerBase.cs b/src/JsonRpc/JsonRpcServerBase.cs index 2a5aeed03..ab7ea00b0 100644 --- a/src/JsonRpc/JsonRpcServerBase.cs +++ b/src/JsonRpc/JsonRpcServerBase.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using MediatR; @@ -27,7 +27,7 @@ public void SendNotification(string method, T @params) ResponseRouter.SendNotification(method, @params); } - public void SendNotification(IRequest @params) + public void SendNotification(IRequest @params) { ResponseRouter.SendNotification(@params); } diff --git a/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs b/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs index c24bb27d2..8a11cce2f 100644 --- a/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs +++ b/src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs @@ -100,7 +100,8 @@ internal static IContainer AddJsonRpcMediatR(this IContainer container) { container.RegisterMany(new[] { typeof(IMediator).GetAssembly() }, Registrator.Interfaces, Reuse.ScopedOrSingleton); container.RegisterMany(Reuse.Scoped); - container.RegisterDelegate(context => context.Resolve, Reuse.ScopedOrSingleton); + // Select the desired constructor + container.Register(made: Made.Of(() => new Mediator(Arg.Of()))); container.Register(typeof(IRequestHandler<,>), typeof(RequestHandler<,>)); container.Register(typeof(IRequestHandler<,>), typeof(RequestHandlerDecorator<,>), setup: Setup.Decorator); diff --git a/src/JsonRpc/NoopResponseRouter.cs b/src/JsonRpc/NoopResponseRouter.cs index 7816d40d1..a2c3e89c5 100644 --- a/src/JsonRpc/NoopResponseRouter.cs +++ b/src/JsonRpc/NoopResponseRouter.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using MediatR; @@ -25,7 +25,7 @@ public void SendNotification(string method, T @params) { } - public void SendNotification(IRequest request) + public void SendNotification(IRequest request) { } diff --git a/src/JsonRpc/NotificationHandler.cs b/src/JsonRpc/NotificationHandler.cs index 54f7228cb..e23ba9bc8 100644 --- a/src/JsonRpc/NotificationHandler.cs +++ b/src/JsonRpc/NotificationHandler.cs @@ -8,15 +8,15 @@ namespace OmniSharp.Extensions.JsonRpc public static class NotificationHandler { public static DelegatingHandlers.Notification For(Action handler) - where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); + where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); public static DelegatingHandlers.Notification For(Func handler) - where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); + where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); public static DelegatingHandlers.Notification For(Action handler) - where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); + where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); public static DelegatingHandlers.Notification For(Func handler) - where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); + where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); } } diff --git a/src/JsonRpc/RequestHandler.cs b/src/JsonRpc/RequestHandler.cs index 42684005b..2ba0a7c0a 100644 --- a/src/JsonRpc/RequestHandler.cs +++ b/src/JsonRpc/RequestHandler.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Threading; using System.Threading.Tasks; using MediatR; @@ -14,9 +14,9 @@ public static DelegatingHandlers.Request For where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); public static DelegatingHandlers.Request For(Func handler) - where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); + where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); public static DelegatingHandlers.Request For(Func handler) - where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); + where TParams : IRequest => new(HandlerAdapter.Adapt(handler)); } } diff --git a/src/JsonRpc/RequestRouterBase.cs b/src/JsonRpc/RequestRouterBase.cs index dcfafde60..51e652744 100644 --- a/src/JsonRpc/RequestRouterBase.cs +++ b/src/JsonRpc/RequestRouterBase.cs @@ -216,7 +216,7 @@ public static Task HandleRequest(IMediator mediator, IHandlerDescriptor descript } private static Task SendRequest(IMediator mediator, T request, CancellationToken token) - where T : IRequest => + where T : IRequest => mediator.Send(request, token); private static Task SendRequest(IMediator mediator, T request, CancellationToken token) diff --git a/src/JsonRpc/ResponseRouter.cs b/src/JsonRpc/ResponseRouter.cs index d66afc528..e64df4ef9 100644 --- a/src/JsonRpc/ResponseRouter.cs +++ b/src/JsonRpc/ResponseRouter.cs @@ -48,7 +48,7 @@ public void SendNotification(string method, T @params) ); } - public void SendNotification(IRequest @params) + public void SendNotification(IRequest @params) { SendNotification(GetMethodName(@params.GetType()), @params); } diff --git a/src/Protocol/AbstractHandlers.Notification.cs b/src/Protocol/AbstractHandlers.Notification.cs index 89b2c4f36..e0142a3cb 100644 --- a/src/Protocol/AbstractHandlers.Notification.cs +++ b/src/Protocol/AbstractHandlers.Notification.cs @@ -17,7 +17,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol public static partial class AbstractHandlers { public abstract class Notification : IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest { public abstract Task Handle(TParams request, CancellationToken cancellationToken); } @@ -25,7 +25,7 @@ public abstract class Notification : IJsonRpcRequestHandler public abstract class Notification : Base, IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest where TRegistrationOptions : class, new() where TCapability : ICapability { @@ -35,7 +35,7 @@ public abstract class Notification : public abstract class Notification : Base, IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest where TRegistrationOptions : class, new() { public abstract Task Handle(TParams request, CancellationToken cancellationToken); @@ -44,7 +44,7 @@ public abstract class Notification : public abstract class NotificationCapability : BaseCapability, IJsonRpcRequestHandler - where TParams : IRequest + where TParams : IRequest where TCapability : ICapability { public abstract Task Handle(TParams request, CancellationToken cancellationToken); diff --git a/src/Protocol/Client/WorkDone/LanguageClientWorkDoneManager.cs b/src/Protocol/Client/WorkDone/LanguageClientWorkDoneManager.cs index fd7e2c1d5..9d2656314 100644 --- a/src/Protocol/Client/WorkDone/LanguageClientWorkDoneManager.cs +++ b/src/Protocol/Client/WorkDone/LanguageClientWorkDoneManager.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Collections.Concurrent; using System.Reactive.Disposables; using System.Threading; diff --git a/src/Protocol/Features/Client/LogTraceFeature.cs b/src/Protocol/Features/Client/LogTraceFeature.cs index 7c033130a..2b9b99215 100644 --- a/src/Protocol/Features/Client/LogTraceFeature.cs +++ b/src/Protocol/Features/Client/LogTraceFeature.cs @@ -14,7 +14,7 @@ namespace Models [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Client")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IClientLanguageServer), typeof(ILanguageServer))] - public record LogTraceParams : IRequest + public record LogTraceParams : IRequest { /// /// The message to be logged. diff --git a/src/Protocol/Features/Document/CodeLensFeature.cs b/src/Protocol/Features/Document/CodeLensFeature.cs index fa9af0f21..6c6aac133 100644 --- a/src/Protocol/Features/Document/CodeLensFeature.cs +++ b/src/Protocol/Features/Document/CodeLensFeature.cs @@ -118,7 +118,7 @@ public override StaticOptions Convert(CodeLensRegistrationOptions source) [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(CodeLensWorkspaceClientCapabilities))] - public partial record CodeLensRefreshParams : IRequest; + public partial record CodeLensRefreshParams : IRequest; } namespace Client.Capabilities diff --git a/src/Protocol/Features/Document/DiagnosticsFeature.cs b/src/Protocol/Features/Document/DiagnosticsFeature.cs index 1a79b7a70..3fcbae608 100644 --- a/src/Protocol/Features/Document/DiagnosticsFeature.cs +++ b/src/Protocol/Features/Document/DiagnosticsFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Collections.Immutable; +using System.Collections.Immutable; using MediatR; using Newtonsoft.Json; using OmniSharp.Extensions.JsonRpc; @@ -73,7 +73,7 @@ public partial record WorkspaceDiagnosticParams : IWorkDoneProgressParams, [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(CodeLensWorkspaceClientCapabilities))] - public partial record DiagnosticRefreshParams : IRequest; + public partial record DiagnosticRefreshParams : IRequest; public interface IDiagnosticReport { diff --git a/src/Protocol/Features/Document/InlayHintFeature.cs b/src/Protocol/Features/Document/InlayHintFeature.cs index ef8168687..02e6e4b8e 100644 --- a/src/Protocol/Features/Document/InlayHintFeature.cs +++ b/src/Protocol/Features/Document/InlayHintFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.Diagnostics; using MediatR; using Newtonsoft.Json; @@ -272,7 +272,7 @@ public enum InlayHintKind [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(InlayHintWorkspaceClientCapabilities))] - public partial record InlayHintRefreshParams : IRequest; + public partial record InlayHintRefreshParams : IRequest; [GenerateRegistrationOptions(nameof(ServerCapabilities.InlayHintProvider))] [RegistrationOptionsConverter(typeof(InlayHintRegistrationOptionsConverter))] diff --git a/src/Protocol/Features/Document/InlineValueFeature.cs b/src/Protocol/Features/Document/InlineValueFeature.cs index b904f531c..cc5922a55 100644 --- a/src/Protocol/Features/Document/InlineValueFeature.cs +++ b/src/Protocol/Features/Document/InlineValueFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System.Diagnostics; +using System.Diagnostics; using MediatR; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -70,7 +70,7 @@ public partial record InlineValueContext [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(InlineValueWorkspaceClientCapabilities))] - public partial record InlineValueRefreshParams : IRequest; + public partial record InlineValueRefreshParams : IRequest; [JsonConverter(typeof(Converter))] public abstract partial record InlineValueBase diff --git a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs index 6d4fd2430..d759bd8f3 100644 --- a/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/NotebookDocumentSyncFeature.cs @@ -37,7 +37,7 @@ namespace Models [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] [Capability(typeof(NotebookDocumentSyncClientCapabilities))] - public partial class DidOpenNotebookDocumentParams : IRequest + public partial class DidOpenNotebookDocumentParams : IRequest { /// /// The notebook document that got opened. @@ -63,7 +63,7 @@ public partial class DidOpenNotebookDocumentParams : IRequest [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] [Capability(typeof(NotebookDocumentSyncClientCapabilities))] - public partial record DidChangeNotebookDocumentParams : IRequest + public partial record DidChangeNotebookDocumentParams : IRequest { /// /// The notebook document that did change. The version number points @@ -94,7 +94,7 @@ public partial record DidChangeNotebookDocumentParams : IRequest [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] [Capability(typeof(NotebookDocumentSyncClientCapabilities))] - public partial class DidSaveNotebookDocumentParams : INotebookDocumentIdentifierParams, IRequest + public partial class DidSaveNotebookDocumentParams : INotebookDocumentIdentifierParams, IRequest { /// /// The notebook document that got saved. @@ -109,7 +109,7 @@ public partial class DidSaveNotebookDocumentParams : INotebookDocumentIdentifier [GenerateRequestMethods(typeof(INotebookDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(NotebookDocumentSyncOptions))] [Capability(typeof(NotebookDocumentSyncClientCapabilities))] - public partial class DidCloseNotebookDocumentParams : INotebookDocumentIdentifierParams, IRequest + public partial class DidCloseNotebookDocumentParams : INotebookDocumentIdentifierParams, IRequest { /// /// The notebook document that got closed. diff --git a/src/Protocol/Features/Document/PublishDiagnosticsFeature.cs b/src/Protocol/Features/Document/PublishDiagnosticsFeature.cs index 2bce7efd0..15ed763c9 100644 --- a/src/Protocol/Features/Document/PublishDiagnosticsFeature.cs +++ b/src/Protocol/Features/Document/PublishDiagnosticsFeature.cs @@ -20,7 +20,7 @@ namespace Models GenerateRequestMethods(typeof(ITextDocumentLanguageServer), typeof(ILanguageServer)) ] [Capability(typeof(PublishDiagnosticsCapability))] - public record PublishDiagnosticsParams : IRequest + public record PublishDiagnosticsParams : IRequest { /// /// The URI for which diagnostic information is reported. diff --git a/src/Protocol/Features/Document/SemanticTokensFeature.cs b/src/Protocol/Features/Document/SemanticTokensFeature.cs index dc651b2ed..40d6d5b36 100644 --- a/src/Protocol/Features/Document/SemanticTokensFeature.cs +++ b/src/Protocol/Features/Document/SemanticTokensFeature.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; @@ -99,7 +99,7 @@ public partial record SemanticTokensRangeParams : IWorkDoneProgressParams, IText [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(SemanticTokensWorkspaceCapability))] - public partial record SemanticTokensRefreshParams : IRequest; + public partial record SemanticTokensRefreshParams : IRequest; public interface ISemanticTokenResult { diff --git a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs index bc2d14057..ce06f1a1c 100644 --- a/src/Protocol/Features/Document/TextDocumentSyncFeature.cs +++ b/src/Protocol/Features/Document/TextDocumentSyncFeature.cs @@ -30,7 +30,7 @@ namespace Models [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentChangeRegistrationOptions))] [Capability(typeof(TextSynchronizationCapability))] - public partial record DidChangeTextDocumentParams : IRequest + public partial record DidChangeTextDocumentParams : IRequest { /// /// The document that did change. The version number points @@ -111,7 +111,7 @@ public record TextDocumentEdit [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentOpenRegistrationOptions))] [Capability(typeof(TextSynchronizationCapability))] - public partial class DidOpenTextDocumentParams : IRequest + public partial class DidOpenTextDocumentParams : IRequest { /// /// The document that was opened. @@ -131,7 +131,7 @@ public partial class TextDocumentOpenRegistrationOptions : ITextDocumentRegistra [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentCloseRegistrationOptions))] [Capability(typeof(TextSynchronizationCapability))] - public partial class DidCloseTextDocumentParams : ITextDocumentIdentifierParams, IRequest + public partial class DidCloseTextDocumentParams : ITextDocumentIdentifierParams, IRequest { /// /// The document that was closed. @@ -151,7 +151,7 @@ public partial class TextDocumentCloseRegistrationOptions : ITextDocumentRegistr [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumentSaveRegistrationOptions))] [Capability(typeof(TextSynchronizationCapability))] - public partial class DidSaveTextDocumentParams : ITextDocumentIdentifierParams, IRequest + public partial class DidSaveTextDocumentParams : ITextDocumentIdentifierParams, IRequest { /// /// The document that was saved. @@ -515,7 +515,7 @@ public static implicit operator TextDocumentCloseRegistrationOptions(TextDocumen [GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(TextDocumenWillSaveRegistrationOptions))] [Capability(typeof(TextSynchronizationCapability))] - public partial class WillSaveTextDocumentParams : IRequest + public partial class WillSaveTextDocumentParams : IRequest { /// /// The document that will be saved. diff --git a/src/Protocol/Features/FileOperationsFeature.cs b/src/Protocol/Features/FileOperationsFeature.cs index ed64a6cab..25604bdf1 100644 --- a/src/Protocol/Features/FileOperationsFeature.cs +++ b/src/Protocol/Features/FileOperationsFeature.cs @@ -48,7 +48,7 @@ public abstract record FileOperationItem [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(DidCreateFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidCreateFilesParams : FileOperationsParams, IRequest + public partial record DidCreateFilesParams : FileOperationsParams, IRequest { public static implicit operator WillCreateFilesParams(DidCreateFilesParams @params) { @@ -83,7 +83,7 @@ public partial record FileCreate : FileOperationItem; [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(DidRenameFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidRenameFilesParams : RenameFilesOperationParams, IRequest + public partial record DidRenameFilesParams : RenameFilesOperationParams, IRequest { public static implicit operator WillRenameFilesParams(DidRenameFilesParams @params) { @@ -146,7 +146,7 @@ public partial record FileRename [GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(DidDeleteFilesRegistrationOptions))] [Capability(typeof(FileOperationsWorkspaceClientCapabilities))] - public partial record DidDeleteFilesParams : FileOperationsParams, IRequest + public partial record DidDeleteFilesParams : FileOperationsParams, IRequest { public static implicit operator WillDeleteFilesParams(DidDeleteFilesParams @params) { diff --git a/src/Protocol/Features/General/ExitFeature.cs b/src/Protocol/Features/General/ExitFeature.cs index 1da73948e..0c5c1fa0d 100644 --- a/src/Protocol/Features/General/ExitFeature.cs +++ b/src/Protocol/Features/General/ExitFeature.cs @@ -12,7 +12,7 @@ namespace Models [Serial] [Method(GeneralNames.Exit, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.General"), GenerateHandlerMethods, GenerateRequestMethods(typeof(ILanguageClient))] - public partial record ExitParams : IRequest + public partial record ExitParams : IRequest { public static ExitParams Instance { get; } = new ExitParams(); } diff --git a/src/Protocol/Features/General/InitializedFeature.cs b/src/Protocol/Features/General/InitializedFeature.cs index fdd35713a..d4d7d2cc4 100644 --- a/src/Protocol/Features/General/InitializedFeature.cs +++ b/src/Protocol/Features/General/InitializedFeature.cs @@ -14,6 +14,6 @@ namespace Models [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.General", Name = "LanguageProtocolInitialized")] [GenerateHandlerMethods(typeof(ILanguageServerRegistry))] [GenerateRequestMethods(typeof(ILanguageClient))] - public partial record InitializedParams : IRequest; + public partial record InitializedParams : IRequest; } } diff --git a/src/Protocol/Features/General/ShutdownFeature.cs b/src/Protocol/Features/General/ShutdownFeature.cs index 18ea4420c..e0c65ff95 100644 --- a/src/Protocol/Features/General/ShutdownFeature.cs +++ b/src/Protocol/Features/General/ShutdownFeature.cs @@ -14,7 +14,7 @@ namespace Models [Serial] [Method(GeneralNames.Shutdown, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.General"), GenerateHandlerMethods, GenerateRequestMethods(typeof(ILanguageClient))] - public partial record ShutdownParams : IRequest + public partial record ShutdownParams : IRequest { public static ShutdownParams Instance { get; } = new(); } diff --git a/src/Protocol/Features/ProgressFeature.cs b/src/Protocol/Features/ProgressFeature.cs index ee48a6187..80763e980 100644 --- a/src/Protocol/Features/ProgressFeature.cs +++ b/src/Protocol/Features/ProgressFeature.cs @@ -24,7 +24,7 @@ namespace Models [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IGeneralLanguageClient), typeof(ILanguageClient), typeof(IGeneralLanguageServer), typeof(ILanguageServer))] - public record ProgressParams : IRequest + public record ProgressParams : IRequest { public static ProgressParams Create(ProgressToken token, T value, JsonSerializer jsonSerializer) { diff --git a/src/Protocol/Features/Server/SetTraceFeature.cs b/src/Protocol/Features/Server/SetTraceFeature.cs index b3c6ce27e..33bec4b41 100644 --- a/src/Protocol/Features/Server/SetTraceFeature.cs +++ b/src/Protocol/Features/Server/SetTraceFeature.cs @@ -11,7 +11,7 @@ namespace Models [Parallel] [Method(GeneralNames.SetTrace, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Server"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IClientLanguageClient), typeof(ILanguageClient))] - public record SetTraceParams : IRequest + public record SetTraceParams : IRequest { /// /// The new value that should be assigned to the trace setting. diff --git a/src/Protocol/Features/Window/LogMessageFeature.cs b/src/Protocol/Features/Window/LogMessageFeature.cs index 2fe2edfcd..e9ec0da08 100644 --- a/src/Protocol/Features/Window/LogMessageFeature.cs +++ b/src/Protocol/Features/Window/LogMessageFeature.cs @@ -14,7 +14,7 @@ namespace Models [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] - public record LogMessageParams : IRequest + public record LogMessageParams : IRequest { /// /// The message type. See {@link MessageType} diff --git a/src/Protocol/Features/Window/ShowMessageFeature.cs b/src/Protocol/Features/Window/ShowMessageFeature.cs index f116c56dd..d913520ee 100644 --- a/src/Protocol/Features/Window/ShowMessageFeature.cs +++ b/src/Protocol/Features/Window/ShowMessageFeature.cs @@ -17,7 +17,7 @@ namespace Models [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window")] [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] - public record ShowMessageParams : IRequest + public record ShowMessageParams : IRequest { /// /// The message type. See {@link MessageType}. diff --git a/src/Protocol/Features/Window/TelemetryEventFeature.cs b/src/Protocol/Features/Window/TelemetryEventFeature.cs index 632b04b11..59415fee9 100644 --- a/src/Protocol/Features/Window/TelemetryEventFeature.cs +++ b/src/Protocol/Features/Window/TelemetryEventFeature.cs @@ -17,7 +17,7 @@ namespace Models GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer)) ] - public record TelemetryEventParams : IRequest + public record TelemetryEventParams : IRequest { [JsonExtensionData] public IDictionary ExtensionData { get; init; } = new Dictionary(); } diff --git a/src/Protocol/Features/Window/WorkDoneProgressFeature.cs b/src/Protocol/Features/Window/WorkDoneProgressFeature.cs index 79aed087e..10a552cb4 100644 --- a/src/Protocol/Features/Window/WorkDoneProgressFeature.cs +++ b/src/Protocol/Features/Window/WorkDoneProgressFeature.cs @@ -15,7 +15,7 @@ namespace Models [Method(WindowNames.WorkDoneProgressCreate, Direction.ServerToClient)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageServer), typeof(ILanguageServer))] - public partial record WorkDoneProgressCreateParams : IRequest + public partial record WorkDoneProgressCreateParams : IRequest { /// /// The token to be used to report progress. @@ -27,7 +27,7 @@ public partial record WorkDoneProgressCreateParams : IRequest [Method(WindowNames.WorkDoneProgressCancel, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Window"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWindowLanguageClient), typeof(ILanguageClient))] - public partial record WorkDoneProgressCancelParams : IRequest + public partial record WorkDoneProgressCancelParams : IRequest { /// /// The token to be used to report progress. diff --git a/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs b/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs index 83468c6b1..951981b79 100644 --- a/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs +++ b/src/Protocol/Features/Workspace/DidChangeConfigurationFeature.cs @@ -15,7 +15,7 @@ namespace Models [Method(WorkspaceNames.DidChangeConfiguration, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [Capability(typeof(DidChangeConfigurationCapability))] - public partial record DidChangeConfigurationParams : IRequest + public partial record DidChangeConfigurationParams : IRequest { /// /// The actual changed settings diff --git a/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs b/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs index 7e02f041f..178f87ab3 100644 --- a/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs +++ b/src/Protocol/Features/Workspace/DidChangeWatchedFilesFeature.cs @@ -15,7 +15,7 @@ namespace Models [Method(WorkspaceNames.DidChangeWatchedFiles, Direction.ClientToServer)] [GenerateHandler("OmniSharp.Extensions.LanguageServer.Protocol.Workspace"), GenerateHandlerMethods, GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient))] [RegistrationOptions(typeof(DidChangeWatchedFilesRegistrationOptions)), Capability(typeof(DidChangeWatchedFilesCapability))] - public partial record DidChangeWatchedFilesParams : IRequest + public partial record DidChangeWatchedFilesParams : IRequest { /// /// The actual file events. diff --git a/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs b/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs index 13b49b0df..2d61dc571 100644 --- a/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs +++ b/src/Protocol/Features/Workspace/WorkspaceFoldersFeature.cs @@ -21,7 +21,7 @@ namespace Models GenerateRequestMethods(typeof(IWorkspaceLanguageClient), typeof(ILanguageClient)) ] [RegistrationOptions(typeof(DidChangeWorkspaceFolderRegistrationOptions))] - public partial record DidChangeWorkspaceFoldersParams : IRequest + public partial record DidChangeWorkspaceFoldersParams : IRequest { /// /// The actual workspace folder change event. diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs index ca1b7a124..4dd5b3e4a 100644 --- a/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.Notification.cs @@ -20,7 +20,7 @@ public sealed class Notification : AbstractHandlers.Base, IJsonRpcNotificationHandler, ICanBeIdentifiedHandler - where TParams : IRequest + where TParams : IRequest where TRegistrationOptions : class, new() where TCapability : ICapability { @@ -59,7 +59,7 @@ public sealed class Notification : AbstractHandlers.Base, IJsonRpcNotificationHandler, ICanBeIdentifiedHandler - where TParams : IRequest + where TParams : IRequest where TRegistrationOptions : class, new() { private readonly Func _handler; @@ -92,7 +92,7 @@ public sealed class NotificationCapability : AbstractHandlers.BaseCapability, IJsonRpcNotificationHandler, ICanBeIdentifiedHandler - where TParams : IRequest + where TParams : IRequest where TCapability : ICapability { private readonly Func _handler; diff --git a/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs b/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs index b269ffe4f..ed4bd923a 100644 --- a/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs +++ b/src/Protocol/LanguageProtocolDelegatingHandlers.Request.cs @@ -58,7 +58,7 @@ public sealed class Request : AbstractHandlers.Base, IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IRequest + where TParams : IRequest where TRegistrationOptions : class, new() where TCapability : ICapability { @@ -136,7 +136,7 @@ public sealed class RequestRegistration : AbstractHandlers.Base, IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IRequest + where TParams : IRequest where TRegistrationOptions : class, new() { private readonly Func _handler; @@ -202,7 +202,7 @@ public sealed class RequestCapability : AbstractHandlers.BaseCapability, IJsonRpcRequestHandler, ICanBeIdentifiedHandler - where TParams : IRequest + where TParams : IRequest where TCapability : ICapability { private readonly Func _handler; diff --git a/src/Protocol/LanguageProtocolProxy.cs b/src/Protocol/LanguageProtocolProxy.cs index df5ca6584..f81be7c8b 100644 --- a/src/Protocol/LanguageProtocolProxy.cs +++ b/src/Protocol/LanguageProtocolProxy.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -43,7 +43,7 @@ public void SendNotification(string method, T @params) _responseRouter.SendNotification(method, @params); } - public void SendNotification(IRequest request) + public void SendNotification(IRequest request) { _responseRouter.SendNotification(request); } diff --git a/src/Server/Pipelines/ResolveCommandPipeline.cs b/src/Server/Pipelines/ResolveCommandPipeline.cs index af075aa89..9bfb76ec3 100644 --- a/src/Server/Pipelines/ResolveCommandPipeline.cs +++ b/src/Server/Pipelines/ResolveCommandPipeline.cs @@ -24,7 +24,7 @@ public ResolveCommandPipeline(IRequestContext context, ILogger Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { var response = await next().ConfigureAwait(false); cancellationToken.ThrowIfCancellationRequested(); diff --git a/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs b/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs index 377e430a9..19af5ce44 100644 --- a/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs +++ b/src/Server/Pipelines/SemanticTokensDeltaPipeline.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -10,7 +10,7 @@ namespace OmniSharp.Extensions.LanguageServer.Server.Pipelines internal class SemanticTokensDeltaPipeline : IPipelineBehavior where TRequest : notnull { - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { if (request is SemanticTokensParams semanticTokensParams) { diff --git a/test/Dap.Tests/Integration/RecursiveResolutionTests.cs b/test/Dap.Tests/Integration/RecursiveResolutionTests.cs index 9449dad99..d53eb04cc 100644 --- a/test/Dap.Tests/Integration/RecursiveResolutionTests.cs +++ b/test/Dap.Tests/Integration/RecursiveResolutionTests.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Threading; using System.Threading.Tasks; using DryIoc; @@ -185,7 +185,7 @@ public enum Side } [Method(nameof(ClassRequest))] - public class ClassRequest : IRequest + public class ClassRequest : IRequest { } @@ -204,7 +204,7 @@ public ClassHandler(T jsonRpcServer) } [Method(nameof(InterfaceRequest))] - public class InterfaceRequest : IRequest + public class InterfaceRequest : IRequest { } diff --git a/test/Generation.Tests/LspFeatureTests.cs b/test/Generation.Tests/LspFeatureTests.cs index 7dd0834d9..2090084fe 100644 --- a/test/Generation.Tests/LspFeatureTests.cs +++ b/test/Generation.Tests/LspFeatureTests.cs @@ -39,7 +39,7 @@ namespace Lsp.Tests.Integration.Fixtures GenerateRequestMethods(typeof(ILanguageClient)) ] [RegistrationOptions(typeof(UnitTestRegistrationOptions)), Capability(typeof(UnitTestCapability))] - public partial class UnitTest : IRequest + public partial class UnitTest : IRequest { public string Name { get; set; } = null!; } @@ -587,7 +587,7 @@ public override StaticOptions Convert(SubLensRegistrationOptions source) [GenerateHandlerMethods] [GenerateRequestMethods(typeof(IWorkspaceLanguageServer), typeof(ILanguageServer))] [Capability(typeof(SubLensWorkspaceClientCapabilities))] - public partial record SubLensRefreshParams : IRequest; + public partial record SubLensRefreshParams : IRequest; } namespace Client.Capabilities diff --git a/test/JsonRpc.Tests/HandlerResolverTests.cs b/test/JsonRpc.Tests/HandlerResolverTests.cs index d9d706558..1a89492b1 100644 --- a/test/JsonRpc.Tests/HandlerResolverTests.cs +++ b/test/JsonRpc.Tests/HandlerResolverTests.cs @@ -11,7 +11,7 @@ namespace JsonRpc.Tests { public class HandlerResolverTests { - public class Request : IRequest, IRequest + public class Request : IRequest, IRequest { } @@ -19,7 +19,7 @@ public class Response { } - public class Notification : IRequest + public class Notification : IRequest { } diff --git a/test/JsonRpc.Tests/MediatorTestsNotificationHandler.cs b/test/JsonRpc.Tests/MediatorTestsNotificationHandler.cs index f492e853f..d7645a665 100644 --- a/test/JsonRpc.Tests/MediatorTestsNotificationHandler.cs +++ b/test/JsonRpc.Tests/MediatorTestsNotificationHandler.cs @@ -14,7 +14,7 @@ namespace JsonRpc.Tests public class MediatorTestsNotificationHandler : AutoTestBase { [Method("exit")] - public class ExitParams : IRequest + public class ExitParams : IRequest { } diff --git a/test/JsonRpc.Tests/MediatorTestsNotificationHandlerOfT.cs b/test/JsonRpc.Tests/MediatorTestsNotificationHandlerOfT.cs index bffd51124..a1026694a 100644 --- a/test/JsonRpc.Tests/MediatorTestsNotificationHandlerOfT.cs +++ b/test/JsonRpc.Tests/MediatorTestsNotificationHandlerOfT.cs @@ -21,7 +21,7 @@ public interface ICancelRequestHandler : IJsonRpcNotificationHandler { public object Id { get; set; } = null!; } diff --git a/test/JsonRpc.Tests/MediatorTestsRequestHandlerOfTRequest.cs b/test/JsonRpc.Tests/MediatorTestsRequestHandlerOfTRequest.cs index 00ec86b50..231dacbb6 100644 --- a/test/JsonRpc.Tests/MediatorTestsRequestHandlerOfTRequest.cs +++ b/test/JsonRpc.Tests/MediatorTestsRequestHandlerOfTRequest.cs @@ -21,7 +21,7 @@ public interface IExecuteCommandHandler : IJsonRpcRequestHandler { public string Command { get; set; } = null!; } diff --git a/test/JsonRpc.Tests/RecursiveResolutionTests.cs b/test/JsonRpc.Tests/RecursiveResolutionTests.cs index 0769ad859..bf11de4cc 100644 --- a/test/JsonRpc.Tests/RecursiveResolutionTests.cs +++ b/test/JsonRpc.Tests/RecursiveResolutionTests.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Threading; using System.Threading.Tasks; using DryIoc; @@ -110,7 +110,7 @@ public async Task Server_Facade_Can_Injected_Into_Handler_During_Creation_Using_ } [Method(nameof(ClassRequest))] - public class ClassRequest : IRequest + public class ClassRequest : IRequest { } @@ -132,7 +132,7 @@ public Task Handle(ClassRequest classRequest, CancellationToken cancellati } [Method(nameof(InterfaceRequest))] - public class InterfaceRequest : IRequest + public class InterfaceRequest : IRequest { } diff --git a/test/JsonRpc.Tests/ResponseRouterTests.cs b/test/JsonRpc.Tests/ResponseRouterTests.cs index d2ec2b1a2..1612cdf66 100644 --- a/test/JsonRpc.Tests/ResponseRouterTests.cs +++ b/test/JsonRpc.Tests/ResponseRouterTests.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -82,12 +82,12 @@ public class ItemResult } [Method("unit")] - public class UnitParams : IRequest + public class UnitParams : IRequest { } [Method("notification")] - public class NotificationParams : IRequest + public class NotificationParams : IRequest { } } diff --git a/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs b/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs index 7cc1a14f1..d86852174 100644 --- a/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs +++ b/test/Lsp.Integration.Tests/RecursiveResolutionTests.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -348,7 +348,7 @@ public enum Side } [Method(nameof(ClassRequest))] - public class ClassRequest : IRequest + public class ClassRequest : IRequest { } @@ -370,7 +370,7 @@ public Task Handle(ClassRequest classRequest, CancellationToken cancellati } [Method(nameof(InterfaceRequest))] - public class InterfaceRequest : IRequest + public class InterfaceRequest : IRequest { } @@ -392,7 +392,7 @@ public Task Handle(InterfaceRequest request, CancellationToken cancellatio } [Method(nameof(NestedRequest))] - public class NestedRequest : IRequest + public class NestedRequest : IRequest { } diff --git a/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs b/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs index 3633d7007..b2b86c212 100644 --- a/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs +++ b/test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs @@ -83,7 +83,7 @@ public async Task Should_Not_Throw_Given_Another_Descriptor() ); // When - Func a = async () => await handlerMatcher.Handle(new CodeLensParams(), CancellationToken.None, () => Task.FromResult(new CodeLensContainer())); + Func a = async () => await handlerMatcher.Handle(new CodeLensParams(), () => Task.FromResult(new CodeLensContainer()), CancellationToken.None); await a.Should().NotThrowAsync(); } @@ -272,7 +272,7 @@ public async Task Should_Update_CompletionItems_With_HandlerType() ( list is IEnumerable ).Should().BeTrue(); // When - var response = await handlerMatcher.Handle(new CompletionParams(), CancellationToken.None, () => Task.FromResult(list)); + var response = await handlerMatcher.Handle(new CompletionParams(), () => Task.FromResult(list), CancellationToken.None); // Then response.Should().BeEquivalentTo(list, x => x.UsingStructuralRecordEquality()); @@ -323,7 +323,7 @@ public async Task Should_Update_CodeLensContainer_With_HandlerType() ( list is IEnumerable ).Should().BeTrue(); // When - var response = await handlerMatcher.Handle(new CodeLensParams(), CancellationToken.None, () => Task.FromResult(list)); + var response = await handlerMatcher.Handle(new CodeLensParams(), () => Task.FromResult(list), CancellationToken.None); // Then response.Should().BeEquivalentTo(list, x => x.UsingStructuralRecordEquality()); @@ -370,7 +370,7 @@ public async Task Should_Update_CodeLens_Removing_HandlerType() }; // When - var response = await handlerMatcher.Handle(item, CancellationToken.None, () => Task.FromResult(item)); + var response = await handlerMatcher.Handle(item, () => Task.FromResult(item), CancellationToken.None); // Then response.Should().BeEquivalentTo(item, x => x.UsingStructuralRecordEquality()); From 3acc97849d107c24d0911c6e595f7a1a04a0eaa9 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 30 Jan 2025 09:53:12 -0800 Subject: [PATCH 561/647] Use actions/upload-artifact@v4 --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3223fff9..860a75e82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,9 +136,9 @@ jobs: working-directory: 'vscode-testextension' - name: 🏺 Publish coverage data if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'coverage' + name: 'coverage-${{ matrix.os }}' path: 'coverage/' - name: 🐿 Publish Coverage if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]') @@ -147,26 +147,26 @@ jobs: name: 'actions-${{ matrix.os }}' - name: 🏺 Publish logs if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'logs' + name: 'logs-${{ matrix.os }}' path: 'artifacts/logs/' - name: 🏺 Publish test data if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'test data' + name: 'test data-${{ matrix.os }}' path: 'artifacts/test/' - name: 🏺 Publish NuGet Packages if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'nuget' + name: 'nuget-${{ matrix.os }}' path: 'artifacts/nuget/' - name: 🏺 Publish Documentation - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'docs' + name: 'docs-${{ matrix.os }}' path: 'artifacts/docs/' Publish: needs: From f84189e7b534535e997f8683b407f194b2695c89 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 30 Jan 2025 10:16:51 -0800 Subject: [PATCH 562/647] Use actions/download-artifacts@v4 --- .github/workflows/publish-nuget.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 4aae24726..ea5aa7864 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -23,9 +23,11 @@ jobs: with: nuget-version: '5.x' - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: nuget + path: nuget + pattern: nuget-* + merge-multiple: true - name: nuget.org # continue-on-error: true From 072b0db1bb7e9cf3d72925c56f8fc2f935522ffd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:57:05 +0000 Subject: [PATCH 563/647] chore(deps): update dependency prettier to v3.4.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b98ab66d..ee4e5cbca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", "lint-staged": "15.4.3", - "prettier": "3.3.3" + "prettier": "3.4.2" } }, "node_modules/@prettier/plugin-xml": { @@ -578,9 +578,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index c1f9ded0c..5b988f36a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", "lint-staged": "15.4.3", - "prettier": "3.3.3" + "prettier": "3.4.2" }, "scripts": { "prepare": "husky install" From e6e002fbf7dad73a37fe62f1c8b56c083caab789 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:59:32 +0000 Subject: [PATCH 564/647] chore(deps): update dependency mocha to v11 --- vscode-testextension/package-lock.json | 138 +++++++++++++++++++------ vscode-testextension/package.json | 2 +- 2 files changed, 106 insertions(+), 34 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 5d99294d1..1408b69c9 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -19,7 +19,7 @@ "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", "glob": "^11.0.0", - "mocha": "^10.2.0", + "mocha": "^11.0.0", "source-map-support": "^0.5.21", "tmp-promise": "^3.0.3", "typescript": "^5.2.2" @@ -475,14 +475,18 @@ } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/color-convert": { @@ -1065,9 +1069,9 @@ } }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.1.0.tgz", + "integrity": "sha512-8uJR5RTC2NgpY3GrYcgpZrsEd9zKbPDpob1RezyR2upGHRQtHWofmzTMzTMSV6dru3tj5Ukt0+Vnq1qhFEEwAg==", "dev": true, "license": "MIT", "dependencies": { @@ -1078,7 +1082,7 @@ "diff": "^5.2.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", - "glob": "^8.1.0", + "glob": "^10.4.5", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", @@ -1088,8 +1092,8 @@ "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", "yargs-unparser": "^2.0.0" }, "bin": { @@ -1097,25 +1101,91 @@ "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/mocha/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/mocha/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1817,6 +1887,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -1863,31 +1934,32 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, + "license": "MIT", "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-unparser": { diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index 812027f0f..c6f8f7935 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -53,7 +53,7 @@ "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", "glob": "^11.0.0", - "mocha": "^10.2.0", + "mocha": "^11.0.0", "source-map-support": "^0.5.21", "tmp-promise": "^3.0.3", "typescript": "^5.2.2" From 94bb43cc02f85912ff240a7702ab468eeb3d94be Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 30 Jan 2025 15:34:40 -0800 Subject: [PATCH 565/647] Fix ci publish --- .github/workflows/ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 860a75e82..d8d08e2be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,10 +168,18 @@ jobs: with: name: 'docs-${{ matrix.os }}' path: 'artifacts/docs/' + Merge: + runs-on: ubuntu-latest + needs: build + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: nuget + pattern: nuget-* Publish: - needs: - - Build - uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.3 + needs: Merge + uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.15 secrets: RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}' RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}' From 6b34abea4c3cd1c46816558e1066c8763ac59c37 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 00:25:44 +0000 Subject: [PATCH 566/647] chore(deps): update actions/setup-dotnet action to v4.3.0 (#1440) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8d08e2be..c85a41cd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,19 +91,19 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v4.2.0 + uses: actions/setup-dotnet@v4.3.0 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v4.2.0 + uses: actions/setup-dotnet@v4.3.0 with: dotnet-version: '6.0.x' - name: πŸ”¨ Use .NET Core 8.0 SDK - uses: actions/setup-dotnet@v4.2.0 + uses: actions/setup-dotnet@v4.3.0 with: dotnet-version: '8.0.x' - name: πŸ”¨ Use .NET Core 9.0 SDK - uses: actions/setup-dotnet@v4.2.0 + uses: actions/setup-dotnet@v4.3.0 with: dotnet-version: '9.0.x' - name: 🎁 dotnet tool restore From 1d7f76b9118b86a46c4af5290bc5e39c866e25cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 08:22:29 +0000 Subject: [PATCH 567/647] chore(deps): update rocket surgery other --- .github/workflows/close-milestone.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/update-milestone.yml | 2 +- Directory.Packages.props | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 6d70c169f..c0b3da18c 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -41,7 +41,7 @@ jobs: # move any issues to that milestone in the event the release is renamed - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.3 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15 with: default-label: 'mysterious' github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }} diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 1e083ade2..3ead49020 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -44,7 +44,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.3 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 078e14e8f..eb3d037f9 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -50,7 +50,7 @@ jobs: continue-on-error: true - name: sync milestones - uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.3 + uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15 with: default-label: 'mysterious' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Directory.Packages.props b/Directory.Packages.props index 81ea57846..6fb20cffc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + @@ -24,7 +24,7 @@ - + From 0fc882bae4fa231fa920ec02589848f3f48ffd7f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 00:23:03 -0800 Subject: [PATCH 568/647] Update GitVersion configuration --- GitVersion.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitVersion.yml b/GitVersion.yml index d1aa3a074..44a0d9e85 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -2,4 +2,4 @@ assembly-versioning-scheme: MajorMinorPatch mode: ContinuousDeployment branches: master: - tag: alpha + label: alpha From c4011fa29736d0e54d4f1360d476bd0cd05e79b7 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 00:29:13 -0800 Subject: [PATCH 569/647] Update GitVersion Configuration --- GitVersion.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/GitVersion.yml b/GitVersion.yml index 44a0d9e85..af194b0dc 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -2,4 +2,5 @@ assembly-versioning-scheme: MajorMinorPatch mode: ContinuousDeployment branches: master: + regex: ^master$|^main$ label: alpha From 6eb6f6fa9fe52dedcc56124eb9a36c5cd2d1f4ea Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 00:36:16 -0800 Subject: [PATCH 570/647] Update GitVersion configuration --- GitVersion.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index af194b0dc..12a8ef6e4 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,6 +1,9 @@ -assembly-versioning-scheme: MajorMinorPatch -mode: ContinuousDeployment +workflow: GitHubFlow/v1 +semantic-version-format: Loose + branches: - master: - regex: ^master$|^main$ + main: + mode: ContinuousDeployment label: alpha + source-branches: + - master \ No newline at end of file From c7589fd4d3c4837407037ac8d34f7e007af6e64b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 00:50:14 -0800 Subject: [PATCH 571/647] Update GitVersion configuration --- GitVersion.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 12a8ef6e4..ce103c93a 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -4,6 +4,4 @@ semantic-version-format: Loose branches: main: mode: ContinuousDeployment - label: alpha - source-branches: - - master \ No newline at end of file + label: alpha \ No newline at end of file From fde7e20380f04aea415e1070d2b94dc2910d108b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 00:58:33 -0800 Subject: [PATCH 572/647] Remove GitVersion.Tool from dotnet-tools config --- .config/dotnet-tools.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index befb91c30..1f19a0dd5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -8,12 +8,6 @@ "dotnet-outdated" ] }, - "gitversion.tool": { - "version": "6.1.0", - "commands": [ - "dotnet-gitversion" - ] - }, "dotnet-reportgenerator-globaltool": { "version": "5.4.3", "commands": [ @@ -38,12 +32,6 @@ "jb" ] }, - "dotnet-format": { - "version": "5.1.250801", - "commands": [ - "dotnet-format" - ] - }, "nukeeper": { "version": "0.35.0", "commands": [ From d14396f924523191b12e5e468865cc62022d3f77 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 01:03:54 -0800 Subject: [PATCH 573/647] Include dotnet-tools in NuGet cache hash --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c85a41cd6..c0b994439 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: uses: actions/cache@v4 with: path: '${{ github.workspace }}/.nuget/packages' - key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}" + key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK From 8c873bceaeb6b9bb9af71964ddd356e9c71ba0a3 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 01:07:19 -0800 Subject: [PATCH 574/647] Update NuGet Cache hash --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0b994439..ff37cdd4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: uses: actions/cache@v4 with: path: '${{ github.workspace }}/.nuget/packages' - key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" + key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" restore-keys: | ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK From a8d6ae6cee250229b807cd977098836cc57ac409 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 01:22:25 -0800 Subject: [PATCH 575/647] Update NuGet Cache --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff37cdd4a..9e77e0c0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,13 +83,12 @@ jobs: with: clean: 'false' fetch-depth: '0' - - name: NuGet Cache + - name: Restore NuGet Cache + id: restore-nuget-cache uses: actions/cache@v4 with: path: '${{ github.workspace }}/.nuget/packages' key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" - restore-keys: | - ${{ runner.os }}-nuget- - name: πŸ”¨ Use .NET Core 3.1 SDK uses: actions/setup-dotnet@v4.3.0 with: @@ -113,6 +112,12 @@ jobs: id: restore run: | dotnet nuke Restore --skip + - name: Update NuGet Cache + if: always() && steps.restore-nuget-cacheoutputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + key: ${{ steps.restore-nuget-cache.outputs.cache-primary-key }} + path: '${{ github.workspace }}/.nuget/packages' - name: βš™ Build id: build run: | From 884f0e676e1f10cb7e61b04db4f8ebbdc5b0c8c8 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 01:25:36 -0800 Subject: [PATCH 576/647] Fix NuGet Cache --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e77e0c0e..2ba144f19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: run: | dotnet nuke Restore --skip - name: Update NuGet Cache - if: always() && steps.restore-nuget-cacheoutputs.cache-hit != 'true' + if: always() && steps.restore-nuget-cache.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: key: ${{ steps.restore-nuget-cache.outputs.cache-primary-key }} From dbd3b8a46dc9b5b3f63d9416516c2556d69b38a2 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 31 Jan 2025 01:42:36 -0800 Subject: [PATCH 577/647] Fix NuGet caching --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ba144f19..f4e527ddb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: fetch-depth: '0' - name: Restore NuGet Cache id: restore-nuget-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: '${{ github.workspace }}/.nuget/packages' key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" @@ -116,7 +116,7 @@ jobs: if: always() && steps.restore-nuget-cache.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: - key: ${{ steps.restore-nuget-cache.outputs.cache-primary-key }} + key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" path: '${{ github.workspace }}/.nuget/packages' - name: βš™ Build id: build From 3e86861a7709eff60911f2f300ca789535e90caa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:43:17 +0000 Subject: [PATCH 578/647] chore(deps): update verify --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6fb20cffc..a36781e3d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,8 +40,8 @@ - - + + From 544cf0ddf993bd9fda98d7ec9cf07e20e8468732 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:43:22 +0000 Subject: [PATCH 579/647] chore(deps): update dependency fluentassertions to v8 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6fb20cffc..982264e16 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 5afb8d6bb48907f5e340fc2d1915949dc0c16e19 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Fri, 31 Jan 2025 19:54:22 +0100 Subject: [PATCH 580/647] Fix FluentAssertions after update --- test/Dap.Tests/FoundationTests.cs | 8 ++++---- .../FluentAssertionsExtensions.cs | 2 +- test/Lsp.Tests/FluentAssertionsExtensions.cs | 2 +- test/Lsp.Tests/FoundationTests.cs | 18 +++++++++--------- test/Lsp.Tests/Models/PositionTests.cs | 8 ++++---- test/TestingUtils/RecordExtensions.cs | 6 +++--- .../RecordStructuralEqualityEquivalencyStep.cs | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/Dap.Tests/FoundationTests.cs b/test/Dap.Tests/FoundationTests.cs index f592e298a..a73c92d20 100644 --- a/test/Dap.Tests/FoundationTests.cs +++ b/test/Dap.Tests/FoundationTests.cs @@ -249,7 +249,7 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection( extensionClass.GetMethods(BindingFlags.Static | BindingFlags.Public) .Where(z => z.Name == onMethodName) .Where(z => item.matcher(z.GetParameters()[0])) - .Should().HaveCountGreaterOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a registry implementation for {item.type}"); + .Should().HaveCountGreaterThanOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a registry implementation for {item.type}"); } foreach (var item in expectedRequestHandlers) @@ -257,7 +257,7 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection( extensionClass.GetMethods(BindingFlags.Static | BindingFlags.Public) .Where(z => z.Name == sendMethodName) .Where(z => item.matcher(z.GetParameters()[0])) - .Should().HaveCountGreaterOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a request implementation for {item.type}"); + .Should().HaveCountGreaterThanOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a request implementation for {item.type}"); } { @@ -268,7 +268,7 @@ Func ForParameter(int index, Func m) return info => m(info.GetParameters()[index]); } - var containsCancellationToken = ForParameter(1, info => info.ParameterType.GetGenericArguments().Reverse().Take(2).Any(x => x == typeof(CancellationToken))); + var containsCancellationToken = ForParameter(1, info => info.ParameterType.GetGenericArguments().AsEnumerable().Reverse().Take(2).Any(x => x == typeof(CancellationToken))); var returnType = descriptor.HasResponseType ? typeof(Task<>).MakeGenericType(descriptor.ResponseType!) : typeof(Task); var returns = ForParameter(1, info => info.ParameterType.GetGenericArguments().LastOrDefault() == returnType); var isAction = ForParameter(1, info => info.ParameterType.Name.StartsWith(nameof(Action))); @@ -291,7 +291,7 @@ Func ForParameter(int index, Func m) } { var matcher = new MethodMatcher(sendMethodRegistries, descriptor, extensionClass, sendMethodName); - Func containsCancellationToken = info => info.GetParameters().Reverse().Take(2).Any(x => x.ParameterType == typeof(CancellationToken)); + Func containsCancellationToken = info => info.GetParameters().AsEnumerable().Reverse().Take(2).Any(x => x.ParameterType == typeof(CancellationToken)); var returnType = descriptor.HasResponseType ? typeof(Task<>).MakeGenericType(descriptor.ResponseType!) : typeof(Task); Func returns = info => info.ReturnType == returnType; Func isAction = info => info.ReturnType.Name == "Void"; diff --git a/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs b/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs index cbb682d93..49c450c92 100644 --- a/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs +++ b/test/Lsp.Integration.Tests/FluentAssertionsExtensions.cs @@ -9,7 +9,7 @@ namespace Lsp.Integration.Tests { public static class FluentAssertionsExtensions { - public static EquivalencyAssertionOptions ConfigureForSupports(this EquivalencyAssertionOptions options, ILogger? logger = null) + public static EquivalencyOptions ConfigureForSupports(this EquivalencyOptions options, ILogger? logger = null) { return options .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) diff --git a/test/Lsp.Tests/FluentAssertionsExtensions.cs b/test/Lsp.Tests/FluentAssertionsExtensions.cs index 7378b1acc..74afac78d 100644 --- a/test/Lsp.Tests/FluentAssertionsExtensions.cs +++ b/test/Lsp.Tests/FluentAssertionsExtensions.cs @@ -9,7 +9,7 @@ namespace Lsp.Tests { public static class FluentAssertionsExtensions { - public static EquivalencyAssertionOptions ConfigureForSupports(this EquivalencyAssertionOptions options, ILogger? logger = null) + public static EquivalencyOptions ConfigureForSupports(this EquivalencyOptions options, ILogger? logger = null) { return options .WithTracing(new TraceWriter(logger ?? NullLogger.Instance)) diff --git a/test/Lsp.Tests/FoundationTests.cs b/test/Lsp.Tests/FoundationTests.cs index a46838a9c..74d40e816 100644 --- a/test/Lsp.Tests/FoundationTests.cs +++ b/test/Lsp.Tests/FoundationTests.cs @@ -1,4 +1,4 @@ -ο»Ώusing System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO.Pipelines; @@ -262,13 +262,13 @@ public void HandlersShouldExtensionMethodClassWithMethods( { registries .Where(z => typeof(ILanguageClientProxy).IsAssignableFrom(z) || typeof(ILanguageServerRegistry).IsAssignableFrom(z)) - .Should().HaveCountGreaterOrEqualTo( + .Should().HaveCountGreaterThanOrEqualTo( 1, $"{descriptor.HandlerType.FullName} there should be methods for both handing the event and sending the event" ); registries .Where(z => typeof(ILanguageServerProxy).IsAssignableFrom(z) || typeof(ILanguageClientRegistry).IsAssignableFrom(z)) - .Should().HaveCountGreaterOrEqualTo( + .Should().HaveCountGreaterThanOrEqualTo( 1, $"{descriptor.HandlerType.FullName} there should be methods for both handing the event and sending the event" ); @@ -277,7 +277,7 @@ public void HandlersShouldExtensionMethodClassWithMethods( { registries .Where(z => typeof(ILanguageServerProxy).IsAssignableFrom(z) || typeof(ILanguageClientRegistry).IsAssignableFrom(z)) - .Should().HaveCountGreaterOrEqualTo( + .Should().HaveCountGreaterThanOrEqualTo( 1, $"{descriptor.HandlerType.FullName} there should be methods for both handing the event and sending the event" ); @@ -289,7 +289,7 @@ public void HandlersShouldExtensionMethodClassWithMethods( { registries .Where(z => typeof(ILanguageClientProxy).IsAssignableFrom(z) || typeof(ILanguageServerRegistry).IsAssignableFrom(z)) - .Should().HaveCountGreaterOrEqualTo( + .Should().HaveCountGreaterThanOrEqualTo( 1, $"{descriptor.HandlerType.FullName} there should be methods for both handing the event and sending the event" ); @@ -341,7 +341,7 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection( extensionClass.GetMethods(BindingFlags.Static | BindingFlags.Public) .Where(z => z.Name == onMethodName) .Where(z => item.matcher(z.GetParameters()[0])) - .Should().HaveCountGreaterOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a registry implementation for {item.type}"); + .Should().HaveCountGreaterThanOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a registry implementation for {item.type}"); } foreach (var item in expectedRequestHandlers) @@ -349,7 +349,7 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection( extensionClass.GetMethods(BindingFlags.Static | BindingFlags.Public) .Where(z => z.Name == sendMethodName) .Where(z => item.matcher(z.GetParameters()[0])) - .Should().HaveCountGreaterOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a request implementation for {item.type}"); + .Should().HaveCountGreaterThanOrEqualTo(1, $"{descriptor.HandlerType.FullName} is missing a request implementation for {item.type}"); } } @@ -386,7 +386,7 @@ Func ForAnyParameter(Func m) } var containsCancellationToken = ForAnyParameter( - info => info.ParameterType.GetGenericArguments().Reverse().Take(2).Any(x => x == typeof(CancellationToken)) + info => info.ParameterType.GetGenericArguments().AsEnumerable().Reverse().Take(2).Any(x => x == typeof(CancellationToken)) ); var returnType = descriptor.HasResponseType ? typeof(Task<>).MakeGenericType(descriptor.ResponseType!) : typeof(Task); var returns = ForAnyParameter(info => info.ParameterType.GetGenericArguments().LastOrDefault() == returnType); @@ -517,7 +517,7 @@ Func ForAnyParameter(Func m) { var matcher = new MethodMatcher(sendMethodRegistries, descriptor, extensionClass); Func containsCancellationToken = - info => info.GetParameters().Reverse().Take(2).Any(x => x.ParameterType == typeof(CancellationToken)); + info => info.GetParameters().AsEnumerable().Reverse().Take(2).Any(x => x.ParameterType == typeof(CancellationToken)); var returnType = descriptor.HasResponseType ? typeof(Task<>).MakeGenericType(descriptor.ResponseType!) : typeof(Task); Func returns = info => info.ReturnType == returnType; Func isAction = info => info.ReturnType.Name == "Void"; diff --git a/test/Lsp.Tests/Models/PositionTests.cs b/test/Lsp.Tests/Models/PositionTests.cs index 180b0e8fd..81a525675 100644 --- a/test/Lsp.Tests/Models/PositionTests.cs +++ b/test/Lsp.Tests/Models/PositionTests.cs @@ -34,8 +34,8 @@ public void Is_Sortable_By_Character() a.CompareTo(c).Should().Be(0); - a.Should().BeLessOrEqualTo(c); - a.Should().BeGreaterOrEqualTo(c); + a.Should().BeLessThanOrEqualTo(c); + a.Should().BeGreaterThanOrEqualTo(c); } [Fact] @@ -50,8 +50,8 @@ public void Is_Sortable_By_Line() a.CompareTo(c).Should().Be(0); - a.Should().BeLessOrEqualTo(c); - a.Should().BeGreaterOrEqualTo(c); + a.Should().BeLessThanOrEqualTo(c); + a.Should().BeGreaterThanOrEqualTo(c); } [Fact] diff --git a/test/TestingUtils/RecordExtensions.cs b/test/TestingUtils/RecordExtensions.cs index a3c574d35..7e185f4c4 100644 --- a/test/TestingUtils/RecordExtensions.cs +++ b/test/TestingUtils/RecordExtensions.cs @@ -1,12 +1,12 @@ -ο»Ώusing FluentAssertions.Equivalency; +using FluentAssertions.Equivalency; namespace TestingUtils { public static class RecordExtensions { - public static EquivalencyAssertionOptions UsingStructuralRecordEquality(this EquivalencyAssertionOptions options) + public static EquivalencyOptions UsingStructuralRecordEquality(this EquivalencyOptions options) { return options.Using(new RecordStructuralEqualityEquivalencyStep()); } } -} \ No newline at end of file +} diff --git a/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs b/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs index c874e8499..5ebd63621 100644 --- a/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs +++ b/test/TestingUtils/RecordStructuralEqualityEquivalencyStep.cs @@ -5,9 +5,9 @@ namespace TestingUtils { public class RecordStructuralEqualityEquivalencyStep : StructuralEqualityEquivalencyStep, IEquivalencyStep { - EquivalencyResult IEquivalencyStep.Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator) + EquivalencyResult IEquivalencyStep.Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency nestedValidator) { - return comparands.Subject?.GetType()?.GetMethod("$") != null ? EquivalencyResult.AssertionCompleted : EquivalencyResult.ContinueWithNext; + return comparands.Subject?.GetType()?.GetMethod("$") != null ? EquivalencyResult.EquivalencyProven : EquivalencyResult.ContinueWithNext; } } } From ceb12ccf063e125d007515ad921548d420b20895 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:58:43 +0000 Subject: [PATCH 581/647] chore(deps): update dependency serilog.extensions.logging to v9 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6fb20cffc..f31a1c200 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From 3157694da4ca8659c91299aa2b1d45b68f9f6186 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sat, 1 Feb 2025 02:56:01 +0100 Subject: [PATCH 582/647] Update dotnet dependencies to version 9.0 --- Directory.Packages.props | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f31a1c200..25442562e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,13 +28,13 @@ - - - - - - - + + + + + + + @@ -50,8 +50,8 @@ - - + + From 0a6e02f8ce4f890f33915e2fbcd4444dd0f1a379 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Sun, 2 Feb 2025 00:36:07 +0100 Subject: [PATCH 583/647] Fix verify update --- ...nostic_If_Missing_Information.verified.txt | 46 +++++++++++++------ ...irection_DidChangeTextHandler.verified.txt | 22 ++++++--- ..._Infers_Direction_ExitHandler.verified.txt | 22 ++++++--- ...Requests_And_Infers_Direction.verified.txt | 22 ++++++--- 4 files changed, 80 insertions(+), 32 deletions(-) diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt index 3a81787e4..8ca4b6b8d 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Should_Report_Diagnostic_If_Missing_Information.verified.txt @@ -1,24 +1,42 @@ ο»Ώ{ Diagnostics: [ { - Id: JRPC1003, - Title: Cannot infer request router(s), - Severity: Error, - WarningLevel: 0, - Location: Test0.cs: (15,66)-(15,88), - MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Location: /* +{ + [Serial, Method(GeneralNames.Exit, Direction.ClientToServer), GenerateHandlerMethods, GenerateRequestMethods] + ^^^^^^^^^^^^^^^^^^^^^^ + public interface IExitHandler : IJsonRpcNotificationHandler +*/ + Test0.cs: (15,66)-(15,88), Message: Could not infer the request router(s) to use, please specify the target interface(s)., - Category: JsonRPC + Severity: Error, + Descriptor: { + Id: JRPC1003, + Title: Cannot infer request router(s), + MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Category: JsonRPC, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: JRPC1003, - Title: Cannot infer request router(s), - Severity: Error, - WarningLevel: 0, - Location: Test0.cs: (15,90)-(15,112), - MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Location: /* +{ + [Serial, Method(GeneralNames.Exit, Direction.ClientToServer), GenerateHandlerMethods, GenerateRequestMethods] + ^^^^^^^^^^^^^^^^^^^^^^ + public interface IExitHandler : IJsonRpcNotificationHandler +*/ + Test0.cs: (15,90)-(15,112), Message: Could not infer the request router(s) to use, please specify the target interface(s)., - Category: JsonRPC + Severity: Error, + Descriptor: { + Id: JRPC1003, + Title: Cannot infer request router(s), + MessageFormat: Could not infer the request router(s) to use, please specify the target interface(s)., + Category: JsonRPC, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt index 64ea0be1b..b90ac0de2 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_DidChangeTextHandler.verified.txt @@ -1,14 +1,24 @@ ο»Ώ{ Diagnostics: [ { - Id: JRPC1001, - Title: No Response Router Provided, + Location: /* + [Serial, Method(TextDocumentNames.DidChange, Direction.ClientToServer), GenerateHandlerMethods, GenerateRequestMethods] + public interface IDidChangeTextDocumentHandler : IJsonRpcNotificationHandler, + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + IRegistration +*/ + Test0.cs: (17,21)-(17,50), + Message: No Response Router Provided for handler {0}, defaulting to {1}., Severity: Info, WarningLevel: 1, - Location: Test0.cs: (17,21)-(17,50), - MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., - Message: No Response Router Provided for handler {0}, defaulting to {1}., - Category: JsonRPC + Descriptor: { + Id: JRPC1001, + Title: No Response Router Provided, + MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., + Category: JsonRPC, + DefaultSeverity: Info, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt index 03ae9d9ee..b5ad868da 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Notifications_And_Infers_Direction_ExitHandler.verified.txt @@ -1,14 +1,24 @@ ο»Ώ{ Diagnostics: [ { - Id: JRPC1001, - Title: No Response Router Provided, + Location: /* + [Serial, Method(GeneralNames.Exit, Direction.ClientToServer), GenerateHandlerMethods, GenerateRequestMethods] + public interface IExitHandler : IJsonRpcNotificationHandler + ^^^^^^^^^^^^ + { +*/ + Test0.cs: (16,21)-(16,33), + Message: No Response Router Provided for handler {0}, defaulting to {1}., Severity: Info, WarningLevel: 1, - Location: Test0.cs: (16,21)-(16,33), - MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., - Message: No Response Router Provided for handler {0}, defaulting to {1}., - Category: JsonRPC + Descriptor: { + Id: JRPC1001, + Title: No Response Router Provided, + MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., + Category: JsonRPC, + DefaultSeverity: Info, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt index e7f3821c1..695992307 100644 --- a/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt +++ b/test/Generation.Tests/snapshots/JsonRpcGenerationTests.Supports_Generating_Requests_And_Infers_Direction.verified.txt @@ -1,14 +1,24 @@ ο»Ώ{ Diagnostics: [ { - Id: JRPC1001, - Title: No Response Router Provided, + Location: /* + [Parallel, Method(TextDocumentNames.Definition, Direction.ClientToServer), GenerateHandlerMethods, GenerateRequestMethods, Obsolete("This is obsolete")] + public interface IDefinitionHandler : IJsonRpcRequestHandler, IRegistration { } + ^^^^^^^^^^^^^^^^^^ +} +*/ + Test0.cs: (17,21)-(17,39), + Message: No Response Router Provided for handler {0}, defaulting to {1}., Severity: Info, WarningLevel: 1, - Location: Test0.cs: (17,21)-(17,39), - MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., - Message: No Response Router Provided for handler {0}, defaulting to {1}., - Category: JsonRPC + Descriptor: { + Id: JRPC1001, + Title: No Response Router Provided, + MessageFormat: No Response Router Provided for handler {0}, defaulting to {1}., + Category: JsonRPC, + DefaultSeverity: Info, + IsEnabledByDefault: true + } } ] } \ No newline at end of file From b52061d2fb39292437f7d34425a4c74b222d3dcf Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 3 Feb 2025 15:15:32 -0800 Subject: [PATCH 584/647] Update GH Action tool versions --- .github/workflows/close-milestone.yml | 5 +++-- .github/workflows/draft-release.yml | 3 ++- .github/workflows/publish-nuget.yml | 2 +- .github/workflows/update-milestone.yml | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index c0b3da18c..0cff1b3c8 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -19,12 +19,13 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v3.1.11 with: - versionSpec: '5.x' + versionSpec: '6.0.x' + preferLatestVersion: true - name: Install GitReleaseManager uses: gittools/actions/gitreleasemanager/setup@v3.1.11 with: - versionSpec: '0.15.x' + versionSpec: '0.18.x' - name: Use GitVersion id: gitversion diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 3ead49020..7f595dca9 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -29,7 +29,8 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v3.1.11 with: - versionSpec: '5.x' + versionSpec: '6.0.x' + preferLatestVersion: true - name: Use GitVersion id: gitversion diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index ea5aa7864..184655771 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -21,7 +21,7 @@ jobs: - uses: nuget/setup-nuget@v2 with: - nuget-version: '5.x' + nuget-version: '6.x' - uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index eb3d037f9..8aa210765 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -27,13 +27,14 @@ jobs: if: ${{ github.event.action == 'opened' }} uses: gittools/actions/gitversion/setup@v3.1.11 with: - versionSpec: '5.x' + versionSpec: '6.0.x' + preferLatestVersion: true - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} uses: gittools/actions/gitreleasemanager/setup@v3.1.11 with: - versionSpec: '0.15.x' + versionSpec: '0.18.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} From 249f5db8511f006d7dd15e03954ebb0cfbf2db31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:51:36 +0000 Subject: [PATCH 585/647] chore(deps): update crazy-max/ghaction-github-labeler action to v5.2.0 (#1445) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 59cb233a8..be527bb99 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,7 +20,7 @@ jobs: - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v5.1.0 + uses: crazy-max/ghaction-github-labeler@v5.2.0 with: yaml-file: .github/labels.yml skip-delete: false From 72a12070e409297082b6ae2d783f988ed8b86a01 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 01:25:41 +0000 Subject: [PATCH 586/647] chore(deps): update dependency @types/node to v20.17.17 (#1447) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 47c82851f..8a370c5aa 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.16.tgz", - "integrity": "sha512-vOTpLduLkZXePLxHiHsBLp98mHGnl8RptV4YAO3HfKO5UHjDvySGbxKtpYfy8Sx5+WKcgc45qNreJJRVM3L6mw==", + "version": "20.17.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.17.tgz", + "integrity": "sha512-/WndGO4kIfMicEQLTi/mDANUu/iVUhT7KboZPdEqqHQ4aTS+3qT3U5gIqWDFV+XouorjfgGqvKILJeHhuQgFYg==", "dev": true, "license": "MIT", "dependencies": { From f5fc419986ad24588c7f8c6f55bc762f066cc6ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 01:37:35 +0000 Subject: [PATCH 587/647] chore(deps): update dependency @types/node to v22 --- vscode-testextension/package-lock.json | 16 ++++++++-------- vscode-testextension/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 8a370c5aa..875d2c298 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -15,7 +15,7 @@ "devDependencies": { "@types/glob": "^8.1.0", "@types/mocha": "^10.0.2", - "@types/node": "^20.8.0", + "@types/node": "^22.0.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", "glob": "^11.0.0", @@ -158,13 +158,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.17.tgz", - "integrity": "sha512-/WndGO4kIfMicEQLTi/mDANUu/iVUhT7KboZPdEqqHQ4aTS+3qT3U5gIqWDFV+XouorjfgGqvKILJeHhuQgFYg==", + "version": "22.13.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", + "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.20.0" } }, "node_modules/@types/vscode": { @@ -1813,9 +1813,9 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, "license": "MIT" }, diff --git a/vscode-testextension/package.json b/vscode-testextension/package.json index c6f8f7935..bd0344768 100644 --- a/vscode-testextension/package.json +++ b/vscode-testextension/package.json @@ -49,7 +49,7 @@ "devDependencies": { "@types/glob": "^8.1.0", "@types/mocha": "^10.0.2", - "@types/node": "^20.8.0", + "@types/node": "^22.0.0", "@types/vscode": "^1.82.0", "@vscode/test-electron": "^2.3.4", "glob": "^11.0.0", From 2dc2f021bf33803ab4d7ca2cd7352536745258e7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 10:16:22 +0000 Subject: [PATCH 588/647] chore(deps): update dependency xunit.runner.visualstudio to 3.0.2 (#1451) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e9b05339d..8ed784dc8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,7 +37,7 @@ - + From 0094cfa2e8313a4f2ea19686cfedb88569a41d4c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:21:50 +0000 Subject: [PATCH 589/647] chore(deps): update dependency verify.xunit to 28.10.1 (#1448) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8ed784dc8..d67c66440 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From b5caaad88bcea400e59276f3c2e212a17f76ac1d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 17:10:14 +0000 Subject: [PATCH 590/647] chore(deps): update jetbrains to 2024.3.5 (#1452) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1f19a0dd5..ad37251db 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -27,7 +27,7 @@ ] }, "jetbrains.resharper.globaltools": { - "version": "2024.3.4", + "version": "2024.3.5", "commands": [ "jb" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index d67c66440..c25895fb7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 54a7113f49cd8666907679245a7af1f9d89071e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 08:47:36 +0000 Subject: [PATCH 591/647] chore(deps): update dependency microsoft.net.test.sdk to 17.13.0 (#1455) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c25895fb7..00c17207f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,7 +36,7 @@ - + From 70cadd56359e780b5937ce5dd195c95722e2309a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 13:08:39 +0000 Subject: [PATCH 592/647] chore(deps): update reportgenerator to 5.4.4 (#1454) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ad37251db..109b0cded 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.4.3", + "version": "5.4.4", "commands": [ "reportgenerator" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 00c17207f..d54ec7bea 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 734b115b2c023443e81821c0f41eaffb4de287c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 03:13:28 +0000 Subject: [PATCH 593/647] chore(deps): update dependency prettier to v3.5.3 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee4e5cbca..b3c015c05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", "lint-staged": "15.4.3", - "prettier": "3.4.2" + "prettier": "3.5.3" } }, "node_modules/@prettier/plugin-xml": { @@ -578,9 +578,9 @@ } }, "node_modules/prettier": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", - "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 5b988f36a..dc9f42493 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "@prettier/plugin-xml": "3.4.1", "husky": "9.1.7", "lint-staged": "15.4.3", - "prettier": "3.4.2" + "prettier": "3.5.3" }, "scripts": { "prepare": "husky install" From 930d890b776b1973bbae1ddd42c9ca229f57388b Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Thu, 6 Mar 2025 23:41:29 +0100 Subject: [PATCH 594/647] Update dotnet tools --- .config/dotnet-tools.json | 86 +++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 109b0cded..6bf3738a1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,42 +1,48 @@ { - "version": 1, - "isRoot": true, - "tools": { - "dotnet-outdated": { - "version": "2.11.0", - "commands": [ - "dotnet-outdated" - ] - }, - "dotnet-reportgenerator-globaltool": { - "version": "5.4.4", - "commands": [ - "reportgenerator" - ] - }, - "nuke.globaltool": { - "version": "9.0.4", - "commands": [ - "nuke" - ] - }, - "codecov.tool": { - "version": "1.13.0", - "commands": [ - "codecov" - ] - }, - "jetbrains.resharper.globaltools": { - "version": "2024.3.5", - "commands": [ - "jb" - ] - }, - "nukeeper": { - "version": "0.35.0", - "commands": [ - "nukeeper" - ] - } + "version": 1, + "isRoot": true, + "tools": { + "dotnet-outdated-tool": { + "version": "4.6.7", + "commands": [ + "dotnet-outdated" + ], + "rollForward": false + }, + "dotnet-reportgenerator-globaltool": { + "version": "5.4.4", + "commands": [ + "reportgenerator" + ], + "rollForward": false + }, + "nuke.globaltool": { + "version": "9.0.4", + "commands": [ + "nuke" + ], + "rollForward": false + }, + "codecov.tool": { + "version": "1.13.0", + "commands": [ + "codecov" + ], + "rollForward": false + }, + "jetbrains.resharper.globaltools": { + "version": "2024.3.5", + "commands": [ + "jb" + ], + "rollForward": false + }, + "nukeeper": { + "version": "0.35.0", + "commands": [ + "nukeeper" + ], + "rollForward": false } -} + } +} \ No newline at end of file From 5df288cb4aeadd5552c5cdb246920aaf4c566d47 Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:20:37 +0100 Subject: [PATCH 595/647] Remove codecov.tool --- .config/dotnet-tools.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6bf3738a1..39caf3d2d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -23,13 +23,6 @@ ], "rollForward": false }, - "codecov.tool": { - "version": "1.13.0", - "commands": [ - "codecov" - ], - "rollForward": false - }, "jetbrains.resharper.globaltools": { "version": "2024.3.5", "commands": [ From e032946127635656ceca796e90d0edd1ef29b8cc Mon Sep 17 00:00:00 2001 From: Emmanuel ANDRE <2341261+manandre@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:32:07 +0100 Subject: [PATCH 596/647] Remove nukeeper dotnet tool --- .config/dotnet-tools.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 39caf3d2d..1b5932829 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -29,13 +29,6 @@ "jb" ], "rollForward": false - }, - "nukeeper": { - "version": "0.35.0", - "commands": [ - "nukeeper" - ], - "rollForward": false } } } \ No newline at end of file From 5691e227aec0d353fa4909c3eb30f93be060ccb1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 18:57:28 +0000 Subject: [PATCH 597/647] chore(deps): update dependency typescript to v5.8.2 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3ffabe75b..212fd674f 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1800,9 +1800,9 @@ } }, "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", "dev": true, "license": "Apache-2.0", "bin": { From 84a626f4750075811151559f55c75f04ec618919 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:07:56 +0000 Subject: [PATCH 598/647] chore(deps): update dependency @types/node to v22.13.9 (#1457) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 3ffabe75b..001d7f488 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", - "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", + "version": "22.13.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.9.tgz", + "integrity": "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==", "dev": true, "license": "MIT", "dependencies": { From fab79dcf574c59a8d5719bec99526d144fe4efe7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:15:07 +0000 Subject: [PATCH 599/647] chore(deps): update dependency bogus to 35.6.2 (#1461) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d54ec7bea..8038c1afa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From 7d5238f31fe2516cfc4830925c6b0889fede8433 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:15:32 +0000 Subject: [PATCH 600/647] chore(deps): update dependency verify.xunit to 28.13.0 (#1458) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8038c1afa..ba11a03ea 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 31e543f0738d7a02e538d9d067707c4ee0cc6c35 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:15:47 +0000 Subject: [PATCH 601/647] chore(deps): update dependency nerdbank.streams to 2.11.86 (#1465) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ba11a03ea..04e5e1f69 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + From f16cd2a1c74401a848f9668587da6397c4ca57da Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:20:53 +0000 Subject: [PATCH 602/647] chore(deps): update jetbrains to 2024.3.6 (#1462) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1b5932829..fdb082d88 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -24,7 +24,7 @@ "rollForward": false }, "jetbrains.resharper.globaltools": { - "version": "2024.3.5", + "version": "2024.3.6", "commands": [ "jb" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index 04e5e1f69..c3e831aca 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From e2c05da95a359be5cbaefe754839ee12adcf6027 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:27:20 +0000 Subject: [PATCH 603/647] chore(deps): update dependency @types/vscode to v1.98.0 --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 001d7f488..84bac3327 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -168,9 +168,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.96.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.96.0.tgz", - "integrity": "sha512-qvZbSZo+K4ZYmmDuaodMbAa67Pl6VDQzLKFka6rq+3WUTY4Kro7Bwoi0CuZLO/wema0ygcmpwow7zZfPJTs5jg==", + "version": "1.98.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.98.0.tgz", + "integrity": "sha512-+KuiWhpbKBaG2egF+51KjbGWatTH5BbmWQjSLMDCssb4xF8FJnW4nGH4nuAdOOfMbpD0QlHtI+C3tPq+DoKElg==", "dev": true, "license": "MIT" }, From 640e9dc1c507c5131803cd149ef8983dad00989e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:28:38 +0000 Subject: [PATCH 604/647] chore(deps): update dependency xunitxml.testlogger to v6 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c3e831aca..508a20aa8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -46,7 +46,7 @@ - + From 9ca97c45c1d3a69ff144bdb36ebff35bb98dc9ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:43:09 +0000 Subject: [PATCH 605/647] chore(deps): update dotnet monorepo (#1456) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c3e831aca..c5c410fff 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -58,7 +58,7 @@ - + diff --git a/global.json b/global.json index 49cfff708..72e987316 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.102", + "version": "9.0.200", "rollForward": "latestMinor" } } From 416e1ce1fe74fa108d84725ac465114e2e7ae362 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:05:29 +0000 Subject: [PATCH 606/647] chore(deps): update dependency fluentassertions to 8.1.1 (#1460) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 75653afc4..b91f53486 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 2c0157ea4911b3c11552bd8f2977e6fa586a5706 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 8 Mar 2025 10:03:42 +0000 Subject: [PATCH 607/647] chore(deps): update dependency @types/node to v22.13.10 (#1467) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 798380ca0..f2a82f65b 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.9.tgz", - "integrity": "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==", + "version": "22.13.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", + "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "dev": true, "license": "MIT", "dependencies": { From f03221d5571534adfa049c42e5592ebbb7b5267f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:26:37 +0000 Subject: [PATCH 608/647] chore(deps): update dependency verify.xunit to 28.14.0 (#1469) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b91f53486..1ec5bace8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From d621a8a62d5dd24f396ef92ec88eac407a341567 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 15:18:23 +0000 Subject: [PATCH 609/647] chore(deps): update dependency dotnet-sdk to v9.0.201 (#1471) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 72e987316..5f47393d7 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.200", + "version": "9.0.201", "rollForward": "latestMinor" } } From ab22d2156e4ca7330d0ddd76706543eea3170bf0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:45:17 +0000 Subject: [PATCH 610/647] chore(deps): update dependency dotnet-outdated-tool to 4.6.8 (#1468) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index fdb082d88..5117b270b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-outdated-tool": { - "version": "4.6.7", + "version": "4.6.8", "commands": [ "dotnet-outdated" ], From b789b92b524709559a79a110a05cc3e9413c1059 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 23:03:36 +0000 Subject: [PATCH 611/647] chore(deps): update dotnet monorepo [minor/patch] to 9.0.3 (#1464) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1ec5bace8..10067eb18 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,13 +28,13 @@ - - - - - - - + + + + + + + @@ -50,8 +50,8 @@ - - + + From c7b3d190987fc79820dd937ccfacab60744a5021 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 01:30:23 +0000 Subject: [PATCH 612/647] chore(deps): update dependency verify.xunit to 28.15.0 (#1470) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 10067eb18..aefcf3d6b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From cb5a44152404c37346a84a4e706cc4fe65eedd13 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 19:04:49 +0000 Subject: [PATCH 613/647] chore(deps): update dependency fluentassertions to 8.2.0 (#1473) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index aefcf3d6b..a49051dfa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,7 @@ - + From 158a2f550c4bc21a0a01cf26dab2caf5c9906bce Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 03:44:03 +0000 Subject: [PATCH 614/647] chore(deps): update dependency verify.xunit to 28.16.0 (#1476) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a49051dfa..e0f968b01 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 073fe686456817b6b736be1acd26a426c4af5960 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 03:44:15 +0000 Subject: [PATCH 615/647] chore(deps): update actions/setup-dotnet action to v4.3.1 (#1475) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4e527ddb..7b3920a9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,19 +90,19 @@ jobs: path: '${{ github.workspace }}/.nuget/packages' key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" - name: πŸ”¨ Use .NET Core 3.1 SDK - uses: actions/setup-dotnet@v4.3.0 + uses: actions/setup-dotnet@v4.3.1 with: dotnet-version: '3.1.x' - name: πŸ”¨ Use .NET Core 6.0 SDK - uses: actions/setup-dotnet@v4.3.0 + uses: actions/setup-dotnet@v4.3.1 with: dotnet-version: '6.0.x' - name: πŸ”¨ Use .NET Core 8.0 SDK - uses: actions/setup-dotnet@v4.3.0 + uses: actions/setup-dotnet@v4.3.1 with: dotnet-version: '8.0.x' - name: πŸ”¨ Use .NET Core 9.0 SDK - uses: actions/setup-dotnet@v4.3.0 + uses: actions/setup-dotnet@v4.3.1 with: dotnet-version: '9.0.x' - name: 🎁 dotnet tool restore From 02200e59ce59c8958e8217388a626258b24671d9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 23:17:01 +0000 Subject: [PATCH 616/647] chore(deps): update dependency nerdbank.streams to 2.11.90 (#1477) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e0f968b01..e41fc9e07 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + From c1a9ecb7e85ca440e741413caefc2eca90143283 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 22:58:12 +0000 Subject: [PATCH 617/647] chore(deps): update dependency nerdbank.streams to 2.11.92 (#1479) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e41fc9e07..97940963c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + From 461c805a6e52912c96ffc277eb3585f857a6ea89 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:51:07 +0000 Subject: [PATCH 618/647] chore(deps): update dependency @types/node to v22.13.11 (#1481) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index f2a82f65b..6616f8daa 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", - "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", + "version": "22.13.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.11.tgz", + "integrity": "sha512-iEUCUJoU0i3VnrCmgoWCXttklWcvoCIx4jzcP22fioIVSdTmjgoEvmAO/QPw6TcS9k5FrNgn4w7q5lGOd1CT5g==", "dev": true, "license": "MIT", "dependencies": { From fbd4093d8b0ad03fe1868edb252b565ad67c2c95 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:44:15 +0000 Subject: [PATCH 619/647] chore(deps): update dependency dotnet-sdk to v9.0.202 (#1478) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 5f47393d7..016e6ccd1 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.201", + "version": "9.0.202", "rollForward": "latestMinor" } } From 7a298ff9c606a3f05eec060648f3a285811cf563 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 23 Mar 2025 22:59:53 +0000 Subject: [PATCH 620/647] chore(deps): update reportgenerator to 5.4.5 (#1482) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5117b270b..f43a01a83 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,7 +10,7 @@ "rollForward": false }, "dotnet-reportgenerator-globaltool": { - "version": "5.4.4", + "version": "5.4.5", "commands": [ "reportgenerator" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index 97940963c..3740c205e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From 765b469b2d6e2d0f5045679f82dfb4889daf8439 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 07:22:37 +0000 Subject: [PATCH 621/647] chore(deps): update dependency @types/node to v22.13.12 (#1483) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 6616f8daa..b5a4db143 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.11.tgz", - "integrity": "sha512-iEUCUJoU0i3VnrCmgoWCXttklWcvoCIx4jzcP22fioIVSdTmjgoEvmAO/QPw6TcS9k5FrNgn4w7q5lGOd1CT5g==", + "version": "22.13.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.12.tgz", + "integrity": "sha512-ixiWrCSRi33uqBMRuICcKECW7rtgY43TbsHDpM2XK7lXispd48opW+0IXrBVxv9NMhaz/Ue9kyj6r3NTVyXm8A==", "dev": true, "license": "MIT", "dependencies": { From 0187641b370fb0c79842aaf1f1c9127022385225 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 12:06:34 +0000 Subject: [PATCH 622/647] chore(deps): update dependency @types/node to v22.13.13 (#1484) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index b5a4db143..bbb74a7a0 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.12.tgz", - "integrity": "sha512-ixiWrCSRi33uqBMRuICcKECW7rtgY43TbsHDpM2XK7lXispd48opW+0IXrBVxv9NMhaz/Ue9kyj6r3NTVyXm8A==", + "version": "22.13.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz", + "integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==", "dev": true, "license": "MIT", "dependencies": { From 05f9825601cc31c1bd5f504ec2c997451cab1040 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 07:03:51 +0000 Subject: [PATCH 623/647] chore(deps): update dependency serilog.extensions.logging to 9.0.1 (#1485) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3740c205e..f51147e22 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From 99de8d5b77bd950af9c8d0879c080c7c02b27477 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 23:37:51 +0000 Subject: [PATCH 624/647] chore(deps): update dependency verify.xunit to v29 (#1488) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f51147e22..28aa850c9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 2a1fef8251bb5912e264e806fb3587700c30cb9b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 02:52:57 +0000 Subject: [PATCH 625/647] chore(deps): update dependency @types/node to v22.13.14 (#1486) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index bbb74a7a0..bca6ff90e 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz", - "integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==", + "version": "22.13.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz", + "integrity": "sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==", "dev": true, "license": "MIT", "dependencies": { From 03ed316565fad120f03cd68864bfdfd6c540eff9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 02:53:51 +0000 Subject: [PATCH 626/647] chore(deps): update crazy-max/ghaction-github-labeler action to v5.3.0 (#1487) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index be527bb99..c606ef342 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,7 +20,7 @@ jobs: - name: Run Labeler if: success() - uses: crazy-max/ghaction-github-labeler@v5.2.0 + uses: crazy-max/ghaction-github-labeler@v5.3.0 with: yaml-file: .github/labels.yml skip-delete: false From 6d42dc53f5a5aee04ebc4a51fe31065bcf8b0e06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 07:16:40 +0000 Subject: [PATCH 627/647] chore(deps): update dependency @types/node to v22.13.15 (#1489) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index bca6ff90e..2e7de76b4 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz", - "integrity": "sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==", + "version": "22.13.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.15.tgz", + "integrity": "sha512-imAbQEEbVni6i6h6Bd5xkCRwLqFc8hihCsi2GbtDoAtUcAFQ6Zs4pFXTZUUbroTkXdImczWM9AI8eZUuybXE3w==", "dev": true, "license": "MIT", "dependencies": { From 158c244353fb24882ab625f0168ae99b0c96c49f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 21:42:25 +0000 Subject: [PATCH 628/647] chore(deps): update dependency @types/node to v22.13.17 (#1490) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 2e7de76b4..d580c5718 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -158,9 +158,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.15.tgz", - "integrity": "sha512-imAbQEEbVni6i6h6Bd5xkCRwLqFc8hihCsi2GbtDoAtUcAFQ6Zs4pFXTZUUbroTkXdImczWM9AI8eZUuybXE3w==", + "version": "22.13.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.17.tgz", + "integrity": "sha512-nAJuQXoyPj04uLgu+obZcSmsfOenUg6DxPKogeUy6yNCFwWaj5sBF8/G/pNo8EtBJjAfSVgfIlugR/BCOleO+g==", "dev": true, "license": "MIT", "dependencies": { From 798f97d72ca14ad2495ce1de5de9965307238ed5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 02:52:37 +0000 Subject: [PATCH 629/647] chore(deps): update dependency gitversion.tool to 6.2.0 (#1493) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 28aa850c9..bcdfc2f01 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 7f832fef4b2633f02642e7ae36079fa3fe354c07 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 02:52:59 +0000 Subject: [PATCH 630/647] chore(deps): update dependency verify.xunit to 29.1.0 (#1492) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index bcdfc2f01..a162e67ee 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From d1460675bbea13d8092431491d00c9eebd540abe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 02:53:25 +0000 Subject: [PATCH 631/647] chore(deps): update gittools/actions action to v3.2.0 (#1494) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 0cff1b3c8..835dbe0a4 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,19 +17,19 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.11 + uses: gittools/actions/gitversion/setup@v3.2.0 with: versionSpec: '6.0.x' preferLatestVersion: true - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.1.11 + uses: gittools/actions/gitreleasemanager/setup@v3.2.0 with: versionSpec: '0.18.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.11 + uses: gittools/actions/gitversion/execute@v3.2.0 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 7f595dca9..8d3f519dc 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,14 +27,14 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.1.11 + uses: gittools/actions/gitversion/setup@v3.2.0 with: versionSpec: '6.0.x' preferLatestVersion: true - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.11 + uses: gittools/actions/gitversion/execute@v3.2.0 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 8aa210765..52deab5cb 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,21 +25,21 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.1.11 + uses: gittools/actions/gitversion/setup@v3.2.0 with: versionSpec: '6.0.x' preferLatestVersion: true - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.1.11 + uses: gittools/actions/gitreleasemanager/setup@v3.2.0 with: versionSpec: '0.18.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.1.11 + uses: gittools/actions/gitversion/execute@v3.2.0 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 19ab6abeeb553120d29ff5d614714f92a208c92c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 12:14:50 +0000 Subject: [PATCH 632/647] chore(deps): update jetbrains to 2024.3.7 (#1496) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f43a01a83..75e9d28fc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -24,7 +24,7 @@ "rollForward": false }, "jetbrains.resharper.globaltools": { - "version": "2024.3.6", + "version": "2024.3.7", "commands": [ "jb" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index a162e67ee..35b7a17de 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From b2179b29d1a20e242610f4e8d52abf63e7b8b6e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:57:34 +0000 Subject: [PATCH 633/647] chore(deps): update dependency typescript to v5.8.3 (#1498) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index d580c5718..583a387c8 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -1800,9 +1800,9 @@ } }, "node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { From a20ff4bde2cc6779e30cb0496b36a7c449ec638e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 06:29:49 +0000 Subject: [PATCH 634/647] chore(deps): update dependency verify.xunit to 29.2.0 (#1499) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 35b7a17de..5cd522a4c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From 8628b6a00d27358fa3046ec47d21f191b7560965 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 19:07:56 +0000 Subject: [PATCH 635/647] chore(deps): update dependency dotnet-sdk to v9.0.203 (#1501) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 016e6ccd1..d8052df1b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.202", + "version": "9.0.203", "rollForward": "latestMinor" } } From b51b930f56415dad07aad95a2f4b486dd249e02a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 21:54:56 +0000 Subject: [PATCH 636/647] chore(deps): update dotnet monorepo [minor/patch] to 9.0.4 (#1502) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5cd522a4c..c96dcb72f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,13 +28,13 @@ - - - - - - - + + + + + + + @@ -50,8 +50,8 @@ - - + + From 488637b761fb5b6dba33dc6d9ac9db3390d35c2f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 17:46:55 +0000 Subject: [PATCH 637/647] chore(deps): update dependency bogus to 35.6.3 (#1503) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c96dcb72f..1465d26b0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,7 +54,7 @@ - + From f43520bd1cd265e6ce801f2acd7953c36a1c4e63 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 23:53:48 +0000 Subject: [PATCH 638/647] chore(deps): update dependency verify.xunit to 29.3.0 (#1505) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1465d26b0..4228f99b8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From a0c5960f547a8c4bde7e841bd2ac058404758136 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 03:25:58 +0000 Subject: [PATCH 639/647] chore(deps): update jetbrains to v2025 (major) (#1504) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 75e9d28fc..31b8768be 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -24,7 +24,7 @@ "rollForward": false }, "jetbrains.resharper.globaltools": { - "version": "2024.3.7", + "version": "2025.1.0", "commands": [ "jb" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index 4228f99b8..0ceb1f8f3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 7b907a56b1d638233020ffc9cce5d0e6ecb8cd46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:26:20 +0000 Subject: [PATCH 640/647] chore(deps): update dependency glob to v11.0.2 (#1506) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- vscode-testextension/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-testextension/package-lock.json b/vscode-testextension/package-lock.json index 583a387c8..834c8f1a1 100644 --- a/vscode-testextension/package-lock.json +++ b/vscode-testextension/package-lock.json @@ -689,9 +689,9 @@ } }, "node_modules/glob": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", - "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", "dev": true, "license": "ISC", "dependencies": { From 7cbd16ee78d7496085394de551519ef9cbadb228 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 17:59:52 +0000 Subject: [PATCH 641/647] chore(deps): update gittools/actions action to v3.2.1 (#1507) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-milestone.yml | 6 +++--- .github/workflows/draft-release.yml | 4 ++-- .github/workflows/update-milestone.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml index 835dbe0a4..c2a952fce 100644 --- a/.github/workflows/close-milestone.yml +++ b/.github/workflows/close-milestone.yml @@ -17,19 +17,19 @@ jobs: - uses: actions/setup-dotnet@v4 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.2.0 + uses: gittools/actions/gitversion/setup@v3.2.1 with: versionSpec: '6.0.x' preferLatestVersion: true - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v3.2.0 + uses: gittools/actions/gitreleasemanager/setup@v3.2.1 with: versionSpec: '0.18.x' - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.2.0 + uses: gittools/actions/gitversion/execute@v3.2.1 # Ensure the milestone exists - name: Create Milestone diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 8d3f519dc..9b8321675 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -27,14 +27,14 @@ jobs: run: git fetch --prune - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v3.2.0 + uses: gittools/actions/gitversion/setup@v3.2.1 with: versionSpec: '6.0.x' preferLatestVersion: true - name: Use GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v3.2.0 + uses: gittools/actions/gitversion/execute@v3.2.1 - name: Create Milestone uses: WyriHaximus/github-action-create-milestone@v1 diff --git a/.github/workflows/update-milestone.yml b/.github/workflows/update-milestone.yml index 52deab5cb..bc9494c13 100644 --- a/.github/workflows/update-milestone.yml +++ b/.github/workflows/update-milestone.yml @@ -25,21 +25,21 @@ jobs: - name: Install GitVersion if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitversion/setup@v3.2.0 + uses: gittools/actions/gitversion/setup@v3.2.1 with: versionSpec: '6.0.x' preferLatestVersion: true - name: Install GitReleaseManager if: ${{ github.event.action == 'opened' }} - uses: gittools/actions/gitreleasemanager/setup@v3.2.0 + uses: gittools/actions/gitreleasemanager/setup@v3.2.1 with: versionSpec: '0.18.x' - name: Use GitVersion if: ${{ github.event.action == 'opened' }} id: gitversion - uses: gittools/actions/gitversion/execute@v3.2.0 + uses: gittools/actions/gitversion/execute@v3.2.1 - name: Create Milestone if: ${{ github.event.action == 'opened' }} From 6a13a32388546ed37207832a356915afd139d133 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 23:00:32 +0000 Subject: [PATCH 642/647] chore(deps): update dependency gitversion.tool to 6.3.0 (#1508) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0ceb1f8f3..6e18ab4d6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,7 +21,7 @@ - + From 54221a75b7f687faf67720a45bf0d1f6d617fecd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 26 Apr 2025 14:01:25 +0000 Subject: [PATCH 643/647] chore(deps): update dependency verify.xunit to 29.3.1 (#1509) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6e18ab4d6..4cea41f5d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From c114feb34f3b9e6d19b8f8e9c45100430f99e1ba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 11:12:14 +0000 Subject: [PATCH 644/647] chore(deps): update dependency verify.xunit to v30 (#1514) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4cea41f5d..f3ed03838 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + From febd26bee8f094606a5742d1955156036fea64bd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 May 2025 01:48:11 +0000 Subject: [PATCH 645/647] chore(deps): update dependency xunit.runner.visualstudio to 3.1.0 (#1515) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f3ed03838..6d778b451 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -37,7 +37,7 @@ - + From b7083278e92d0b64de8c744940c6dac5c46b3e67 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 May 2025 13:43:10 +0000 Subject: [PATCH 646/647] chore(deps): update reportgenerator to 5.4.6 (#1516) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 31b8768be..34c20e54f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,7 +10,7 @@ "rollForward": false }, "dotnet-reportgenerator-globaltool": { - "version": "5.4.5", + "version": "5.4.6", "commands": [ "reportgenerator" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index 6d778b451..197bf42e5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From f498e0457590f68dd73ffa78b11eb2060205dadf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 May 2025 18:54:33 +0000 Subject: [PATCH 647/647] chore(deps): update jetbrains to 2025.1.1 (#1511) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 34c20e54f..154fbb623 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -24,7 +24,7 @@ "rollForward": false }, "jetbrains.resharper.globaltools": { - "version": "2025.1.0", + "version": "2025.1.1", "commands": [ "jb" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index 197bf42e5..e23d7520f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - +