-
Notifications
You must be signed in to change notification settings - Fork 21
(GH-24) Allow parsing in tasks mode #93
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
Conversation
|
Extracting and using the bolt metadata may be another PR. The scope is creepin' |
19cdcd2 to
d71fe76
Compare
16bfea4 to
7f7138c
Compare
Previously the parser helper was silently failing to parse documents that had the cursor at line 0, char 0. This was due to the removal based methods trying to remove characters at the beginning of the document. This commit modifies the helper to ignore these parsing attempts if the cursor is at line 0, char 0.
7f7138c to
054eef4
Compare
d0cbe2d to
08ed9ba
Compare
|
With the puppetlabs-reboot module I still get a syntax error: Environment: VSCode: Puppet: Repro steps:
|
|
Repro'd. Try to figure out what's gone south ... |
|
Found it...URI escaping was breaking my path checking. |
08ed9ba to
b86ce67
Compare
|
Fixed. Had to rework the URIHelper. .... and CI blew up :-) |
The Puppet language introduced Puppet Tasks and Plans as part of Puppet 5.4.0 [1]. A special parsing switch `--tasks` was introduced which changes the behaviour of the Puppet parser, that is switching it into "tasks" mode. Unfortunately this switch is global to all Puppet parsing therefore to dynamically switch it like we do in Editor Services, this required a global mutex to be used. Note that this commit does not add Puppet Tasks/Plans intellisense but merely allows the standard manifest providers (completion, validation etc.) to actually function instead of silently failing This commit; * Modifies the Puppet parser, via monkey patching, to implement a "singleton" parsing method that dynamically, and safely, switch the parsing mode on a per request basis * Modifies the Document Store to detect whether a File URI is a Puppet Task/Plan based on the relative path of the file versus the module root. * Modifies the various providers to call the parsing helper in the correct mode * Modifies the Message Router to detect whether a file is a Puppet Task/Plan and then sets the appropriate mode when calling the manifest providers (completion, validation etc.) [1] https://puppet.com/docs/bolt/1.x/writing_plans.html#concept-4485
This commit updates two minor violations that appeared as part of robocop 0.63.1.
b86ce67 to
06c8b01
Compare
|
We'll have to add documentation in the vscode readme about what to expect. For example, we no longer throw errors, but the advanced features are not implemented yet. WIP, etc |


The Puppet language introduced Puppet Tasks and Plans as part of
Puppet 5.4.0 [1]. A special parsing switch
--taskswasintroduced which changes the behaviour of the Puppet parser, that
is switching it into "tasks" mode. Unfortunately this switch is
global to all Puppet parsing therefore to dynamically switch it
like we do in Editor Services, this required a global mutex to be
used.
Note that this commit does not add Puppet Tasks/Plans intellisense
but merely allows the standard manifest providers (completion,
validation etc.) to actually function instead of silently failing
This commit;
"singleton" parsing method that dynamically, and safely, switch
the parsing mode on a per request basis
Puppet Task/Plan based on the relative path of the file versus
the module root.
correct mode
Task/Plan and then sets the appropriate mode when calling the
manifest providers (completion, validation etc.)
[1] https://puppet.com/docs/bolt/1.x/writing_plans.html#concept-4485
Fixes #24
Puppet[:tasks]Completion Provider
Definition Provider
Document Symbol Provider
Hover Provider
Validation Provider
Puppet[:tasks]