From 9b1f0c8ba3c8ca7a7207519889b6509bfc10370e Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 12 Oct 2021 09:58:04 -0400 Subject: chore: upgrade crates based on deno ast 0.3 (#12403) --- cli/lsp/analysis.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cli/lsp') 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, 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 }) } -- cgit v1.2.3