Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@winstliu
Copy link
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Single-line comments were overcomplicated. They've been this way at least since the JSON -> CSON conversion. This PR simplifies them, in the process fixing an import bug, and also adds some basic specs for them.

Alternate Designs

None.

Benefits

Easier-to-reason-about code.

Possible Drawbacks

As far as I can tell, none.

Applicable Issues

Fixes #485.

lines = grammar.tokenizeLines '''
import a from 'a'; //
import b from 'b';
'''
Copy link
Contributor

Choose a reason for hiding this comment

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

This test doesn't cover the original issue. Corrected:

lines = grammar.tokenizeLines '''
  import a from 'a' //
  import b from 'b'
'''
expect(lines[1][0]).toEqual value: 'import', scopes: ['source.js', 'meta.import.js', 'keyword.control.js']

@winstliu winstliu merged commit f975e17 into master Jan 27, 2017
@winstliu winstliu deleted the wl-fix-line-comments branch January 27, 2017 23:09
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.

End-of-line comments break next-line imports

3 participants