Skip to content
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

EPP files do not appear to tokenise correctly #68

Open
glennsarti opened this issue Jun 27, 2020 · 4 comments
Open

EPP files do not appear to tokenise correctly #68

glennsarti opened this issue Jun 27, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@glennsarti
Copy link
Contributor

Originally logged by @llowder in #66

Describe the Bug

In an epp file, specifically in a templated shell script, comment highlighting breaks inside function blocks.

image

Ref - https://www.dropbox.com/s/jvn5aif7qd4s4it/vscode_puppet_epp_highlight.png?dl=0

Expected Behavior

Functions should tokenise like a node or class statement

Steps to Reproduce

function bar {
  # something
}

Environment

  • Version [e.g. 1.27.0] N/A
  • Platform [e.g. Ubuntu 18.04] N/A

Additional Context

@glennsarti glennsarti added the bug Something isn't working label Jun 27, 2020
@glennsarti
Copy link
Contributor Author

@glennsarti
Copy link
Contributor Author

Hrmm actually, the EPP syntax highlighter is very broken :-(

@glennsarti glennsarti changed the title Functions do not appear to tokenise correctly EPP files do not appear to tokenise correctly Jun 28, 2020
@glennsarti
Copy link
Contributor Author

This is not a function tokenising problem. The EPP language uses the same syntax file, but the puppet code is only valid within certain types of tokens e.g. <% ...... %>

This will need a new syntax file for EPP files.

@glennsarti
Copy link
Contributor Author

glennsarti commented Jun 28, 2020

@llowder Note in the example above the syntax highlighting is breaking because that is not valid Puppet code. Functions MUST have a return type (and should be namespaced)

Ref - https://puppet.com/docs/puppet/latest/lang_write_functions_in_puppet.html#syntax-of-functions

function <MODULE NAME>::<NAME>(<PARAMETER LIST>) >> <RETURN TYPE> {
  ... body of function ...
  final expression, which is the returned value of the function
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant