Remove annoying log output related to modelines#1212
Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom Mar 12, 2026
Merged
Remove annoying log output related to modelines#1212datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561 merged 1 commit intoredhat-developer:mainfrom
Conversation
6829453 to
0a1bcaf
Compare
Currently, a log entry is emitted whenever a modeline comment is parsed. This is because, in redhat-developer#1193, the logic for how modelines were parsed was changed. On this line: https://github.com/redhat-developer/yaml-language-server/pull/1193/changes#diff-dc843f2ff5a3d197853464e616d6e413820becbc82e0e9a3aa6fc6d996976bb2L21 there is always 2 entries if a parsable modeline is present. This is because the index 0 entry contains the entire match, and the index 1 entry contains the group match (that contains the URI of the schema). This means that the `console.log()` will always run, incorrectly alerting the user that they tried to specify two schemas in the modeline. Even if the message were accurate, I don't think logging is the best way to alert the user to this problem. This should ideally be a warning or error instead. For now, I'm removing the `console.log()` entirely to address this. Signed-off-by: David Thompson <davthomp@redhat.com>
0a1bcaf to
05d23b4
Compare
shin19991207
approved these changes
Mar 12, 2026
Member
shin19991207
left a comment
There was a problem hiding this comment.
LGTM and fixes the issue. Thanks, David!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Currently, a log entry is emitted whenever a modeline comment is parsed. This is because, in #1193, the logic for how modelines were parsed was changed. On this line: https://github.com/redhat-developer/yaml-language-server/pull/1193/changes#diff-dc843f2ff5a3d197853464e616d6e413820becbc82e0e9a3aa6fc6d996976bb2L21 there is always 2 entries if a parsable modeline is present. This is because the index 0 entry contains the entire match, and the index 1 entry contains the group match (that contains the URI of the schema). This means that the
console.log()will always run, incorrectly alerting the user that they tried to specify two schemas in the modeline.Even if the message were accurate, I don't think logging is the best way to alert the user to this problem.
This should ideally be a warning or error instead. For now, I'm removing the
console.log()entirely to address this.What issues does this PR fix or reference?
Fixes #1211
Is it tested? How?
Manually