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

Terraform (HCL) (*.tf): new parser #3683

Closed
wants to merge 14 commits into from

Conversation

Haggus
Copy link
Contributor

@Haggus Haggus commented Mar 29, 2023

Add support for Terraform (HCL) files.

Continuation of #2952

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add "args.ctags" file with contents:

--sort=no

Sorted tags output is hard to compare with the input.

--regex-terraform=/^[[:space:]]*provider[[:space:]]*"([^"]*)"/\1/p,Provider/
--regex-terraform=/^[[:space:]]*module[[:space:]]*"([^"]*)"/\1/m,Module/
--regex-terraform=/^[[:space:]]*output[[:space:]]*"([^"]*)"/\1/o,Output/
--regex-terraform=/^resource[[:space:]]"([^"]+)"[[:space:]]"([^"]+)"/\2/r,Resource/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use both kind letter and kind long name in "r,Resource".
However, r is already defined with --kinddef-terraform. So you should use only 'r' here.

--regex-terraform=/^resource[[:space:]]"([^"]+)"[[:space:]]"([^"]+)"/\2/r/

--regex-tf=/^[[:space:]]*module[[:space:]]*"([^"]*)"/\1/m,Module/
--regex-tf=/^[[:space:]]*output[[:space:]]*"([^"]*)"/\1/o,Output/
--regex-tf=/^([a-z0-9_]+)[[:space:]]*=/\1/f,TFVar/
--langdef=terraform
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terraform or TerraForm is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. It should be Terraform.

@masatake
Copy link
Member

Looks good for me. @Haggus thank you for adding the test cases. They were really what I needed.

I would like to squash these into one.

I would like to squash into one commit.
In that case, we have to think about how the "author" of the commit should be.

The Author must be Antony Southworth. So your named will be put to the commit like:

Co-authored-by: Mateusz Mrowiec <...>
Co-authored-by: Masatake YAMATO <...>

Is this acceptable?

@Haggus
Copy link
Contributor Author

Haggus commented Mar 29, 2023

Looks good for me. @Haggus thank you for adding the test cases. They were really what I needed.

I would like to squash these into one.

I would like to squash into one commit. In that case, we have to think about how the "author" of the commit should be.

The Author must be Antony Southworth. So your named will be put to the commit like:

Co-authored-by: Mateusz Mrowiec <...>
Co-authored-by: Masatake YAMATO <...>

Is this acceptable?

Sounds good to me 👍

@masatake
Copy link
Member

Ok, I will take over this.

@Haggus
Copy link
Contributor Author

Haggus commented Mar 29, 2023

@masatake One more thing. Windows build doesn't pass. I think entries in ctags_vs2013.vcxproj have been put incorrectly. I need to fix that.

@Haggus
Copy link
Contributor Author

Haggus commented Mar 29, 2023

It's all green, good to go!

masatake pushed a commit to masatake/ctags that referenced this pull request Mar 29, 2023
@masatake
Copy link
Member

See #3684.

masatake pushed a commit to masatake/ctags that referenced this pull request Mar 29, 2023
masatake pushed a commit to masatake/ctags that referenced this pull request Mar 29, 2023
masatake pushed a commit to masatake/ctags that referenced this pull request Mar 30, 2023
masatake pushed a commit to masatake/ctags that referenced this pull request Mar 30, 2023
@masatake masatake mentioned this pull request Mar 31, 2023
masatake pushed a commit to masatake/ctags that referenced this pull request Apr 1, 2023
@masatake
Copy link
Member

masatake commented Apr 1, 2023

Closed via #3684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants