summaryrefslogtreecommitdiff
path: root/cli/lsp/analysis.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-10-12 09:58:04 -0400
committerGitHub <noreply@github.com>2021-10-12 09:58:04 -0400
commit9b1f0c8ba3c8ca7a7207519889b6509bfc10370e (patch)
tree8660a11544f221e1a295c5e98c5907532523f351 /cli/lsp/analysis.rs
parentb1e7452cd310ead7e6379f694d660e935641e596 (diff)
chore: upgrade crates based on deno ast 0.3 (#12403)
Diffstat (limited to 'cli/lsp/analysis.rs')
-rw-r--r--cli/lsp/analysis.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs
index b5fca62f4..643de5c56 100644
--- a/cli/lsp/analysis.rs
+++ b/cli/lsp/analysis.rs
@@ -199,15 +199,10 @@ pub fn get_lint_references(
parsed_source: &deno_ast::ParsedSource,
maybe_lint_config: Option<&LintConfig>,
) -> Result<Vec<Reference>, AnyError> {
- let syntax = deno_ast::get_syntax(parsed_source.media_type());
let lint_rules =
get_configured_rules(maybe_lint_config, vec![], vec![], vec![])?;
- let linter = create_linter(syntax, lint_rules);
- // TODO(dsherret): do not re-parse here again
- let (_, lint_diagnostics) = linter.lint(
- parsed_source.specifier().to_string(),
- parsed_source.source().text_str().to_string(),
- )?;
+ let linter = create_linter(parsed_source.media_type(), lint_rules);
+ let lint_diagnostics = linter.lint_with_ast(parsed_source);
Ok(
lint_diagnostics
@@ -357,6 +352,7 @@ pub fn parse_module(
// capture the tokens for linting and formatting
capture_tokens: true,
maybe_syntax: None,
+ scope_analysis: true, // for deno_lint
})
}