summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/analysis.rs4
-rw-r--r--cli/lsp/code_lens.rs2
-rw-r--r--cli/lsp/config.rs4
-rw-r--r--cli/lsp/testing/collectors.rs6
4 files changed, 8 insertions, 8 deletions
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs
index 2bff545c0..88ca47f67 100644
--- a/cli/lsp/analysis.rs
+++ b/cli/lsp/analysis.rs
@@ -423,11 +423,11 @@ fn fix_ts_import_action(
if action.fix_name == "import" {
let change = action
.changes
- .get(0)
+ .first()
.ok_or_else(|| anyhow!("Unexpected action changes."))?;
let text_change = change
.text_changes
- .get(0)
+ .first()
.ok_or_else(|| anyhow!("Missing text change."))?;
if let Some(captures) = IMPORT_SPECIFIER_RE.captures(&text_change.new_text)
{
diff --git a/cli/lsp/code_lens.rs b/cli/lsp/code_lens.rs
index 5330be5da..f2ac24840 100644
--- a/cli/lsp/code_lens.rs
+++ b/cli/lsp/code_lens.rs
@@ -98,7 +98,7 @@ impl DenoTestCollector {
}
fn check_call_expr(&mut self, node: &ast::CallExpr, range: &SourceRange) {
- if let Some(expr) = node.args.get(0).map(|es| es.expr.as_ref()) {
+ if let Some(expr) = node.args.first().map(|es| es.expr.as_ref()) {
match expr {
ast::Expr::Object(obj_lit) => {
for prop in &obj_lit.props {
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs
index b618495bd..e7839de3b 100644
--- a/cli/lsp/config.rs
+++ b/cli/lsp/config.rs
@@ -932,7 +932,7 @@ impl Config {
}
pub fn root_uri(&self) -> Option<&Url> {
- self.workspace_folders.get(0).map(|p| &p.0)
+ self.workspace_folders.first().map(|p| &p.0)
}
pub fn maybe_node_modules_dir_path(&self) -> Option<&PathBuf> {
@@ -1184,7 +1184,7 @@ fn specifier_enabled(
return true;
};
let (settings, mut folder_uri) = settings.get_for_specifier(specifier);
- folder_uri = folder_uri.or_else(|| workspace_folders.get(0).map(|f| &f.0));
+ folder_uri = folder_uri.or_else(|| workspace_folders.first().map(|f| &f.0));
let mut disable_paths = vec![];
let mut enable_paths = None;
if let Some(folder_uri) = folder_uri {
diff --git a/cli/lsp/testing/collectors.rs b/cli/lsp/testing/collectors.rs
index 9781672c6..a66e56948 100644
--- a/cli/lsp/testing/collectors.rs
+++ b/cli/lsp/testing/collectors.rs
@@ -23,7 +23,7 @@ fn visit_arrow(
test_module: &mut TestModule,
) {
if let Some((maybe_test_context, maybe_step_var)) =
- parse_test_context_param(arrow_expr.params.get(0))
+ parse_test_context_param(arrow_expr.params.first())
{
let mut collector = TestStepCollector::new(
maybe_test_context,
@@ -44,7 +44,7 @@ fn visit_fn(
test_module: &mut TestModule,
) {
if let Some((maybe_test_context, maybe_step_var)) =
- parse_test_context_param(function.params.get(0).map(|p| &p.pat))
+ parse_test_context_param(function.params.first().map(|p| &p.pat))
{
let mut collector = TestStepCollector::new(
maybe_test_context,
@@ -136,7 +136,7 @@ fn visit_call_expr(
text_info: &SourceTextInfo,
test_module: &mut TestModule,
) {
- if let Some(expr) = node.args.get(0).map(|es| es.expr.as_ref()) {
+ if let Some(expr) = node.args.first().map(|es| es.expr.as_ref()) {
match expr {
ast::Expr::Object(obj_lit) => {
let mut maybe_name = None;