VSCode IDE messes up RTL strings after selecting - visual-studio-code

Recently, I had to reinstall windows 11 on my machine. So, after that, I had to install VSCode again (therefore, I have the most recent version of VSCode).
Now, whenever I select any Persian sentences (strings) in my code, the IDE shows a messed-up string that is far away from the correct one. I can not show the correct and incorrect sentences as texts here because copying and pasting results in the correct format. Therefore, I have to provide them as images. (Sorry for any inconvenience, in advance)
Correct Persian Sentence
Incorrect Persian Sentence (After selecting)
This might be a little bit tricky to understand for people who are not familiar with the Persian Language. The difference can be understood by looking at the first word after $creatorId in both images.
This also might happen if we wanted to write in Arabic or other right-to-left languages.
It would be highly appreciated if you could suggest anything to avoid this.

After searching a lot, I found the proper answer on one of the VScode repository's issues. The problem was with the way the new version of VSCode renders the whitespace. So, to solve this problem, you need to follow the below steps:
Open VSCode command pallete by CTRL + SHIFT + p
Search for Open Settings (JSON) and click on it. It should open a JSON file named setting.
In this JSON file, add a key named editor.renderWhitespace and assign on of the following values to it: boundary, trailing or none. Your JSON file should look something like this:
{
"editor.renderWhitespace":"boundary"
}
The weird messed-up string is disapeared now.
Note
You can also access and change the editor.renderWhitespace using the settings editor. So, if you find the steps mentioned above frustrating, just use the settings editor (you can open it using the setting icon at the right end of the VSCode window or even using CTRL + ,) and search for editor.renderWhitespace. Then choose one of the three above-mentioned options.

Related

VS Code, Syntax highlighting Powershell

Ive been scratching my head with this one. Previously VS Code highlighted Powershell scripts and modules just fine with highlighting functions in yellow and variables $var in light blue. Both as part of a string and "stand-alone". However, suddenly it doesn't highlight functions or variables anymore? I've tried to uninstall and reinstall the powershell extension from Microsoft, as well as disable and re-enable the built in language support for powershell.
I've not been able to find any support regarding this issue and hope that I might be able to find it here.
Have you tried this?
File Association.
Basically:
The easiest way I've found for a global association is simply to Ctrl+k m (or Ctrl+Shift+P and type "change language mode") with a file of the type you're associating open.
In the first selections will be the option "Configure File Association for 'x' " (whatever file type - see image attached). Selecting this gives you the option to choose the language and will then make the filetype association permanent.
if you start your code block with a ```PowerShell it will highlight the syntax properly.
I've noticed that you may also need to end your code block with a ``` in VSCode specifically.

Indentation for files that don't have a registered formatter

It seems that I am getting this problem since version 1.18, honestly I don't remember.
With VSCodeVim installed I used to press the = key to get my code (Elixir, embedded elixir, ...) indented properly.
Am I missing something, like a configuration, that would allow me to re-indent my files without having a nagging "Formatter for file x not installed".
This is honestly the only things that nags me with VSCode so far, love the speed, the capabilities and the UI...
Just posting my comment as an answer
Try using the reindent lines command. This command should work for many languages even if you don't have a formatting extension for that language installed
Select the contents of file.Bottom right corner shows spaces/tabs: 2/4. You can click on that and indent the whole file.

sublime text - eclipse App Explorer equivalent

Hi I wondering if there is the equivalent to an App Explorer in Sublime Text 2.
When using eclipse, I use the App Explorer panel to search by file name.
I have a file naming convention that helps me find files by there functionality within the system.
So say I want to list all files relating to the registration process. I search for "regis" via the App Explorer and get a nice list of the relevant files. This filtered list is available all the time until I search again.
I can use Sublime Text's cmd+p but prefer the above as I can see the folder hierarchy etc.
In essence it is merely a file name filter on the folder list.
Are there any plugins that may give me something similar.
Any help much appreciated.
No, as far as I can tell nothing like this has been implemented in Sublime Text 2. I would suggest opening an issue at Sublime's UserEcho forum.
In the meantime:
Typing "regis" into Sublime's 'GoTo Anything' panel will bring up the files you're looking for, and show you their paths (I realize this doesn't help you with visualizing the hierarchy, but that's as close as it gets).
I use a package called SyncedSideBar - this will at least show you a visual representation of the folder hierarchy in the sidebar, for the open file, if it's added to the project.
The GoTo Folder package by freewizard may do something similar to what you're looking for, but I had trouble getting it to work. Maybe you'll have more success.
Good luck!

Is there a diff tool that allows copy-paste

Is there a diff tool that allows you to paste two segments of text and get a diff? I can't use an online tool because I'm dealing with proprietary data, and I haven't found a tool that provides that feature.
Try WinMerge. It'll do that.
Steps:
Download and install winmerge
Open WinMerge & Create new <CTRL+N>
Paste into left & right, then refresh <F5>
In case anyone comes here looking for a tool for Macs that can do this, it seems that there are two tools that can do just this.
Beyond Compare, the Mac version is currently in beta.
Kaleidoscope app
Copy first text
File -> New from Clipboard
Copy second text
Edit -> Paste to comparison
Unfortunately, it doesn't seem to be possible to change the texts once they've been pasted.
There is also a similar (closed) question (the question itself was for a Mac tool, but at least one answer has an alternative diff tool for Windows):
Diff tool for Mac without saving text to files
For those who use Atom, there’s the split-diff package.
KDiff3 can do that too. On startup just Cancel the open dialog and than copy&paste snippets into the two panes. It immediately (re)computes their diff.
Notepad++ makes it really easy to do that: paste first text, open new tab, paste second text then Plugin > Compare > Compare.
Make sure you have the compare plugin installed.
Source: https://stackoverflow.com/a/15817384/965176
I think this might be what you're looking for - Line Diff - it's a online tool that takes as input two snippets of code/text, diff them and then render a nice github like html page (permanent or temporary stored) that you can then share with coworkers.
I used BBEdit (Mac OS X):
paste your snippets into 2 separate new documents (without saving)
go to search → find differences
using the clock icon, pick your new documents
The app has a subscription model, but this doesn't seem to be a premium feature.
You can try online tools
it's good
https://www.diffchecker.com/
Or you can try KDIFF3 its also a good tool
http://kdiff3.sourceforge.net/
also you can try online diff tool , maybe it's useful to you.

How can I enable autocomplete text support in Notepad++

There's already a question on this here. But i want to know if its possible to add autocomplete text support in a .txt file for english words (maybe from GNU Aspell dictionary)?
Something I've pondered myself, you could copy loads of "words" into the keyword list within the user-defined language dialogue. Not the best way!
If you have a look at the XML file in (vista);
C:\Users\yourusername\AppData\Roaming\Notepad++\userDefineLang.xml
Then you can see keywords are kept in one line. I bet, if you made have the entire english dictionary then it would likely crash notepad++.
You could put your idea into the Notepad++ IdeaTorrent for the developers too consider;
http://sourceforge.net/apps/ideatorrent/notepad-plus/ideatorrent/
UPDATE 06/11/2011 :
May I also add that a plugin now available for highlight misspelt words and auto correction.
http://sourceforge.net/projects/squiggly/