VS Code "Include file not found in include path." - json

First of all, I know this issue has been answered a bunch of times already, but the answer (the same one every time) doesn't work for me still..
I get the infamous "Include file not found in include path" when trying to include iostream in a simple hello world c++ program. I then include the path to my MinGW include folder as follows:
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/4.9.3/include/c++"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"browse": {
"path": [],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
Yet, I still get the same error. This is, for what I've found, the only solution to this problem. It's really frustrating that VS Code just doesn't seem to recognize the path.
Any advice is helpful and appreciated!

This seems like you're looking at it from the start of the project. I would go to the extension (C++ my guess) and see how to implement it. If this doesn't work for you I would check your path.
https://code.visualstudio.com/docs/languages/cpp

I met the same trouble with you.
Maybe you could try to set "brose"-"path" like this.
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/4.9.3/include/c++"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"browse": {
"path": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/4.9.3/include/c++"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
Wish this could help you.

Related

Can't get custom configuration points working for my VS Code extension

So I've been spending a lot of time trying to get a couple specific settings working for my language extension in VS Code, and while the documentation and the few articles online seem to make it sound as simple as adding a "configuration" point in my package.json and a "getConfiguration()" call in the extension.ts file, it seems that there is more needed to get them working. This is my first extension I've made so I'm a bit unfamiliar with some of these things.
I am working on this project for work, so I will paste some of my code below with certain edits. The main issue I am getting right now is that it recognizes that I have added the configuration points to the package json, but I get this error when trying to debug the extension:
Cannot register '<configuration_name>'. This property is already registered
I have read as much as I can online about this and it seems that maybe the issue is that VS Code is seeing these settings as already defined and therefore is confused because it may be expecting custom configurations. I'm not sure. I feel though the issue must lie in my extension.ts file since when I look at the configuration example on the VS Code Examples repository on Github, they are doing quite a lot more than just the simple "getConfiguration()" function I am using. But I really have no idea what I would do. I am not very familiar with typescript as of yet, so any help would be greatly appreciated on this. Anyone have any insight as to why it would be doing this?
Here is my package.json:
{
"name": "ex-lang",
"displayName": "Example",
"description": "Example language support",
"version": "0.0.1",
"engines": {
"vscode": "^1.64.2"
},
"categories": [
"Programming Languages",
"Snippets"
],
"contributes": {
"languages": [
{
"id": "ex",
"aliases": [
"EX",
"ex",
"Example"
],
"extensions": [
".ex"
],
"configuration": "./language-configuration.json",
"icon": {
"light": "./icons/icon.png",
"dark": "./icons/icon.png"
}
}
],
"grammars": [
{
"language": "ex",
"scopeName": "source.ex",
"path": "./syntaxes/ex.tmLanguage.json"
}
],
"snippets": [
{
"language": "ex",
"path": "./snippets.json"
}
],
"configuration": [
{
"id": "ex-config",
"title": "Example Custom Settings",
"properties": {
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment.block.documentation.ex"
],
"settings": {
"foreground": "#efc752"
}
}
]
},
"editor.bracketPairColorization.enabled": true,
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#2b85d5",
"editorBracketHighlight.foreground2": "#559ddd",
"editorBracketHighlight.foreground3": "#80b6e6",
"editorBracketHighlight.foreground4": "#aaceee",
"editorBracketHighlight.foreground5": "#d5e7f7",
"editorBracketHighlight.foreground6": "#c6cad4",
"editorBracketHighlight.unexpectedBracket.foreground": "#db6165"
}
}
}
]
},
"dependencies": {
"vsce": "^2.9.2"
},
"devDependencies": {
"#types/node": "^16.11.7",
"#types/vscode": "^1.40.0",
"#typescript-eslint/eslint-plugin": "^5.19.0",
"#typescript-eslint/parser": "^5.19.0",
"eslint": "^8.13.0",
"typescript": "^4.7.2"
}
}
I have tried messing a bit with Activation Events, but I was getting more issues with it as I suppose I don't understand them as well as I might like. I have also fiddled with different scopes for the configuration points and such but to no avail. And lastly, I did have a "main" contribution point, but I was having very strange pathing issues when I had it (it kept saying the file was not found), so I removed it. Not sure if any of these things are also contributing to my problem or not.
Here is my extension.ts file for reference:
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
vscode.workspace.getConfiguration('ex-config');
}

vscode-icons extension: Cannot use custom icon

So I saw that vscode-icons has no icon for assembly files (that end in .asm). So I wanted to make one. I looked at the documentation and stuff and got something. The icons for asm files (which are just a paper sheet normally) disappeared! I think it's because it can't find the image but I put the image at this file path : C:\Users<USER HERE>\AppData\Roaming\Code\User\vsicons-custom-icons and still nothing.
Here is my settings.json:
{
"vsicons.associations.files": [
{
"icon": "file_type_asm.png",
"extensions": [
"asm"
],
"format": "png",
}
],
}
Here is the tutorial I used:
https://medium.com/#chih.hsi.chen/how-to-add-your-custom-icons-to-vscode-icons-9ab8c3f9abc1
What is up with this?
according to the extension's wiki in GitHub, and the source you provided,
the naming convention tells us to only use the full name in the name of the file on the local machine,
but when editing setting.json, in the icon part, just use the name you've given to the icon:
{
"vsicons.associations.files": [
{
"icon": "asm",
"extensions": [
"asm"
],
"format": "png",
}
],
}
just pay attention that for folders, you have to make two icons, but add only one object to the array; one with folder_type_ and one with folder_type_***_opened
one more thing to keep in mind for folders is that the array for folders is vsicons.associations.folders

vscode extension [tht13.python]: 'configuration.jsonValidation.url'

I got this error notification while using VSCode:
[tht13.python]: 'configuration.jsonValidation.url' must be
an absolute URL or start with './' to reference
schemas located in the extension.
I have found and changed jsonValidation to:
"jsonValidation": [
{
"fileMatch": ".condarc",
"url": "./schemas/condarc.json"
},
{
"fileMatch": "environment.yml",
"url": "./schemas/conda-environment.json"
},
{
"fileMatch": "meta.yaml",
"url": "./schemas/conda-meta.json"
}
]
in package.json, but it still doesn't work.
How to figure out this issue?
You are using the extension "Python for VSCode" (tht13.python). It looks like this extension is not maintained anymore (last commit on Jun 13, 2018)
Maybe you should switch to another extension. I'm quite happy with the "Python" (ms-python.python) extension from Microsoft https://marketplace.visualstudio.com/items?itemName=ms-python.python

Change the output directory for .css and .js in Semantic UI's gulp tasks

I changed the output paths in my semantic.json which is working fine. However I would like the following files to be built in ../../static/css (../../static/js):
semantic.css
semantic.js
semantic.min.css
semantic.min.js
What do I have to change in order to achieve this?
File content:
{
"base": "semantic/",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "../static/",
"uncompressed": "../static/components/",
"compressed": "../static/components/",
"themes": "../static/themes/"
},
"clean": "../static/"
},
"permission": false,
"autoInstall": false,
"rtl": false,
"components": [
/* Components come here... */
],
"version": "2.2.13"
}
Changing the output directories in the Semantic.json didn't work for me, but changing it in semantic/tasks/config/defaults.js worked. I don't know why or if that's good, but the files have been created correctly now.
As to your problem with separating CSS and JS:
Here (https://github.com/Semantic-Org/Semantic-UI/issues/2221) it says:
JS and CSS files are not set up to have separate output directories in
the current build system.
As of July 2016 there was no solution yet.

I broke JSON code

I have no idea what I am doing but my programmer is sleeping and have phone turned off.
I have a json config file for important server going
the text is like this
"36": {
"link": "http://www.dpbolvw.net/click-7950848-12234805-1461061905000",
"name": "Cedok.cz"
},
"37": {
"link": "http://www.vivantis.cz/?d=72815",
"name": "Vivantis.cz"
},
"38": {
"link": "http://www.tkqlhce.com/click-7950848-12197703-1461744724000",
"name": "Parfums.cz"
},
"99": {
"link": "http://89.221.208.56/test",
"name": "Test"
}
I have no idea where exactly I broke the code that my website doesnt function but I did broke it. U just copied one full number and tried to get for a fresh new config setupp..it didnt work..so I deleted the number..and it still does not work.
The code seems perfectly okay to me visually. I messed up the end somehow.
You might just need another } (closing bracket) at the end of your file. That's just a guess, because it's hard to know without more information.