Does vscode use workspaceRoot or workspaceFolder? - gcc

I have been recently trying to use the MinGW gcc compiler with Code, and am getting some issues with Intellisense(not breaking, but I find it annoying).
I followed the documentation to edit the path for the c_cpp_properties.json file, but the error continues to pop up and I think I have also found contradictory information.
{
"name": "Win32",
"includePath": [
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceRoot}",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include\\c++"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
I looked on the github repo for the documentation and found someone had committed a change where ${workspaceRoot} was changed to workspaceFolder in the documentation. However, root seems to be the default for VS code, and I only updated to the new orange logo version this morning.
https://github.com/Microsoft/vscode-docs/commit/fa613d436a53bd9c5a21065cf5fa0f1b350d9bc6
So which is the correct way to get Intellisense working, Folder or Root?

Turning #Marks comment into an answer: ${workspaceRoot} is deprecated, ${workspaceFolder} should be used instead: https://code.visualstudio.com/docs/editor/multi-root-workspaces
See also this description of variables: https://code.visualstudio.com/docs/editor/variables-reference
${workspaceFolder} - the path of the folder opened in VS Code

Related

Electron-builder macOS notarization problem with puppeteer library: Not all binaries are signed

I am currently struggling with notarizing my app with electron builder for macOS! The app uses puppeteer which causes the error that the ".localChromium" folder does not get signed! I already tried a lot of things but I was not able to fix this problem.
Here is my configuration for the package.json file:
"build": {
"asar": true,
"asarUnpack": "node_modules/puppeteer/.local-chromium/**/*",
"publish": [
{
"provider": "generic",
"url": "http://www.someProvider.com"
}
],
"appId": "SomeApp",
"afterSign": "notarize.js",
"mac": {
"icon": "build/logo.png",
"category": "public.app-category.productivity",
"target": [
"dmg", "zip"
],
"signIgnore": "/node_modules/puppeteer/.local-chromium/",
"gatekeeperAssess": false
}
This is just the lastest configuration I tried! (I read about the signIgnore property on a GitHub post where someone mentioned a similar problem and was able to fix it with this, but this hasn't changed anything - I tried multiple paths in case this one is a wrong expression). I also tried to set the "hardendedRuntime" property to true.
To use puppeteer-core is not an option!
These are some errors I receive - they all state that the content in the .localChromium folder isn't signed:
Does anyone know how to fix this problem?
I solved this by using puppeteer-in-electron. Just replace import puppeteer from 'puppeteer' with import puppeteer from 'puppeteer-core'. That way .local-chromium wont be included with your electron app because it will just use the chromium that is built in along with electron. You will also need to remove puppeteer from package.json

debug spring project with specific profile on visual studio code

I'm trying to debug a kotlin/spring project in vscode, but I can't find a way to activate the desired profile.
My launch.json file looks like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "kotlin",
"request": "launch",
"name": "Kotlin Launch",
"projectRoot": "${workspaceFolder}",
"mainClass": "my.package.ApplicationKt",
"args": [ "--spring.profiles.active=dev" ]
}
]
}
The app starts but with no active profile. I've seen a lot of answers with different combinations: using vmArgs instead of args, "-Dspring.profiles.active=dev" or [ "--spring.profiles.active", "dev" ] or [ "-Dspring.profiles.active", "dev"] but nothing seems to work.
I'm using VSCode 1.63.0 with kotlin 1.5.30 and spring boot 2.4.4.
I finally figured it out thanks to autocomplete.
VSCode documentation is not ok. All the examples and documentation points to vmArgs option where, supposedly, I could set my -Dspring.profiles.active=dev, but that's not the case, at least for the versions I'm working on.
The correct option is not vmArgs but vmArguments instead.

How to use CMDR as vs code default integrated terminal

I want to use CMDR as VS Code default integrated terminal. I have added the following options in my settings.json
"terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k %CMDER_ROOT%\\vendor\\init.bat"
],
and it was working but with this new VS Code update Version: 1.60.0 it stopped working.
any suggestions? how to fix this?
Also had this problem today and managed to fix it by updating settings.json as follows:
"terminal.integrated.profiles.windows": {
"Cmder": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": ["/K", "C:\\Program Files\\cmder\\vendor\\init.bat"]
}
},
"terminal.integrated.defaultProfile.windows": "Cmder"
Make sure to update the path to cmder to match the install location on your system
These old legacy settings can then be removed:
terminal.integrated.shell.windows
terminal.integrated.shell.windowsExec
terminal.integrated.shellArgs.windows

"You don't have an extension for debugging 'JSON with Comments'" warning when debugging VS Code theme

I generated the files necessary for creating a color theme in VS Code. I did this with the generator-code node package.
My file structure is as follows
When I run VS Code's debugger, I get this warning that prevents the debugger from running.
Here are the contents of my launch.json file for reference:
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
}
]
}
In case you're wondering what I'm expecting to happen when I run the debugger, here's the moment in the tutorial I was following where I ran into this problem.
Edit: Well, I evaded the problem somehow by deleting the files and starting over. I'm not sure what was causing the problem before.
This popup only appears for me when trying to launch the debugger while having the launch.json or tasks.json file open. Switching to one of my test files and launching the debugger fixes it
I had this error when my launch.json was not according to the version + configurations scheme, I copy pasted the content of configurations to the file instead of putting it in the array.
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
}

cannot open source file "begin_code.h" (dependency of "SDL2/SDL.h")

When attempting to setup SDL2 with VS Code in Ubuntu 20.01 LTM I get the following VS Code error:
cannot open source file "begin_code.h" (dependency of "SDL2/SDL.h")
Any tips?
Just add "/usr/include/SDL2/" to your c_cpp_properties.json like so:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/SDL2/"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu18",
"cppStandard": "gnu++14",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
in case you don't have the "c_cpp_properties.json" file in your
folder.
Different answer than above, but I believe might be a better approach.
to create the c_cpp_properties.json on your workspace
do the following:
ctrl + shift + p (opens the command palette)
search for "C/C++: Edit Configurations (JSON)" and click on it
"c_cpp_properties.json" file will be created on your workspace
add "/usr/include/SDL2/" to your "c_cpp_properties.json" like
https://stackoverflow.com/a/64187964/8540466
reload C/C++ IntelliSense extension.
I'm assuming you already have the extension
"C/C++ IntelliSense, debugging, and code browsing"
installed on your vscode.
After these steps this problem was fixed for me.
If you, like me, don't have the c_cpp_properties.json file in your project, you can solve it by adding the following line to your settings.json (in VSCode, hit Ctrl+Shift+P and search for Open settings (JSON)):
{
// ...
"C_Cpp.default.includePath": ["/usr/include/SDL2", "${default}"],
//...
}

Resources