Skip to content

fix line number display in code context commands #1470

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

XiaoxuanLu
Copy link
Contributor

@XiaoxuanLu XiaoxuanLu commented May 29, 2025

Problem

Line numbers displayed in the webview were off by 1 when showing code symbol ranges. This is because the editor's internal line numbering starts at 0, but UI displays typically show line numbers starting at 1. This inconsistency affects all IDEs and creates confusion for users when they see line numbers that don't match what's shown in their editor.
VS:
image
VSC:
image
JB:
image

Solution

Added +1 to both the start and end line numbers when displaying the line range in the code context command description. This ensures that the line numbers shown in the UI match what users see in their editor interface, providing a consistent experience across all IDEs.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@XiaoxuanLu XiaoxuanLu requested a review from a team as a code owner May 29, 2025 00:41
@XiaoxuanLu XiaoxuanLu force-pushed the xiaoluk/codeLineNumber branch from e014140 to d0c74e4 Compare May 29, 2025 00:52
@XiaoxuanLu XiaoxuanLu merged commit 743666f into main May 29, 2025
6 checks passed
@XiaoxuanLu XiaoxuanLu deleted the xiaoluk/codeLineNumber branch May 29, 2025 01: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