From f1bfdab938235f987c9cdce40f6c0f72a79c854b Mon Sep 17 00:00:00 2001 From: Miguel Young de la Sota Date: Thu, 27 Feb 2025 12:17:11 -0800 Subject: [PATCH] cr --- experimental/parser/diagnostics_internal.go | 6 ++---- experimental/token/cursor.go | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/experimental/parser/diagnostics_internal.go b/experimental/parser/diagnostics_internal.go index a1f2fb49..0780a8b2 100644 --- a/experimental/parser/diagnostics_internal.go +++ b/experimental/parser/diagnostics_internal.go @@ -149,10 +149,8 @@ type justified struct { // 1. Surrounded on both sides by at least once space. (justifyBetween) // 2. Has no whitespace to its left or its right. (justifyLeft, justifyRight) // -// This is necessary in order to generate sensible suggestions in a number of -// cases. -// -// # Case 1: Inserting an equals sign. +// See the comments on doJustify* for details on the different cases this +// function handles. func justify(stream *token.Stream, span report.Span, message string, edits ...justified) report.DiagnosticOption { for i := range edits { switch edits[i].justify { diff --git a/experimental/token/cursor.go b/experimental/token/cursor.go index 9e635a70..08bbddaf 100644 --- a/experimental/token/cursor.go +++ b/experimental/token/cursor.go @@ -77,8 +77,7 @@ func (c *Cursor) IsSynthetic() bool { // Clone returns a copy of this cursor, which allows performing operations on // it without mutating the original cursor. func (c *Cursor) Clone() *Cursor { - //nolint:revive,stylecheck // The type here is explicit to show a copy actually happens. - var clone Cursor = *c + clone := *c return &clone }