VSCODE Latex, security risk: running with elevated privileges - visual-studio-code

Environment:
OS: Window 10,x64
VSCode: 1.69.1
Related VSCode Plugins installed: LaTeX,LaTeX Workshop,LaTeX Utilities,LaTeX language support
Latex: MiKTeX 21.12.10 Portable
The VSCode Configuration is below
"latex-workshop.latex.recipes": [
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": ["pdflatex", "bibtex", "pdflatex","pdflatex"]
},
{
"name": "xelatex",
"tools": ["xelatex"]
},
{
"name": "latexmk",
"tools": ["latexmk"]
},
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": ["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=./output","%DOCFILE%"]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [ "-synctex=1","-interaction=nonstopmode","-file-line-error","-output-directory=./output","%DOCFILE%"]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [ "-synctex=1","-interaction=nonstopmode","-file-line-error","-output-directory=./output","%DOCFILE%"]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [ "./output/%DOCFILE%"]
},
],
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
"latex-workshop.latex.autoClean.run": "never",
"latex-workshop.latex.recipe.default": "first",
"latex-workshop.view.pdf.external.viewer.args": [
"./output/%PDF%"
],
"latex-workshop.latex.outDir": "./output",
I use VSCode to write latex. And it occurs the errors below:
chktex: security risk: running with elevated privileges
Cannot count words, code: 4294967295, texcount: security risk: running with elevated privileges
How to solve it?
I have tried to run VSCode with administrator, but it didn't help.

I solved it.
Only the plugin LaTeX Workshop is needed. Other plugins(LaTeX,LaTeX Utilities,LaTeX language support) can be uninstalled.

Related

Prevent asynchronous order of command sequence execution in VS Codium

How can I control the execution order of multiCommand extension? It behaves like it executes them in parallel, while I want them to be executed one after another.
I have a project with the following structure:
/home/user/myproject/dir1/problem1.py
/home/user/myproject/dir1/problem1.txt
/home/user/myproject/dir1/problem2.py
/home/user/myproject/dir1/problem2.txt
...
/home/user/myproject/pointer.txt
The pointer.txt contains the text: dir1/problem2.
I want to press a shortcut, and do a sequence of actions:
Create next problem files pair
Modify a pointer.txt to point to new files
Open them in the editor
I setuped the following things.
In settings.json I defined the command sequence named "openPointedProblemLayout" (for being able to easily reuse it):
"multiCommand.commands": [
{
"command": "multiCommand.openPointedProblemLayout",
"sequence": [
{ "command": "htmlRelatedLinks.openFile",
"args": {
"file": "${command:mypointer}.py",
"method": "vscode.open",
"viewColumn": 1,
"command": {
"mypointer": {
"command": "extension.commandvariable.file.content",
"args": {
"fileName": "${workspaceFolder}/pointer.txt"
}
}
}
}
},
{ "command": "htmlRelatedLinks.openFile",
"args": {
"file": "${command:mypointer}.txt",
"method": "vscode.open",
"viewColumn": 2,
"command": {
"mypointer": {
"command": "extension.commandvariable.file.content",
"args": {
"fileName": "${workspaceFolder}/pointer.txt"
}
}
}
}
},
]
},
]
In tasks.json I created a shell command definition, that creates a new .py and .txt pair and also changes the pointer:
{
"version": "2.0.0",
"tasks": [
{
"label": "create_new_problem_files_pair",
"type": "shell",
"command": "python /home/user/scripts/create_new_problem_files_pair.py \"${file}\""
},
],
}
In keybindings.json I defined shortcut numpad2 that executes both actions (creates files and opens them) and a numpad5 (just opens them):
{
"key": "numpad2",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "workbench.action.tasks.runTask",
"args": "create_new_problem_files_pair"
},
{
"command": "multiCommand.openPointedProblemLayout"
},
]
}
},
{
"key": "numpad5",
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.openPointedProblemLayout" },
},
Now, when I press numpad2, the two new files are created:
/home/user/myproject/dir1/problem3.py
/home/user/myproject/dir1/problem3.txt
And then two files are opened in layout (means the command actually runs), but wrong files. They are problem2.py and problem2.txt, i.e. the previous pointer is used.
I checked the content of the pointer.txt now, and it actually contains dir1/problem3. And when I press numpad5, they are opened correctly.
Why does the VS Codium uses previous content of pointer, while at the moment of command run, it should already take the new content? It looks like VS Code executes the command sequence in parallel, instead of sequence them.
Am I doing something wrong? Is that an issue with configuration or vs code itself or maybe in multiCommand extension?
I have solved the problem by avoiding usage of any extensions. A command sequence can be defined via Tasks. See https://stackoverflow.com/a/72201981/7869636
In keybindings.json I define:
{
"key": "numpad2",
"command": "workbench.action.tasks.runTask",
"args": "create_new_problem_files_pair_and_open_file_pair_in_layout"
},
And in tasks.json I defined the whole things:
{
"version": "2.0.0",
"tasks": [
{
"label": "create_new_problem_files_pair",
"type": "shell",
"command": "python /home/user/scripts/create_new_problem_files_pair.py \"${file}\""
},
{
"label": "open_file_pair_in_layout",
"dependsOrder": "sequence",
"dependsOn": [
"open_in_layout_left",
"open_in_layout_right",
],
},
{
"label": "create_new_problem_files_pair_and_open_file_pair_in_layout",
"dependsOrder": "sequence",
"dependsOn": [
"create_new_problem_files_pair",
"open_file_pair_in_layout",
],
},
{
"label": "open_in_layout_left",
"command": "${input:open_in_layout_left}",
},
{
"label": "open_in_layout_right",
"command": "${input:open_in_layout_right}",
},
],
"inputs": [
{
"id": "open_in_layout_left",
"type": "command",
"command": "htmlRelatedLinks.openFile",
"args": {
"file": "${command:mypointer}.py",
"method": "vscode.open",
"viewColumn": 1,
"command": {
"mypointer": {
"command": "extension.commandvariable.file.content",
"args": {
"fileName": "${workspaceFolder}/pointer.txt"
}
}
}
}
},
{
"id": "open_in_layout_right",
"type": "command",
"command": "htmlRelatedLinks.openFile",
"args": {
"file": "${command:mypointer}.txt",
"method": "vscode.open",
"viewColumn": 2,
"command": {
"mypointer": {
"command": "extension.commandvariable.file.content",
"args": {
"fileName": "${workspaceFolder}/pointer.txt"
}
}
}
}
}
]
}
This approach has a benefit that it defines these tasks in a scope of that project's workspace, and not globally in setting.json.

How to cope with this error while compiling latex with vscode?

I followed several tutorials on the Internet and tried to build a latex environment in vscode. However, after I've installed everything and started running a .tex file, it came up with the following error:
Qt: Untested Windows version 6.2 detected!
xelatex: Bad parameter value.
xelatex: Data: font_mem_size
source code test.tex: (I put it in a folder on desktop)
\documentclass{article}
\begin{document}
Hello World!
\end{document}
I tried Google, but didn't find any effective approach. I also restarted my computer and reinstalled MiKTeX, but nothing changed.
By the way: I installed LaTeX workshop, MiKTeX and Strawberry Perl (just following the tutorial) and added this into the settings.json of vscode.
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
],
},
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdf->bib->pdf->pdf",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.autoBuild.run": "onFileChange",
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
Update: the issue was solved by reinstalling MiKTeX and resetting its environment variables in PATH.
The issue was eventually solved by reinstalling MiKTeX and resetting its environment variables in PATH. (Another way is to directly install MiKTeX in its recommended directory, which is how I solved the problem.) In addition, the code I added in the settings.json should be discarded (or vscode will report errors).

VS Code ESLint Checking for quick fixes... not working

