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

Make the syntax work with Syntect; support Cargo.lock and Gopkg.lock TOML files #9

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

emidoots
Copy link

@emidoots emidoots commented Jun 4, 2018

This is based on / can be merged after #7 is merged.

@jasonwilliams
Copy link
Owner

@slimsag does this need rebasing?

@FichteFoll
Copy link

FichteFoll commented Jun 8, 2018

f50a73c is definitely a bug in syntect that should be fixed. Usually you want to avoid unnecessary capture groups like these.

eceda6d would be easy enough to add manuall/cherry-pick, though you have to wonder what other usages the lock extension might have. Pipfile.lock, for example, uses JSON syntax.

@emidoots
Copy link
Author

emidoots commented Jun 8, 2018

f50a73c is definitely a bug in syntect that should be fixed. Usually you want to avoid unnecessary capture groups like these.

I agree, although my hope is that we would be okay with this workaround for now (until the bug is fixed there, I will file a bug on Syntect)

eceda6d would be easy enough to add manuall/cherry-pick, though you have to wonder what other usages the lock extension might have. Pipfile.lock, for example, uses JSON syntax.

That is a good point, I tried to find other examples of .lock files online but wasn't able to easily. I can change this to only match Cargo.lock and Gopkg.lock, then

Will update this PR soon.

emidoots added 2 commits June 8, 2018 18:41
So that the syntax can work with Syntect, otherwise you get:

```
ParseSyntax(RegexCompileError("((?:[ \\t\\n]|$)*)", Error(-114, target of repeat operator is invalid)))
```
@emidoots
Copy link
Author

emidoots commented Jun 9, 2018

PR updated & re-tested, should be good to merge now :)

@@ -6,12 +6,14 @@ name: TOML
file_extensions:
- toml
- tml
- Cargo.lock
- Gopkg.lock
Copy link
Author

Choose a reason for hiding this comment

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

(note: in case anyone questions this, other syntaxes also specify full filenames in the file_extensions section and both Sublime and Syntect support this feature. e.g. see https://github.com/zyxar/Sublime-CMakeLists/blob/ff9a800a4ca942edd095de553ca05fba03b02275/CMake.sublime-syntax#L7)

@jasonwilliams jasonwilliams merged commit 72ae770 into jasonwilliams:master Jun 12, 2018
@jasonwilliams
Copy link
Owner

jasonwilliams commented Jun 12, 2018

Great work @slimsag

This has been released here:
https://github.com/jasonwilliams/sublime_toml_highlighting/releases/tag/v2.1.0

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.

3 participants