diff options
author | Satya Rohith <me@satyarohith.com> | 2021-09-14 17:46:51 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 17:46:51 +0530 |
commit | bb7ee4f4450882419ac46378df882d243eb150da (patch) | |
tree | 9988b101c62cfd088d001cabc6e45ebf5f6bd22b /cli/tests/integration/lsp_tests.rs | |
parent | 6e3c8a4b058b774b7eb9eebebe8532d04c6fc61e (diff) |
feat(lsp): ignore specific lint for entire file (#12023)
Diffstat (limited to 'cli/tests/integration/lsp_tests.rs')
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 3d87c222d..5034b6ed6 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -3526,3 +3526,37 @@ fn lsp_code_actions_ignore_lint() { ); shutdown(&mut client); } + +/// This test exercises updating an existing deno-lint-ignore-file comment. +#[test] +fn lsp_code_actions_update_ignore_lint() { + let mut client = init("initialize_params.json"); + did_open( + &mut client, + json!({ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": +"#!/usr/bin/env -S deno run +// deno-lint-ignore-file camelcase +let snake_case = 'Hello, Deno!'; +console.log(snake_case); +", + } + }), + ); + let (maybe_res, maybe_err) = client + .write_request( + "textDocument/codeAction", + load_fixture("code_action_update_ignore_lint_params.json"), + ) + .unwrap(); + assert!(maybe_err.is_none()); + assert_eq!( + maybe_res, + Some(load_fixture("code_action_update_ignore_lint_response.json")) + ); + shutdown(&mut client); +} |