-
Notifications
You must be signed in to change notification settings - Fork 21
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
Display puppet parser warnings #211
Comments
Thanks @SPIRIT-Betrieb . We will try and repo this |
Okay, so the parser validation is only outputing the warnings to the console:
|
Looks like we'll need to monkey_patch the lexer |
We won't be able to do the number coercion though. That happens during a catalog compile, not parser validation. And compilations are an "expensive" thing to do. Given a manifest of $server = 'localhost'
notify{"Path: ${server}\foo":}
$number1 = 5000
$number2 = '6000'
$sum = $number1 + $number2
notify{"Sum: $sum":}
|
I've raised a bug in puppet-lint as it appears it should be raising the warnings already |
I've got a WIP PR up to detect the issue. https://github.com/glennsarti/puppet-editor-services/tree/gh-211-lexer-warnings I'll hold off a bit to see if puppet-lint fix the error first. |
Just for your information: I raised a ticket for the compiler as well: https://tickets.puppetlabs.com/browse/PUP-10176 (I was the one raising this FR). |
Summary of the new feature
The puppet parser validate command display some problematic lexical construct as warnings.
Examples:
Parser Warning:
Unrecognized escape sequence '\f' (file: lexer.pp, line: 2, column: 29)
Parser Warning:
The string '6000' was automatically coerced to the numerical value 6000 (file: lexer.pp, line: 3, column: 19)
I would like VSCode to show that warnings to the developer, so that they are aware of the problematic lexical construct they are using.
As a puppet code developer I want to be able to see lexer warning that puppet parser validates provides, so that I'm aware of problematical constructs in my code.
The text was updated successfully, but these errors were encountered: