code-formatting Questions

10

Solved

When I copy code from another file, the formatting is messed up, like this: fun() { for(...) { for(...) { if(...) { } } } } How can I autoformat this code in vim?
Kickback asked 1/3, 2010 at 12:50

6

Solved

I have a Python script: if True: if False: print('foo') print('bar') However, when I attempt to run my script, Python raises an IndentationError: File "script.py", line 4 print('bar...
Editorial asked 10/8, 2017 at 19:6

5

Solved

In what ways can you comment in CoffeeScript? The documentation say you can use three hash symbols to start and close a comment block: ### Comments go here ### I've found that I can sometime...
Cheng asked 16/10, 2011 at 0:59

4

Although I seem to have configured both linitng and formatting properly, the linting runs but the black formatting does not. "python.linting.flake8Enabled": true, "python.linting.flake8Args": [...
Clemens asked 15/7, 2019 at 12:23

14

Solved

I have occasion to need to print code (Horrors!!! ;) ), and i was wondering what editor or tool would i use to print that code out with proper formatting and syntax highlighting? If it's impo...
Darwindarwinian asked 1/11, 2009 at 11:19

3

How can I realize the following indentation after access modifiers: class A{ public: int a; } should result in class A { public: int a; // note the indentation } clang-format only allows t...
Spermatic asked 7/12, 2016 at 16:47

4

Solved

What is the correct way of code comments in Javascript - is the same syntax as in Java? And which tools actually would take advantage of these comments: /* * Add an element to the group * @para...
Aarhus asked 25/7, 2011 at 12:11

15

Solved

Is there a keyboard shortcut to format code in Notepad++ ? I'm mainly working with HTML, CSS and Python code. For example: <title>{% block title %} {% endblock %}</title> <link r...
Anisaanise asked 3/9, 2010 at 11:58

3

I am using Roslyn to modify the syntax of C# files. Using CSharpSyntaxRewriter, it is very easy to find and replace nodes in the syntax tree. However, the generated code is very ugly and won't even...
Abduction asked 1/11, 2015 at 21:14

13

Solved

I would like to automatically format TypeScript code using the build-in formatter when I save a file in Visual Studio Code. I'm aware of the following options, but none of them is good enough: ...
Jaques asked 14/9, 2016 at 15:26

5

Ctrl K + D in a Visual Studio 2010 Sharepoint project is not working in some files as they contain paths to some resources (masterpageurl/images/js/css classnames) that get generated at runtime. ...
Heater asked 14/3, 2012 at 17:24

12

Solved

I have looked at various documentation and similar questions on here, but cannot seem to find the particular solution. Apologies if I have missed anything obvious or have repeated this question! A...

2

Solved

I have a checkstyle configuration XML file and want to automatically generate an Eclipse formatter configuration from this. Is there any tool that can do this?
Neukam asked 12/6, 2009 at 2:50

2

This is for IntelliJ 2016.2. I'm cleaning up some code that's causing CheckStyle violations and halting our CI build, and it appears to be happening because of IntelliJ's code style rules. I can f...
Medallist asked 8/9, 2016 at 16:44

21

Solved

When I select multiple lines of code and want to indent them as usual with TAB key, it just deletes them all. I come from Eclipse where I always did it that way. How's that done in Xcode? I hope no...
Onaonager asked 6/5, 2009 at 14:43

2

Solved

I am using Eclipse - mars. I need to replace tab character with white spaces in existing code. I did this: Open Window->Preferences from menu bar. Select Text Editors from tree menu. Uncheck In...
Meaghan asked 23/12, 2016 at 9:2

8

Is it possible to make VSCode keep indents on empty lines? Could not find such a setting neither natively nor in "Beautify" extension. Example of desired behavior: UPDATE: eventually I'v...
Garbage asked 25/12, 2017 at 12:9

6

When I type this private MyKlass myklass; and hit 'save' in Eclipse, it becomes this: private final MyKlass myklass; How do I stop Eclipse from doing this?
Grobe asked 22/8, 2011 at 12:12

2

Solved

How do I import code conventions (code formatting settings) from an EditorConfig file into Visual Studio? I would like to have one .editorconfig file for all solutions and not one per project.
Lover asked 30/10, 2019 at 13:14

5

Solved

I would like to correctly indent some VB.NET code contained within a text file. Is there some way to do this? e.g. Start with this: Public Shared Function CanReachPage(page As String) As Boolean ...
Wimbush asked 11/2, 2014 at 9:27

4

Solved

Is there any way to define custom indent width for .prettify() function? From what I can get from it's source - def prettify(self, encoding=None, formatter="minimal"): if encoding is None: retu...

13

Solved

How would be possible to assign a shortcut for word wrap like as sublime text do? i.e. if the code line is too long it should be automatically break to the next line. wikipedia.org.org/Word_wrap ...
Votyak asked 11/4, 2014 at 5:53

2

Solved

How to format .liquid (Shopify liquid) code in Visual Studio. By settings language as HTML I can do it but at the same time, I can't use Shopify autocomplete. When I switch to liquid.html then I ca...
Eckert asked 17/5, 2018 at 6:4

8

Solved

I have been searching online with little success for a way to force php to output a newline after a closing php tag ?> so that my HTML will be rendered as I see it before its parsed by PHP so th...
Latchet asked 15/12, 2009 at 15:24

3

Solved

I'm using Visual Studio Code to code a Vue.js component and need to reformat the code of that component. I did not find any built-in formatters, and the first choice for a plugin was vue-buetify wh...

© 2022 - 2024 — McMap. All rights reserved.