Open
Conversation
Old method needed a newline character to stop, resulting in an endless loop when compiling a one-line file
The old method triggered the LESS compilation on "core:save" which happens before the new file content is actually written on the disk. With the "onDidSave", you don't need to save your file twice to get your changes compiled.
Owner
|
I am happy to transfer ownership. |
Owner
|
Two things:
|
schmuli
requested changes
Apr 21, 2018
|
|
||
| deactivate: -> | ||
| @subscriptions.dispose() | ||
|
|
Owner
There was a problem hiding this comment.
You should probably get rid of this too
| fs.readFile filepath, (err, fileData) => | ||
| if err != null | ||
| callback err | ||
| callback null, fileData.toString().match /.*/ |
Owner
There was a problem hiding this comment.
The point of this file is to read the first line of a file in the most efficient way possible. So instead of reading in the entire file, which could be very large, we instead read as few bytes as possible while looking for the the newline separator. We then pass the first line to the callback.
Your change is reading the entire file, and is actually passing a RegEx Match object, which is not what the callback is expecting, as far as I know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My Atom kept freezing each time I created a new .less file so I investigated and fixed 2 bugs.
Also I've seen that you don't maintain the code anymore and you may not want to test my changes. If you agree I can take the ownership of the code and plugin.