automated-refactoring Questions

1

Does anyone know if it's possible to configure VSCode to have the following occur after moving a file to another locations? Update the namespace of the class/trait. Update the imports of all other...
Postmistress asked 21/6, 2021 at 20:35

1

Is there a way to get clang-format to turn this: function_name("a very very " | <-- column limit "very very " | "long string"); | into this: function_name("a very very very very long" | "...
Childbirth asked 22/3, 2018 at 23:53

2

I have to modify around 1 000 of typescript files in a specific way: I need to replace all StringLiteral and JsxText tokens with a CallExpression to a translation function for internationalization ...

3

How to refactor this class programmatically via Java code/Groovy plugin? Let's say, I need to: Rename foo.method2 to foo.method3 Rename myMethod to yourMethod Change the imported package org.you.c...
Malraux asked 21/2, 2023 at 11:43

0

It is possible to define custom snippets of code that VS Code can auto complete. These can even use place-holders so that one can fill in the blanks as required. /* Before */ //= /* After (for ex...
Zarah asked 19/7, 2022 at 16:27

8

Solved

I have a foreach loop in Java (simplified version here) List<String> names = getNames(); for(String name:names) { doSomething(name); } Is there an automated way to refactor this to a trad...
Durkin asked 5/6, 2015 at 8:52

3

I and my team are working on an angular application from more than a year now. As part of our code refactoring process we want to delete unused or dead code from our repo. Is there any technique o...
Toadflax asked 11/11, 2018 at 9:42

1

Recently I started to use Black code formatter for my projects and sometimes it can be hard to track did I formatted all my changed files or not. Let's assume that my project contains 20 different ...

1

Solved

Is there an option to remove and sort usings automatically on save for the current document? This used to be provided by the Power Commands for Visual Studio extension. Is this available somewhere ...
Nonconductor asked 28/1, 2022 at 18:42

4

Solved

We are refactoring our code base. Old: from a.b import foo_method New: from b.d import bar_method Both methods (foo_method() and bar_method()) are the same. It just changed the name an the packag...
Erida asked 23/11, 2021 at 13:1

1

Solved

VS Code has a 'Convert namespace import to named imports' refactoring. As far as I understand, the refactoring is defined in the Typescript codebase itself, so it's not specific to VS Code. I need ...

3

Recently I've found myself working with R code that is all over the map in terms of coding style - multiple authors and individual authors who aren't rigorous about sticking to a single structure. ...
Suited asked 2/2, 2012 at 0:12

3

Solved

I'm in the process of moving a project currently compiling with gcc to clang, and have a bunch of warnings that gcc didn't generate (-Winconsistent-missing-override). clang-tidy works for fixing th...
Sacrilegious asked 8/2, 2016 at 3:15

4

Solved

When writing C++ code, I often start by writing full 'implementation' code in my header files, then later need to refactor the implementation into a .cpp file. This is great, but I find this proc...
Informality asked 25/6, 2012 at 6:28

3

Solved

I switched to Visual Studio Code for Python programming recently. Below is my Python configuration in Visual Studio Code settings: "python.pythonPath": "/Users/hzhang/.virtualenvs/env-2.7/bin/pyth...

1

Solved

Why I cannot (?) move a method from one Dart file to another using Android Studio and Flutter Plugin? My file is getting big and I decided to refactor it by separated some Widget build methods to t...

3

Solved

I have a lot of C# code that uses public fields, and I would like to convert them to properties. I have Resharper, and it will do them one by one, but this will take forever. Does anyone know of ...
Clincher asked 22/6, 2009 at 18:16

2

I am trying to cleanup/refactor a legacy C# solution and am therefore exploring options how certain refactorings or quick actions could be applied for the entire solution. For example, Visual Stud...
Reciprocal asked 27/3, 2019 at 15:53

2

I am in the middle of a big refactoring. I have dozens of methods, which are called via positional parameters. Now I would like to have them called via named parameters. The methods exist in sever...

1

Solved

I have the following class: class Dogs(object): def __init__(self): self.names = [] self.breeds = set() def number(self): return len(self.names) I want to change number to being a property...

6

Solved

I am having trouble finding the correct refactor option for the following scenario: I have code like this (in Outer.java): public class Outer { // ... class stuff public static class Inner { ...
Magnetism asked 22/1, 2010 at 14:43

2

Solved

Often after refactoring throws sections become unnecessary. IntelliJ highlights them with grey showing that they can be removed, but I'd like to remove them automatically (just like unused imports ...
Defrost asked 19/3, 2018 at 12:36

1

IntelliJ provides Extract Property refactoring which can be used to extract maven artifact versions to properties in pom.xml. Extract Property refactoring creates a new property definition in t...
Collectivity asked 23/9, 2016 at 7:54

2

Solved

With eclipse i can easily transform the static invocation to import java.util.Arrays; import java.util.List; public class StaticImport { public static void main(String[] args) { List<String...
Canzonet asked 30/7, 2014 at 10:6

2

I'm looking for a tool that will automate the process of optimizing the imports on a code base. This tool is available in most IDEs (IntelliJ for instance) which removes unused imports and expands ...
Hydrotherapeutics asked 9/4, 2014 at 21:1

© 2022 - 2024 — McMap. All rights reserved.