Tag Archives: visual studio code

[Solved] Vscode Katex Error: ParseError: KaTeX Parse Error: Can‘t Use Function ‘$‘ In Math Mode At Position …

Vscode Katex Error: ParseError: KaTeX Parse Error: Can‘t Use Function ‘$‘ In Math Mode At Position …

Problem description

When doing Wu Enda’s deep learning, KAtex is prompted with parsing errors. A pile of KAtex plug-ins under vscode are useless. The errors are as follows:

parseError: KAtex parse error: can't use function '$' in math mode at position

Solution:

Strange solution, in the following figure, call back

Problem solved

[Solved] GLSL Lint: Failed to spawn ‘glslangValidator‘ binary. Error: spawn glslangValidator.exe ENOENT

1. preface

After using vscode to install the plug-in: glsl lint, there is an error every time you start vscode:
glsl lint: failed to spawn ‘glslangvalidator’ binary Error: spawn glslangValidator. Exe enoent
and vscode will not be automatically colored and highlighted every time the shader program is opened. At this time, I reinstall the glsl lint plug-in. It’s troublesome

glslangValidator is a custom GLSL reference compiler from the Khronos Group, the official OpenGL standard customizer. The command line compilation mode facilitates users to test glsl syntax directly and bypass the C/C++ related dependency libraries compilation, and there is no need to write a lot of initialization code in the main file. This can save a lot of time in practical testing. In many websites such as shadertoy, the glsl code written by users can be compiled and run directly in the main function, which requires a convenient syntax check, and the shadertoy website also provides a simple syntax check. However, glslang is a standard custom official compiler, so the compiled glsl code can be compiled correctly on all kinds of drivers that support GLSL syntax.

2. Solution steps

1. Open vscode settings

2. Search “security.workspace.trust”

Enter “security.workspace.trust” in “search settings” (just enter “security”)

3. Cancel ssecurity.workspace.trust:Enabled

Remove the hook in front of “security.workspace.trust:Enabled”

Just restart vscode

Vscode uses /deep/ Syntax error [How to Solve]

Use/deep/to report syntax errors in vscode and report them in red

When pulling other people’s items, you will encounter/deep/reporting syntax errors in vscode, but the items can run and we can’t modify them. The problem can be solved by modifying the configuration file of vscode

CSS> Lint: empty rules

then there is no red wavy line and no error is reported

[Solved] VScode sftp Code synchronizate Error: Error: No such file

Cause

After the extension is successfully installed, the file upload prompt error: no such file
but the code has actually been uploaded successfully**

Solution:

Open ~ /.Vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2streams/lib/sftp.js

search

options.emitClose= false;

Add under each search term

options.autoDestroy = false;

Remember to restart vscode for the changes to take effect.

Code screenshot

VSCode Error: collect2.exe:error:1d returned 1 exit status [How to Solve]

Recently, I learned the C + + program video of dark horse. When I realized the employee management system based on polymorphism, I knocked the same code as the video, but I couldn’t compile it successfully by using vscode, and the following errors occurred:

[Employee_Management_System.cpp 2021-10-22 13:58:17.099]
,,C:\Users\AAE3~1\AppData\Local\Temp\cc7ZdaG7.o:Employee_Management_System.cpp:(.text+0x1b): undefined reference to `WorkerManager::WorkerManager()'
C:\Users\AAE3~1\AppData\Local\Temp\cc7ZdaG7.o:Employee_Management_System.cpp:(.text+0x27): undefined reference to `WorkerManager::Show_Menu()'
C:\Users\AAE3~1\AppData\Local\Temp\cc7ZdaG7.o:Employee_Management_System.cpp:(.text+0x44): undefined reference to `WorkerManager::~WorkerManager()'
C:\Users\AAE3~1\AppData\Local\Temp\cc7ZdaG7.o:Employee_Management_System.cpp:(.text+0x57): undefined reference to `WorkerManager::~WorkerManager()'
collect2.exe: error: ld returned 1 exit status

After querying many blogs, it is found that the causes and solutions of errors such as collect.exe: error: 1D returned 1 exit status are as follows
1. The last compiled program is not closed, that is, the black box still exists. Find it and close or restart the IDE
2. The program has no main function or the main function is misspelled
3. Running in vscode will not help you save the code. You need to save the code before running
4. The file name and file path may cause errors in some compilers
5. There is an undefined reference. This is the case for this error. When instantiating the classes of other files in the main function, you need to define the .H file and .Cpp file of other classes to solve the problem.

#include<iostream>
#include"workerManager.h"
#include"workerManager.cpp"

[Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘

1. Cause

A new configuration file of vetur.config.js is added in vetur 0.31.0.
after this version, priority will be given to finding whether the project is equipped with tsconfig.json (TS project) or jsconfig.json (JS project).
if these two files are not found, go to vetur.config.js. If they are not found, this prompt will be thrown.

2. Explain

The JavaScript support of vscode can run in two different modes:
file range (without jsconfig.JSON)
in this mode, JavaScript files opened in vscode are regarded as independent units
as long as the file A.js does not explicitly reference the file b.ts (using// reference instructions or commonjs modules), there is no common project context between the two files.

3. Explicit project

(use jsconfig.JSON)

The JavaScript project is defined through the jsconfig.JSON file. The existence of such a file in the directory indicates that the directory is the root directory of the JavaScript project
the file itself can optionally list files belonging to the project, files to be excluded from the project, and compiler options (see below)
the JavaScript experience improves when you have a jsconfig.json file in your workspace that defines the project context
therefore, when you open a JavaScript file in a new workspace, we provide a prompt to create a jsconfig.json file.

4. Solution (1 out of 3)

4.1. Configure the vehicle plug-in and ignore the prompt </ H6>
 "vetur.ignoreProjectWarning": true,

4.2. Create jsconfig.json file in the project root directory </ H6>

Add code:

{
    "include": [
        "./src/*"
    ]
}
4.3. Create the vetur.config.js file in the project root directory </ H6>

Add code:

module.exports = {
    // vetur configuration, which will override the settings in vscode.  default: `{}`
    settings: {
        "vetur.useWorkspaceDependencies": true,
        "vetur.experimental.templateInterpolationService": true
    },
    // Normal projects use the default configuration default: `[{ root: './' }]`
}

Vscode remote connection server reports an error: could not establish connection to “XXXXXX” [resolved]

Suppose you have made the following configuration and try

    install remote SSH in the extensions, add the IP address of the server you want to access, and have a config file (as shown in the figure below)
    please remember the path of this config file, which is generally “C: \ users \ user”_ Name \. SSH \ config “
    so you start trying to connect to the server. After selecting Linux/windows from the top drop-down menu, you unfortunately fail

    Error message:

    After the popup window of could not establish connection to “XXX” appears, check the error information below. If the error information contains:

    resolvent:

      Open extensions in the left column, find the installed remote SSH, right-click, select “extension settings”
      , enter the config file path in config file, and try to connect again. It is found that the connection is successful

Visual Studio Code Error command ‘markdown.extension.onBackspaceKey’ not found

background

Today, when using Visual Studio code to delete some characters with keyboard back, we found the following error:

command 'markdown.extension.onBackspaceKey' not found

It seems that it is caused by some shortcut key conflicts

Solution:

Open file – > preferences – > keyboard shortcut and search back, as shown in the figure below:

Just reset a shortcut key for this option:

Visual studio code shortcut

The main command box
The most important function is the Command Panel opened by F1 or Ctrl+Shift+P. In this command box, you can execute any command of VSCode and even close the editor.
Pressing Backspace will take you to Ctrl+P mode
Type> under Ctrl+P; You can go back to Ctrl+Shift+P.
It’s fine under the Ctrl+P window
Type the file name directly and jump to the file
?List the currently executable actions! Errors or Warnings. Or Ctrl+Shift+M: skip to line number, or Ctrl+G to @: skip to Symbol (search for a variable or function), or Ctrl+Shift+O to @: skip to Symbol by category and find an attribute or function, or Ctrl+Shift+O to: enter # find Symbol by name, or Ctrl+T
Common Shortcuts
 
Editor and window management
Open multiple Windows at once (view multiple projects)
Open a new window: Ctrl+Shift+N Close the window: Ctrl+Shift+W
Open multiple editors at the same time (view multiple files)
Create a new file Ctrl+N Toggling Ctrl+Tab between files Cut out a new editor (up to 3) Ctrl+\, or you can hold down the Ctrl mouse and click on the file name in the Explorer Ctrl+1 Ctrl+2 Ctrl+33 editor cycle Ctrl+ ‘editor to change position, Ctrl+ K and then press Left or Right
The code editor
formatting
Lines of code indented Ctrl+[Ctrl+]
Ctrl+C Ctrl+V If unchecked, copy or cut a whole line by default
Copy one line Up or Down: Shift+Alt+Up or Shift+Alt+Down Enter one line below the current line, Ctrl+Shift+Enter
The cursor associated
Move to Start of Line: Home Move to End of Line: End Move to Start of File: Ctrl+End Move to Start of File: Ctrl+Home Move to Definition: F12 Definition Thumnail: Just Look at It and Don’t Skip Forward Alt+F12 Move to End of Bracket Ctrl+Shift+] Select From Ctrl to End of Line Shift+Home Remove all words on the right side of the cursor Ctrl+DeleteShrink/ Expand Selection: Shift+Alt+Left and Shift+Alt+ Rightmulti-cursor: Alt+Click to add Cursor or Ctrl+Alt+Down or Ctrl+Alt+Up to select all matching Ctrl+Shift+L at the same time
Ctrl+D The next match is also selected (I’ve customized it to delete the current line, see Ctrl+Shift+K below).
Back up the previous cursor operation Ctrl+U
Refactor the code
Rename: For example, if you want to change a method name, select it and press F2. Enter the new name. You will see that all the files have been changed. Right-click “Set File to Compare” in the Explorer and select “Compare with ‘file_name_you_chose’ on the file you want to compare.”
To find the replacement
Find Ctrl+F Find Ctrl+H Find Ctrl+Shift+F
:
* To match one or more characters in a path segment?To match on one character in a path segment** to match any number of path segments,including none{} to group conditions (e.g. {**/*.html,**/*.txt} matches all HTML and TXT files)[] to declare a Range of characters to match (e.g., example.[0-9] to match on…
According to the relevant
Full-screen: F11Zoomin/Zoomout: Ctrl+ =/Ctrl + – Sidebar Show/Hidden: Ctrl+B Sidebar Show:
Show Explorer Ctrl+Shift+ ESHOW SearchCtrl+Shift+ FSHOW GitCtrl+Shift+ GSHOW DebugCtrl+Shift+ DSHOW OutputCtrl+Shift+U
other
Auto-save: File ->; AutoSave, or Ctrl+Shift+P, type Auto