Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 262467 Details for
Bug 496202
[quickfix][eslint] Quickfix for gratuitous parentheses doesn't work if the closing parenthesis is on the next line.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch including regression tests
496202.patch (text/plain), 2.28 KB, created by
Olivier Thomann
on 2016-06-15 13:10:27 EDT
(
hide
)
Description:
Proposed patch including regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2016-06-15 13:10:27 EDT
Size:
2.28 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/quickfixes.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/quickfixes.js >index 3829cdd..9a78604 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/quickfixes.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/quickfixes.js >@@ -354,10 +354,17 @@ define([ > */ > "no-extra-parens": function(annotation, annotations, file) { > return applySingleFixToAll(annotations, function(annot) { >- var token = Finder.findToken(annot.start, file.ast.tokens); >- var openBracket = file.ast.tokens[token.index-1]; >+ var tokens = file.ast.tokens; >+ var token = Finder.findToken(annot.start, tokens); >+ var openBracket = tokens[token.index-1]; > if (openBracket.value === '(') { >- var closeBracket = Finder.findToken(annot.end, file.ast.tokens); >+ var closeBracket = Finder.findToken(annot.end, tokens); >+ if (closeBracket.value !== ')') { >+ // try the next token if ')' is on the next line >+ if (tokens.length > closeBracket.index + 1) { >+ closeBracket = tokens[closeBracket.index + 1]; >+ } >+ } > if (closeBracket.value === ')') { > var replacementText = ""; > if (token.index >= 2) { >diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/quickfixTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/quickfixTests.js >index 9940d08..4a893bf 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/quickfixTests.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/quickfixTests.js >@@ -2461,6 +2461,21 @@ define([ > callback: callback, > contentType: 'text/html'}); > }); >+ it("no-extra-parens - multiline expression",function(callback) { >+ var rule = createTestRule('no-extra-parens'); >+ var expected = [ >+ {value: "", >+ start: 10, >+ end: 11}, >+ {value: "", >+ start: 14, >+ end: 15} >+ ]; >+ return getFixes({buffer: 'if (a === (\nb\n)){}', >+ rule: rule, >+ expected: expected, >+ callback: callback}); >+ }); > }); > //NO-EXTRA-SEMI > describe('no-extra-semi', function(){
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 496202
: 262467