Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
1 answer
189 views

When I refactor a class with a regular constructor to a primary constructor I'd like Visual Studio to capitalize the name of the parameters. For example: public class Desk { private Guid Material; ...
Brad's user avatar
  • 12.4k
1 vote
1 answer
60 views

I have a legacy application with lots of cases where classes use an old-style (Java-like) property pattern with getXXX() and setXXX() method pairs and a backing private variable, for example: class ...
user1211286's user avatar
0 votes
1 answer
60 views

I am working with Playwright on a test automation project. I already have several Pages classes and would now like to move a method from one class to another. This already has various references. Is ...
Michael S.'s user avatar
0 votes
0 answers
62 views

I have many hundreds of python functions I'm evaluating for memory usage, and many of them differ simply by the usage of intermediate variable assignments. I would like a way, if possible, to ...
Mathhead's user avatar
2 votes
1 answer
112 views

I have hundreds occurences of this kind of lines in my app : public ICommand MyCommandName => ReactiveCommand.Create(TriggerCommand); I tried without luck to add a Custom Pattern in resharper to ...
Whiletrue's user avatar
  • 645
-1 votes
1 answer
283 views

I have a working code generator, that on top-level, just instantiates modules and takes care of all the connectivty - that one is proven to be working. I would like now to partition some of the ...
John T.'s user avatar
1 vote
1 answer
201 views

I am trying to compare different linters and their performance with custom rules. Ast-grep is promising, and likely runs much faster than eslint, as it is written in Rust instead of javascript. ...
Steven Love's user avatar
2 votes
2 answers
230 views

We have a Python codebase containing quite a lot recursive functions, they may run into deep recursions and break the recursion limit with default Python interpreter settings. We have used sys....
freeswan's user avatar
0 votes
1 answer
242 views

Usually, I can disable an annoying warning by wrapping two pragma warning disable statements around it. For instance: #pragma warning disable IDE0060 public static int MultiplyByZero(int Number) =&...
Brendan Lynn's user avatar
0 votes
1 answer
104 views

I have been given a medium-sized but complex C project (about 200,000 lines in total) which contains around 100 .h files and nearly as many .c files. Many of the .h files correspond to equivalent .c ...
Wilseus's user avatar
0 votes
0 answers
44 views

I'm looking for a suggestion on how to refactor a +50K lines of Java. Inspired by version 2.x of the AWS SDK for Java, which has many builders and almost no getters / setters that start with a leading ...
algonell's user avatar
  • 185
3 votes
1 answer
827 views

I've got a project I've been wrestling with for a while, which is almost ready for submission; but there have been a few previous coders who have contributed. Their code is great, but it doesn't ...
Michael Macha's user avatar
0 votes
1 answer
104 views

Gimp has script-fu for scripting code in Scheme. But i don't know does ít has the reverse function? It mean, when i draw or do something, can it generate scheme code or any language parallel with that ...
user avatar
9 votes
3 answers
2k views

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.core....
Garruk The Wildspeaker's user avatar
1 vote
0 answers
353 views

This is a small quality of life issue, but I'm curious if there is a solution. I'm working with a python file in visual studio code. I'm using the "Extract Method" feature to do some ...
Zimos's user avatar
  • 11
4 votes
2 answers
6k views

Typically when I implement an interface or write code for which usings are missing it is possible to press Ctrl+. (or right click and press 'Quick Actions and Refactorings...') to get a menu of ...
jool's user avatar
  • 2,431
4 votes
2 answers
793 views

Background Hundreds of class files need to be renamed with a prefix. For example, rename these: com.domain.project.Mary com.domain.project.Jones com.domain.project.package.Locket com.domain.project....
Dave Jarvis's user avatar
  • 31.3k
-2 votes
1 answer
38 views

I'm working on making a change to a large C++ codebase where I need to change a method call to an equivalent function call, e.g. someExpression.foo() becomes bar(someExpression). A few more examples ...
Bri Bri's user avatar
  • 1,992
-1 votes
1 answer
48 views

What IntelliJ format setting should be set to automatically change line comments to look like: validcode(); // comment1 // comment2 validCode(); from lookin like this: validcode();...
Igor Velikopopovetsky's user avatar
0 votes
0 answers
134 views

