Skip to content

Add columns to Language Server for external editors - #114185

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
voylin:language_server_column_support
Jan 31, 2026
Merged

Add columns to Language Server for external editors#114185
akien-mga merged 1 commit into
godotengine:masterfrom
voylin:language_server_column_support

Conversation

@voylin

@voylin voylin commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

This PR is to have column support for the language server when using external text editors. Full-filling this TODO mentioned here:

// TODO: Improve positional information.

This should not break anything and just add's the functionality to get more feedback of what part of the line contains the warning or the error.

Without this PR:
image

With this PR:
image

@voylin

voylin commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

Does anything still need to happen for this PR to be merged or just waiting for a review? @dalexeev

Comment thread modules/gdscript/gdscript_parser.h Outdated
Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp Outdated
Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp Outdated
Comment thread modules/gdscript/gdscript_parser.cpp
@voylin
voylin force-pushed the language_server_column_support branch from 4f8f86e to e00f11e Compare January 28, 2026 21:42
@voylin

voylin commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

I re-based onto the master branch and did the requested changes. There's only the one review conversation about the loop which I'm not 100% certain with of what to do.

@voylin
voylin force-pushed the language_server_column_support branch from e00f11e to 95355fa Compare January 28, 2026 21:47
@voylin
voylin requested a review from a team as a code owner January 28, 2026 21:47
@voylin
voylin force-pushed the language_server_column_support branch 3 times, most recently from 09452f7 to f74f1ca Compare January 28, 2026 22:28
@voylin

voylin commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

Added the changes requested and everything works as expected:
image

@voylin
voylin force-pushed the language_server_column_support branch from f74f1ca to eb3e0c5 Compare January 29, 2026 00:27
@voylin
voylin requested a review from dalexeev January 29, 2026 00:27

@HolonProduction HolonProduction left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering whether we should adjust the test runner to print the full ranges. Right now it only prints the start line for parser errors and the start and end lines for warnings. But the reason for that is probably that no more information was available at the time.

On the other hand this would mean touching all GDScript tests 🤔

Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp Outdated
Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp Outdated
Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp Outdated
@voylin

voylin commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

I'm wondering whether we should adjust the test runner to print the full ranges. Right now it only prints the start line for parser errors and the start and end lines for warnings. But the reason for that is probably that no more information was available at the time.

On the other hand this would mean touching all GDScript tests 🤔

Want to give me a go at it and add it to this PR?

@voylin
voylin force-pushed the language_server_column_support branch from f0e9ecb to bc1c9db Compare January 30, 2026 00:44
@voylin

voylin commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

@HolonProduction I felt that the error/warning messages with line and columns is part of this PR so I went ahead and implemented the changes in the script and checked/adjusted all of the .out files. Was quite tedious work. ^^"

I'm not certain if the error's from the parser are what is desired, but I'll leave that upon your feedback to decide how to write those.
image

I've added it as a separate commit in case you prefer that this is done through a separate PR, but it does feel like part of this commit. Let me know if I should merge both commits.

@voylin
voylin force-pushed the language_server_column_support branch from 0267704 to 8ab76ed Compare January 30, 2026 03:00
@dalexeev

Copy link
Copy Markdown
Contributor

I don't think this is a good idea. It's not visually clear, and it's unlikely anyone will monitor the column numbers. It just creates unnecessary noise and makes it difficult to edit tests.

I think the correctness of source regions should be ensured by other measures. There's no point in adding full positional information to every test. Especially in analyzer tests, since errors/warnings are generated on AST nodes, so positional information will always be correct if the previous steps (tokenization and parsing) are bug-free and the correct target node for the error/warning is selected.

Please revert these changes. Even if we decide such an improvement is necessary, it's beyond the scope of this PR and should be moved to a separate PR.

@voylin
voylin force-pushed the language_server_column_support branch from 8ab76ed to bc1c9db Compare January 30, 2026 05:11
@voylin

voylin commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

Please revert these changes. Even if we decide such an improvement is necessary, it's beyond the scope of this PR and should be moved to a separate PR.

Okay, changed it back ;)

@HolonProduction HolonProduction left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code makes sense to me. Tested this with VSCode and it seems to work fine.

@HolonProduction

Copy link
Copy Markdown
Member

Might need an adjustment to the commit message though, which contains the entire squash noise

Comment thread modules/gdscript/gdscript_warning.h Outdated
Comment thread modules/gdscript/gdscript_parser.cpp
@voylin
voylin force-pushed the language_server_column_support branch from 6efbf88 to a649c4a Compare January 30, 2026 18:31
@voylin

voylin commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

Might need an adjustment to the commit message though, which contains the entire squash noise

Cleaned it up. ;)

Comment thread modules/gdscript/gdscript_parser.h Outdated
Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp
Comment thread modules/gdscript/language_server/gdscript_extend_parser.cpp Outdated
@voylin
voylin force-pushed the language_server_column_support branch from a649c4a to 1d74815 Compare January 30, 2026 21:01
@voylin
voylin requested a review from a team as a code owner January 30, 2026 21:01
@voylin
voylin force-pushed the language_server_column_support branch 2 times, most recently from a0bbd94 to b167a57 Compare January 30, 2026 21:16
Comment thread modules/gdscript/gdscript_tokenizer.h Outdated
Comment thread modules/gdscript/gdscript_tokenizer.h
Comment thread modules/gdscript/gdscript_parser.h
Comment thread modules/gdscript/gdscript_parser.h
@voylin
voylin force-pushed the language_server_column_support branch from b167a57 to ea1cb8f Compare January 30, 2026 21:22
@voylin

voylin commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

@dalexeev Thanks for pointing out my mistakes, I had forgotten to order the start_* and end_* together after changing the lines. My mistake, sorry. I'll be more careful! ^^"

@dalexeev dalexeev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. 👍 Thank you for your patience!

@voylin
voylin requested a review from akien-mga January 30, 2026 23:16
@akien-mga
akien-mga merged commit 4b09283 into godotengine:master Jan 31, 2026
20 checks passed
@voylin
voylin deleted the language_server_column_support branch January 31, 2026 22:01
rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…umn_support

Add columns to Language Server for external editors
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…umn_support

Add columns to Language Server for external editors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants