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 258805 Details for
Bug 475952
[Quickfix] Provide quickfix to rename a shadowed variable
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
475952.patch (text/plain), 3.00 KB, created by
Olivier Thomann
on 2015-12-18 12:14:45 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2015-12-18 12:14:45 EST
Size:
3.00 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js >index a2b5c33..55cb8c0 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js >@@ -88,8 +88,13 @@ > that.timeout = null; > }, 5000); > var files = [{type:'full', name:params.input, text:text}]; //$NON-NLS-1$ >+ var offset = params.offset; >+ if (params.annotation) { >+ // this is used in the quickfix to get the right offset >+ offset = params.annotation.start; >+ } > that.ternworker.postMessage( >- {request:'rename', args:{params:{offset: params.offset}, files: files, meta:{location: params.input}, newname:''}}, //$NON-NLS-1$ >+ {request:'rename', args:{params:{offset: offset}, files: files, meta:{location: params.input}, newname:''}}, //$NON-NLS-1$ > function(response) { > var changes = response.changes; > if(changes && changes.changes && changes.changes.length > 0) { >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js >index 894900f..4ab4531 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js >@@ -176,5 +176,6 @@ > 'no-self-compare' : 'Disallow self compare:', > 'no-irregular-whitespace' : 'No irregular whitespace:', > 'no-self-assign' : 'Disallow self assignment:', >- 'type-checked-consistent-return' : 'Report return inconsistent types' >+ 'type-checked-consistent-return' : 'Report return inconsistent types', >+ 'noShadowFixName' : 'Rename in scope' > }); >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >index db37371..3020d12 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >@@ -788,7 +788,24 @@ > {source: "annotation:id", match: "^(?:no-new-array)$"} //$NON-NLS-1$ //$NON-NLS-2$ > ] > } >- ); >+ ); >+ >+ provider.registerServiceProvider("orion.edit.command", //$NON-NLS-1$ >+ new RenameCommand.RenameCommand(astManager, ternWorker, scriptresolver, CUProvider), >+ { >+ name: javascriptMessages["noShadowFixName"], >+ scopeId: "orion.edit.quickfix", //$NON-NLS-1$ >+ id : "no.shadow.fix", //$NON-NLS-1$ >+ contentType: ['application/javascript', 'text/html'], //$NON-NLS-1$ //$NON-NLS-2$ >+ validationProperties: [ >+ { >+ source: "annotation:id", //$NON-NLS-1$ >+ match: "^(?:no-shadow)$" //$NON-NLS-1$ >+ } >+ ] >+ } >+ ); >+ > > /** > * legacy pref id
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 475952
: 258805