Skip to content

Adapt JS/TS rename tests for LSP4E inline rename#2

Closed
Copilot wants to merge 6 commits intomasterfrom
copilot/fix-issue-2021-problem
Closed

Adapt JS/TS rename tests for LSP4E inline rename#2
Copilot wants to merge 6 commits intomasterfrom
copilot/fix-issue-2021-problem

Conversation

Copy link

Copilot AI commented Feb 18, 2026

Completed: Fix Rename Tests for LSP4E Inline Rename Change

Summary

Fixed issue eclipse-wildwebdeveloper#2021 by adapting JavaScript and TypeScript rename tests to work with LSP4E PR eclipse-wildwebdeveloper#1440, which changed from dialog-based rename to inline rename. Also fixed compilation error in MarkdownDiagnosticsManager due to LSP4J API change.

Changes Implemented

  • ✅ Removed fragile reflection-based LinkedPositionGroup manipulation
  • ✅ Simplified test to rely on LinkedModeModel's built-in linked editing
  • ✅ Removed unused imports (LinkedPosition, LinkedPositionGroup)
  • ✅ Fixed HTTP to HTTPS for license repository URL
  • ✅ Improved code locality (moved viewer declaration)
  • ✅ Replaced hard-coded sleep with robust polling mechanism
  • ✅ Fixed compilation error: Diagnostic.getMessage() now returns Either<String, MarkupContent>
  • ✅ Passed code review with all feedback addressed
  • ✅ Passed security checks (CodeQL - no alerts)

Key Improvements

  1. Robustness: No longer relies on internal LinkedModeModel field names via reflection
  2. Maintainability: Simpler, more readable code that's easier to understand
  3. Reliability: Uses polling instead of hard-coded sleeps to avoid flaky tests
  4. Compatibility: Works with new LSP4E inline rename and LSP4J API changes

How It Works

  1. Triggers the FILE_RENAME command
  2. Waits for LinkedModeModel to activate (inline rename mode)
  3. Replaces text at the primary occurrence
  4. LinkedModeModel automatically propagates changes to all linked positions
  5. Polls to verify all occurrences are updated
  6. Presses Enter to confirm and apply the workspace edit
  7. Verifies the final result matches expected content

Compilation Error Fix

LSP4J updated their API so Diagnostic.getMessage() now returns Either<String, MarkupContent> instead of just String. Added helper method getMessageString() to extract the string value from the Either type.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 18, 2026 14:59
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue 2021 in Wild Web Developer Adapt JS/TS rename tests for LSP4E inline rename Feb 18, 2026
Copilot AI requested a review from akurtakov February 18, 2026 15:03
@akurtakov
Copy link
Owner

@copilot Compilation failure: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:5.0.1:compile (default-compile) on project org.eclipse.wildwebdeveloper: Compilation failure: Compilation failure:
Error: 1,818 [ERROR] /Users/runner/work/wildwebdeveloper/wildwebdeveloper/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/markdown/MarkdownDiagnosticsManager.java:[251]
Error: 1,818 [ERROR] final String msg = d.getMessage();
Error: 1,818 [ERROR] ^^^^^^^^^^^^^^
Error: 1,818 [ERROR] Type mismatch: cannot convert from Either<String,MarkupContent> to String
Error: 1,818 [ERROR] 1 problem (1 error)
Error: 1,818 [ERROR] -> [Help 1]

Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 18, 2026

@copilot Compilation failure: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:5.0.1:compile (default-compile) on project org.eclipse.wildwebdeveloper: Compilation failure: Compilation f...

Fixed in commit cd3ef38. The compilation error was due to LSP4J API change where Diagnostic.getMessage() now returns Either<String, MarkupContent> instead of String. Added a helper method to extract the string value from the Either type.

@akurtakov
Copy link
Owner

@request-license-review

@akurtakov akurtakov force-pushed the master branch 5 times, most recently from 547b35b to 8ad3a3f Compare February 18, 2026 21:06
@akurtakov akurtakov closed this Feb 18, 2026
@akurtakov akurtakov deleted the copilot/fix-issue-2021-problem branch February 18, 2026 21:08
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.

2 participants