I want to make a AMX mod X script, this modules are related which game I make, so I am using workspace as configuration. Making compiler, library and output path dependent of each game.
my source code has same folder as compiler
I've tried to write ./ and .\\ but it's won't work, vscode still can't find amxxpc.exe, here's my configuration workspace:
{
"folders": [
{
"path": "."
}
],
"settings": {
"amxxpawn.compiler.executablePath": "./amxxpc.exe",
"amxxpawn.compiler.includePaths": [
"./include"
],
"amxxpawn.compiler.outputPath": "../plugins",
"amxxpawn.compiler.outputType": "path"
}
}
amxxpawn.compiler.executablePath still can't figure amxxpc.exe until I wrote full path. since this placed in same folder as source code, I also tried to remove ./ but still can't find it.
here's my extension I use: https://marketplace.visualstudio.com/items?itemName=KliPPy.amxxpawn-language
This is not always work in every extension but I moved every configs in workspace settings to user.json and then use ${workspaceFolder} as relative variable, for e.x:
"amxxpawn.compiler.includePaths": [
"${workspaceFolder}/include"
]
workspace still used but I left it folder and path alone, also making path value to . means location of workspace file
Related
I noticed, if I define a c_cpp_properties.json for the "C/C++" plugin in my user config folder "~/.vscode" instead of the project config folder, the file is not parsed. My aim is to define some global include directories, which are used in all projects. I haven't found a clear answer whether and how this is possible (or not).
{
"configurations": [
{
"includePath": [
"/foo/*"
]
}
]
}
so I'm a developer working mostly with c using yocto/openembedded for developing our products. I'm trying to set up my nvim with coc-cland as an IDE, but having some problems.
So what I want is to give languageserver the compile_commands.json file. I have the setup working when the compile_commands.json is in the "root of the src dir" but the compile_commands.json is normally not generated in the source folder instead it is generated to <root of src dir>/oe-workdir/<project name>/compile_commands.json. How do I tell coc to use that file if it exists? Finding the file is easy using shell script, but what variable shall I set and where?
My :CocConfig looks like:
{
"languageserver": {
"coc-clangd": {
"command": "clangd",
"rootPatterns": [ ".git/", "compile_flags.txt", "compile_commands.json"],
"filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"]
}
}
}
I have found some relevant git for coc-clangd (https://github.com/clangd/coc-clangd) where it states that I can set the clangd.arguments but I need to do it dynamically as the <project name> folder changes name from project to project, can I do it in the :CocConfig or can I do it in my vimrc/init.vim?
I use CTRL+Click (or F12) to search and open the definitions in vscode. The problem is that my files are copied to another directory called sketch as I compile my code, so when I wanna open the definition of a function, VS shows both files (the real and the copied ones in the sketch folder), and sometimes I edit the copied file by mistake!
How can I exclude some folders from the "Go To definition"?
I had the same problem in a Javascript project.
None of the following solved it for me: files.exclude, files.watcherExclude, or search.exclude.
The solution was to add jsconfig.json to my project folder:
{
"compilerOptions": {
"target": "ES6"
},
"exclude": [
"Backup",
"Sketch"
]
}
This example specifies two folders to exclude: "Backup", and "Sketch".
If you are using TypeScript, use a tsconfig.json file instead.
Also see https://code.visualstudio.com/docs/languages/jsconfig
Add files to C:\Users\user\AppData\Roaming\Code\User\settings.json:
"files.exclude": {
"**/sketch": true
},
Or files to exclude when searching (in files):
"files.watcherExclude": {
"**/*.x": true,
},
When writing a javascript app, it's possible to create an .env file in the root directory containing just e.g:
NODE_PATH=src/
Which sets up allowing for absolute paths e.g: in import statements in code.
e.g: I can be working on the file /src/actions/index.js and enter:
import { SAVE_COMMENT } from "actions/types";
..and the import works, but there is no auto-complete and I wonder: Is it possible to auto-complete after I type just:
import { SAVE_COMMENT } from "actions/
?
Relative-path lookup continues to work great. In fact, the relative path lookup is one of my favorite features of vs-code and one of the reasons I use it, so it would be very nice for it to work when absolute paths are configured, too.
VS Code does not support using NODE_PATH for intellisense. To achieve what you want, create a jsconfig.json file at the root of your project with the contents:
{
"compilerOptions": {
"target": "ES6",
"baseUrl": "./src"
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
The important setting is baseUrl. It tells VS Code to resolve non-relative paths relative to the ./src folder
After configuring jsconfig and baseUrl, you can also set "javascript.preferences.importModuleSpecifier": "non-relative" in VS Code to specify that VS Code should always try to use paths to use the baseUrl
Here is a nice guide for Vue.js and Nuxt.js projects configuration in VS Code
this is the solution that worked for me
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"core/*": ["./src/*"],
}
}
}
I am using webpack and absolute paths
Using the gulp tasks from the yeoman generated Aurelia app I'm trying to bundle a custom application. When I run gulp bundle the following error is reported.
Where can I find a log to help track down this file or the reference to this file?
Double check your config.js
I've seen this from time to time, and it's usually an issue of the config.js. You'll want to make sure:
The github, npm, or wherever your text plugin is located is above your '*' line.
The text plugin is mapped.
The plugin files are located where (1) and (2) are pointing.
So, something like this:
config.js
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*",
"*": "dist/*"
},
map: {
"text": "github:systemjs/plugin-text#0.0.4"
}
And jspm_packages/github/systemjs/plugin-text#0.0.4 exists.
If all else fails, try deleting your jspm_packages folder, and typing jspm install text.