Skip to content

fix(lsp): set range on invalid parse results, fixes #1176#1178

Merged
a-h merged 1 commit intomainfrom
issue_1176
Jun 4, 2025
Merged

fix(lsp): set range on invalid parse results, fixes #1176#1178
a-h merged 1 commit intomainfrom
issue_1176

Conversation

@a-h
Copy link
Copy Markdown
Owner

@a-h a-h commented Jun 4, 2025

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the range setting for invalid parse results in the LSP by refactoring the range assignment logic in the parser functions and updating the associated tests. Key changes include:

  • Using defer blocks to assign the Range field in HTMLTemplate, ScriptTemplate, and CSSTemplate parsers.
  • Removing redundant manual assignments to r.Range.
  • Updating tests to check for the new range values.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
parser/v2/templatefile_test.go Adds test assertions to verify the updated range values.
parser/v2/scripttemplateparser.go Refactors range assignment to use defer, removing duplicate code.
parser/v2/parser.go Applies similar refactoring for range assignment in HTML templates.
parser/v2/cssparser.go Uses defer to set range and removes redundant assignment.
.version Updates the version number.

Copy link
Copy Markdown
Collaborator

@joerdav joerdav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@a-h a-h merged commit 608c516 into main Jun 4, 2025
9 checks passed
@a-h a-h deleted the issue_1176 branch June 4, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants