Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

add go.mod and go.sum support #2344

Merged
merged 2 commits into from
Mar 2, 2019

Conversation

calebdoxsey
Copy link
Contributor

For: #1886

I was 90% done with this before I realized there was already a PR out there from a few months ago. If this isn't useful, feel free to close.

@msftclas
Copy link

msftclas commented Feb 22, 2019

CLA assistant check
All CLA requirements met.

@ramya-rao-a
Copy link
Contributor

Thanks for the PR @calebdoxsey. Looks like this is your first contribution to this project, Thanks & Welcome!

I realized there was already a PR out there from a few months ago

Which PR are you referring to here?

@calebdoxsey
Copy link
Contributor Author

Here's the PR in the atom repo: atom/language-go#156

@ramya-rao-a
Copy link
Contributor

@brainsnail Do you know if there is an ETA for your PR (atom/language-go#156)?

If not, then would you be interested in reviewing this PR and give us your feedback?

@brainsnail
Copy link
Contributor

@ramya-rao-a As far as I know there hasn't been an update on that PR, but I'm fine with taking a look at this PR instead 😄

I'll take a look at it this soon @calebdoxsey.

},
"semver": {
"comment": "Semver version strings (v1.2.3)",
"match": "v(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\da-z-]+(?:\\.[\\da-z-]+)*)?(?:\\+[\\da-z-]+(?:\\.[\\da-z-]+)*)?",
Copy link
Contributor

Choose a reason for hiding this comment

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

the "official" regexp is: ^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+incompatible)?$

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's for the special pseudo version: https://tip.golang.org/cmd/go/#hdr-Pseudo_versions

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I agree about using that regex instead - I wrote one by hand on the Atom repo, but we may want to just use the same regex as the one the language uses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is it only matches pseudo versions:

v0.0.0-20161113214103-89cd22812c4f

It won't match

v1.2.3

At least that's how I read the regex. Is there another one that matches both?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you are right - the code they use to validate the semver is here.

In testing out your branch locally I didn't experience any problems.

@brainsnail
Copy link
Contributor

I tried it out with a few different repos that had modules enabled and did some go mod init-ing on a few others to see how it handled the highlighting. As far as that goes - I think it works great. It highlighted the proper keywords on the go.mod files, gave appropriate highlighting on versions and kept comment formatting. The go.sum file highlights the most important piece - the version.

Super glad to see it moving forward 👍

Copy link
Contributor

@brainsnail brainsnail left a comment

Choose a reason for hiding this comment

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

I think if the official regex works, then we should use that, but that's really it. Thanks so much for adding the grammars in here 🎊

package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@brainsnail brainsnail left a comment

Choose a reason for hiding this comment

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

Thank you @calebdoxsey 👍

@ramya-rao-a
Copy link
Contributor

Thanks a lot @brainsnail and @calebdoxsey!

@ramya-rao-a ramya-rao-a merged commit df3499d into microsoft:master Mar 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants