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

Replace string,long string to empty (eg. delete functions) #21389

Closed
ManPython opened this issue Feb 24, 2017 · 5 comments
Closed

Replace string,long string to empty (eg. delete functions) #21389

ManPython opened this issue Feb 24, 2017 · 5 comments
Labels
info-needed Issue requires more information from poster

Comments

@ManPython
Copy link

  • VSCode Version: Code 1.9.1 (f9d0c68, 2017-02-09T00:26:45.394Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:

Steps to Reproduce:

  1. There is often case to delete some functions, and we can do this by replace some string to empty, but not in current VSCode Version coz always is required some string in 2nd field to replace the 1st as search field
  2. The question is how to do this, or current replacing must realy expect some string or can be empty to null (eg. the space is not friendly for python where indention is base parser in compiler)
@roblourens
Copy link
Member

This works for me - I can do a search/replace to an empty string. What goes wrong when you try to do it?

@roblourens roblourens added the info-needed Issue requires more information from poster label Feb 24, 2017
@ManPython
Copy link
Author

ManPython commented Feb 25, 2017

You are right if the string is in one single line or as one word, if structure with \n \r then replacing not acting.
Try do with this (python indention):


class ApiConfig(AppConfig):     
     name = "test"

Maybe solution is to offer resize control to the search/replace popup window? It's realy hard to edit longer string to search/replace in short input field where long text is "parsed" to single line.
I discovered this problem when try do refactoring of meta classes as packet vars similar in other classes, the solution to do this was replacing line by line in all files (ctr+shift+f) and not as all packet lines.

@roblourens
Copy link
Member

Search/replace with multiple lines isn't supported right now, so is that the problem? Can you give me steps for exactly what the problem is?

@ManPython
Copy link
Author

Yes this is problem or leak functionality.

Let me explain. In ORM exist many classes eg. django. Refactoring is often hard pain to project clasess easy, clear and cognitive. Soo.. we often replacing names in class Meta globally, eg. name1, name2 to name1object, name2object in all files of project. The example is small coz very ofeten is long json structures as dictionaries, tupples fields or htmls parts (as naturaly override pratice for deafult framework code).

class DefaultClass(Something):   

         class Meta:  
                 name1 = "test"
                 name2 = "test"

Trying reffer to sollution like in https://www.jetbrains.com/help/pycharm/2016.3/move-refactorings.html

@roblourens
Copy link
Member

I see. Multiline search is tracked by #13155. Hope to support it sometime.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants