summaryrefslogtreecommitdiff
path: root/cli/tests/lsp
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2021-06-21 12:13:35 +0530
committerGitHub <noreply@github.com>2021-06-21 16:43:35 +1000
commit952caa79b32e6c249977281ed494d4b1f98ed451 (patch)
tree3f072fc64b571eca1b203fb07df3689ad4fc3a95 /cli/tests/lsp
parentbbc2745350687f209c6af75958cc12bb43e64042 (diff)
feat(lsp): quick fix actions to ignore lint errors (#10627)
Closes #10122
Diffstat (limited to 'cli/tests/lsp')
-rw-r--r--cli/tests/lsp/code_action_ignore_lint_params.json39
-rw-r--r--cli/tests/lsp/code_action_ignore_lint_response.json62
2 files changed, 101 insertions, 0 deletions
diff --git a/cli/tests/lsp/code_action_ignore_lint_params.json b/cli/tests/lsp/code_action_ignore_lint_params.json
new file mode 100644
index 000000000..7711812fd
--- /dev/null
+++ b/cli/tests/lsp/code_action_ignore_lint_params.json
@@ -0,0 +1,39 @@
+{
+ "textDocument": {
+ "uri": "file:///a/file.ts"
+ },
+ "range": {
+ "start": {
+ "line": 1,
+ "character": 5
+ },
+ "end": {
+ "line": 1,
+ "character": 12
+ }
+ },
+ "context": {
+ "diagnostics": [
+ {
+ "range": {
+ "start": {
+ "line": 1,
+ "character": 5
+ },
+ "end": {
+ "line": 1,
+ "character": 12
+ }
+ },
+ "severity": 1,
+ "code": "prefer-const",
+ "source": "deno-lint",
+ "message": "'message' is never reassigned\nUse 'const' instead",
+ "relatedInformation": []
+ }
+ ],
+ "only": [
+ "quickfix"
+ ]
+ }
+}
diff --git a/cli/tests/lsp/code_action_ignore_lint_response.json b/cli/tests/lsp/code_action_ignore_lint_response.json
new file mode 100644
index 000000000..f5c24ec21
--- /dev/null
+++ b/cli/tests/lsp/code_action_ignore_lint_response.json
@@ -0,0 +1,62 @@
+[
+ {
+ "title": "Disable prefer-const for this line",
+ "kind": "quickfix",
+ "diagnostics": [
+ {
+ "range": {
+ "start": { "line": 1, "character": 5 },
+ "end": { "line": 1, "character": 12 }
+ },
+ "severity": 1,
+ "code": "prefer-const",
+ "source": "deno-lint",
+ "message": "'message' is never reassigned\nUse 'const' instead",
+ "relatedInformation": []
+ }
+ ],
+ "edit": {
+ "changes": {
+ "file:///a/file.ts": [
+ {
+ "range": {
+ "start": { "line": 1, "character": 0 },
+ "end": { "line": 1, "character": 0 }
+ },
+ "newText": "// deno-lint-ignore prefer-const\n"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "title": "Ignore lint errors for the entire file",
+ "kind": "quickfix",
+ "diagnostics": [
+ {
+ "range": {
+ "start": { "line": 1, "character": 5 },
+ "end": { "line": 1, "character": 12 }
+ },
+ "severity": 1,
+ "code": "prefer-const",
+ "source": "deno-lint",
+ "message": "'message' is never reassigned\nUse 'const' instead",
+ "relatedInformation": []
+ }
+ ],
+ "edit": {
+ "changes": {
+ "file:///a/file.ts": [
+ {
+ "range": {
+ "start": { "line": 0, "character": 0 },
+ "end": { "line": 0, "character": 0 }
+ },
+ "newText": "// deno-lint-ignore-file\n"
+ }
+ ]
+ }
+ }
+ }
+]