Give the path for compile_commands.json file to coc-clangd - yocto

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?

Related

Synopsis Codesight doesn't work in subfolder

Okay, I have the following project structure
- MegaDirectory
--- SubProject1
----- coverity.conf
--- SubProject2
These subprojects are handled as git submodules.
I use codesight plugin with visual studio code.
I have created the following coverity.conf file in the first subproject.
{
"$schema": "http://URL.com/schemas/coverity.conf.schema.json",
"type": "Coverity configuration",
"format_version": 1,
"format_minor_version": 7,
"settings": {
"cov_run_desktop": {
"build_cmd": ["make","-C", "$(code_base_dir)/build"],
"clean_cmd": ["make","-C", "$(code_base_dir)/build","clean"]
},
"ide": {
"build_strategy": "CUSTOM"
}
}
}
If I open the subproject folder as the root folder inside vs-code and edit a file from it, I get the codesight output and everything works ok.
If I open the MegaDirectory as the root folder inside vs-code and edit a file from the subproject, I get an error that this file is uncaptured.
I have been delving into the configuration of codesight, but I got nothing useful.
Is there a solution to this ?
Thanks

vscode workspace can use relative path

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

VSCode shows TSLint errors only for opened file

I have a project with this structure:
-src
-dist
-node_modules
-gulpfile.js
-tslint.json
My typescript files reside in src and are transpiled in a gulp task into dist folder. I've installed tslint locally and started with a plain tslint config:
{
"rules": {
"max-line-length": {
"options": [120]
}
}
}
Now, when I run tslint from a command line, I get warnings about all files in 'src' folder as expected. But VSCode highlights only the errors in currently opened file. The 'Problems' tab is getting filled only when I open a file with a tslint error.
Do I need to add some configuration to VSCode launch.json?
At the moment it seems like it's not possible to show all warnings for all files in a project. You might be able to achieve something similar with a VS Code task that starts a watcher.
There's a feature request for this though.

Babel file structure is duplicating

Using latest babel preset. My .babelrc contains
{
"presets": ["env"]
}
In my package.json, I run it as follows:
"build:babel": "babel app.js app/** venue/** -d build",
My original code structure is:
But after running babel my build folder looks like the following:
The problem I'm seeing is that it's building the file in the sub-directories correctly but it also putting it into the root build folder. Example: "containers" is in the build folder under app/plugins/containers which is correct. But its also in the root build folder. Also, the files "border, button, card, checkbox, click, color_picker, ..." belong in other sub-directories (which it is), but is also in the root build folder.
I'm wondering if I'm running it incorrectly?

Bundling looking for text.js in dist directory

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.