Code-Cleanup in VS2022 applies different tab/space formatting rules for closed solution files - visual-studio-2022

Why would the VS2022 Code-Cleanup feature apply different keep-tabs formatting preferences depending on whether a source file is being viewed in VS2022 or is closed?
I have a new VS2022 install on a new Windows 11 dev machine and Resharper is not installed.
With all c-sharp source code windows closed, when I manually run Code-Cleanup all tab characters are converted to spaces. If I then open all source code files in VS2022 and run cleanup again, the spaces are converted back to tabs which is my Tools/Options keep-tabs preference.
I have 'view white-space' enabled and can see the indentation of my sourcde code flipping between tabs and spaces. This problem is repeatable.
Tools/Options 'Use adaptive formatting' is also disabled. I do not believe an .editorconfig settings file is applicable to my solution but even if there was a config file the open/close tabs/spaces formatting flip would be peculiar.

Related

How do I use PyCharm and WebStorm in the same project simultaneously?

I am working on a Django project using React for some aspects and seeing that I have licenses for both WebStorm and PyCharm, I would like to use both.
If I open them simultaneously, they keep having to reload the project. More specifically every time one of the IDEs receives focus, it prompts me to reload the project iff, the other IDE received focus since the last window switch.
I suspect this is because they are using the same folder (i.e. {project_root}/.idea) to store there cache/shelved changes etc.
Were can I change the setting, where these infos are stored in order to allow both IDEs to function alongside each other?
Idea-based IDEs (WebStorm, PyCharm, PHPStorm, IDEA, etc) have the same project format (.idea) but different settings/module types that aren't always compatible, plus each IDE needs to write its stuff to project files (for example, .idea/workspace.xml is updated each time you open editor tab, etc., as information about recently opened files, cursor positions, etc. is stored there), so having the project opened in 2 IDEs at the same time will cause such issues.
If you like to work on the same sources in different IDEs, I'd suggest sharing the sources folder(s) but keeping the .idea folders separated: just create a new empty WebStorm project in preferred WebStorm-specific location and add your shared sources root as additional content root to it in Settings | Directories, Add Content root. Same thing should be done for PyCharm. As a result, you will have IDE-specific .idea folders and shared sources

Sublime Text Indentation Settings Being Overwritten By a File

I am working on a project where tab size is supposed to be 4 and tabs should not be spaces. I updated my Preferences.sublime-settings file to include
"detect_indentation": "false",
"tab_size": 4,
"translate_tabs_to_spaces": false,
When I open a new file these settings are set to how I want and everything works. However, if I open an existing file (scss or html) that has indentations as 2 spaces, my Sublime settings are overwritten and indentations change to 2 spaces. If I click View > Indentation I see that Tab Size is set to 2 and Indent Using Spaces is enabled, even though my preferences should be the opposite of that.
If I manually change Indentation via View > Indentation to Tab Width: 4 and deselect Indent Using Spaces, this works until I save the file, at which point the settings revert to Tab Width 2 and Indent Using Spaces turned on.
How can I force Sublime Text to honor my indentation preferences and not be overwritten by another file. I would assume that Sublime is detecting the indentations on the page, but I've turned that setting off.
Here is my preferences file showing that things should be working:
Here are the messed up settings for a scss file. All I did was open it:
I don't think any plugin is causing this, I disabled most of them and was still experiencing this issue. However, for reference, here is a list of all packages I have installed:
Alignment
BracketHighlighter
Capybara Snippets
ColorPicker
Dotfiles Syntax Highlighting
EditorConfig
Emmet
ERB Snippets
Gem Browser
Gist
Git
GitGutter
Haml
jQuery
JSHint
Package Control
Pretty JSON
PyV8
RSpec
SCSS
SideBarEnahancements
SublimeLinter
Terminal
TrailingSpaces
Thanks in advance for any help.
So I figured this out by completely uninstalling Sublime Text and all associated packages and settings, then reinstalling the app and one-by-one reinstalling my packages. It turns out that one of my packages, EditorConfig, was overwriting my Sublime Text style settings.
EditorConfig is actually a really cool plugin that allows a number of developers working on one project across multiple IDEs to have a consistent style by defining indentation type, size, charset, and other settings.
The answer to my problem was that in the particular project directory I was working some of the node modules I had downloaded had .editorconfig files that had indentation set as size 2 and spaces instead of tabs. I had to either uninstall the EditorConfig package from my Sublime Text or create a new .editorConfig file in the root directory of my project. This is the .editorConfig file I created that fixed my problem.
# top-most EditorConfig file
root = true
# 4 Tab Indentation
indent_style = tab
indent_size = 4
When a file is loaded, its contents are examined, and the "tab_size" and "translate_tabs_to_spaces" settings are set for that file. The status area will report when this happens. While this generally works well, you may want to disable it. You can do that with the "detect_indentation" setting.
This might be helpful: https://www.sublimetext.com/docs/2/indentation.html

How do I share IntelliJ Run/Debug configurations between projects?

I have many different versions of my app. Each one is a separate IntelliJ project. Every time I open a new one, the list of configurations starts blank:
The annoying thing about this is I deploy to 1 VM and I have to copy and paste the debug configurations each time I want to test a different version. IntelliJ makes this dialog modal per IntelliJ Instance, so I can't copy and paste the fields between Project Instances.
I end up taking a screenshot of one configuration and copying the fields by hand into the other project. It's a pretty primitive solution. Is there a more convenient way to get a run configuration from one project to another?
I'm using IntelliJ 13 on Windows 7.
Can I share settings for IntelliJ Idea across different projects? may have the answer to this, but the question is different. It's about window layout. Therefore I don't consider it a duplicate.
The best way to do this is to click the "share" checkmark next to Name field when you edit/create the configuration. You can get to this Dialog with Run > Edit Configurations.
The share check-mark pulls the setting out of your workspace.xml and instead puts it in the directory .idea\runConfigurations. This is designed so you can share the setting with others.
You could copy this file and put it in the same location in all your idea projects.
However, in the future, you might want to consider using source control branches for app versions rather than separate projects. IntelliJ handles these very well.
UPDATE (June 2021):
IntelliJ now puts this in the .run folder as its own file, no longer in .idea/runConfigurations.
Run configurations are stored in .idea/workspace.xml by default. First alternative is to share this file but it is not feasible because you also share a lot of unnecessary configurations.
As already said, the first step is to check "share" option to separate run configurations from workspace.xml.
After that, I recommend adding runConfigurations to source control. But the main problem is, probably you have already marked .idea folder as ignored.
You can unignore the folder by configuring your source control system. For example, if you are using git, you can change .gitignore file as follows:
.idea/*
!/.idea/runConfigurations
don't forget adding * after .idea/
As the last step, add your run configurations to source control and enjoy your shared configurations!
goto
Run > Edit Configuration > create or select existing configuration you want to use > click save and persist it on file system > click on share check mark
now copy this file from
PROJECT_ROOT_DIRECTORY/.idea/runConfigurations/ConfigurationName.xml
to your NEW_PROJECT_ROOT_DIRECTORY/.idea/runConfigurations at the same place and it is available now to your run configuration
You should copy the folder
~/your-old-project/.idea/runConfigurations
to
~/your-new-project/.idea/
That's the folder that contains the run configurations.
An update for this question with the new IntelliJ updates:
Now you can "Store as project file" which will create a folder named ".run" and export your setting to that folder. In the example below, I did it for all my test settings. This removes the requirement of editing .gitignore since files are now not outside of ./idea
This is not exactly an answer to your question but it answers a question similar to your question and one that I had, and I'm assuming others might as well.
That is, How to save unit and instrumentation test run configurations? I usually right-click on the test directory which brings up a menu with the option to Run whatever is in that directory. AndroidStudio then creates a run configuration on the fly and in the Run Configuration drop-down menu a new option will appear, "Save new configuration?" or something similar.
Clicking that option brings up the Run Configuration menu and at that point I check the Share box as many others have already mentioned. This then will prompt the version control system to ask me if I want to add this new run configuration file. If you haven't registered your version control system you can find the new files under .idea/runConfigurations.

Notepad++ workspace refresh?

How do i refresh the workspace / project in notepad++ when the file-system changes ( files and folders added or removed ).
at the moment it does not keep up with the local file system and i have to re-create the project each time!! frustrating..
I followed Rechtar's suggestion.
I had a similar issue. Notepad++'s Project pane doesn't update when I change or create new files. What I ended up doing was downloading the explorer plugin through
PLUGINS > PLUGIN MANAGER > SHOW PLUGIN MANAGER
Then install the explorer plugin.
After it's installed go to PLUGINS > EXPLORER and select the explorer.
It's not really comparable to something like Eclipse's project navigation.
In Notepad++ 7.5.8, this issue has been fixed. I suggest you update your notepad++ to the latest version.
In order to do this, go to ? -> Update Notepad++ and it will automatically detect a new update package. Update Notepad++ normally.
Otherwise, you could download the update from here:
https://notepad-plus-plus.org/news/notepad-7.5.8-released.html
In case you're curious, here's the changelog for 7.5.8:
Notepad++ v7.5.8 bug-fixes:
1. Remove annoying "no update" notification.
2. Fix Folder as Workspace not updating regression.
3. Fixed crash issue by checking & unchecking "Disable extension column" option in preferences dialog.
4. Fixed a crash when trying to launch a secondary instance with command line arguments.
5. Fix "Explorer Here" from "Folder as Workspace" problem if folder name contains comma.
Included plugins:
1. NppExport v0.2.8 (32-bit x86 only)
2. Converter 4.2.1
3. Mime Tool 2.1
4. DSpellCheck 1.3.5
Updater (Installer only):
* WinGup (for Notepad++) v5.0.2
I'm currently running version 6.3.3 of notepad ++ and instead of adding the entire project all over again, you can right-click the folder in your project that has the new file and choose: "Add files...". From there, you can select your new file and open it. This will add it to your project in the appropriate folder.
There doesn't seem to be a proper way to do this in Notepad++. The Project panel was born just 2 or 3 releases ago, so it's naturally immature. I suggest that you install either the Explorer plugin or the Light Explorer plugin - they are much more usable.
Or better yet, go learn Vim and fall in love with the NERDTree ;-)

How to add new programming language to jEdit?

I've recently been learning the Processing programming language. Processing includes an IDE called the Processing Development Environment (PDE), but the editor is quite basic.
The IDE has an option to use an external editor. One of my preferred editors is jEdit due to it's cross-platform support. Jedit has built-in support for over 170 languages, but not processing which I guess is still a little bit too niche at the moment.
How do I add Processing with all the color highlights to jEdit?
The whole process for adding processing has been detailed here: http://wiki.processing.org/w/JEdit_as_External_IDE.
Basically, jEdit is using XML files to define syntax coloring rules (incl. simple checking) for its various editing modes. Each syntax definition file has a file extension mapping to tell jEdit which language mode to use for individual files. For Processing files we will use the standard .pde extension.
There are two things you need to do: (Before installing any of the files below, please make sure jEdit is not running.)
Syntax Highlighting
Download File:Processing.xml into the "modes" folder inside your jEdit installation.
On Linux/MAC this is usually /usr/share/jedit/modes
On Windows this is C:\Program Files\jEdit\modes
Then copy and paste the following XML node into the file "catalog" inside the same folder and syntax coloring/checking for PDE files should be ready: <MODE NAME="processing" FILE="Processing.xml" FILE_NAME_GLOB="*.pde" />
Abbreviations
Download Media:abbrevs_v0.1.zip and extract it into the right folder for your system:
Windows
C:\Documents and Settings\{USERNAME}\.jedit
Mac
/Users/{USERNAME}/.jedit
Note: This folder is not visible in the Finder. Unzip the file in your home folder, open a terminal window and type: mv ~/abbrevs ~/.jedit/abbrevs</source>
Linux
Find the location of the jEdit settings directory via the menu: Utilities > Troubleshooting > Activity log, then extract/copy the file in that folder.
For all systems, you'll need to restart jEdit in order for the abbreviations to come in effect.