In WebStorm, I would really like to know if there's a way to refactor the structure of objects. Let's say I have this object, inventory = { fruits: [ {type: 'apple', quantity: 24}, {type: '...
jna's user avatar
  • 996
1 vote
1 answer
497 views

I am writing an automated code that opens a text file and reads it line by line: if __name__ == '__main__': #Argument Required: Full directory of log file for processing parser = ...
CaffeineAndCode 's user avatar
0 votes
3 answers
533 views

I have a file that is a python code (may not be syntactically correct). It has some functions which are commented out except the signature. My goal is to detect those empty functions using a regex and ...
ishandutta2007's user avatar
1 vote
1 answer
171 views

I have this function f(MyType a, b) and I want to it to become f(MyType a, b, c). The problem is that f is called by multiple other functions (g(), h(), i()) which in turn are called by multiple other ...
clappy_blappy's user avatar
10 votes
1 answer
1k views

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 ...
Maddy Guthridge's user avatar
0 votes
1 answer
385 views

I have two Win10 PC, both with the same installation VS2019 Enterpsrise(Version 16.11.15). Almost the same extensions. But in one VS installation, quick action menu and it's options look like on the ...
KeiserSoze's user avatar
5 votes
1 answer
2k views

I wanted to rename a module in a Python project, however I would then need to update all the imports to match. The VSC Python extension has a clearly documented feature that should do this listed here:...
Kokonoe's user avatar
  • 71
1 vote
0 answers
49 views

Summary: After moving a file with a TestCase class in it (using refactor), tests are no longer executed at all. I have a class startupTests.py that has: import unittest import logging logging....
Natan's user avatar
  • 1,141
1 vote
1 answer
1k views

When trying to refactor function names, variable names, or class names within all files using F2 (as shown at https://code.visualstudio.com/docs/editor/refactoring#_rename-symbol), I only seem to have ...
Cameron Abt's user avatar
0 votes
1 answer
320 views

I was extracting closure to method but I always get this error: Function is unused This is whole working func: fileprivate func attemptToChangePassword() { passwordChanger.change(...
Nikola's user avatar
  • 65
10 votes
1 answer
23k views

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 ...
user avatar
4 votes
1 answer
6k views

I would like to update YAML file values in Python without losing formatting and comments in Python. For example I would like to tranform YAML file value: 456 # nice value to value: 6 ...
Přemysl Šťastný's user avatar
2 votes
1 answer
261 views

I have a small module that defines a function: # small_file.py def func(): ... I have a larger module that does a wildcard import of that one: # giant_file.py from small_file import * ... I have ...
dshin's user avatar
  • 2,468
10 votes
1 answer
15k views

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 in ...
dodekja's user avatar
  • 595
1 vote
0 answers
116 views

I wrote this redundant code consisting of 30 lines: if Button = TMouseButton.mbLeft then begin if pnlEndColor.ShowCaption then begin pnlStartColor.ShowCaption := False; pnlEndColor....
user1580348's user avatar
  • 6,099
6 votes
4 answers
2k views

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 package. ...
guettli's user avatar
  • 27.7k
10 votes
1 answer
2k views

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 to ...
Maksym's user avatar
  • 508
-1 votes
1 answer
89 views

I had some code that had a few thousands lines of code that contain pieces like this opencanmanager.GetObjectDict()->ReadDataFrom(0x1234, 1).toInt() that I needed to convert to some other library ...
mrKirushko's user avatar
0 votes
3 answers
2k views

BEFORE SAVE AFTER this thing has never happened to me with languages like c++, etc... in other cases it happens but for the better, for example my html code becomes more orderly and clean. the ...
user avatar
0 votes
1 answer
40 views

Two methods intValueOf and intValueOfOptional, which are very similar. I would like to modify the implementation so that the two methods use as little duplicated code. Both methods contain a very ...
Maqn's user avatar
  • 15
0 votes
1 answer
505 views

Though we have refactoring tool to rename the struct field we do not have refactoring tool for deleting the struct field & its usages. How to safely delete the struct field and its usages[Write &...
TomNJerry's user avatar
  • 2,659
9 votes
1 answer
1k views

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 ...
pickle's user avatar
  • 1,047
0 votes
1 answer
146 views

I need to refactor this private method. Codeclimate is giving me a error msj because the line of the params is too long. How can i refactor it? def base_plan_params params[:base_plan][:...
BeeM's user avatar
  • 17
2 votes
1 answer
231 views

when I do refactoring in visual studio (2019) and I say "generate field", it per default always adds the "private" keyword before the new field. I don't want this. How can I modify ...
codymanix's user avatar
  • 29.6k
2 votes
1 answer
481 views

In c++14 we can use ' to write big numbers in a more readable way, like this: 2'000'000'000'000'000'000. But my clang-format turns it into this: 2 '000' 000 '000' 000 '000' 000. What should I do to ...
parean's user avatar
  • 315
5 votes
1 answer
615 views

I have a medium/large TypeScript project (~500 source files) and I'd like to do a large-scale reorganization, changing the directory structure and moving all the modules around. It's easy to move a ...
danvk's user avatar
  • 17.2k
0 votes
1 answer
486 views

I want to write a refactor tool, where I want to move the function at the cursor(cursor is in the function name) to the source file. I found the FunctionMover.cc in https://github.com/lanl/CoARCT ...
veio's user avatar
  • 537
0 votes
2 answers
388 views

I have a legacy springMvc project and i want to refactor all the controllers to return ResponseEntity object rather then returning Model object which is returned by default. I am looking for a way ...
Cheikh Ahmed's user avatar
0 votes
1 answer
238 views

I was working in automating e2e automation cases.To increase the reusability we have used many if conditions inside a function and eventually script performance went down. Could anyone suggest me a ...
Surendran's user avatar
1 vote
1 answer
502 views

Suppose I have a foo function marked as noexcept somewhere in my code. Many other functions call foo, and many of them are also marked as noexcept. Now suppose I have to adjust foo, and now it can ...
rodrigocfd's user avatar
  • 8,389
0 votes
0 answers
71 views

I need to click on CC to verify if its working.Can't figure out, It gives me error. public void cc() { driver.findElement(By.cssSelector("button[class*='vjs-subs-caps-button']")); } ...
Jawaria Noman's user avatar

1
2 3 4 5
8