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

maxLineLength + embedded grammars #473

Merged
merged 2 commits into from
Jan 30, 2018
Merged

maxLineLength + embedded grammars #473

merged 2 commits into from
Jan 30, 2018

Conversation

Aerijo
Copy link
Contributor

@Aerijo Aerijo commented Jan 29, 2018

This changes two things:

  1. The setting limitLineLength has been replaced by maxLineLength. This is then set to 1000, and the related rules that were in effect are deleted because they are now redundant.

  2. The property injectionSelector is added with a value of source.embedded.jsx. This means that when the scope source.embedded.jsx is encountered in another file, it will automatically use this packages grammar for the duration of the scope. For example, the scope will be encountered in a markdown file using language-gfm if the following is present:

```jsx
<jsx code>
```

@Aerijo
Copy link
Contributor Author

Aerijo commented Jan 29, 2018

Please note I haven't tested any changes, so that should be done before any merging. I don't know how good the CI specs are at catching regressions / what they look for.

@gandm
Copy link
Owner

gandm commented Jan 29, 2018

Thanks. I actually put the limitLineLength to false for a reason - I allude to it in this issue #340 (comment) but I cant actually remember the specifics of why I prefer my approach to the one provided by Atom.

The grammar specs are pretty thorough and they seem to pass but I never do any with extra long lines.

@Aerijo
Copy link
Contributor Author

Aerijo commented Jan 29, 2018

@gandm it could have been the fact that in the event a line is truncated, the rules will still be applied to the start. This would have caused the string scope to overflow, because the opening quote was seen, but not the proper end one. With the existing setup, it would hide the entire line from the parser.

The second change should be fine though. I'll fix the PR.

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

2 participants