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
AutoIndent update implementation #289
Comments
This was reported by Joseph Citarello. |
The regex can account for the Puppet DSL keywords but when it comes to the type declarations it is much harder. For example:
This isn't caught by the existing configuration because of the string followed by the colon. Adding a single quote and colon begins to break the regex. |
I think for the 0.11 release we can correct the file name and add indentation support for the keywords in the DSL. Auto indentation for the types will need to come in a subsequent PR |
This commit fixes the declaration for block comments by setting it to an array.
This commit uses the correct block comment characters as per puppet specifications.
This commit uses the correct block comment characters as per puppet specifications.
This commit fixes the declaration for block comments by setting it to an array.
This commit uses the correct block comment characters as per puppet specifications.
This commit fixes the declaration for block comments by setting it to an array.
This commit uses the correct block comment characters as per puppet specifications.
First pass implemented (DSL indenting). Adding this to the 0.12. for the more complicated type indenting. |
This issue has been marked stale because it has been open for more than 30 days with no activity. If this issue is still important to you, please comment to keep this issue open. If not, this will be closed in 5 days |
Added this to 0.23 to plan and triage |
This commit enables the editor to indent properly after a type declaration with a title.
This commit programmatically sets language configuration for Puppet manifests and Puppetfiles instead of using json files. This commit also enables the editor to indent properly after a type declaration with a title by adding the `onEnterRules` section.
(GH-289) Auto Indent for Types with Titles
This reverts commit fa2ef7c. Removing the language configuration json files removed support for `surroundingPairs`, which breaks adding matching characters like quotes or brackets. The programmatic language configuration method does not support `surroundingPairs`, so we still need the language config json file. We can instead have the language config file present as well as a programmatic declaration at the same time, and keep both old and new functionality.
This commit programmatically sets language configuration for Puppet manifests and Puppetfiles instead of using json files. This commit also enables the editor to indent properly after a type declaration with a title by adding the `onEnterRules` section.
In VSCode version 1.9 auto-indent was updated. Functionality is documented here.
This requires usto update the https://github.com/lingua-pupuli/puppet-vscode/blob/master/languages/puppet.configuration.json file, with a new
indentationRules
block that contains regex patterns for increasing and decreasing the indent. According to the documentation, we should also change the name frompuppet.configuration.json
topuppet-languages-configuration.json
in order to get validation and editor support.I did a POC locally and have it working somewhat, but it's controlled by a regex so it's going to need some further work to catch all the different cases we have. Examples show a known list of keywords ( if, else, when, do, etc) so we have a possible problem in that we want indentation to occur after both puppet language keywords (the puppet
dsl
) as well as any type name (file
,package
, etc)The text was updated successfully, but these errors were encountered: