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

Font-lock facts and built-in variables #47

Open
bbatsov opened this issue Apr 23, 2014 · 5 comments
Open

Font-lock facts and built-in variables #47

bbatsov opened this issue Apr 23, 2014 · 5 comments

Comments

@bbatsov
Copy link
Contributor

bbatsov commented Apr 23, 2014

I think it would be great if we font-locked facts and built-in variables differently from user-defined variables to highlight their special status. A list of them is available here. In ruby-mode we use font-lock-builtin-face for those, although I guess we can introduce a different face in puppet-mode.

They'll also be a great candidate for completion when we get to the completion-at-point-functions support.

@swsnr
Copy link
Contributor

swsnr commented Apr 23, 2014

We can add a list of all built-in facts, but it's going to be huge, and how should we deal with variable facts, e.g. ipaddress_eth0?

For completion, I'd not rely upon a built-in list of facts, but rather parse the output of facter.

@bbatsov
Copy link
Contributor Author

bbatsov commented Apr 23, 2014

The problem is that if you have a master/server setup it's unlikely that you'll have facter installed locally.

If you think this list is huge I guess you haven't seen the built-in lists in ruby-mode and clojure-mode. :-)

@swsnr
Copy link
Contributor

swsnr commented Apr 23, 2014

@bbatsov I don't think that we'll be able to re-use the list compiled for fontification for completion. Fontification must use regular expressions to deal with variable fact names (e.g. ipaddress_.+), but we can't complete with such expressions.

@bbatsov
Copy link
Contributor Author

bbatsov commented Apr 23, 2014

I think we can generate the regexp from the list of built-in vars/facts and use the list itself as a completion source.

@swsnr
Copy link
Contributor

swsnr commented Apr 23, 2014

@bbatsov Sounds good. I'll look into it.

@swsnr swsnr self-assigned this Apr 23, 2014
@swsnr swsnr removed their assignment Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants