1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore(lsp): temporarily reparse AST for linting (#11988)

This commit is contained in:
David Sherret 2021-09-12 09:42:11 -04:00 committed by GitHub
parent 464dcc1388
commit 00d62e64bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,7 +139,11 @@ pub fn get_lint_references(
let syntax = deno_ast::get_syntax(parsed_source.media_type());
let lint_rules = rules::get_recommended_rules();
let linter = create_linter(syntax, lint_rules);
let lint_diagnostics = linter.lint_with_ast(parsed_source);
// 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(),
)?;
Ok(
lint_diagnostics