VSCode adding a ruler for python files but not C files. Why?

Advertisements I’m tring to add custom rulers for C and python files in vscode. Here is my settings.json file { "C_Cpp.updateChannel": "Insiders", "editor.inlineSuggest.enabled": true, "security.workspace.trust.untrustedFiles": "open", "python.defaultInterpreterPath": "C:\\Path\\to\\my\\python.exe", "python.formatting.provider": "black", "[C_Cpp]": { "editor.rulers": [ 80 ], }, "editor.formatOnSave": true, "[python]": { "editor.defaultFormatter": "ms-python.black-formatter", "editor.rulers": [ 88 ], }, } Here’s my main.cpp file #include <iostream>… Read More VSCode adding a ruler for python files but not C files. Why?

Vscode """ """ string when comment color somehow got turned to dark green

Advertisements example One day, the color """ """ string when comment color somehow got turned to dark green. While the string color remain light orange. I had try to change comments’ color in settings, but it only effect the # comment. "editor.fontLigatures": false, "workbench.colorTheme": "Default Dark+", "editor.tokenColorCustomizations":{ "comments":"#a1b876", } how do I change the color… Read More Vscode """ """ string when comment color somehow got turned to dark green

Why this regex doesn't work in vscode but works in another site?

Advertisements I don’t know much about regex, but I’m trying to use this regex made by chatGPT in vscode but it returns nothing as result. But when I try to use in another site like https://regex101.com/, the string matches. Regex: throw\s+new\s+ApiResponseError\s*\(\s*HttpStatusCode\.([^,]+),\s*(‘[^’]*’|"[^"]*"),\s*new\s+Error\(`([^`]*)`\),\s*(true|false)?\s*\) Pattern that matches in the site: throw new ApiResponseError( HttpStatusCode.BAD_REQUEST, ‘low’, new Error(`Required parameters… Read More Why this regex doesn't work in vscode but works in another site?

How can I make a VS Code reference from one class to another class file while it is injected through a constructor?

Advertisements I have three files: index.js employee.js employer.js index.js import Employer from "./employer.js" import Employee from "./employee.js" const employer = new Employer(); const employee = new Employee(employer); employee.js class Employee { constructor(employer) { this.employer = employer; } getEmployer() { return this.employer.name(); } } employer.js class Employer() { name() { return "Default Employer"; } } The… Read More How can I make a VS Code reference from one class to another class file while it is injected through a constructor?

How can I make an arrow function show up in the functions section of the Outline search instead of the variables section?

Advertisements The VS Code code navigation is not working with arrow functions defined: async function all(req: Request, res: Response) { ….. const checkLogin = async (req: Request, res: Response) => { When I display the code navigation, this is what I see: I would like to have the checkLogin definition in the functions section. Is… Read More How can I make an arrow function show up in the functions section of the Outline search instead of the variables section?

Why does VS Code show different autocompletions (trigger suggest) when manually triggering?

Advertisements Whenever I start writing code like this and I put there quotation marks the autocomplete works fine: However, when I close it and then manually trigger the autocomplete to show up again I end up with this: The autocomplete list still contains the correct values but there’s like a hundred snippets before. Some of… Read More Why does VS Code show different autocompletions (trigger suggest) when manually triggering?