Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing consistent behavior for Rename operation in custom files #9397

Open
Mylan719 opened this issue Mar 2, 2016 · 1 comment
Open
Labels
Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - Rename Question
Milestone

Comments

@Mylan719
Copy link

Mylan719 commented Mar 2, 2016

Hi,
I am working on Visual Studio 2015 extension.
Is there any API that would let me use the renaming/refactoring dialog like in Code Editor, but inside my custom markup files?
I know there is Renamer class for renaming symbols in roslyn workspace.
But I would like to make use of renaming In my custom markup files.
So I quess I need to rename symbols in my markup by myself, then use Renamer helper class on roslyn workspace.
But it would be nice if renaming behaved the same in markup as it does in Code editor.

Example of markup i wish to use renaming tools in:

@viewmodel MyViewModel, MyAssembly
<div>
{{_this.MyPropety}}
<div>

Code file:

public class MyViewModel
{
     public string MyProperty {get; set;}
}

The behaviour I want to reproduce in my markup file is:

  1. Whith cursor on MyPropety in markup file I hit Ctrl+R+R
  2. Renaming dialog appears
  3. I rename MyPropety to something else
  4. I commit the rename operation
  5. Here I would like to insert my own behaviour that would rename the symbols in my markup files and then rename it in the workspace. (I already have functionality that gives me resolved roslyn ISymbol for position inside my markup file in place.)

I have read quite a bit of roslyn source but everything thought could use is internal.

@Mylan719 Mylan719 changed the title Providing same behavior for Rename operation in custom files Providing consistent behavior for Rename operation in custom files Mar 2, 2016
@Pilchie Pilchie added Question Concept-API This issue involves adding, removing, clarification, or modification of an API. Area-IDE labels Mar 2, 2016
@DustinCampbell DustinCampbell added this to the Unknown milestone Mar 2, 2016
@liviriniu
Copy link

This would be very very helpful for at least refactoring scenarios of large code scope / volume that involve markup files and their C# code-behind counterparts. Also would significantly ease tight development where you test & refactor as you go.

Relevant in situations of highly coupled code files with markup files (by bindings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - Rename Question
Projects
None yet
Development

No branches or pull requests

6 participants