This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Limit QuickView to literal color names in some languages #8156
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8efafdf
Limit QuickView to literal color names in some languages
ad80150
Merge remote-tracking branch 'upstream/master' into quick-view-literal
d4a5cb3
Use whitelist instead of blacklist
72584d6
Only call getModeAt if needed
93e1eaa
Merge remote-tracking branch 'upstream/master' into quick-view-literal
64a418c
Renamed var & method
bf24ee7
Merge remote-tracking branch 'upstream/master' into quick-view-literal
8c7fcda
Add LESS
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* Sample JS for testing the QuickView extension. */ | ||
|
||
function green() { // generate green colors | ||
var color = "green", | ||
tan = Math.tan; | ||
return tan(array["red"], array[red]); | ||
} | ||
darkgray | ||
// #123456 | ||
// :rgb(65, 43, 21) |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TokenUtils.getModeAt()
is not a cheap method to call, so we need to minimize the number of times it is called. Until we add support for inline css in style attributes, then it's safe to assume that entire line has same mode, so only need to check it once per line. It's simpler to just pass inmode
instead of botheditor
andpos
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, can calculate
ignoreNamedColors
for line and just pass that in.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redmunds
getModeAt
is only called when there is an actual result and it's only called once per line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I was hoping to make the loop & params a little cleaner, but that's more efficient, so I'm good with it.