I'm not sure if it was a recent update, but for some reason I'm not getting the quick fixes for ESLint any longer. It will say "Checking for quick fixes...", but I will not display any. In the ESLint server I can see the fix available, but the command is missing in VS Code.
[Trace - 5:30:49 PM] Received response 'textDocument/codeAction - (13)' in 0ms.
Result: [
{
"title": "Disable no-unused-vars for this line",
"command": {
"title": "Disable no-unused-vars for this line",
"command": "eslint.applyDisableLine",
"arguments": [
{
"uri": "file:///d%3A/Development/sfdx/insider/force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js",
"version": 14,
"ruleId": "no-unused-vars"
}
]
},
"kind": "quickfix"
},
{
"title": "Disable no-unused-vars for the entire file",
"command": {
"title": "Disable no-unused-vars for the entire file",
"command": "eslint.applyDisableFile",
"arguments": [
{
"uri": "file:///",
"version": 14,
"ruleId": "no-unused-vars"
}
]
},
"kind": "quickfix"
},
{
"title": "Show documentation for no-unused-vars",
"command": {
"title": "Show documentation for no-unused-vars",
"command": "eslint.openRuleDoc",
"arguments": [
{
"uri": "file:///",
"version": 14,
"ruleId": "no-unused-vars"
}
]
},
"kind": "quickfix"
}
]
Same was happening to me as well and after trying multiple things what worked for me was a clean reinstall of Code which meant uninstalling Code, deleting the extension folder and and installing the code followed by extensions. And quick fix is back.

Cannot use Powershell intellisense in Sublime Text 3 with LSP

my LSP.sublime-settings is below
// Settings in here override those in "LSP/LSP.sublime-settings",
{
"powershell-ls":
{
"command":
[
"powershell.exe",
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy",
"Bypass",
"-Command",
"C:\\Users\\georg\\Downloads\\PowerShellEditorServices\\PowerShellEditorServices\\Start-EditorServices.ps1",
"-LogPath",
"C:\\Users\\georg\\Downloads\\PowerShellEditorServices\\pses-sublime.log",
"-LogLevel",
"Normal",
"-SessionDetailsPath",
"C:\\Users\\georg\\Downloads\\PowerShellEditorServices\\session.json",
"-FeatureFlags",
"#()",
"-HostName",
"'Sublime Text'",
"-HostProfileId",
"subl",
"-HostVersion",
"1.0.0",
"-AdditionalModules",
"#()",
"-BundledModulesPath",
"C:\\Users\\georg\\Downloads\\PowerShellEditorServices",
"-Stdio"
],
"enabled": true,
"languageId": "powershell",
"scopes":
[
"source.powershell"
],
"syntaxes":
[
"Packages/PowerShell/Support/PowershellSyntax.tmLanguage"
]
}
}
Root location of PowerShellEditorServices:
C:\Users\georg\Downloads\
When I click LSP: Setup language server, message below shows LSP has no built-in configuration for a Powershellsyntax language server
Using Powershell 5.1 on Windows 10 x64, with generated help files.
Link for Powershell config template for Sublime editor:
https://github.com/tomv564/LSP/blob/master/docs/index.md
Any language needs to be added under the clients heading, as per below:
{
"auto_show_diagnostics_panel_level": 2,
"clients":
{
"omnisharp":
{
"command":
[
"/home/tb/prebuilt/omnisharp/OmniSharp.exe", // or eg. /usr/local/opt/omnisharp/run
"-lsp"
],
"enabled": true,
"languageId": "csharp",
"syntaxes": ["Packages/C#/C#.sublime-syntax"],
"scopes":
[
"source.cs"
]
}
}
}

Use built-in Octicons in editor/title menu for vscode extension command contribution point

Is it possible to use Octitons that ship with vscode without embedding it into my extension?
"contributes": {
"commands": [
{
"command": "my.extraordinary.command",
"title": "My command",
"icon":{
"dark": "<what should go here?>",
"light": "<what should go here?>"
}
},
],
"menus": {
"editor/title": [
{
"command": "my.extraordinary.command",
"group": "navigation"
}
]
},