Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure named sprite type is nil-checked before renaming #52

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

aofei
Copy link
Member

@aofei aofei commented Mar 18, 2025

@aofei aofei requested a review from Copilot March 18, 2025 07:57

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 issue reported in goplus/builder#1470 by ensuring that a named sprite type is properly nil-checked before renaming it.

  • Adds a new test case ("WrongCodeWithInvalidType") in rename_test.go to validate the behavior when an invalid sprite type is encountered.
  • Updates the spxRenameSpriteResource function in rename.go to include a nil-check for tv.Type and use vfs.HasSpriteType for additional validation.

Reviewed Changes

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

File Description
internal/server/rename_test.go New test case added to check behavior for invalid sprite type cases.
internal/server/rename.go Updated condition to nil-check tv.Type and validate sprite type using vfs.HasSpriteType.
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.58%. Comparing base (6408b54) to head (85b3438).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   66.55%   66.58%   +0.03%     
==========================================
  Files          39       39              
  Lines        6007     6007              
==========================================
+ Hits         3998     4000       +2     
+ Misses       1762     1760       -2     
  Partials      247      247              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aofei aofei merged commit 0b05a68 into goplus:main Mar 18, 2025
5 checks passed
@aofei aofei deleted the renaming branch March 18, 2025 08:09
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.

language server rename method panic
2 participants