Giter Site home page Giter Site logo

vscode-uncrustify's Introduction

Uncrustify Formatter for Visual Studio Code

.github/workflows/vscode.yml VS Code Marketplace Downloads VS Code Marketplace Installs

Uncrustify is a highly configurable source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA.

Installing uncrustify

  • Linux : Uncrustify is available in most distributions as a package in the official repositories (sudo apt/yum install uncrustify or equivalent)
  • macOS : Uncrustify is available through Homebrew (brew install uncrustify or see http://macappstore.org/uncrustify)
  • Windows : Prebuilt binaries are available on sourceforge. You will need to put the executable in your PATH variable and you will have to update it manually

If the executable is not in the PATH environment variable, you must set its path in the settings explicitly.

Uncrustify configuration

A default config file can automatically be created (see the commands below).

Extension commands

  • Uncrustify: Create default config file (uncrustify.create): Creates a default uncrustify.cfg file and puts it at the root of the current workspace.
  • Uncrustify: Open config file (uncrustify.open): Opens the configuration file that is currently set in the extension settings.

Extension settings

  • uncrustify.executablePath.[linux|osx|windows] (string): Path to the uncrustify executable if it's not already in the PATH environment variable.
  • uncrustify.configPath.[linux|osx|windows] (string): Path to the uncrustify configuration file. Environment variables can be used with either a Windows or a bash syntax (examples: %SOME_PATH%/dev/uncrustify.cfg, $SOME_PATH/dev/uncrustify.cfg). A relative path will be automatically prefixed with the current workspace path.
  • uncrustify.graphicalConfig (boolean): Toggles the graphical config editor when opening an uncrustify config file.
  • uncrustify.debug (boolean): Activates logs for debugging the extension. Logs should appear in the uncrustify output channel.
  • uncrustify.langOverrides (object): Overrides the language used by uncrustify.

Acknowledgements

This extension was originally created and maintained by @LaurentTreguier. While it has since been archived and removed from the extension marketplace, I have relied heavily on it over the past few years and have chosen to resurrect it. To that end, any of the good stuff in this extension undoubtedly comes from the original maintainer's hard work, and I will do my best to honor that.

vscode-uncrustify's People

Contributors

eternalphane avatar everleest avatar laurenttreguier avatar markus456 avatar nchursin avatar w0ndersp00n avatar zachflower avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-uncrustify's Issues

Cannot specify relative paths

Running via ssh (installed on ssh):

Specifying "uncrustify.executablePath.linux": "${workspaceFolder}/uncrustify/uncrustify" results in an error ENOENT, while
"uncrustify.executablePath.linux": "/home/user/workspace/uncrustify/uncrustify" functions as expected.

(NB the config var uncrustify.configPath.linux does appear to accept ${workspaceFolder} )

Copy Paste Duplication of entire document if "Use Temp File" setting is checked

Entire document will be pasted into itself if "Use Temp File" is checked and you copy/cut and then paste. The copy itself is not duplicated, it pastes as expected into other word processors, just when pasting back into the document. Ctrl+Z will then undo the entire document paste, and the expected result will be present.

Please note that "Use Temp File" being unchecked fixes the issue.

Steps to reproduce:

  1. Enable "Use Temp File" Setting
  2. Copy some text in any text document in VS Code
  3. Paste the text into the same document (or a different one)
  4. You will see the document pasted into itself

Extension stops working with Uncrustify 0.74 (solved)

I just upgraded Uncrustify.exe from 0.73f to 0.74 and extension stopped working.
When I run "format document" - nothing happen.
Replacing .exe back to 073f restore functionality.

I don't see any errors in VSCode window or logs.

Windows 10 x64, Uncrustify x64, VSCode 1.62.3

Copy paste duplication in dev container

Issue Type: Bug

Remote-Containers: Try a Development Container Sample...
Select C++ option
Install Uncrustify extension in Dev Container
Install uncrusity (apt install uncrustify) in Dev Container
Create uncrustify.cfg, with default config
Copy any line in file
Paste line
Result is the entire file (?) is duplicated at that line.

Example:
Copy line 12 of main.cpp - return 0; and paste on line below this is the result:

#include
#include

using namespace std;

int main() {
cout << "Hello World\n";
cout << "Input: ";
string data;
getline(cin, data);
cout << "Output: " << data << "\n\n";
return 0;
#include
#include

using namespace std;

int main() {
cout << "Hello World\n";
cout << "Input: ";
string data;
getline(cin, data);
cout << "Output: " << data << "\n\n";
return 0;
return 0;
}
}

Extension version: 3.2.0
VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No
Connection to 'dev-container+633a5c6465766f707364656d6f735c7870635f6170706c69636174696f6e' could not be established

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.20GB (5.24GB free)
Process Argv --folder-uri vscode-remote://dev-container%2B633a5c6465766f707364656d6f735c7870635f6170706c69636174696f6e/workspaces/xpc_application --crash-reporter-id f295f7a2-3e2f-4a78-90b0-66d65453804b
Screen Reader no
VM 0%

Connection to 'dev-container+633a5c6465766f707364656d6f735c7870635f6170706c69636174696f6e' could not be established

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
vscaac:30438847
vsclangdc:30486549
841h4636:30513947

Replace text works not properly

When replace text in vscode, some files are duplicated to each other. The duplicate doing after replece text

vscode 1.66.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.